From 7c7b7c9c1ea42f5409d01c9ef0ebbb0093fde16f Mon Sep 17 00:00:00 2001 From: Andrew Kyle Purtell Date: Wed, 15 Aug 2012 19:22:21 +0000 Subject: [PATCH] HBASE-6263. Use default mode for Thrift gateway if not specified git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1373591 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/hadoop/hbase/thrift/ThriftServerRunner.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java index 193a4a08e54..49c9fe842c3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java @@ -202,11 +202,14 @@ public class ThriftServerRunner implements Runnable { ++numChosen; } } - if (numChosen != 1) { + if (numChosen < 1) { + LOG.info("Using default thrift server type"); + chosenType = DEFAULT; + } else if (numChosen > 1) { throw new AssertionError("Exactly one option out of " + - Arrays.toString(values()) + " has to be specified"); + Arrays.toString(values()) + " has to be specified"); } - LOG.info("Setting thrift server to " + chosenType.option); + LOG.info("Using thrift server type " + chosenType.option); conf.set(SERVER_TYPE_CONF_KEY, chosenType.option); }