Author: liyin Date: Fri Apr 11 18:18:30 2014 New Revision: 1586736 URL: http://svn.apache.org/r1586736 Log: [master] Add sleep for restart ThriftServerRunner
Author: daviddeng Summary: Add a sleep in `catch` block Test Plan: `TestThriftMutationAPI` Reviewers: manukranthk, rshroff Reviewed By: manukranthk CC: hbase-eng@ Differential Revision: https://phabricator.fb.com/D1268413 Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java?rev=1586736&r1=1586735&r2=1586736&view=diff ============================================================================== --- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java (original) +++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java Fri Apr 11 18:18:30 2014 @@ -79,6 +79,7 @@ import org.apache.hadoop.hbase.thrift.ge import org.apache.hadoop.hbase.thrift.generated.TRowResult; import org.apache.hadoop.hbase.thrift.generated.TScan; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.Threads; import org.apache.hadoop.hbase.util.Writables; import org.apache.thrift.TException; import org.apache.thrift.protocol.TBinaryProtocol; @@ -264,6 +265,7 @@ public class ThriftServerRunner implemen } catch (Exception e) { LOG.error("Cannot run ThriftServer", e); metrics.incNumRestarted(); + Threads.sleepRetainInterrupt(1000); } } } @@ -712,11 +714,11 @@ public class ThriftServerRunner implemen timestamp, regionName); } + @SuppressWarnings("deprecation") @Override public List<TRowResult> getRowWithColumnsTs(ByteBuffer tableName, ByteBuffer row, List<ByteBuffer> columns, long timestamp, ByteBuffer regionName) throws IOError { try { - HTable table = getTable(tableName); byte[] rowBytes = getBytes(row); if (columns == null) { Get get = new Get(rowBytes); @@ -748,6 +750,7 @@ public class ThriftServerRunner implemen HConstants.LATEST_TIMESTAMP, regionName)); } + @SuppressWarnings("deprecation") @Override public List<TRowResult> getRowWithColumnPrefixTs(ByteBuffer tableName, ByteBuffer row, ByteBuffer prefix, long timestamp, ByteBuffer regionName) throws IOError { @@ -803,6 +806,7 @@ public class ThriftServerRunner implemen return getRowsWithColumnsTs(tableName, rows, null, timestamp, regionName); } + @SuppressWarnings("deprecation") @Override public List<TRowResult> getRowsWithColumnsTs(ByteBuffer tableName, List<ByteBuffer> rows, List<ByteBuffer> columns, long timestamp,
