hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [07/27] hbase-site git commit: Published site at .
Date Thu, 18 Jan 2018 15:31:06 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/cc91ad79/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.MyMasterObserver.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.MyMasterObserver.html
b/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.MyMasterObserver.html
index 9fe9867..c873505 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.MyMasterObserver.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.MyMasterObserver.html
@@ -66,39 +66,39 @@
 <span class="sourceLineNo">058</span>import org.junit.Assert;<a name="line.58"></a>
 <span class="sourceLineNo">059</span>import org.junit.Before;<a name="line.59"></a>
 <span class="sourceLineNo">060</span>import org.junit.BeforeClass;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>import org.junit.Ignore;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>import org.junit.Test;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>import org.junit.experimental.categories.Category;<a
name="line.63"></a>
-<span class="sourceLineNo">064</span>import org.slf4j.Logger;<a name="line.64"></a>
-<span class="sourceLineNo">065</span>import org.slf4j.LoggerFactory;<a name="line.65"></a>
-<span class="sourceLineNo">066</span><a name="line.66"></a>
-<span class="sourceLineNo">067</span>@Ignore // Depends on Master being able
to host regions. Needs fixing.<a name="line.67"></a>
-<span class="sourceLineNo">068</span>@Category({MediumTests.class, FlakeyTests.class})<a
name="line.68"></a>
-<span class="sourceLineNo">069</span>public class TestMultiParallel {<a name="line.69"></a>
-<span class="sourceLineNo">070</span>  private static final Logger LOG = LoggerFactory.getLogger(TestMultiParallel.class);<a
name="line.70"></a>
-<span class="sourceLineNo">071</span><a name="line.71"></a>
-<span class="sourceLineNo">072</span>  private static final HBaseTestingUtility
UTIL = new HBaseTestingUtility();<a name="line.72"></a>
-<span class="sourceLineNo">073</span>  private static final byte[] VALUE = Bytes.toBytes("value");<a
name="line.73"></a>
-<span class="sourceLineNo">074</span>  private static final byte[] QUALIFIER
= Bytes.toBytes("qual");<a name="line.74"></a>
-<span class="sourceLineNo">075</span>  private static final String FAMILY = "family";<a
name="line.75"></a>
-<span class="sourceLineNo">076</span>  private static final TableName TEST_TABLE
= TableName.valueOf("multi_test_table");<a name="line.76"></a>
-<span class="sourceLineNo">077</span>  private static final byte[] BYTES_FAMILY
= Bytes.toBytes(FAMILY);<a name="line.77"></a>
-<span class="sourceLineNo">078</span>  private static final byte[] ONE_ROW =
Bytes.toBytes("xxx");<a name="line.78"></a>
-<span class="sourceLineNo">079</span>  private static final byte [][] KEYS =
makeKeys();<a name="line.79"></a>
-<span class="sourceLineNo">080</span><a name="line.80"></a>
-<span class="sourceLineNo">081</span>  private static final int slaves = 5; //
also used for testing HTable pool size<a name="line.81"></a>
-<span class="sourceLineNo">082</span>  private static Connection CONNECTION;<a
name="line.82"></a>
-<span class="sourceLineNo">083</span><a name="line.83"></a>
-<span class="sourceLineNo">084</span>  @BeforeClass public static void beforeClass()
throws Exception {<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    // Uncomment the following lines if
more verbosity is needed for<a name="line.85"></a>
-<span class="sourceLineNo">086</span>    // debugging (see HBASE-12285 for details).<a
name="line.86"></a>
-<span class="sourceLineNo">087</span>    //((Log4JLogger)RpcServer.LOG).getLogger().setLevel(Level.ALL);<a
name="line.87"></a>
-<span class="sourceLineNo">088</span>    //((Log4JLogger)RpcClient.LOG).getLogger().setLevel(Level.ALL);<a
name="line.88"></a>
-<span class="sourceLineNo">089</span>    //((Log4JLogger)ScannerCallable.LOG).getLogger().setLevel(Level.ALL);<a
name="line.89"></a>
-<span class="sourceLineNo">090</span>    UTIL.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY,<a
name="line.90"></a>
-<span class="sourceLineNo">091</span>        KeyValueCodec.class.getCanonicalName());<a
name="line.91"></a>
-<span class="sourceLineNo">092</span>    UTIL.getConfiguration().setBoolean(LoadBalancer.TABLES_ON_MASTER,
true);<a name="line.92"></a>
-<span class="sourceLineNo">093</span>    UTIL.getConfiguration().setBoolean(LoadBalancer.SYSTEM_TABLES_ON_MASTER,
true);<a name="line.93"></a>
+<span class="sourceLineNo">061</span>import org.junit.Test;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>import org.junit.experimental.categories.Category;<a
name="line.62"></a>
+<span class="sourceLineNo">063</span>import org.slf4j.Logger;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>import org.slf4j.LoggerFactory;<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>@Category({MediumTests.class, FlakeyTests.class})<a
name="line.66"></a>
+<span class="sourceLineNo">067</span>public class TestMultiParallel {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>  private static final Logger LOG = LoggerFactory.getLogger(TestMultiParallel.class);<a
name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>  private static final HBaseTestingUtility
UTIL = new HBaseTestingUtility();<a name="line.70"></a>
+<span class="sourceLineNo">071</span>  private static final byte[] VALUE = Bytes.toBytes("value");<a
name="line.71"></a>
+<span class="sourceLineNo">072</span>  private static final byte[] QUALIFIER
= Bytes.toBytes("qual");<a name="line.72"></a>
+<span class="sourceLineNo">073</span>  private static final String FAMILY = "family";<a
name="line.73"></a>
+<span class="sourceLineNo">074</span>  private static final TableName TEST_TABLE
= TableName.valueOf("multi_test_table");<a name="line.74"></a>
+<span class="sourceLineNo">075</span>  private static final byte[] BYTES_FAMILY
= Bytes.toBytes(FAMILY);<a name="line.75"></a>
+<span class="sourceLineNo">076</span>  private static final byte[] ONE_ROW =
Bytes.toBytes("xxx");<a name="line.76"></a>
+<span class="sourceLineNo">077</span>  private static final byte [][] KEYS =
makeKeys();<a name="line.77"></a>
+<span class="sourceLineNo">078</span><a name="line.78"></a>
+<span class="sourceLineNo">079</span>  private static final int slaves = 5; //
also used for testing HTable pool size<a name="line.79"></a>
+<span class="sourceLineNo">080</span>  private static Connection CONNECTION;<a
name="line.80"></a>
+<span class="sourceLineNo">081</span><a name="line.81"></a>
+<span class="sourceLineNo">082</span>  @BeforeClass public static void beforeClass()
throws Exception {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    // Uncomment the following lines if
more verbosity is needed for<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    // debugging (see HBASE-12285 for details).<a
name="line.84"></a>
+<span class="sourceLineNo">085</span>    //((Log4JLogger)RpcServer.LOG).getLogger().setLevel(Level.ALL);<a
name="line.85"></a>
+<span class="sourceLineNo">086</span>    //((Log4JLogger)RpcClient.LOG).getLogger().setLevel(Level.ALL);<a
name="line.86"></a>
+<span class="sourceLineNo">087</span>    //((Log4JLogger)ScannerCallable.LOG).getLogger().setLevel(Level.ALL);<a
name="line.87"></a>
+<span class="sourceLineNo">088</span>    UTIL.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY,<a
name="line.88"></a>
+<span class="sourceLineNo">089</span>        KeyValueCodec.class.getCanonicalName());<a
name="line.89"></a>
+<span class="sourceLineNo">090</span>    UTIL.getConfiguration().setBoolean(LoadBalancer.TABLES_ON_MASTER,
true);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    // We used to ask for system tables
on Master exclusively but not needed by test and doesn't<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    // work anyways -- so commented out.<a
name="line.92"></a>
+<span class="sourceLineNo">093</span>    // UTIL.getConfiguration().setBoolean(LoadBalancer.SYSTEM_TABLES_ON_MASTER,
true);<a name="line.93"></a>
 <span class="sourceLineNo">094</span>    UTIL.getConfiguration()<a name="line.94"></a>
 <span class="sourceLineNo">095</span>        .set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
MyMasterObserver.class.getName());<a name="line.95"></a>
 <span class="sourceLineNo">096</span>    UTIL.startMiniCluster(slaves);<a
name="line.96"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/cc91ad79/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.html
b/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.html
index 9fe9867..c873505 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestMultiParallel.html
@@ -66,39 +66,39 @@
 <span class="sourceLineNo">058</span>import org.junit.Assert;<a name="line.58"></a>
 <span class="sourceLineNo">059</span>import org.junit.Before;<a name="line.59"></a>
 <span class="sourceLineNo">060</span>import org.junit.BeforeClass;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>import org.junit.Ignore;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>import org.junit.Test;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>import org.junit.experimental.categories.Category;<a
name="line.63"></a>
-<span class="sourceLineNo">064</span>import org.slf4j.Logger;<a name="line.64"></a>
-<span class="sourceLineNo">065</span>import org.slf4j.LoggerFactory;<a name="line.65"></a>
-<span class="sourceLineNo">066</span><a name="line.66"></a>
-<span class="sourceLineNo">067</span>@Ignore // Depends on Master being able
to host regions. Needs fixing.<a name="line.67"></a>
-<span class="sourceLineNo">068</span>@Category({MediumTests.class, FlakeyTests.class})<a
name="line.68"></a>
-<span class="sourceLineNo">069</span>public class TestMultiParallel {<a name="line.69"></a>
-<span class="sourceLineNo">070</span>  private static final Logger LOG = LoggerFactory.getLogger(TestMultiParallel.class);<a
name="line.70"></a>
-<span class="sourceLineNo">071</span><a name="line.71"></a>
-<span class="sourceLineNo">072</span>  private static final HBaseTestingUtility
UTIL = new HBaseTestingUtility();<a name="line.72"></a>
-<span class="sourceLineNo">073</span>  private static final byte[] VALUE = Bytes.toBytes("value");<a
name="line.73"></a>
-<span class="sourceLineNo">074</span>  private static final byte[] QUALIFIER
= Bytes.toBytes("qual");<a name="line.74"></a>
-<span class="sourceLineNo">075</span>  private static final String FAMILY = "family";<a
name="line.75"></a>
-<span class="sourceLineNo">076</span>  private static final TableName TEST_TABLE
= TableName.valueOf("multi_test_table");<a name="line.76"></a>
-<span class="sourceLineNo">077</span>  private static final byte[] BYTES_FAMILY
= Bytes.toBytes(FAMILY);<a name="line.77"></a>
-<span class="sourceLineNo">078</span>  private static final byte[] ONE_ROW =
Bytes.toBytes("xxx");<a name="line.78"></a>
-<span class="sourceLineNo">079</span>  private static final byte [][] KEYS =
makeKeys();<a name="line.79"></a>
-<span class="sourceLineNo">080</span><a name="line.80"></a>
-<span class="sourceLineNo">081</span>  private static final int slaves = 5; //
also used for testing HTable pool size<a name="line.81"></a>
-<span class="sourceLineNo">082</span>  private static Connection CONNECTION;<a
name="line.82"></a>
-<span class="sourceLineNo">083</span><a name="line.83"></a>
-<span class="sourceLineNo">084</span>  @BeforeClass public static void beforeClass()
throws Exception {<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    // Uncomment the following lines if
more verbosity is needed for<a name="line.85"></a>
-<span class="sourceLineNo">086</span>    // debugging (see HBASE-12285 for details).<a
name="line.86"></a>
-<span class="sourceLineNo">087</span>    //((Log4JLogger)RpcServer.LOG).getLogger().setLevel(Level.ALL);<a
name="line.87"></a>
-<span class="sourceLineNo">088</span>    //((Log4JLogger)RpcClient.LOG).getLogger().setLevel(Level.ALL);<a
name="line.88"></a>
-<span class="sourceLineNo">089</span>    //((Log4JLogger)ScannerCallable.LOG).getLogger().setLevel(Level.ALL);<a
name="line.89"></a>
-<span class="sourceLineNo">090</span>    UTIL.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY,<a
name="line.90"></a>
-<span class="sourceLineNo">091</span>        KeyValueCodec.class.getCanonicalName());<a
name="line.91"></a>
-<span class="sourceLineNo">092</span>    UTIL.getConfiguration().setBoolean(LoadBalancer.TABLES_ON_MASTER,
true);<a name="line.92"></a>
-<span class="sourceLineNo">093</span>    UTIL.getConfiguration().setBoolean(LoadBalancer.SYSTEM_TABLES_ON_MASTER,
true);<a name="line.93"></a>
+<span class="sourceLineNo">061</span>import org.junit.Test;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>import org.junit.experimental.categories.Category;<a
name="line.62"></a>
+<span class="sourceLineNo">063</span>import org.slf4j.Logger;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>import org.slf4j.LoggerFactory;<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>@Category({MediumTests.class, FlakeyTests.class})<a
name="line.66"></a>
+<span class="sourceLineNo">067</span>public class TestMultiParallel {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>  private static final Logger LOG = LoggerFactory.getLogger(TestMultiParallel.class);<a
name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>  private static final HBaseTestingUtility
UTIL = new HBaseTestingUtility();<a name="line.70"></a>
+<span class="sourceLineNo">071</span>  private static final byte[] VALUE = Bytes.toBytes("value");<a
name="line.71"></a>
+<span class="sourceLineNo">072</span>  private static final byte[] QUALIFIER
= Bytes.toBytes("qual");<a name="line.72"></a>
+<span class="sourceLineNo">073</span>  private static final String FAMILY = "family";<a
name="line.73"></a>
+<span class="sourceLineNo">074</span>  private static final TableName TEST_TABLE
= TableName.valueOf("multi_test_table");<a name="line.74"></a>
+<span class="sourceLineNo">075</span>  private static final byte[] BYTES_FAMILY
= Bytes.toBytes(FAMILY);<a name="line.75"></a>
+<span class="sourceLineNo">076</span>  private static final byte[] ONE_ROW =
Bytes.toBytes("xxx");<a name="line.76"></a>
+<span class="sourceLineNo">077</span>  private static final byte [][] KEYS =
makeKeys();<a name="line.77"></a>
+<span class="sourceLineNo">078</span><a name="line.78"></a>
+<span class="sourceLineNo">079</span>  private static final int slaves = 5; //
also used for testing HTable pool size<a name="line.79"></a>
+<span class="sourceLineNo">080</span>  private static Connection CONNECTION;<a
name="line.80"></a>
+<span class="sourceLineNo">081</span><a name="line.81"></a>
+<span class="sourceLineNo">082</span>  @BeforeClass public static void beforeClass()
throws Exception {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    // Uncomment the following lines if
more verbosity is needed for<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    // debugging (see HBASE-12285 for details).<a
name="line.84"></a>
+<span class="sourceLineNo">085</span>    //((Log4JLogger)RpcServer.LOG).getLogger().setLevel(Level.ALL);<a
name="line.85"></a>
+<span class="sourceLineNo">086</span>    //((Log4JLogger)RpcClient.LOG).getLogger().setLevel(Level.ALL);<a
name="line.86"></a>
+<span class="sourceLineNo">087</span>    //((Log4JLogger)ScannerCallable.LOG).getLogger().setLevel(Level.ALL);<a
name="line.87"></a>
+<span class="sourceLineNo">088</span>    UTIL.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY,<a
name="line.88"></a>
+<span class="sourceLineNo">089</span>        KeyValueCodec.class.getCanonicalName());<a
name="line.89"></a>
+<span class="sourceLineNo">090</span>    UTIL.getConfiguration().setBoolean(LoadBalancer.TABLES_ON_MASTER,
true);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    // We used to ask for system tables
on Master exclusively but not needed by test and doesn't<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    // work anyways -- so commented out.<a
name="line.92"></a>
+<span class="sourceLineNo">093</span>    // UTIL.getConfiguration().setBoolean(LoadBalancer.SYSTEM_TABLES_ON_MASTER,
true);<a name="line.93"></a>
 <span class="sourceLineNo">094</span>    UTIL.getConfiguration()<a name="line.94"></a>
 <span class="sourceLineNo">095</span>        .set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
MyMasterObserver.class.getName());<a name="line.95"></a>
 <span class="sourceLineNo">096</span>    UTIL.startMiniCluster(slaves);<a
name="line.96"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/cc91ad79/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestZKAsyncRegistry.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestZKAsyncRegistry.html
b/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestZKAsyncRegistry.html
index ddadba0..1047518 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestZKAsyncRegistry.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/client/TestZKAsyncRegistry.html
@@ -55,100 +55,97 @@
 <span class="sourceLineNo">047</span>import org.slf4j.Logger;<a name="line.47"></a>
 <span class="sourceLineNo">048</span>import org.slf4j.LoggerFactory;<a name="line.48"></a>
 <span class="sourceLineNo">049</span><a name="line.49"></a>
-<span class="sourceLineNo">050</span>/**<a name="line.50"></a>
-<span class="sourceLineNo">051</span> * Test the ZooKeeper Async Registry.<a
name="line.51"></a>
-<span class="sourceLineNo">052</span> */<a name="line.52"></a>
-<span class="sourceLineNo">053</span>@Category({ MediumTests.class, ClientTests.class
})<a name="line.53"></a>
-<span class="sourceLineNo">054</span>public class TestZKAsyncRegistry {<a
name="line.54"></a>
-<span class="sourceLineNo">055</span>  private static final Logger LOG = LoggerFactory.getLogger(TestZKAsyncRegistry.class);<a
name="line.55"></a>
-<span class="sourceLineNo">056</span>  private static final HBaseTestingUtility
TEST_UTIL = new HBaseTestingUtility();<a name="line.56"></a>
-<span class="sourceLineNo">057</span><a name="line.57"></a>
-<span class="sourceLineNo">058</span>  private static ZKAsyncRegistry REGISTRY;<a
name="line.58"></a>
-<span class="sourceLineNo">059</span><a name="line.59"></a>
-<span class="sourceLineNo">060</span>  // waits for all replicas to have region
location<a name="line.60"></a>
-<span class="sourceLineNo">061</span>  static void waitUntilAllReplicasHavingRegionLocation(TableName
tbl) throws IOException {<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    TEST_UTIL.waitFor(<a name="line.62"></a>
-<span class="sourceLineNo">063</span>      TEST_UTIL.getConfiguration().getLong("hbase.client.sync.wait.timeout.msec",
60000), 200, true,<a name="line.63"></a>
-<span class="sourceLineNo">064</span>      new ExplainingPredicate&lt;IOException&gt;()
{<a name="line.64"></a>
-<span class="sourceLineNo">065</span>        @Override<a name="line.65"></a>
-<span class="sourceLineNo">066</span>        public String explainFailure() throws
IOException {<a name="line.66"></a>
-<span class="sourceLineNo">067</span>          return TEST_UTIL.explainTableAvailability(tbl);<a
name="line.67"></a>
-<span class="sourceLineNo">068</span>        }<a name="line.68"></a>
-<span class="sourceLineNo">069</span><a name="line.69"></a>
-<span class="sourceLineNo">070</span>        @Override<a name="line.70"></a>
-<span class="sourceLineNo">071</span>        public boolean evaluate() throws
IOException {<a name="line.71"></a>
-<span class="sourceLineNo">072</span>          AtomicBoolean ready = new AtomicBoolean(true);<a
name="line.72"></a>
-<span class="sourceLineNo">073</span>          try {<a name="line.73"></a>
-<span class="sourceLineNo">074</span>            RegionLocations locs = REGISTRY.getMetaRegionLocation().get();<a
name="line.74"></a>
-<span class="sourceLineNo">075</span>            assertEquals(3, locs.getRegionLocations().length);<a
name="line.75"></a>
-<span class="sourceLineNo">076</span>            IntStream.range(0, 3).forEach(i
-&gt; {<a name="line.76"></a>
-<span class="sourceLineNo">077</span>              HRegionLocation loc = locs.getRegionLocation(i);<a
name="line.77"></a>
-<span class="sourceLineNo">078</span>              if (loc == null) {<a name="line.78"></a>
-<span class="sourceLineNo">079</span>                ready.set(false);<a name="line.79"></a>
-<span class="sourceLineNo">080</span>              }<a name="line.80"></a>
-<span class="sourceLineNo">081</span>            });<a name="line.81"></a>
-<span class="sourceLineNo">082</span>          } catch (Exception e) {<a name="line.82"></a>
-<span class="sourceLineNo">083</span>            ready.set(false);<a name="line.83"></a>
-<span class="sourceLineNo">084</span>          }<a name="line.84"></a>
-<span class="sourceLineNo">085</span>          return ready.get();<a name="line.85"></a>
-<span class="sourceLineNo">086</span>        }<a name="line.86"></a>
-<span class="sourceLineNo">087</span>      });<a name="line.87"></a>
-<span class="sourceLineNo">088</span>  }<a name="line.88"></a>
-<span class="sourceLineNo">089</span><a name="line.89"></a>
-<span class="sourceLineNo">090</span>  @BeforeClass<a name="line.90"></a>
-<span class="sourceLineNo">091</span>  public static void setUp() throws Exception
{<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    TEST_UTIL.getConfiguration().setInt(META_REPLICAS_NUM,
3);<a name="line.92"></a>
-<span class="sourceLineNo">093</span>    TEST_UTIL.startMiniCluster(3);<a
name="line.93"></a>
-<span class="sourceLineNo">094</span>    REGISTRY = new ZKAsyncRegistry(TEST_UTIL.getConfiguration());<a
name="line.94"></a>
-<span class="sourceLineNo">095</span>  }<a name="line.95"></a>
-<span class="sourceLineNo">096</span><a name="line.96"></a>
-<span class="sourceLineNo">097</span>  @AfterClass<a name="line.97"></a>
-<span class="sourceLineNo">098</span>  public static void tearDown() throws Exception
{<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    IOUtils.closeQuietly(REGISTRY);<a
name="line.99"></a>
-<span class="sourceLineNo">100</span>    TEST_UTIL.shutdownMiniCluster();<a
name="line.100"></a>
-<span class="sourceLineNo">101</span>  }<a name="line.101"></a>
-<span class="sourceLineNo">102</span><a name="line.102"></a>
-<span class="sourceLineNo">103</span>  @Test<a name="line.103"></a>
-<span class="sourceLineNo">104</span>  public void test() throws InterruptedException,
ExecutionException, IOException {<a name="line.104"></a>
-<span class="sourceLineNo">105</span>    LOG.info("STARTED TEST");<a name="line.105"></a>
-<span class="sourceLineNo">106</span>    String clusterId = REGISTRY.getClusterId().get();<a
name="line.106"></a>
-<span class="sourceLineNo">107</span>    String expectedClusterId = TEST_UTIL.getHBaseCluster().getMaster().getClusterId();<a
name="line.107"></a>
-<span class="sourceLineNo">108</span>    assertEquals("Expected " + expectedClusterId
+ ", found=" + clusterId,<a name="line.108"></a>
-<span class="sourceLineNo">109</span>        expectedClusterId, clusterId);<a
name="line.109"></a>
-<span class="sourceLineNo">110</span>    assertEquals(TEST_UTIL.getHBaseCluster().getClusterStatus().getServersSize(),<a
name="line.110"></a>
-<span class="sourceLineNo">111</span>      REGISTRY.getCurrentNrHRS().get().intValue());<a
name="line.111"></a>
-<span class="sourceLineNo">112</span>    assertEquals(TEST_UTIL.getHBaseCluster().getMaster().getServerName(),<a
name="line.112"></a>
-<span class="sourceLineNo">113</span>      REGISTRY.getMasterAddress().get());<a
name="line.113"></a>
-<span class="sourceLineNo">114</span>    assertEquals(-1, REGISTRY.getMasterInfoPort().get().intValue());<a
name="line.114"></a>
-<span class="sourceLineNo">115</span>    waitUntilAllReplicasHavingRegionLocation(TableName.META_TABLE_NAME);<a
name="line.115"></a>
-<span class="sourceLineNo">116</span>    RegionLocations locs = REGISTRY.getMetaRegionLocation().get();<a
name="line.116"></a>
-<span class="sourceLineNo">117</span>    assertEquals(3, locs.getRegionLocations().length);<a
name="line.117"></a>
-<span class="sourceLineNo">118</span>    IntStream.range(0, 3).forEach(i -&gt;
{<a name="line.118"></a>
-<span class="sourceLineNo">119</span>      HRegionLocation loc = locs.getRegionLocation(i);<a
name="line.119"></a>
-<span class="sourceLineNo">120</span>      assertNotNull("Replica " + i + " doesn't
have location", loc);<a name="line.120"></a>
-<span class="sourceLineNo">121</span>      assertEquals(TableName.META_TABLE_NAME,
loc.getRegion().getTable());<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      assertEquals(i, loc.getRegion().getReplicaId());<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><a name="line.125"></a>
-<span class="sourceLineNo">126</span>  @Test<a name="line.126"></a>
-<span class="sourceLineNo">127</span>  public void testIndependentZKConnections()
throws IOException {<a name="line.127"></a>
-<span class="sourceLineNo">128</span>    ReadOnlyZKClient zk1 = REGISTRY.getZKClient();<a
name="line.128"></a>
-<span class="sourceLineNo">129</span><a name="line.129"></a>
-<span class="sourceLineNo">130</span>    Configuration otherConf = new Configuration(TEST_UTIL.getConfiguration());<a
name="line.130"></a>
-<span class="sourceLineNo">131</span>    otherConf.set(HConstants.ZOOKEEPER_QUORUM,
"127.0.0.1");<a name="line.131"></a>
-<span class="sourceLineNo">132</span>    try (ZKAsyncRegistry otherRegistry =
new ZKAsyncRegistry(otherConf)) {<a name="line.132"></a>
-<span class="sourceLineNo">133</span>      ReadOnlyZKClient zk2 = otherRegistry.getZKClient();<a
name="line.133"></a>
-<span class="sourceLineNo">134</span><a name="line.134"></a>
-<span class="sourceLineNo">135</span>      assertNotSame("Using a different configuration
/ quorum should result in different backing " +<a name="line.135"></a>
-<span class="sourceLineNo">136</span>          "zk connection.",<a name="line.136"></a>
-<span class="sourceLineNo">137</span>        zk1, zk2);<a name="line.137"></a>
-<span class="sourceLineNo">138</span>      assertNotEquals(<a name="line.138"></a>
-<span class="sourceLineNo">139</span>        "Using a different configrution
/ quorum should be reflected in the " + "zk connection.",<a name="line.139"></a>
-<span class="sourceLineNo">140</span>        zk1.getConnectString(), zk2.getConnectString());<a
name="line.140"></a>
-<span class="sourceLineNo">141</span>    }<a name="line.141"></a>
-<span class="sourceLineNo">142</span>  }<a name="line.142"></a>
-<span class="sourceLineNo">143</span>}<a name="line.143"></a>
+<span class="sourceLineNo">050</span>@Category({ MediumTests.class, ClientTests.class
})<a name="line.50"></a>
+<span class="sourceLineNo">051</span>public class TestZKAsyncRegistry {<a
name="line.51"></a>
+<span class="sourceLineNo">052</span>  private static final Logger LOG = LoggerFactory.getLogger(TestZKAsyncRegistry.class);<a
name="line.52"></a>
+<span class="sourceLineNo">053</span>  private static final HBaseTestingUtility
TEST_UTIL = new HBaseTestingUtility();<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>  private static ZKAsyncRegistry REGISTRY;<a
name="line.55"></a>
+<span class="sourceLineNo">056</span><a name="line.56"></a>
+<span class="sourceLineNo">057</span>  // waits for all replicas to have region
location<a name="line.57"></a>
+<span class="sourceLineNo">058</span>  static void waitUntilAllReplicasHavingRegionLocation(TableName
tbl) throws IOException {<a name="line.58"></a>
+<span class="sourceLineNo">059</span>    TEST_UTIL.waitFor(<a name="line.59"></a>
+<span class="sourceLineNo">060</span>      TEST_UTIL.getConfiguration().getLong("hbase.client.sync.wait.timeout.msec",
60000), 200, true,<a name="line.60"></a>
+<span class="sourceLineNo">061</span>      new ExplainingPredicate&lt;IOException&gt;()
{<a name="line.61"></a>
+<span class="sourceLineNo">062</span>        @Override<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        public String explainFailure() throws
IOException {<a name="line.63"></a>
+<span class="sourceLineNo">064</span>          return TEST_UTIL.explainTableAvailability(tbl);<a
name="line.64"></a>
+<span class="sourceLineNo">065</span>        }<a name="line.65"></a>
+<span class="sourceLineNo">066</span><a name="line.66"></a>
+<span class="sourceLineNo">067</span>        @Override<a name="line.67"></a>
+<span class="sourceLineNo">068</span>        public boolean evaluate() throws
IOException {<a name="line.68"></a>
+<span class="sourceLineNo">069</span>          AtomicBoolean ready = new AtomicBoolean(true);<a
name="line.69"></a>
+<span class="sourceLineNo">070</span>          try {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>            RegionLocations locs = REGISTRY.getMetaRegionLocation().get();<a
name="line.71"></a>
+<span class="sourceLineNo">072</span>            assertEquals(3, locs.getRegionLocations().length);<a
name="line.72"></a>
+<span class="sourceLineNo">073</span>            IntStream.range(0, 3).forEach(i
-&gt; {<a name="line.73"></a>
+<span class="sourceLineNo">074</span>              HRegionLocation loc = locs.getRegionLocation(i);<a
name="line.74"></a>
+<span class="sourceLineNo">075</span>              if (loc == null) {<a name="line.75"></a>
+<span class="sourceLineNo">076</span>                ready.set(false);<a name="line.76"></a>
+<span class="sourceLineNo">077</span>              }<a name="line.77"></a>
+<span class="sourceLineNo">078</span>            });<a name="line.78"></a>
+<span class="sourceLineNo">079</span>          } catch (Exception e) {<a name="line.79"></a>
+<span class="sourceLineNo">080</span>            ready.set(false);<a name="line.80"></a>
+<span class="sourceLineNo">081</span>          }<a name="line.81"></a>
+<span class="sourceLineNo">082</span>          return ready.get();<a name="line.82"></a>
+<span class="sourceLineNo">083</span>        }<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><a name="line.86"></a>
+<span class="sourceLineNo">087</span>  @BeforeClass<a name="line.87"></a>
+<span class="sourceLineNo">088</span>  public static void setUp() throws Exception
{<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    TEST_UTIL.getConfiguration().setInt(META_REPLICAS_NUM,
3);<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    TEST_UTIL.startMiniCluster(3);<a
name="line.90"></a>
+<span class="sourceLineNo">091</span>    REGISTRY = new ZKAsyncRegistry(TEST_UTIL.getConfiguration());<a
name="line.91"></a>
+<span class="sourceLineNo">092</span>  }<a name="line.92"></a>
+<span class="sourceLineNo">093</span><a name="line.93"></a>
+<span class="sourceLineNo">094</span>  @AfterClass<a name="line.94"></a>
+<span class="sourceLineNo">095</span>  public static void tearDown() throws Exception
{<a name="line.95"></a>
+<span class="sourceLineNo">096</span>    IOUtils.closeQuietly(REGISTRY);<a
name="line.96"></a>
+<span class="sourceLineNo">097</span>    TEST_UTIL.shutdownMiniCluster();<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>  @Test<a name="line.100"></a>
+<span class="sourceLineNo">101</span>  public void test() throws InterruptedException,
ExecutionException, IOException {<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    LOG.info("STARTED TEST");<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    String clusterId = REGISTRY.getClusterId().get();<a
name="line.103"></a>
+<span class="sourceLineNo">104</span>    String expectedClusterId = TEST_UTIL.getHBaseCluster().getMaster().getClusterId();<a
name="line.104"></a>
+<span class="sourceLineNo">105</span>    assertEquals("Expected " + expectedClusterId
+ ", found=" + clusterId,<a name="line.105"></a>
+<span class="sourceLineNo">106</span>        expectedClusterId, clusterId);<a
name="line.106"></a>
+<span class="sourceLineNo">107</span>    assertEquals(TEST_UTIL.getHBaseCluster().getClusterStatus().getServersSize(),<a
name="line.107"></a>
+<span class="sourceLineNo">108</span>      REGISTRY.getCurrentNrHRS().get().intValue());<a
name="line.108"></a>
+<span class="sourceLineNo">109</span>    assertEquals(TEST_UTIL.getHBaseCluster().getMaster().getServerName(),<a
name="line.109"></a>
+<span class="sourceLineNo">110</span>      REGISTRY.getMasterAddress().get());<a
name="line.110"></a>
+<span class="sourceLineNo">111</span>    assertEquals(-1, REGISTRY.getMasterInfoPort().get().intValue());<a
name="line.111"></a>
+<span class="sourceLineNo">112</span>    waitUntilAllReplicasHavingRegionLocation(TableName.META_TABLE_NAME);<a
name="line.112"></a>
+<span class="sourceLineNo">113</span>    RegionLocations locs = REGISTRY.getMetaRegionLocation().get();<a
name="line.113"></a>
+<span class="sourceLineNo">114</span>    assertEquals(3, locs.getRegionLocations().length);<a
name="line.114"></a>
+<span class="sourceLineNo">115</span>    IntStream.range(0, 3).forEach(i -&gt;
{<a name="line.115"></a>
+<span class="sourceLineNo">116</span>      HRegionLocation loc = locs.getRegionLocation(i);<a
name="line.116"></a>
+<span class="sourceLineNo">117</span>      assertNotNull("Replica " + i + " doesn't
have location", loc);<a name="line.117"></a>
+<span class="sourceLineNo">118</span>      assertEquals(TableName.META_TABLE_NAME,
loc.getRegion().getTable());<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      assertEquals(i, loc.getRegion().getReplicaId());<a
name="line.119"></a>
+<span class="sourceLineNo">120</span>    });<a name="line.120"></a>
+<span class="sourceLineNo">121</span>  }<a name="line.121"></a>
+<span class="sourceLineNo">122</span><a name="line.122"></a>
+<span class="sourceLineNo">123</span>  @Test<a name="line.123"></a>
+<span class="sourceLineNo">124</span>  public void testIndependentZKConnections()
throws IOException {<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    ReadOnlyZKClient zk1 = REGISTRY.getZKClient();<a
name="line.125"></a>
+<span class="sourceLineNo">126</span><a name="line.126"></a>
+<span class="sourceLineNo">127</span>    Configuration otherConf = new Configuration(TEST_UTIL.getConfiguration());<a
name="line.127"></a>
+<span class="sourceLineNo">128</span>    otherConf.set(HConstants.ZOOKEEPER_QUORUM,
"127.0.0.1");<a name="line.128"></a>
+<span class="sourceLineNo">129</span>    try (ZKAsyncRegistry otherRegistry =
new ZKAsyncRegistry(otherConf)) {<a name="line.129"></a>
+<span class="sourceLineNo">130</span>      ReadOnlyZKClient zk2 = otherRegistry.getZKClient();<a
name="line.130"></a>
+<span class="sourceLineNo">131</span><a name="line.131"></a>
+<span class="sourceLineNo">132</span>      assertNotSame("Using a different configuration
/ quorum should result in different backing " +<a name="line.132"></a>
+<span class="sourceLineNo">133</span>          "zk connection.",<a name="line.133"></a>
+<span class="sourceLineNo">134</span>        zk1, zk2);<a name="line.134"></a>
+<span class="sourceLineNo">135</span>      assertNotEquals(<a name="line.135"></a>
+<span class="sourceLineNo">136</span>        "Using a different configrution
/ quorum should be reflected in the " + "zk connection.",<a name="line.136"></a>
+<span class="sourceLineNo">137</span>        zk1.getConnectString(), zk2.getConnectString());<a
name="line.137"></a>
+<span class="sourceLineNo">138</span>    }<a name="line.138"></a>
+<span class="sourceLineNo">139</span>  }<a name="line.139"></a>
+<span class="sourceLineNo">140</span>}<a name="line.140"></a>
 
 
 


Mime
View raw message