Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/client/hadoop/CephFSInterface.cc b/src/client/hadoop/CephFSInterface.cc
- index b8a6a3b..3b330fc 100644
- --- a/src/client/hadoop/CephFSInterface.cc
- +++ b/src/client/hadoop/CephFSInterface.cc
- @@ -411,6 +411,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_apache_hadoop_fs_ceph_CephTalker_ceph_1g
- if (r==-ERANGE) { //expand the buffer
- delete [] buf;
- buflen *= 2;
- + fprintf(stderr, "new buflen: %d\n", buflen);
- buf = new char[buflen];
- continue;
- }
- @@ -741,10 +742,18 @@ JNIEXPORT jint JNICALL Java_org_apache_hadoop_fs_ceph_CephTalker_ceph_1statfs
- * Returns: an int containing the number of times replicated.
- */
- JNIEXPORT jint JNICALL Java_org_apache_hadoop_fs_ceph_CephTalker_ceph_1replication
- -(JNIEnv *env, jobject obj, jint fh)
- +(JNIEnv *env, jobject obj, jstring j_path)
- {
- - struct ceph_mount_info *cmount = get_ceph_mount_t(env, obj);
- - int replication = ceph_get_file_replication(cmount, (int)fh);
- + //get c-string of path, send off to libceph, release c-string, return
- + const char *c_path = env->GetStringUTFChars(j_path, 0);
- + if (c_path == NULL)
- + return -ENOMEM;
- + ceph_mount_info *cmount = get_ceph_mount_t(env, obj);
- + int fh = 0;
- + fh = ceph_open(cmount, c_path, O_RDONLY, 0);
- + int replication = ceph_get_file_replication(cmount, fh);
- + ceph_close(cmount, fh);
- + env->ReleaseStringUTFChars(j_path, c_path);
- return replication;
- }
- diff --git a/src/client/hadoop/org_apache_hadoop_fs_ceph_CephTalker.h b/src/client/hadoop/org_apache_hadoop_fs_ceph_CephTalker.h
- index e1051a7..5585454 100644
- --- a/src/client/hadoop/org_apache_hadoop_fs_ceph_CephTalker.h
- +++ b/src/client/hadoop/org_apache_hadoop_fs_ceph_CephTalker.h
- @@ -170,10 +170,10 @@ JNIEXPORT jint JNICALL Java_org_apache_hadoop_fs_ceph_CephTalker_ceph_1statfs
- /*
- * Class: org_apache_hadoop_fs_ceph_CephTalker
- * Method: ceph_replication
- - * Signature: (I)I
- + * Signature: (Ljava/lang/String;)I
- */
- JNIEXPORT jint JNICALL Java_org_apache_hadoop_fs_ceph_CephTalker_ceph_1replication
- - (JNIEnv *, jobject, jint);
- + (JNIEnv *, jobject, jstring);
- /*
- * Class: org_apache_hadoop_fs_ceph_CephTalker
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement