From 3c83cee118137e3d5bbe0c942e92e179d1234d5b Mon Sep 17 00:00:00 2001 From: Allen Wittenauer Date: Wed, 25 May 2016 15:28:02 -0700 Subject: [PATCH] HADOOP-12925. Checks for SPARC architecture need to include 64-bit SPARC (Alan Burlison via aw) --- .../main/java/org/apache/hadoop/io/FastByteComparisons.java | 2 +- .../src/main/java/org/apache/hadoop/util/NativeCrc32.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java index a3fea3115cb..705678ec182 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/FastByteComparisons.java @@ -75,7 +75,7 @@ abstract class FastByteComparisons { * implementation if unable to do so. */ static Comparer getBestComparer() { - if (System.getProperty("os.arch").equals("sparc")) { + if (System.getProperty("os.arch").toLowerCase().startsWith("sparc")) { if (LOG.isTraceEnabled()) { LOG.trace("Lexicographical comparer selected for " + "byte aligned system architecture"); diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/NativeCrc32.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/NativeCrc32.java index cacf006d431..0669b0abd24 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/NativeCrc32.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/NativeCrc32.java @@ -33,7 +33,11 @@ class NativeCrc32 { * Return true if the JNI-based native CRC extensions are available. */ public static boolean isAvailable() { - return NativeCodeLoader.isNativeCodeLoaded(); + if (System.getProperty("os.arch").toLowerCase().startsWith("sparc")) { + return false; + } else { + return NativeCodeLoader.isNativeCodeLoaded(); + } } /**