private static synchronized native int native_ceph_get_file_replication(long mountp, int fd);
- /**
- * Set the default file stripe unit.
- *
- * @param stripe_unit The stripe unit.
- */
- public void set_default_file_stripe_unit(int stripe_unit) {
- native_ceph_set_default_file_stripe_unit(instance_ptr, stripe_unit);
- }
-
- private static synchronized native int native_ceph_set_default_file_stripe_unit(long mountp, int stripe_unit);
-
- /**
- * Set the default file stripe count.
- *
- * @param stripe_count The stripe count.
- */
- public void set_default_file_stripe_count(int stripe_count) {
- native_ceph_set_default_file_stripe_count(instance_ptr, stripe_count);
- }
-
- private static synchronized native int native_ceph_set_default_file_stripe_count(long mountp, int stripe_count);
-
- /**
- * Set the default object size.
- *
- * @param object_size The object size.
- */
- public void set_default_object_size(int object_size) {
- native_ceph_set_default_object_size(instance_ptr, object_size);
- }
-
- private static synchronized native int native_ceph_set_default_object_size(long mountp, int object_size);
-
/**
* Favor reading from local replicas when possible.
*
return ret;
}
-/*
- * Class: com_ceph_fs_CephMount
- * Method: native_ceph_set_default_file_stripe_unit
- * Signature: (JI)I
- */
-JNIEXPORT jint JNICALL Java_com_ceph_fs_CephMount_native_1ceph_1set_1default_1file_1stripe_1unit
- (JNIEnv *env, jclass clz, jlong j_mntp, jint j_stripe_unit)
-{
- struct ceph_mount_info *cmount = get_ceph_mount(j_mntp);
- CephContext *cct = ceph_get_mount_context(cmount);
- int ret;
-
- CHECK_MOUNTED(cmount, -1);
-
- ldout(cct, 10) << "jni: set_default_file_stripe_unit: " << (int)j_stripe_unit << dendl;
-
- ret = ceph_set_default_file_stripe_unit(cmount, (int)j_stripe_unit);
-
- ldout(cct, 10) << "jni: set_default_file_stripe_unit: exit ret " << ret << dendl;
-
- if (ret)
- handle_error(env, ret);
-
- return ret;
-}
-
-/*
- * Class: com_ceph_fs_CephMount
- * Method: native_ceph_set_default_file_stripe_count
- * Signature: (JI)I
- */
-JNIEXPORT jint JNICALL Java_com_ceph_fs_CephMount_native_1ceph_1set_1default_1file_1stripe_1count
- (JNIEnv *env, jclass clz, jlong j_mntp, jint j_stripe_count)
-{
- struct ceph_mount_info *cmount = get_ceph_mount(j_mntp);
- CephContext *cct = ceph_get_mount_context(cmount);
- int ret;
-
- CHECK_MOUNTED(cmount, -1);
-
- ldout(cct, 10) << "jni: set_default_file_stripe_count: " << (int)j_stripe_count << dendl;
-
- ret = ceph_set_default_file_stripe_count(cmount, (int)j_stripe_count);
-
- ldout(cct, 10) << "jni: set_default_file_stripe_count: exit ret " << ret << dendl;
-
- if (ret)
- handle_error(env, ret);
-
- return ret;
-}
-
-/*
- * Class: com_ceph_fs_CephMount
- * Method: native_ceph_set_default_object_size
- * Signature: (JI)I
- */
-JNIEXPORT jint JNICALL Java_com_ceph_fs_CephMount_native_1ceph_1set_1default_1object_1size
- (JNIEnv *env, jclass clz, jlong j_mntp, jint j_object_size)
-{
- struct ceph_mount_info *cmount = get_ceph_mount(j_mntp);
- CephContext *cct = ceph_get_mount_context(cmount);
- int ret;
-
- CHECK_MOUNTED(cmount, -1);
-
- ldout(cct, 10) << "jni: set_default_object_size: " << (int)j_object_size << dendl;
-
- ret = ceph_set_default_object_size(cmount, (int)j_object_size);
-
- ldout(cct, 10) << "jni: set_default_object_size: exit ret " << ret << dendl;
-
- if (ret)
- handle_error(env, ret);
-
- return ret;
-}
-
/*
* Class: com_ceph_fs_CephMount
* Method: native_ceph_localize_reads
public void test_get_repl() throws Exception {
mount.get_file_replication(0);
}
-
- @Test(expected=CephNotMountedException.class)
- public void test_set_def_stripe_unit() throws Exception {
- mount.set_default_file_stripe_unit(1);
- }
-
- @Test(expected=CephNotMountedException.class)
- public void test_set_def_stripe_count() throws Exception {
- mount.set_default_file_stripe_count(1);
- }
-
- @Test(expected=CephNotMountedException.class)
- public void test_set_def_obj_size() throws Exception {
- mount.set_default_object_size(1);
- }
}