From 0c7a578927032d5d1ef3469283d7d1fb7dee2a56 Mon Sep 17 00:00:00 2001 From: Wei-Chiu Chuang Date: Mon, 16 Jul 2018 11:32:45 -0700 Subject: [PATCH] HADOOP-15598. DataChecksum calculate checksum is contented on hashtable synchronization. Contributed by Prasanth Jayachandran. --- .../src/main/java/org/apache/hadoop/util/NativeCrc32.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 0669b0abd2..3142df2da3 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 @@ -28,12 +28,12 @@ * natively. */ class NativeCrc32 { - + private static final boolean isSparc = System.getProperty("os.arch").toLowerCase().startsWith("sparc"); /** * Return true if the JNI-based native CRC extensions are available. */ public static boolean isAvailable() { - if (System.getProperty("os.arch").toLowerCase().startsWith("sparc")) { + if (isSparc) { return false; } else { return NativeCodeLoader.isNativeCodeLoaded();