Skip to content

Commit 37fdbfa

Browse files
xerial-botxerial
andauthored
Update hadoop-common to 3.4.0 (#568)
* Update hadoop-common to 3.4.0 * Fix tests * Fix for arm --------- Co-authored-by: Taro L. Saito <[email protected]>
1 parent 59bd3c6 commit 37fdbfa

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ libraryDependencies ++= Seq(
7878
"org.wvlet.airframe" %% "airframe-log" % "24.3.0" % "test",
7979
"org.osgi" % "org.osgi.core" % "6.0.0" % "provided",
8080
"com.github.sbt" % "junit-interface" % "0.13.3" % "test",
81-
"org.apache.hadoop" % "hadoop-common" % "2.10.2" % "test" exclude ("org.xerial.snappy", "snappy-java")
81+
"org.apache.hadoop" % "hadoop-common" % "3.4.0" % "test" exclude ("org.xerial.snappy", "snappy-java")
8282
)
8383

8484
enablePlugins(SbtOsgi)

src/test/java/org/xerial/snappy/SnappyHadoopCompatibleOutputStreamTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.apache.commons.io.FileUtils;
44
import org.apache.commons.io.IOUtils;
5-
import org.apache.commons.lang.SystemUtils;
65
import org.apache.hadoop.conf.Configuration;
76
import org.apache.hadoop.io.compress.SnappyCodec;
87
import org.junit.AfterClass;
@@ -25,13 +24,13 @@ public static void loadHadoopNativeLibrary() throws Exception
2524
{
2625
final String libResourceFolder;
2726
Map<String, String> libraryNames = new LinkedHashMap<>();
28-
if (SystemUtils.IS_OS_LINUX) {
27+
if (OSInfo.getOSName() == "Linux") {
2928
libResourceFolder = "/lib/Linux";
3029
libraryNames.put("libhadoop.so", "libhadoop.so");
3130
// certain Linux systems need these shared library be copied before the JVM started, see build.sbt
3231
libraryNames.put("libsnappy.so", "libsnappy.so");
3332
libraryNames.put("libsnappy.so.1", "libsnappy.so");
34-
} else if (SystemUtils.IS_OS_MAC_OSX) {
33+
} else if (OSInfo.getOSName() == "Mac") {
3534
libResourceFolder = "/lib/MacOSX";
3635
libraryNames.put("libhadoop.dylib", "libhadoop.dylib");
3736
libraryNames.put("libsnappy.dylib", "libsnappy.dylib");

src/test/java/org/xerial/snappy/SnappyOutputStreamTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ public void batchingOfWritesShouldNotAffectCompressedDataSize()
179179
// compression quality:
180180
if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN)
181181
assertEquals(90992, expectedCompressedData.length);
182+
else if(OSInfo.getArchName() == "aarch64")
183+
// Arm has a better compression ratio
184+
assertEquals(91051, expectedCompressedData.length);
182185
else
183186
assertEquals(91080, expectedCompressedData.length);
184187
// The chunk size should not affect the size of the compressed output:

0 commit comments

Comments
 (0)