From 9df2e54160d3d959138857757d2d64d595b54093 Mon Sep 17 00:00:00 2001 From: Colin Patrick Mccabe Date: Tue, 29 Mar 2016 17:13:52 -0700 Subject: [PATCH] HADOOP-12972. Lz4Compressor#getLibraryName returns the wrong version number (cmccabe) (cherry picked from commit e3d15a2e236f93325c67f9e52fb16f645c44238a) --- .../src/org/apache/hadoop/io/compress/lz4/Lz4Compressor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/lz4/Lz4Compressor.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/lz4/Lz4Compressor.c index f742384efc7..2c8af1b9115 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/lz4/Lz4Compressor.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/lz4/Lz4Compressor.c @@ -87,7 +87,9 @@ JNIEXPORT jstring JNICALL Java_org_apache_hadoop_io_compress_lz4_Lz4Compressor_getLibraryName( JNIEnv *env, jclass class ) { - return (*env)->NewStringUTF(env, "revision:99"); + char version_buf[128]; + snprintf(version_buf, sizeof(version_buf), "revision:%d", LZ4_versionNumber()); + return (*env)->NewStringUTF(env, version_buf); } JNIEXPORT jint JNICALL Java_org_apache_hadoop_io_compress_lz4_Lz4Compressor_compressBytesDirectHC