/*
* Class: org_apache_hadoop_fs_ceph_CephFileSystem
* Method: ceph_initializeClient
- * Signature: (Ljava/lang/String;)Z
+ * Signature: (Ljava/lang/String;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_apache_hadoop_fs_ceph_CephFileSystem_ceph_1initializeClient
- (JNIEnv *env, jobject obj, jstring j_args )
+ (JNIEnv *env, jobject obj, jstring j_args, jint block_size)
{
dout(3) << "CephFSInterface: Initializing Ceph client:" << dendl;
const char *c_args = env->GetStringUTFChars(j_args, 0);
env->ReleaseStringUTFChars(j_args, c_args);
delete argv;
+ ceph_set_default_file_stripe_unit(block_size);
+ ceph_set_default_object_size(block_size);
+
if (r < 0) return false;
r = ceph_mount();
if (r < 0) return false;
/*
* Class: org_apache_hadoop_fs_ceph_CephFileSystem
* Method: ceph_initializeClient
- * Signature: (Ljava/lang/String;)Z
+ * Signature: (Ljava/lang/String;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_apache_hadoop_fs_ceph_CephFileSystem_ceph_1initializeClient
- (JNIEnv *, jobject, jstring);
+ (JNIEnv *, jobject, jstring, jint);
/*
* Class: org_apache_hadoop_fs_ceph_CephFileSystem
private static String monAddr;
private static String fs_default_name;
- private native boolean ceph_initializeClient(String arguments);
+ private native boolean ceph_initializeClient(String arguments, int block_size);
private native String ceph_getcwd();
private native boolean ceph_setcwd(String path);
private native boolean ceph_rmdir(String path);
throw new IOException("You must specify a Ceph monitor address or config file!");
}
// Initialize the client
- if (!ceph_initializeClient(arguments)) {
+ if (!ceph_initializeClient(arguments,
+ conf.getInt("fs.ceph.blockSize", 1<<26))) {
debug("Ceph initialization failed!");
throw new IOException("Ceph initialization failed!");
}
*/
@Override
public long getDefaultBlockSize() {
- return ceph_getblocksize("/");
+ return getConf().getInt("fs.ceph.blockSize", 1<<26);
}
// Makes a Path absolute. In a cheap, dirty hack, we're
#ifdef __cplusplus
extern "C" {
#endif
-#undef org_apache_hadoop_fs_ceph_CephFileSystem_DEFAULT_BLOCK_SIZE
-#define org_apache_hadoop_fs_ceph_CephFileSystem_DEFAULT_BLOCK_SIZE 4194304LL
#undef org_apache_hadoop_fs_ceph_CephFileSystem_EEXIST
#define org_apache_hadoop_fs_ceph_CephFileSystem_EEXIST 17L
/*
* Class: org_apache_hadoop_fs_ceph_CephFileSystem
* Method: ceph_initializeClient
- * Signature: (Ljava/lang/String;)Z
+ * Signature: (Ljava/lang/String;I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_apache_hadoop_fs_ceph_CephFileSystem_ceph_1initializeClient
- (JNIEnv *, jobject, jstring);
+ (JNIEnv *, jobject, jstring, jint);
/*
* Class: org_apache_hadoop_fs_ceph_CephFileSystem