diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.java index eb2121aedf..7445502c98 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.java @@ -298,7 +298,7 @@ private void checkStream() { private native static void init(int level, long stream); private native int deflateBytesDirect(ByteBuffer src, int srcOffset, int srcLen, ByteBuffer dst, int dstLen); - private static native int getStreamSize(); + private native static int getStreamSize(); private native static void end(long strm); private native static void initIDs(); public native static String getLibraryName(); diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.c index 04f2a3e661..055683ad51 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.c @@ -139,7 +139,7 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompress } // Create the compression stream -JNIEXPORT jlong JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompressor_create (JNIEnv *env, jobject this) { +JNIEXPORT jlong JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompressor_create (JNIEnv *env, jclass clazz) { ZSTD_CStream* const stream = dlsym_ZSTD_createCStream(); if (stream == NULL) { THROW(env, "java/lang/InternalError", "Error creating the stream"); @@ -149,7 +149,7 @@ JNIEXPORT jlong JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompres } // Initialize the compression stream -JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompressor_init (JNIEnv *env, jobject this, jint level, jlong stream) { +JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompressor_init (JNIEnv *env, jclass clazz, jint level, jlong stream) { size_t result = dlsym_ZSTD_initCStream((ZSTD_CStream *) stream, level); if (dlsym_ZSTD_isError(result)) { THROW(env, "java/lang/InternalError", dlsym_ZSTD_getErrorName(result)); @@ -158,7 +158,7 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompress } // free the compression stream -JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompressor_end (JNIEnv *env, jobject this, jlong stream) { +JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompressor_end (JNIEnv *env, jclass clazz, jlong stream) { size_t result = dlsym_ZSTD_freeCStream((ZSTD_CStream *) stream); if (dlsym_ZSTD_isError(result)) { THROW(env, "java/lang/InternalError", dlsym_ZSTD_getErrorName(result)); @@ -227,7 +227,7 @@ JNIEXPORT jint Java_org_apache_hadoop_io_compress_zstd_ZStandardCompressor_defla } JNIEXPORT jstring JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompressor_getLibraryName -(JNIEnv *env, jclass class) { +(JNIEnv *env, jclass clazz) { #ifdef UNIX if (dlsym_ZSTD_isError) { Dl_info dl_info; @@ -250,7 +250,7 @@ JNIEXPORT jstring JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompr // returns the max size of the recommended input and output buffers JNIEXPORT jint JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardCompressor_getStreamSize -(JNIEnv *env, jobject this) { +(JNIEnv *env, jclass clazz) { int x = (int) dlsym_ZSTD_CStreamInSize(); int y = (int) dlsym_ZSTD_CStreamOutSize(); return (x >= y) ? x : y; diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zstd/ZStandardDecompressor.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zstd/ZStandardDecompressor.c index e75a6efd0d..b97dd1797a 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zstd/ZStandardDecompressor.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/zstd/ZStandardDecompressor.c @@ -130,7 +130,7 @@ JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompre ZStandardDecompressor_remaining = (*env)->GetFieldID(env, clazz, "remaining", "I"); } -JNIEXPORT jlong JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompressor_create(JNIEnv *env, jobject this) { +JNIEXPORT jlong JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompressor_create(JNIEnv *env, jclass clazz) { ZSTD_DStream * stream = dlsym_ZSTD_createDStream(); if (stream == NULL) { THROW(env, "java/lang/InternalError", "Error creating stream"); @@ -139,17 +139,16 @@ JNIEXPORT jlong JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompr return (jlong) stream; } -JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompressor_init(JNIEnv *env, jobject this, jlong stream) { +JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompressor_init(JNIEnv *env, jclass clazz, jlong stream) { size_t result = dlsym_ZSTD_initDStream((ZSTD_DStream *) stream); if (dlsym_ZSTD_isError(result)) { THROW(env, "java/lang/InternalError", dlsym_ZSTD_getErrorName(result)); return; } - (*env)->SetIntField(env, this, ZStandardDecompressor_remaining, 0); } -JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompressor_free(JNIEnv *env, jclass obj, jlong stream) { +JNIEXPORT void JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompressor_free(JNIEnv *env, jclass clazz, jlong stream) { size_t result = dlsym_ZSTD_freeDStream((ZSTD_DStream *) stream); if (dlsym_ZSTD_isError(result)) { THROW(env, "java/lang/InternalError", dlsym_ZSTD_getErrorName(result)); @@ -209,10 +208,10 @@ JNIEXPORT jint JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompre // returns the max size of the recommended input and output buffers JNIEXPORT jint JNICALL Java_org_apache_hadoop_io_compress_zstd_ZStandardDecompressor_getStreamSize -(JNIEnv *env, jclass obj) { +(JNIEnv *env, jclass clazz) { int x = (int) dlsym_ZSTD_DStreamInSize(); int y = (int) dlsym_ZSTD_DStreamOutSize(); return (x >= y) ? x : y; } -#endif //define HADOOP_ZSTD_LIBRARY \ No newline at end of file +#endif //define HADOOP_ZSTD_LIBRARY