hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [05/19] hbase-site git commit: Published site at .
Date Sun, 10 Dec 2017 15:18:13 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/3a590ccc/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.ErrorType.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.ErrorType.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.ErrorType.html
index 41efd1d..48b1769 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.ErrorType.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.ErrorType.html
@@ -26,29 +26,29 @@
 <span class="sourceLineNo">018</span><a name="line.18"></a>
 <span class="sourceLineNo">019</span>package org.apache.hadoop.hbase.thrift;<a name="line.19"></a>
 <span class="sourceLineNo">020</span><a name="line.20"></a>
-<span class="sourceLineNo">021</span>import org.apache.hadoop.hbase.CallQueueTooBigException;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import org.apache.hadoop.hbase.Cell;<a name="line.22"></a>
-<span class="sourceLineNo">023</span>import org.apache.hadoop.hbase.DoNotRetryIOException;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.MultiActionResultTooLarge;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.NotServingRegionException;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.RegionTooBusyException;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.UnknownScannerException;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.client.Get;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.coprocessor.CoreCoprocessor;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.coprocessor.ObserverContext;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor;<a name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.coprocessor.RegionObserver;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.exceptions.RegionMovedException;<a name="line.36"></a>
-<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.exceptions.ScannerResetException;<a name="line.37"></a>
-<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.metrics.ExceptionTrackingSource;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.39"></a>
-<span class="sourceLineNo">040</span><a name="line.40"></a>
-<span class="sourceLineNo">041</span>import java.io.IOException;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>import java.util.List;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>import java.util.Optional;<a name="line.43"></a>
+<span class="sourceLineNo">021</span>import java.io.IOException;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.util.List;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import java.util.Optional;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.CallQueueTooBigException;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.Cell;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.DoNotRetryIOException;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.MultiActionResultTooLarge;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.NotServingRegionException;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.RegionTooBusyException;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.UnknownScannerException;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.client.Get;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.coprocessor.CoreCoprocessor;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.coprocessor.ObserverContext;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.coprocessor.RegionObserver;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>import org.apache.hadoop.hbase.exceptions.RegionMovedException;<a name="line.40"></a>
+<span class="sourceLineNo">041</span>import org.apache.hadoop.hbase.exceptions.ScannerResetException;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>import org.apache.hadoop.hbase.metrics.ExceptionTrackingSource;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.43"></a>
 <span class="sourceLineNo">044</span><a name="line.44"></a>
 <span class="sourceLineNo">045</span>/**<a name="line.45"></a>
 <span class="sourceLineNo">046</span> * Simple test coprocessor for injecting exceptions on Get requests.<a name="line.46"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/3a590ccc/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.html
index 41efd1d..48b1769 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/ErrorThrowingGetObserver.html
@@ -26,29 +26,29 @@
 <span class="sourceLineNo">018</span><a name="line.18"></a>
 <span class="sourceLineNo">019</span>package org.apache.hadoop.hbase.thrift;<a name="line.19"></a>
 <span class="sourceLineNo">020</span><a name="line.20"></a>
-<span class="sourceLineNo">021</span>import org.apache.hadoop.hbase.CallQueueTooBigException;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import org.apache.hadoop.hbase.Cell;<a name="line.22"></a>
-<span class="sourceLineNo">023</span>import org.apache.hadoop.hbase.DoNotRetryIOException;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.MultiActionResultTooLarge;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.NotServingRegionException;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.RegionTooBusyException;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.UnknownScannerException;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.client.Get;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.coprocessor.CoreCoprocessor;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.coprocessor.ObserverContext;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor;<a name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.coprocessor.RegionObserver;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.exceptions.RegionMovedException;<a name="line.36"></a>
-<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.exceptions.ScannerResetException;<a name="line.37"></a>
-<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.metrics.ExceptionTrackingSource;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.39"></a>
-<span class="sourceLineNo">040</span><a name="line.40"></a>
-<span class="sourceLineNo">041</span>import java.io.IOException;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>import java.util.List;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>import java.util.Optional;<a name="line.43"></a>
+<span class="sourceLineNo">021</span>import java.io.IOException;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.util.List;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import java.util.Optional;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.CallQueueTooBigException;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.Cell;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.DoNotRetryIOException;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.MultiActionResultTooLarge;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.NotServingRegionException;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.RegionTooBusyException;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.UnknownScannerException;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.client.Get;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.coprocessor.CoreCoprocessor;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.coprocessor.ObserverContext;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.coprocessor.RegionObserver;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>import org.apache.hadoop.hbase.exceptions.RegionMovedException;<a name="line.40"></a>
+<span class="sourceLineNo">041</span>import org.apache.hadoop.hbase.exceptions.ScannerResetException;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>import org.apache.hadoop.hbase.metrics.ExceptionTrackingSource;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.43"></a>
 <span class="sourceLineNo">044</span><a name="line.44"></a>
 <span class="sourceLineNo">045</span>/**<a name="line.45"></a>
 <span class="sourceLineNo">046</span> * Simple test coprocessor for injecting exceptions on Get requests.<a name="line.46"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/3a590ccc/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestCallQueue.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestCallQueue.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestCallQueue.html
index a28e726..384dbfd 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestCallQueue.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestCallQueue.html
@@ -38,11 +38,11 @@
 <span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.test.MetricsAssertHelper;<a name="line.30"></a>
 <span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.testclassification.ClientTests;<a name="line.31"></a>
 <span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.testclassification.SmallTests;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.junit.experimental.categories.Category;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.junit.runner.RunWith;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import org.junit.runners.Parameterized;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.junit.runners.Parameterized.Parameters;<a name="line.36"></a>
-<span class="sourceLineNo">037</span>import org.junit.Test;<a name="line.37"></a>
+<span class="sourceLineNo">033</span>import org.junit.Test;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.junit.experimental.categories.Category;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import org.junit.runner.RunWith;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>import org.junit.runners.Parameterized;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import org.junit.runners.Parameterized.Parameters;<a name="line.37"></a>
 <span class="sourceLineNo">038</span><a name="line.38"></a>
 <span class="sourceLineNo">039</span>/**<a name="line.39"></a>
 <span class="sourceLineNo">040</span> * Unit testing for CallQueue, a part of the<a name="line.40"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/3a590ccc/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.html
index 9323d96..e2436c1 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.html
@@ -26,189 +26,190 @@
 <span class="sourceLineNo">018</span> */<a name="line.18"></a>
 <span class="sourceLineNo">019</span>package org.apache.hadoop.hbase.thrift;<a name="line.19"></a>
 <span class="sourceLineNo">020</span><a name="line.20"></a>
-<span class="sourceLineNo">021</span>import java.util.ArrayList;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import java.util.List;<a name="line.22"></a>
-<span class="sourceLineNo">023</span><a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.commons.logging.Log;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.commons.logging.LogFactory;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.HBaseTestingUtility;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.HConstants;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.testclassification.ClientTests;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.testclassification.LargeTests;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.thrift.generated.Hbase;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManagerTestHelper;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.util.IncrementingEnvironmentEdge;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.apache.thrift.protocol.TBinaryProtocol;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import org.apache.thrift.protocol.TProtocol;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.apache.thrift.transport.THttpClient;<a name="line.36"></a>
-<span class="sourceLineNo">037</span>import org.apache.thrift.transport.TTransportException;<a name="line.37"></a>
-<span class="sourceLineNo">038</span>import org.junit.AfterClass;<a name="line.38"></a>
-<span class="sourceLineNo">039</span>import org.junit.BeforeClass;<a name="line.39"></a>
-<span class="sourceLineNo">040</span>import org.junit.Test;<a name="line.40"></a>
-<span class="sourceLineNo">041</span>import org.junit.experimental.categories.Category;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>import static org.junit.Assert.assertFalse;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>import org.junit.Rule;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>import org.junit.rules.ExpectedException;<a name="line.44"></a>
-<span class="sourceLineNo">045</span><a name="line.45"></a>
-<span class="sourceLineNo">046</span>import org.apache.hadoop.hbase.shaded.com.google.common.base.Joiner;<a name="line.46"></a>
-<span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>/**<a name="line.48"></a>
-<span class="sourceLineNo">049</span> * Start the HBase Thrift HTTP server on a random port through the command-line<a name="line.49"></a>
-<span class="sourceLineNo">050</span> * interface and talk to it from client side.<a name="line.50"></a>
-<span class="sourceLineNo">051</span> */<a name="line.51"></a>
-<span class="sourceLineNo">052</span>@Category({ClientTests.class, LargeTests.class})<a name="line.52"></a>
-<span class="sourceLineNo">053</span><a name="line.53"></a>
-<span class="sourceLineNo">054</span>public class TestThriftHttpServer {<a name="line.54"></a>
-<span class="sourceLineNo">055</span><a name="line.55"></a>
-<span class="sourceLineNo">056</span>  private static final Log LOG =<a name="line.56"></a>
-<span class="sourceLineNo">057</span>      LogFactory.getLog(TestThriftHttpServer.class);<a name="line.57"></a>
-<span class="sourceLineNo">058</span><a name="line.58"></a>
-<span class="sourceLineNo">059</span>  private static final HBaseTestingUtility TEST_UTIL =<a name="line.59"></a>
-<span class="sourceLineNo">060</span>      new HBaseTestingUtility();<a name="line.60"></a>
-<span class="sourceLineNo">061</span><a name="line.61"></a>
-<span class="sourceLineNo">062</span>  private Thread httpServerThread;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>  private volatile Exception httpServerException;<a name="line.63"></a>
-<span class="sourceLineNo">064</span><a name="line.64"></a>
-<span class="sourceLineNo">065</span>  private Exception clientSideException;<a name="line.65"></a>
-<span class="sourceLineNo">066</span><a name="line.66"></a>
-<span class="sourceLineNo">067</span>  private ThriftServer thriftServer;<a name="line.67"></a>
-<span class="sourceLineNo">068</span>  private int port;<a name="line.68"></a>
-<span class="sourceLineNo">069</span><a name="line.69"></a>
-<span class="sourceLineNo">070</span>  @BeforeClass<a name="line.70"></a>
-<span class="sourceLineNo">071</span>  public static void setUpBeforeClass() throws Exception {<a name="line.71"></a>
-<span class="sourceLineNo">072</span>    TEST_UTIL.getConfiguration().setBoolean("hbase.regionserver.thrift.http", true);<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    TEST_UTIL.getConfiguration().setBoolean("hbase.table.sanity.checks", false);<a name="line.73"></a>
-<span class="sourceLineNo">074</span>    TEST_UTIL.startMiniCluster();<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    //ensure that server time increments every time we do an operation, otherwise<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    //successive puts having the same timestamp will override each other<a name="line.76"></a>
-<span class="sourceLineNo">077</span>    EnvironmentEdgeManagerTestHelper.injectEdge(new IncrementingEnvironmentEdge());<a name="line.77"></a>
-<span class="sourceLineNo">078</span>  }<a name="line.78"></a>
-<span class="sourceLineNo">079</span><a name="line.79"></a>
-<span class="sourceLineNo">080</span>  @AfterClass<a name="line.80"></a>
-<span class="sourceLineNo">081</span>  public static void tearDownAfterClass() throws Exception {<a name="line.81"></a>
-<span class="sourceLineNo">082</span>    TEST_UTIL.shutdownMiniCluster();<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    EnvironmentEdgeManager.reset();<a name="line.83"></a>
-<span class="sourceLineNo">084</span>  }<a name="line.84"></a>
-<span class="sourceLineNo">085</span><a name="line.85"></a>
-<span class="sourceLineNo">086</span>  private void startHttpServerThread(final String[] args) {<a name="line.86"></a>
-<span class="sourceLineNo">087</span>    LOG.info("Starting HBase Thrift server with HTTP server: " + Joiner.on(" ").join(args));<a name="line.87"></a>
-<span class="sourceLineNo">088</span><a name="line.88"></a>
-<span class="sourceLineNo">089</span>    httpServerException = null;<a name="line.89"></a>
-<span class="sourceLineNo">090</span>    httpServerThread = new Thread(new Runnable() {<a name="line.90"></a>
-<span class="sourceLineNo">091</span>      @Override<a name="line.91"></a>
-<span class="sourceLineNo">092</span>      public void run() {<a name="line.92"></a>
-<span class="sourceLineNo">093</span>        try {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>          thriftServer.doMain(args);<a name="line.94"></a>
-<span class="sourceLineNo">095</span>        } catch (Exception e) {<a name="line.95"></a>
-<span class="sourceLineNo">096</span>          httpServerException = e;<a name="line.96"></a>
-<span class="sourceLineNo">097</span>        }<a name="line.97"></a>
-<span class="sourceLineNo">098</span>      }<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    });<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    httpServerThread.setName(ThriftServer.class.getSimpleName() +<a name="line.100"></a>
-<span class="sourceLineNo">101</span>        "-httpServer");<a name="line.101"></a>
-<span class="sourceLineNo">102</span>    httpServerThread.start();<a name="line.102"></a>
-<span class="sourceLineNo">103</span>  }<a name="line.103"></a>
-<span class="sourceLineNo">104</span><a name="line.104"></a>
-<span class="sourceLineNo">105</span>  @Rule<a name="line.105"></a>
-<span class="sourceLineNo">106</span>  public ExpectedException exception = ExpectedException.none();<a name="line.106"></a>
-<span class="sourceLineNo">107</span><a name="line.107"></a>
-<span class="sourceLineNo">108</span>  @Test(timeout=600000)<a name="line.108"></a>
-<span class="sourceLineNo">109</span>  public void testRunThriftServerWithHeaderBufferLength() throws Exception {<a name="line.109"></a>
-<span class="sourceLineNo">110</span><a name="line.110"></a>
-<span class="sourceLineNo">111</span>    // Test thrift server with HTTP header length less than 64k<a name="line.111"></a>
-<span class="sourceLineNo">112</span>    try {<a name="line.112"></a>
-<span class="sourceLineNo">113</span>      runThriftServer(1024 * 63);<a name="line.113"></a>
-<span class="sourceLineNo">114</span>    } catch (TTransportException tex) {<a name="line.114"></a>
-<span class="sourceLineNo">115</span>      assertFalse(tex.getMessage().equals("HTTP Response code: 431"));<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    }<a name="line.116"></a>
-<span class="sourceLineNo">117</span><a name="line.117"></a>
-<span class="sourceLineNo">118</span>    // Test thrift server with HTTP header length more than 64k, expect an exception<a name="line.118"></a>
-<span class="sourceLineNo">119</span>    exception.expect(TTransportException.class);<a name="line.119"></a>
-<span class="sourceLineNo">120</span>    exception.expectMessage("HTTP Response code: 431");<a name="line.120"></a>
-<span class="sourceLineNo">121</span>    runThriftServer(1024 * 64);<a name="line.121"></a>
-<span class="sourceLineNo">122</span>  }<a name="line.122"></a>
-<span class="sourceLineNo">123</span><a name="line.123"></a>
-<span class="sourceLineNo">124</span>  @Test(timeout=600000)<a name="line.124"></a>
-<span class="sourceLineNo">125</span>  public void testRunThriftServer() throws Exception {<a name="line.125"></a>
-<span class="sourceLineNo">126</span>    runThriftServer(0);<a name="line.126"></a>
-<span class="sourceLineNo">127</span>  }<a name="line.127"></a>
-<span class="sourceLineNo">128</span><a name="line.128"></a>
-<span class="sourceLineNo">129</span>  private void runThriftServer(int customHeaderSize) throws Exception {<a name="line.129"></a>
-<span class="sourceLineNo">130</span>    List&lt;String&gt; args = new ArrayList&lt;&gt;(3);<a name="line.130"></a>
-<span class="sourceLineNo">131</span>    port = HBaseTestingUtility.randomFreePort();<a name="line.131"></a>
-<span class="sourceLineNo">132</span>    args.add("-" + ThriftServer.PORT_OPTION);<a name="line.132"></a>
-<span class="sourceLineNo">133</span>    args.add(String.valueOf(port));<a name="line.133"></a>
-<span class="sourceLineNo">134</span>    args.add("start");<a name="line.134"></a>
-<span class="sourceLineNo">135</span><a name="line.135"></a>
-<span class="sourceLineNo">136</span>    thriftServer = new ThriftServer(TEST_UTIL.getConfiguration());<a name="line.136"></a>
-<span class="sourceLineNo">137</span>    startHttpServerThread(args.toArray(new String[args.size()]));<a name="line.137"></a>
-<span class="sourceLineNo">138</span><a name="line.138"></a>
-<span class="sourceLineNo">139</span>    // wait up to 10s for the server to start<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    for (int i = 0; i &lt; 100<a name="line.140"></a>
-<span class="sourceLineNo">141</span>        &amp;&amp; ( thriftServer.serverRunner == null ||  thriftServer.serverRunner.httpServer ==<a name="line.141"></a>
-<span class="sourceLineNo">142</span>        null); i++) {<a name="line.142"></a>
-<span class="sourceLineNo">143</span>      Thread.sleep(100);<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    }<a name="line.144"></a>
-<span class="sourceLineNo">145</span><a name="line.145"></a>
-<span class="sourceLineNo">146</span>    try {<a name="line.146"></a>
-<span class="sourceLineNo">147</span>      talkToThriftServer(customHeaderSize);<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    } catch (Exception ex) {<a name="line.148"></a>
-<span class="sourceLineNo">149</span>      clientSideException = ex;<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    } finally {<a name="line.150"></a>
-<span class="sourceLineNo">151</span>      stopHttpServerThread();<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    }<a name="line.152"></a>
-<span class="sourceLineNo">153</span><a name="line.153"></a>
-<span class="sourceLineNo">154</span>    if (clientSideException != null) {<a name="line.154"></a>
-<span class="sourceLineNo">155</span>      LOG.error("Thrift client threw an exception " + clientSideException);<a name="line.155"></a>
-<span class="sourceLineNo">156</span>      if (clientSideException instanceof  TTransportException) {<a name="line.156"></a>
-<span class="sourceLineNo">157</span>        throw clientSideException;<a name="line.157"></a>
-<span class="sourceLineNo">158</span>      } else {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>        throw new Exception(clientSideException);<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      }<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    }<a name="line.161"></a>
-<span class="sourceLineNo">162</span>  }<a name="line.162"></a>
-<span class="sourceLineNo">163</span><a name="line.163"></a>
-<span class="sourceLineNo">164</span>  private static volatile boolean tableCreated = false;<a name="line.164"></a>
-<span class="sourceLineNo">165</span><a name="line.165"></a>
-<span class="sourceLineNo">166</span>  private void talkToThriftServer(int customHeaderSize) throws Exception {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>    THttpClient httpClient = new THttpClient(<a name="line.167"></a>
-<span class="sourceLineNo">168</span>        "http://"+ HConstants.LOCALHOST + ":" + port);<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    httpClient.open();<a name="line.169"></a>
-<span class="sourceLineNo">170</span><a name="line.170"></a>
-<span class="sourceLineNo">171</span>    if (customHeaderSize &gt; 0) {<a name="line.171"></a>
-<span class="sourceLineNo">172</span>      StringBuilder sb = new StringBuilder();<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      for (int i = 0; i &lt; customHeaderSize; i++) {<a name="line.173"></a>
-<span class="sourceLineNo">174</span>        sb.append("a");<a name="line.174"></a>
-<span class="sourceLineNo">175</span>      }<a name="line.175"></a>
-<span class="sourceLineNo">176</span>      httpClient.setCustomHeader("User-Agent", sb.toString());<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    }<a name="line.177"></a>
-<span class="sourceLineNo">178</span><a name="line.178"></a>
-<span class="sourceLineNo">179</span>    try {<a name="line.179"></a>
-<span class="sourceLineNo">180</span>      TProtocol prot;<a name="line.180"></a>
-<span class="sourceLineNo">181</span>      prot = new TBinaryProtocol(httpClient);<a name="line.181"></a>
-<span class="sourceLineNo">182</span>      Hbase.Client client = new Hbase.Client(prot);<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      if (!tableCreated){<a name="line.183"></a>
-<span class="sourceLineNo">184</span>        TestThriftServer.createTestTables(client);<a name="line.184"></a>
-<span class="sourceLineNo">185</span>        tableCreated = true;<a name="line.185"></a>
-<span class="sourceLineNo">186</span>      }<a name="line.186"></a>
-<span class="sourceLineNo">187</span>      TestThriftServer.checkTableList(client);<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    } finally {<a name="line.188"></a>
-<span class="sourceLineNo">189</span>      httpClient.close();<a name="line.189"></a>
-<span class="sourceLineNo">190</span>    }<a name="line.190"></a>
-<span class="sourceLineNo">191</span>  }<a name="line.191"></a>
-<span class="sourceLineNo">192</span><a name="line.192"></a>
-<span class="sourceLineNo">193</span>  private void stopHttpServerThread() throws Exception {<a name="line.193"></a>
-<span class="sourceLineNo">194</span>    LOG.debug("Stopping " + " Thrift HTTP server");<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    thriftServer.stop();<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    httpServerThread.join();<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    if (httpServerException != null) {<a name="line.197"></a>
-<span class="sourceLineNo">198</span>      LOG.error("Command-line invocation of HBase Thrift server threw an " +<a name="line.198"></a>
-<span class="sourceLineNo">199</span>          "exception", httpServerException);<a name="line.199"></a>
-<span class="sourceLineNo">200</span>      throw new Exception(httpServerException);<a name="line.200"></a>
-<span class="sourceLineNo">201</span>    }<a name="line.201"></a>
-<span class="sourceLineNo">202</span>  }<a name="line.202"></a>
-<span class="sourceLineNo">203</span>}<a name="line.203"></a>
+<span class="sourceLineNo">021</span>import static org.junit.Assert.assertFalse;<a name="line.21"></a>
+<span class="sourceLineNo">022</span><a name="line.22"></a>
+<span class="sourceLineNo">023</span>import java.util.ArrayList;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import java.util.List;<a name="line.24"></a>
+<span class="sourceLineNo">025</span><a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.commons.logging.Log;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.commons.logging.LogFactory;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.HBaseTestingUtility;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.HConstants;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.testclassification.ClientTests;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.testclassification.LargeTests;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.thrift.generated.Hbase;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManagerTestHelper;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.util.IncrementingEnvironmentEdge;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>import org.apache.thrift.protocol.TBinaryProtocol;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import org.apache.thrift.protocol.TProtocol;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>import org.apache.thrift.transport.THttpClient;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import org.apache.thrift.transport.TTransportException;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>import org.junit.AfterClass;<a name="line.40"></a>
+<span class="sourceLineNo">041</span>import org.junit.BeforeClass;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>import org.junit.Rule;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>import org.junit.Test;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>import org.junit.experimental.categories.Category;<a name="line.44"></a>
+<span class="sourceLineNo">045</span>import org.junit.rules.ExpectedException;<a name="line.45"></a>
+<span class="sourceLineNo">046</span><a name="line.46"></a>
+<span class="sourceLineNo">047</span>import org.apache.hadoop.hbase.shaded.com.google.common.base.Joiner;<a name="line.47"></a>
+<span class="sourceLineNo">048</span><a name="line.48"></a>
+<span class="sourceLineNo">049</span>/**<a name="line.49"></a>
+<span class="sourceLineNo">050</span> * Start the HBase Thrift HTTP server on a random port through the command-line<a name="line.50"></a>
+<span class="sourceLineNo">051</span> * interface and talk to it from client side.<a name="line.51"></a>
+<span class="sourceLineNo">052</span> */<a name="line.52"></a>
+<span class="sourceLineNo">053</span>@Category({ClientTests.class, LargeTests.class})<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>public class TestThriftHttpServer {<a name="line.55"></a>
+<span class="sourceLineNo">056</span><a name="line.56"></a>
+<span class="sourceLineNo">057</span>  private static final Log LOG =<a name="line.57"></a>
+<span class="sourceLineNo">058</span>      LogFactory.getLog(TestThriftHttpServer.class);<a name="line.58"></a>
+<span class="sourceLineNo">059</span><a name="line.59"></a>
+<span class="sourceLineNo">060</span>  private static final HBaseTestingUtility TEST_UTIL =<a name="line.60"></a>
+<span class="sourceLineNo">061</span>      new HBaseTestingUtility();<a name="line.61"></a>
+<span class="sourceLineNo">062</span><a name="line.62"></a>
+<span class="sourceLineNo">063</span>  private Thread httpServerThread;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>  private volatile Exception httpServerException;<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>  private Exception clientSideException;<a name="line.66"></a>
+<span class="sourceLineNo">067</span><a name="line.67"></a>
+<span class="sourceLineNo">068</span>  private ThriftServer thriftServer;<a name="line.68"></a>
+<span class="sourceLineNo">069</span>  private int port;<a name="line.69"></a>
+<span class="sourceLineNo">070</span><a name="line.70"></a>
+<span class="sourceLineNo">071</span>  @BeforeClass<a name="line.71"></a>
+<span class="sourceLineNo">072</span>  public static void setUpBeforeClass() throws Exception {<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    TEST_UTIL.getConfiguration().setBoolean("hbase.regionserver.thrift.http", true);<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    TEST_UTIL.getConfiguration().setBoolean("hbase.table.sanity.checks", false);<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    TEST_UTIL.startMiniCluster();<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    //ensure that server time increments every time we do an operation, otherwise<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    //successive puts having the same timestamp will override each other<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    EnvironmentEdgeManagerTestHelper.injectEdge(new IncrementingEnvironmentEdge());<a name="line.78"></a>
+<span class="sourceLineNo">079</span>  }<a name="line.79"></a>
+<span class="sourceLineNo">080</span><a name="line.80"></a>
+<span class="sourceLineNo">081</span>  @AfterClass<a name="line.81"></a>
+<span class="sourceLineNo">082</span>  public static void tearDownAfterClass() throws Exception {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    TEST_UTIL.shutdownMiniCluster();<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    EnvironmentEdgeManager.reset();<a name="line.84"></a>
+<span class="sourceLineNo">085</span>  }<a name="line.85"></a>
+<span class="sourceLineNo">086</span><a name="line.86"></a>
+<span class="sourceLineNo">087</span>  private void startHttpServerThread(final String[] args) {<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    LOG.info("Starting HBase Thrift server with HTTP server: " + Joiner.on(" ").join(args));<a name="line.88"></a>
+<span class="sourceLineNo">089</span><a name="line.89"></a>
+<span class="sourceLineNo">090</span>    httpServerException = null;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    httpServerThread = new Thread(new Runnable() {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>      @Override<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      public void run() {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>        try {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>          thriftServer.doMain(args);<a name="line.95"></a>
+<span class="sourceLineNo">096</span>        } catch (Exception e) {<a name="line.96"></a>
+<span class="sourceLineNo">097</span>          httpServerException = e;<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        }<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      }<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    });<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    httpServerThread.setName(ThriftServer.class.getSimpleName() +<a name="line.101"></a>
+<span class="sourceLineNo">102</span>        "-httpServer");<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    httpServerThread.start();<a name="line.103"></a>
+<span class="sourceLineNo">104</span>  }<a name="line.104"></a>
+<span class="sourceLineNo">105</span><a name="line.105"></a>
+<span class="sourceLineNo">106</span>  @Rule<a name="line.106"></a>
+<span class="sourceLineNo">107</span>  public ExpectedException exception = ExpectedException.none();<a name="line.107"></a>
+<span class="sourceLineNo">108</span><a name="line.108"></a>
+<span class="sourceLineNo">109</span>  @Test(timeout=600000)<a name="line.109"></a>
+<span class="sourceLineNo">110</span>  public void testRunThriftServerWithHeaderBufferLength() throws Exception {<a name="line.110"></a>
+<span class="sourceLineNo">111</span><a name="line.111"></a>
+<span class="sourceLineNo">112</span>    // Test thrift server with HTTP header length less than 64k<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    try {<a name="line.113"></a>
+<span class="sourceLineNo">114</span>      runThriftServer(1024 * 63);<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    } catch (TTransportException tex) {<a name="line.115"></a>
+<span class="sourceLineNo">116</span>      assertFalse(tex.getMessage().equals("HTTP Response code: 431"));<a name="line.116"></a>
+<span class="sourceLineNo">117</span>    }<a name="line.117"></a>
+<span class="sourceLineNo">118</span><a name="line.118"></a>
+<span class="sourceLineNo">119</span>    // Test thrift server with HTTP header length more than 64k, expect an exception<a name="line.119"></a>
+<span class="sourceLineNo">120</span>    exception.expect(TTransportException.class);<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    exception.expectMessage("HTTP Response code: 431");<a name="line.121"></a>
+<span class="sourceLineNo">122</span>    runThriftServer(1024 * 64);<a name="line.122"></a>
+<span class="sourceLineNo">123</span>  }<a name="line.123"></a>
+<span class="sourceLineNo">124</span><a name="line.124"></a>
+<span class="sourceLineNo">125</span>  @Test(timeout=600000)<a name="line.125"></a>
+<span class="sourceLineNo">126</span>  public void testRunThriftServer() throws Exception {<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    runThriftServer(0);<a name="line.127"></a>
+<span class="sourceLineNo">128</span>  }<a name="line.128"></a>
+<span class="sourceLineNo">129</span><a name="line.129"></a>
+<span class="sourceLineNo">130</span>  private void runThriftServer(int customHeaderSize) throws Exception {<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    List&lt;String&gt; args = new ArrayList&lt;&gt;(3);<a name="line.131"></a>
+<span class="sourceLineNo">132</span>    port = HBaseTestingUtility.randomFreePort();<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    args.add("-" + ThriftServer.PORT_OPTION);<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    args.add(String.valueOf(port));<a name="line.134"></a>
+<span class="sourceLineNo">135</span>    args.add("start");<a name="line.135"></a>
+<span class="sourceLineNo">136</span><a name="line.136"></a>
+<span class="sourceLineNo">137</span>    thriftServer = new ThriftServer(TEST_UTIL.getConfiguration());<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    startHttpServerThread(args.toArray(new String[args.size()]));<a name="line.138"></a>
+<span class="sourceLineNo">139</span><a name="line.139"></a>
+<span class="sourceLineNo">140</span>    // wait up to 10s for the server to start<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    for (int i = 0; i &lt; 100<a name="line.141"></a>
+<span class="sourceLineNo">142</span>        &amp;&amp; ( thriftServer.serverRunner == null ||  thriftServer.serverRunner.httpServer ==<a name="line.142"></a>
+<span class="sourceLineNo">143</span>        null); i++) {<a name="line.143"></a>
+<span class="sourceLineNo">144</span>      Thread.sleep(100);<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    }<a name="line.145"></a>
+<span class="sourceLineNo">146</span><a name="line.146"></a>
+<span class="sourceLineNo">147</span>    try {<a name="line.147"></a>
+<span class="sourceLineNo">148</span>      talkToThriftServer(customHeaderSize);<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    } catch (Exception ex) {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>      clientSideException = ex;<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    } finally {<a name="line.151"></a>
+<span class="sourceLineNo">152</span>      stopHttpServerThread();<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    }<a name="line.153"></a>
+<span class="sourceLineNo">154</span><a name="line.154"></a>
+<span class="sourceLineNo">155</span>    if (clientSideException != null) {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>      LOG.error("Thrift client threw an exception " + clientSideException);<a name="line.156"></a>
+<span class="sourceLineNo">157</span>      if (clientSideException instanceof  TTransportException) {<a name="line.157"></a>
+<span class="sourceLineNo">158</span>        throw clientSideException;<a name="line.158"></a>
+<span class="sourceLineNo">159</span>      } else {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>        throw new Exception(clientSideException);<a name="line.160"></a>
+<span class="sourceLineNo">161</span>      }<a name="line.161"></a>
+<span class="sourceLineNo">162</span>    }<a name="line.162"></a>
+<span class="sourceLineNo">163</span>  }<a name="line.163"></a>
+<span class="sourceLineNo">164</span><a name="line.164"></a>
+<span class="sourceLineNo">165</span>  private static volatile boolean tableCreated = false;<a name="line.165"></a>
+<span class="sourceLineNo">166</span><a name="line.166"></a>
+<span class="sourceLineNo">167</span>  private void talkToThriftServer(int customHeaderSize) throws Exception {<a name="line.167"></a>
+<span class="sourceLineNo">168</span>    THttpClient httpClient = new THttpClient(<a name="line.168"></a>
+<span class="sourceLineNo">169</span>        "http://"+ HConstants.LOCALHOST + ":" + port);<a name="line.169"></a>
+<span class="sourceLineNo">170</span>    httpClient.open();<a name="line.170"></a>
+<span class="sourceLineNo">171</span><a name="line.171"></a>
+<span class="sourceLineNo">172</span>    if (customHeaderSize &gt; 0) {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>      StringBuilder sb = new StringBuilder();<a name="line.173"></a>
+<span class="sourceLineNo">174</span>      for (int i = 0; i &lt; customHeaderSize; i++) {<a name="line.174"></a>
+<span class="sourceLineNo">175</span>        sb.append("a");<a name="line.175"></a>
+<span class="sourceLineNo">176</span>      }<a name="line.176"></a>
+<span class="sourceLineNo">177</span>      httpClient.setCustomHeader("User-Agent", sb.toString());<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    }<a name="line.178"></a>
+<span class="sourceLineNo">179</span><a name="line.179"></a>
+<span class="sourceLineNo">180</span>    try {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>      TProtocol prot;<a name="line.181"></a>
+<span class="sourceLineNo">182</span>      prot = new TBinaryProtocol(httpClient);<a name="line.182"></a>
+<span class="sourceLineNo">183</span>      Hbase.Client client = new Hbase.Client(prot);<a name="line.183"></a>
+<span class="sourceLineNo">184</span>      if (!tableCreated){<a name="line.184"></a>
+<span class="sourceLineNo">185</span>        TestThriftServer.createTestTables(client);<a name="line.185"></a>
+<span class="sourceLineNo">186</span>        tableCreated = true;<a name="line.186"></a>
+<span class="sourceLineNo">187</span>      }<a name="line.187"></a>
+<span class="sourceLineNo">188</span>      TestThriftServer.checkTableList(client);<a name="line.188"></a>
+<span class="sourceLineNo">189</span>    } finally {<a name="line.189"></a>
+<span class="sourceLineNo">190</span>      httpClient.close();<a name="line.190"></a>
+<span class="sourceLineNo">191</span>    }<a name="line.191"></a>
+<span class="sourceLineNo">192</span>  }<a name="line.192"></a>
+<span class="sourceLineNo">193</span><a name="line.193"></a>
+<span class="sourceLineNo">194</span>  private void stopHttpServerThread() throws Exception {<a name="line.194"></a>
+<span class="sourceLineNo">195</span>    LOG.debug("Stopping " + " Thrift HTTP server");<a name="line.195"></a>
+<span class="sourceLineNo">196</span>    thriftServer.stop();<a name="line.196"></a>
+<span class="sourceLineNo">197</span>    httpServerThread.join();<a name="line.197"></a>
+<span class="sourceLineNo">198</span>    if (httpServerException != null) {<a name="line.198"></a>
+<span class="sourceLineNo">199</span>      LOG.error("Command-line invocation of HBase Thrift server threw an " +<a name="line.199"></a>
+<span class="sourceLineNo">200</span>          "exception", httpServerException);<a name="line.200"></a>
+<span class="sourceLineNo">201</span>      throw new Exception(httpServerException);<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    }<a name="line.202"></a>
+<span class="sourceLineNo">203</span>  }<a name="line.203"></a>
+<span class="sourceLineNo">204</span>}<a name="line.204"></a>
 
 
 


Mime
View raw message