diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java index e55a7ebfce0..26d6f18d590 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java @@ -120,7 +120,7 @@ public class AsyncRpcClient extends AbstractRpcClient { boolean epollEnabled = conf.getBoolean(USE_NATIVE_TRANSPORT, false); // Use the faster native epoll transport mechanism on linux if enabled - if (epollEnabled && JVM.isLinux()) { + if (epollEnabled && JVM.isLinux() && JVM.isAmd64()) { if (LOG.isDebugEnabled()) { LOG.debug("Create EpollEventLoopGroup with maxThreads = " + maxThreads); } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java index 9fb7037a5a9..2d6065bdb6f 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java @@ -51,6 +51,7 @@ public class JVM { private static final boolean linux = System.getProperty("os.name").startsWith("Linux"); private static final String JVMVersion = System.getProperty("java.version"); + private static final boolean amd64 = System.getProperty("os.arch").contains("amd64"); /** * Constructor. Get the running Operating System instance @@ -79,6 +80,14 @@ public class JVM { public static boolean isLinux() { return linux; } + + /** + * Check if the arch is amd64; + * @return whether this is amd64 or not. + */ + public static boolean isAmd64() { + return amd64; + } /** * Check if the finish() method of GZIPOutputStream is broken diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestAsyncIPC.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestAsyncIPC.java index c977cfabe10..ca7c9a74165 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestAsyncIPC.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestAsyncIPC.java @@ -100,7 +100,7 @@ public class TestAsyncIPC extends AbstractTestIPC { private void setConf(Configuration conf) { conf.setBoolean(AsyncRpcClient.USE_NATIVE_TRANSPORT, useNativeTransport); - conf.setBoolean(AsyncRpcClient.USE_NATIVE_TRANSPORT, useGlobalEventLoopGroup); + conf.setBoolean(AsyncRpcClient.USE_GLOBAL_EVENT_LOOP_GROUP, useGlobalEventLoopGroup); if (useGlobalEventLoopGroup && AsyncRpcClient.GLOBAL_EVENT_LOOP_GROUP != null) { if (useNativeTransport && !(AsyncRpcClient.GLOBAL_EVENT_LOOP_GROUP.getFirst() instanceof EpollEventLoopGroup)