http://git-wip-us.apache.org/repos/asf/hbase-site/blob/2fda40d6/testdevapidocs/src-html/org/apache/hadoop/hbase/master/AbstractTestDLS.html
----------------------------------------------------------------------
diff --git 
a/testdevapidocs/src-html/org/apache/hadoop/hbase/master/AbstractTestDLS.html 
b/testdevapidocs/src-html/org/apache/hadoop/hbase/master/AbstractTestDLS.html
index c02a436..cdcd37f 100644
--- 
a/testdevapidocs/src-html/org/apache/hadoop/hbase/master/AbstractTestDLS.html
+++ 
b/testdevapidocs/src-html/org/apache/hadoop/hbase/master/AbstractTestDLS.html
@@ -50,39 +50,39 @@
 <span class="sourceLineNo">042</span>import java.util.concurrent.TimeUnit;<a 
name="line.42"></a>
 <span class="sourceLineNo">043</span>import 
java.util.concurrent.TimeoutException;<a name="line.43"></a>
 <span class="sourceLineNo">044</span>import 
java.util.concurrent.atomic.LongAdder;<a name="line.44"></a>
-<span class="sourceLineNo">045</span><a name="line.45"></a>
-<span class="sourceLineNo">046</span>import 
org.apache.hadoop.conf.Configuration;<a name="line.46"></a>
-<span class="sourceLineNo">047</span>import 
org.apache.hadoop.fs.FSDataOutputStream;<a name="line.47"></a>
-<span class="sourceLineNo">048</span>import org.apache.hadoop.fs.FileStatus;<a 
name="line.48"></a>
-<span class="sourceLineNo">049</span>import org.apache.hadoop.fs.FileSystem;<a 
name="line.49"></a>
-<span class="sourceLineNo">050</span>import org.apache.hadoop.fs.Path;<a 
name="line.50"></a>
-<span class="sourceLineNo">051</span>import org.apache.hadoop.fs.PathFilter;<a 
name="line.51"></a>
-<span class="sourceLineNo">052</span>import 
org.apache.hadoop.hbase.HBaseTestingUtility;<a name="line.52"></a>
-<span class="sourceLineNo">053</span>import 
org.apache.hadoop.hbase.HConstants;<a name="line.53"></a>
-<span class="sourceLineNo">054</span>import 
org.apache.hadoop.hbase.KeyValue;<a name="line.54"></a>
-<span class="sourceLineNo">055</span>import 
org.apache.hadoop.hbase.MiniHBaseCluster;<a name="line.55"></a>
-<span class="sourceLineNo">056</span>import 
org.apache.hadoop.hbase.NamespaceDescriptor;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>import 
org.apache.hadoop.hbase.ServerName;<a name="line.57"></a>
-<span class="sourceLineNo">058</span>import 
org.apache.hadoop.hbase.SplitLogCounters;<a name="line.58"></a>
-<span class="sourceLineNo">059</span>import 
org.apache.hadoop.hbase.TableName;<a name="line.59"></a>
-<span class="sourceLineNo">060</span>import org.apache.hadoop.hbase.Waiter;<a 
name="line.60"></a>
-<span class="sourceLineNo">061</span>import 
org.apache.hadoop.hbase.client.Put;<a name="line.61"></a>
-<span class="sourceLineNo">062</span>import 
org.apache.hadoop.hbase.client.RegionInfo;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>import 
org.apache.hadoop.hbase.client.RegionInfoBuilder;<a name="line.63"></a>
-<span class="sourceLineNo">064</span>import 
org.apache.hadoop.hbase.client.RegionLocator;<a name="line.64"></a>
-<span class="sourceLineNo">065</span>import 
org.apache.hadoop.hbase.client.Table;<a name="line.65"></a>
-<span class="sourceLineNo">066</span>import 
org.apache.hadoop.hbase.coordination.ZKSplitLogManagerCoordination;<a 
name="line.66"></a>
-<span class="sourceLineNo">067</span>import 
org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;<a name="line.67"></a>
-<span class="sourceLineNo">068</span>import 
org.apache.hadoop.hbase.master.SplitLogManager.TaskBatch;<a name="line.68"></a>
-<span class="sourceLineNo">069</span>import 
org.apache.hadoop.hbase.master.assignment.RegionStates;<a name="line.69"></a>
-<span class="sourceLineNo">070</span>import 
org.apache.hadoop.hbase.regionserver.HRegion;<a name="line.70"></a>
-<span class="sourceLineNo">071</span>import 
org.apache.hadoop.hbase.regionserver.HRegionServer;<a name="line.71"></a>
-<span class="sourceLineNo">072</span>import 
org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl;<a 
name="line.72"></a>
-<span class="sourceLineNo">073</span>import 
org.apache.hadoop.hbase.regionserver.Region;<a name="line.73"></a>
-<span class="sourceLineNo">074</span>import 
org.apache.hadoop.hbase.util.Bytes;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>import 
org.apache.hadoop.hbase.util.FSUtils;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>import 
org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread;<a name="line.76"></a>
-<span class="sourceLineNo">077</span>import 
org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;<a 
name="line.77"></a>
+<span class="sourceLineNo">045</span>import 
org.apache.hadoop.conf.Configuration;<a name="line.45"></a>
+<span class="sourceLineNo">046</span>import 
org.apache.hadoop.fs.FSDataOutputStream;<a name="line.46"></a>
+<span class="sourceLineNo">047</span>import org.apache.hadoop.fs.FileStatus;<a 
name="line.47"></a>
+<span class="sourceLineNo">048</span>import org.apache.hadoop.fs.FileSystem;<a 
name="line.48"></a>
+<span class="sourceLineNo">049</span>import org.apache.hadoop.fs.Path;<a 
name="line.49"></a>
+<span class="sourceLineNo">050</span>import org.apache.hadoop.fs.PathFilter;<a 
name="line.50"></a>
+<span class="sourceLineNo">051</span>import 
org.apache.hadoop.hbase.HBaseTestingUtility;<a name="line.51"></a>
+<span class="sourceLineNo">052</span>import 
org.apache.hadoop.hbase.HConstants;<a name="line.52"></a>
+<span class="sourceLineNo">053</span>import 
org.apache.hadoop.hbase.KeyValue;<a name="line.53"></a>
+<span class="sourceLineNo">054</span>import 
org.apache.hadoop.hbase.MiniHBaseCluster;<a name="line.54"></a>
+<span class="sourceLineNo">055</span>import 
org.apache.hadoop.hbase.NamespaceDescriptor;<a name="line.55"></a>
+<span class="sourceLineNo">056</span>import 
org.apache.hadoop.hbase.ServerName;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>import 
org.apache.hadoop.hbase.SplitLogCounters;<a name="line.57"></a>
+<span class="sourceLineNo">058</span>import 
org.apache.hadoop.hbase.TableName;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>import org.apache.hadoop.hbase.Waiter;<a 
name="line.59"></a>
+<span class="sourceLineNo">060</span>import 
org.apache.hadoop.hbase.client.Put;<a name="line.60"></a>
+<span class="sourceLineNo">061</span>import 
org.apache.hadoop.hbase.client.RegionInfo;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>import 
org.apache.hadoop.hbase.client.RegionInfoBuilder;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>import 
org.apache.hadoop.hbase.client.RegionLocator;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>import 
org.apache.hadoop.hbase.client.Table;<a name="line.64"></a>
+<span class="sourceLineNo">065</span>import 
org.apache.hadoop.hbase.coordination.ZKSplitLogManagerCoordination;<a 
name="line.65"></a>
+<span class="sourceLineNo">066</span>import 
org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;<a name="line.66"></a>
+<span class="sourceLineNo">067</span>import 
org.apache.hadoop.hbase.master.SplitLogManager.TaskBatch;<a name="line.67"></a>
+<span class="sourceLineNo">068</span>import 
org.apache.hadoop.hbase.master.assignment.RegionStates;<a name="line.68"></a>
+<span class="sourceLineNo">069</span>import 
org.apache.hadoop.hbase.regionserver.HRegion;<a name="line.69"></a>
+<span class="sourceLineNo">070</span>import 
org.apache.hadoop.hbase.regionserver.HRegionServer;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>import 
org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl;<a 
name="line.71"></a>
+<span class="sourceLineNo">072</span>import 
org.apache.hadoop.hbase.regionserver.Region;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>import 
org.apache.hadoop.hbase.util.Bytes;<a name="line.73"></a>
+<span class="sourceLineNo">074</span>import 
org.apache.hadoop.hbase.util.FSUtils;<a name="line.74"></a>
+<span class="sourceLineNo">075</span>import 
org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread;<a name="line.75"></a>
+<span class="sourceLineNo">076</span>import 
org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;<a 
name="line.76"></a>
+<span class="sourceLineNo">077</span>import 
org.apache.hadoop.hbase.util.Threads;<a name="line.77"></a>
 <span class="sourceLineNo">078</span>import 
org.apache.hadoop.hbase.wal.AbstractFSWALProvider;<a name="line.78"></a>
 <span class="sourceLineNo">079</span>import org.apache.hadoop.hbase.wal.WAL;<a 
name="line.79"></a>
 <span class="sourceLineNo">080</span>import 
org.apache.hadoop.hbase.wal.WALEdit;<a name="line.80"></a>
@@ -100,693 +100,701 @@
 <span class="sourceLineNo">092</span>import org.junit.rules.TestName;<a 
name="line.92"></a>
 <span class="sourceLineNo">093</span>import org.slf4j.Logger;<a 
name="line.93"></a>
 <span class="sourceLineNo">094</span>import org.slf4j.LoggerFactory;<a 
name="line.94"></a>
-<span class="sourceLineNo">095</span>import 
org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;<a name="line.95"></a>
-<span class="sourceLineNo">096</span><a name="line.96"></a>
-<span class="sourceLineNo">097</span>/**<a name="line.97"></a>
-<span class="sourceLineNo">098</span> * Base class for testing distributed log 
splitting.<a name="line.98"></a>
-<span class="sourceLineNo">099</span> */<a name="line.99"></a>
-<span class="sourceLineNo">100</span>public abstract class AbstractTestDLS {<a 
name="line.100"></a>
-<span class="sourceLineNo">101</span>  private static final Logger LOG = 
LoggerFactory.getLogger(TestSplitLogManager.class);<a name="line.101"></a>
-<span class="sourceLineNo">102</span><a name="line.102"></a>
-<span class="sourceLineNo">103</span>  private static final 
HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();<a 
name="line.103"></a>
-<span class="sourceLineNo">104</span><a name="line.104"></a>
-<span class="sourceLineNo">105</span>  // Start a cluster with 2 masters and 5 
regionservers<a name="line.105"></a>
-<span class="sourceLineNo">106</span>  private static final int NUM_MASTERS = 
2;<a name="line.106"></a>
-<span class="sourceLineNo">107</span>  private static final int NUM_RS = 5;<a 
name="line.107"></a>
-<span class="sourceLineNo">108</span>  private static byte[] COLUMN_FAMILY = 
Bytes.toBytes("family");<a name="line.108"></a>
-<span class="sourceLineNo">109</span><a name="line.109"></a>
-<span class="sourceLineNo">110</span>  @Rule<a name="line.110"></a>
-<span class="sourceLineNo">111</span>  public TestName testName = new 
TestName();<a name="line.111"></a>
-<span class="sourceLineNo">112</span><a name="line.112"></a>
-<span class="sourceLineNo">113</span>  private TableName tableName;<a 
name="line.113"></a>
-<span class="sourceLineNo">114</span>  private MiniHBaseCluster cluster;<a 
name="line.114"></a>
-<span class="sourceLineNo">115</span>  private HMaster master;<a 
name="line.115"></a>
-<span class="sourceLineNo">116</span>  private Configuration conf;<a 
name="line.116"></a>
-<span class="sourceLineNo">117</span><a name="line.117"></a>
-<span class="sourceLineNo">118</span>  @Rule<a name="line.118"></a>
-<span class="sourceLineNo">119</span>  public TestName name = new 
TestName();<a name="line.119"></a>
-<span class="sourceLineNo">120</span><a name="line.120"></a>
-<span class="sourceLineNo">121</span>  @BeforeClass<a name="line.121"></a>
-<span class="sourceLineNo">122</span>  public static void setup() throws 
Exception {<a name="line.122"></a>
-<span class="sourceLineNo">123</span>    // Uncomment the following line if 
more verbosity is needed for<a name="line.123"></a>
-<span class="sourceLineNo">124</span>    // debugging (see HBASE-12285 for 
details).<a name="line.124"></a>
-<span class="sourceLineNo">125</span>    // 
Logger.getLogger("org.apache.hadoop.hbase").setLevel(Level.DEBUG);<a 
name="line.125"></a>
-<span class="sourceLineNo">126</span>    TEST_UTIL.startMiniZKCluster();<a 
name="line.126"></a>
-<span class="sourceLineNo">127</span>    TEST_UTIL.startMiniDFSCluster(3);<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>  @AfterClass<a name="line.130"></a>
-<span class="sourceLineNo">131</span>  public static void tearDown() throws 
Exception {<a name="line.131"></a>
-<span class="sourceLineNo">132</span>    TEST_UTIL.shutdownMiniCluster();<a 
name="line.132"></a>
-<span class="sourceLineNo">133</span>  }<a name="line.133"></a>
-<span class="sourceLineNo">134</span><a name="line.134"></a>
-<span class="sourceLineNo">135</span>  protected abstract String 
getWalProvider();<a name="line.135"></a>
-<span class="sourceLineNo">136</span><a name="line.136"></a>
-<span class="sourceLineNo">137</span>  private void startCluster(int numRS) 
throws Exception {<a name="line.137"></a>
-<span class="sourceLineNo">138</span>    SplitLogCounters.resetCounters();<a 
name="line.138"></a>
-<span class="sourceLineNo">139</span>    LOG.info("Starting cluster");<a 
name="line.139"></a>
-<span class="sourceLineNo">140</span>    
conf.setLong("hbase.splitlog.max.resubmit", 0);<a name="line.140"></a>
-<span class="sourceLineNo">141</span>    // Make the failure test faster<a 
name="line.141"></a>
-<span class="sourceLineNo">142</span>    
conf.setInt("zookeeper.recovery.retry", 0);<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    
conf.setInt(HConstants.REGIONSERVER_INFO_PORT, -1);<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    
conf.setFloat(HConstants.LOAD_BALANCER_SLOP_KEY, (float) 100.0); // no load 
balancing<a name="line.144"></a>
-<span class="sourceLineNo">145</span>    
conf.setInt("hbase.regionserver.wal.max.splitters", 3);<a name="line.145"></a>
-<span class="sourceLineNo">146</span>    
conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);<a 
name="line.146"></a>
-<span class="sourceLineNo">147</span>    conf.set("hbase.wal.provider", 
getWalProvider());<a name="line.147"></a>
-<span class="sourceLineNo">148</span>    
TEST_UTIL.startMiniHBaseCluster(NUM_MASTERS, numRS);<a name="line.148"></a>
-<span class="sourceLineNo">149</span>    cluster = 
TEST_UTIL.getHBaseCluster();<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    LOG.info("Waiting for active/ready 
master");<a name="line.150"></a>
-<span class="sourceLineNo">151</span>    
cluster.waitForActiveAndReadyMaster();<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    master = cluster.getMaster();<a 
name="line.152"></a>
-<span class="sourceLineNo">153</span>    TEST_UTIL.waitFor(120000, 200, new 
Waiter.Predicate&lt;Exception&gt;() {<a name="line.153"></a>
-<span class="sourceLineNo">154</span>      @Override<a name="line.154"></a>
-<span class="sourceLineNo">155</span>      public boolean evaluate() throws 
Exception {<a name="line.155"></a>
-<span class="sourceLineNo">156</span>        return 
cluster.getLiveRegionServerThreads().size() &gt;= numRS;<a name="line.156"></a>
-<span class="sourceLineNo">157</span>      }<a name="line.157"></a>
-<span class="sourceLineNo">158</span>    });<a name="line.158"></a>
-<span class="sourceLineNo">159</span>  }<a name="line.159"></a>
-<span class="sourceLineNo">160</span><a name="line.160"></a>
-<span class="sourceLineNo">161</span>  @Before<a name="line.161"></a>
-<span class="sourceLineNo">162</span>  public void before() throws Exception 
{<a name="line.162"></a>
-<span class="sourceLineNo">163</span>    conf = 
TEST_UTIL.getConfiguration();<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    tableName = 
TableName.valueOf(testName.getMethodName());<a name="line.164"></a>
-<span class="sourceLineNo">165</span>  }<a name="line.165"></a>
-<span class="sourceLineNo">166</span><a name="line.166"></a>
-<span class="sourceLineNo">167</span>  @After<a name="line.167"></a>
-<span class="sourceLineNo">168</span>  public void after() throws Exception 
{<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    
TEST_UTIL.shutdownMiniHBaseCluster();<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    
TEST_UTIL.getTestFileSystem().delete(FSUtils.getRootDir(TEST_UTIL.getConfiguration()),
 true);<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    
ZKUtil.deleteNodeRecursively(TEST_UTIL.getZooKeeperWatcher(), "/hbase");<a 
name="line.171"></a>
-<span class="sourceLineNo">172</span>  }<a name="line.172"></a>
-<span class="sourceLineNo">173</span><a name="line.173"></a>
-<span class="sourceLineNo">174</span>  @Test<a name="line.174"></a>
-<span class="sourceLineNo">175</span>  public void testRecoveredEdits() throws 
Exception {<a name="line.175"></a>
-<span class="sourceLineNo">176</span>    
conf.setLong("hbase.regionserver.hlog.blocksize", 30 * 1024); // create more 
than one wal<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    startCluster(NUM_RS);<a 
name="line.177"></a>
-<span class="sourceLineNo">178</span><a name="line.178"></a>
-<span class="sourceLineNo">179</span>    int numLogLines = 10000;<a 
name="line.179"></a>
-<span class="sourceLineNo">180</span>    SplitLogManager slm = 
master.getMasterWalManager().getSplitLogManager();<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    // turn off load balancing to prevent 
regions from moving around otherwise<a name="line.181"></a>
-<span class="sourceLineNo">182</span>    // they will consume 
recovered.edits<a name="line.182"></a>
-<span class="sourceLineNo">183</span>    master.balanceSwitch(false);<a 
name="line.183"></a>
-<span class="sourceLineNo">184</span>    FileSystem fs = 
master.getMasterFileSystem().getFileSystem();<a name="line.184"></a>
-<span class="sourceLineNo">185</span><a name="line.185"></a>
-<span class="sourceLineNo">186</span>    List&lt;RegionServerThread&gt; rsts = 
cluster.getLiveRegionServerThreads();<a name="line.186"></a>
-<span class="sourceLineNo">187</span><a name="line.187"></a>
-<span class="sourceLineNo">188</span>    Path rootdir = 
FSUtils.getRootDir(conf);<a name="line.188"></a>
-<span class="sourceLineNo">189</span><a name="line.189"></a>
-<span class="sourceLineNo">190</span>    int numRegions = 50;<a 
name="line.190"></a>
-<span class="sourceLineNo">191</span>    try (ZKWatcher zkw = new 
ZKWatcher(conf, "table-creation", null);<a name="line.191"></a>
-<span class="sourceLineNo">192</span>        Table t = installTable(zkw, 
numRegions)) {<a name="line.192"></a>
-<span class="sourceLineNo">193</span>      TableName table = t.getName();<a 
name="line.193"></a>
-<span class="sourceLineNo">194</span>      List&lt;RegionInfo&gt; regions = 
null;<a name="line.194"></a>
-<span class="sourceLineNo">195</span>      HRegionServer hrs = null;<a 
name="line.195"></a>
-<span class="sourceLineNo">196</span>      for (int i = 0; i &lt; NUM_RS; i++) 
{<a name="line.196"></a>
-<span class="sourceLineNo">197</span>        hrs = 
rsts.get(i).getRegionServer();<a name="line.197"></a>
-<span class="sourceLineNo">198</span>        regions = 
ProtobufUtil.getOnlineRegions(hrs.getRSRpcServices());<a name="line.198"></a>
-<span class="sourceLineNo">199</span>        // At least one RS will have 
&gt;= to average number of regions.<a name="line.199"></a>
-<span class="sourceLineNo">200</span>        if (regions.size() &gt;= 
numRegions / NUM_RS) {<a name="line.200"></a>
-<span class="sourceLineNo">201</span>          break;<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>      Path logDir = new Path(rootdir,<a 
name="line.204"></a>
-<span class="sourceLineNo">205</span>          
AbstractFSWALProvider.getWALDirectoryName(hrs.getServerName().toString()));<a 
name="line.205"></a>
-<span class="sourceLineNo">206</span><a name="line.206"></a>
-<span class="sourceLineNo">207</span>      LOG.info("#regions = " + 
regions.size());<a name="line.207"></a>
-<span class="sourceLineNo">208</span>      Iterator&lt;RegionInfo&gt; it = 
regions.iterator();<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      while (it.hasNext()) {<a 
name="line.209"></a>
-<span class="sourceLineNo">210</span>        RegionInfo region = it.next();<a 
name="line.210"></a>
-<span class="sourceLineNo">211</span>        if 
(region.getTable().getNamespaceAsString()<a name="line.211"></a>
-<span class="sourceLineNo">212</span>            
.equals(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR)) {<a name="line.212"></a>
-<span class="sourceLineNo">213</span>          it.remove();<a 
name="line.213"></a>
-<span class="sourceLineNo">214</span>        }<a name="line.214"></a>
-<span class="sourceLineNo">215</span>      }<a name="line.215"></a>
-<span class="sourceLineNo">216</span><a name="line.216"></a>
-<span class="sourceLineNo">217</span>      makeWAL(hrs, regions, numLogLines, 
100);<a name="line.217"></a>
-<span class="sourceLineNo">218</span><a name="line.218"></a>
-<span class="sourceLineNo">219</span>      slm.splitLogDistributed(logDir);<a 
name="line.219"></a>
-<span class="sourceLineNo">220</span><a name="line.220"></a>
-<span class="sourceLineNo">221</span>      int count = 0;<a 
name="line.221"></a>
-<span class="sourceLineNo">222</span>      for (RegionInfo hri : regions) {<a 
name="line.222"></a>
-<span class="sourceLineNo">223</span>        Path tdir = 
FSUtils.getTableDir(rootdir, table);<a name="line.223"></a>
-<span class="sourceLineNo">224</span>        
@SuppressWarnings("deprecation")<a name="line.224"></a>
-<span class="sourceLineNo">225</span>        Path editsdir = WALSplitter<a 
name="line.225"></a>
-<span class="sourceLineNo">226</span>            
.getRegionDirRecoveredEditsDir(HRegion.getRegionDir(tdir, 
hri.getEncodedName()));<a name="line.226"></a>
-<span class="sourceLineNo">227</span>        LOG.debug("checking edits dir " + 
editsdir);<a name="line.227"></a>
-<span class="sourceLineNo">228</span>        FileStatus[] files = 
fs.listStatus(editsdir, new PathFilter() {<a name="line.228"></a>
-<span class="sourceLineNo">229</span>          @Override<a name="line.229"></a>
-<span class="sourceLineNo">230</span>          public boolean accept(Path p) 
{<a name="line.230"></a>
-<span class="sourceLineNo">231</span>            if 
(WALSplitter.isSequenceIdFile(p)) {<a name="line.231"></a>
-<span class="sourceLineNo">232</span>              return false;<a 
name="line.232"></a>
-<span class="sourceLineNo">233</span>            }<a name="line.233"></a>
-<span class="sourceLineNo">234</span>            return true;<a 
name="line.234"></a>
-<span class="sourceLineNo">235</span>          }<a name="line.235"></a>
-<span class="sourceLineNo">236</span>        });<a name="line.236"></a>
-<span class="sourceLineNo">237</span>        assertTrue(<a name="line.237"></a>
-<span class="sourceLineNo">238</span>          "edits dir should have more 
than a single file in it. instead has " + files.length,<a name="line.238"></a>
-<span class="sourceLineNo">239</span>          files.length &gt; 1);<a 
name="line.239"></a>
-<span class="sourceLineNo">240</span>        for (int i = 0; i &lt; 
files.length; i++) {<a name="line.240"></a>
-<span class="sourceLineNo">241</span>          int c = 
countWAL(files[i].getPath(), fs, conf);<a name="line.241"></a>
-<span class="sourceLineNo">242</span>          count += c;<a 
name="line.242"></a>
-<span class="sourceLineNo">243</span>        }<a name="line.243"></a>
-<span class="sourceLineNo">244</span>        LOG.info(count + " edits in " + 
files.length + " recovered edits files.");<a name="line.244"></a>
-<span class="sourceLineNo">245</span>      }<a name="line.245"></a>
-<span class="sourceLineNo">246</span><a name="line.246"></a>
-<span class="sourceLineNo">247</span>      // check that the log file is 
moved<a name="line.247"></a>
-<span class="sourceLineNo">248</span>      assertFalse(fs.exists(logDir));<a 
name="line.248"></a>
-<span class="sourceLineNo">249</span>      assertEquals(numLogLines, count);<a 
name="line.249"></a>
-<span class="sourceLineNo">250</span>    }<a name="line.250"></a>
-<span class="sourceLineNo">251</span>  }<a name="line.251"></a>
-<span class="sourceLineNo">252</span><a name="line.252"></a>
-<span class="sourceLineNo">253</span>  @Test<a name="line.253"></a>
-<span class="sourceLineNo">254</span>  public void 
testMasterStartsUpWithLogSplittingWork() throws Exception {<a 
name="line.254"></a>
-<span class="sourceLineNo">255</span>    
conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, NUM_RS - 1);<a 
name="line.255"></a>
-<span class="sourceLineNo">256</span>    startCluster(NUM_RS);<a 
name="line.256"></a>
-<span class="sourceLineNo">257</span><a name="line.257"></a>
-<span class="sourceLineNo">258</span>    int numRegionsToCreate = 40;<a 
name="line.258"></a>
-<span class="sourceLineNo">259</span>    int numLogLines = 1000;<a 
name="line.259"></a>
-<span class="sourceLineNo">260</span>    // turn off load balancing to prevent 
regions from moving around otherwise<a name="line.260"></a>
-<span class="sourceLineNo">261</span>    // they will consume 
recovered.edits<a name="line.261"></a>
-<span class="sourceLineNo">262</span>    master.balanceSwitch(false);<a 
name="line.262"></a>
-<span class="sourceLineNo">263</span><a name="line.263"></a>
-<span class="sourceLineNo">264</span>    try (ZKWatcher zkw = new 
ZKWatcher(conf, "table-creation", null);<a name="line.264"></a>
-<span class="sourceLineNo">265</span>        Table ht = installTable(zkw, 
numRegionsToCreate)) {<a name="line.265"></a>
-<span class="sourceLineNo">266</span>      HRegionServer hrs = 
findRSToKill(false);<a name="line.266"></a>
-<span class="sourceLineNo">267</span>      List&lt;RegionInfo&gt; regions = 
ProtobufUtil.getOnlineRegions(hrs.getRSRpcServices());<a name="line.267"></a>
-<span class="sourceLineNo">268</span>      makeWAL(hrs, regions, numLogLines, 
100);<a name="line.268"></a>
-<span class="sourceLineNo">269</span><a name="line.269"></a>
-<span class="sourceLineNo">270</span>      // abort master<a 
name="line.270"></a>
-<span class="sourceLineNo">271</span>      abortMaster(cluster);<a 
name="line.271"></a>
-<span class="sourceLineNo">272</span><a name="line.272"></a>
-<span class="sourceLineNo">273</span>      // abort RS<a name="line.273"></a>
-<span class="sourceLineNo">274</span>      LOG.info("Aborting region server: " 
+ hrs.getServerName());<a name="line.274"></a>
-<span class="sourceLineNo">275</span>      hrs.abort("testing");<a 
name="line.275"></a>
-<span class="sourceLineNo">276</span><a name="line.276"></a>
-<span class="sourceLineNo">277</span>      // wait for abort completes<a 
name="line.277"></a>
-<span class="sourceLineNo">278</span>      TEST_UTIL.waitFor(120000, 200, new 
Waiter.Predicate&lt;Exception&gt;() {<a name="line.278"></a>
-<span class="sourceLineNo">279</span>        @Override<a name="line.279"></a>
-<span class="sourceLineNo">280</span>        public boolean evaluate() throws 
Exception {<a name="line.280"></a>
-<span class="sourceLineNo">281</span>          return 
cluster.getLiveRegionServerThreads().size() &lt;= NUM_RS - 1;<a 
name="line.281"></a>
-<span class="sourceLineNo">282</span>        }<a name="line.282"></a>
-<span class="sourceLineNo">283</span>      });<a name="line.283"></a>
-<span class="sourceLineNo">284</span><a name="line.284"></a>
-<span class="sourceLineNo">285</span>      Thread.sleep(2000);<a 
name="line.285"></a>
-<span class="sourceLineNo">286</span>      LOG.info("Current Open Regions:" + 
HBaseTestingUtility.getAllOnlineRegions(cluster).size());<a name="line.286"></a>
-<span class="sourceLineNo">287</span><a name="line.287"></a>
-<span class="sourceLineNo">288</span>      // wait for abort completes<a 
name="line.288"></a>
-<span class="sourceLineNo">289</span>      TEST_UTIL.waitFor(120000, 200, new 
Waiter.Predicate&lt;Exception&gt;() {<a name="line.289"></a>
-<span class="sourceLineNo">290</span>        @Override<a name="line.290"></a>
-<span class="sourceLineNo">291</span>        public boolean evaluate() throws 
Exception {<a name="line.291"></a>
-<span class="sourceLineNo">292</span>          return 
(HBaseTestingUtility.getAllOnlineRegions(cluster)<a name="line.292"></a>
-<span class="sourceLineNo">293</span>              .size() &gt;= 
(numRegionsToCreate + 1));<a name="line.293"></a>
-<span class="sourceLineNo">294</span>        }<a name="line.294"></a>
-<span class="sourceLineNo">295</span>      });<a name="line.295"></a>
-<span class="sourceLineNo">296</span><a name="line.296"></a>
-<span class="sourceLineNo">297</span>      LOG.info("Current Open Regions 
After Master Node Starts Up:" +<a name="line.297"></a>
-<span class="sourceLineNo">298</span>          
HBaseTestingUtility.getAllOnlineRegions(cluster).size());<a name="line.298"></a>
-<span class="sourceLineNo">299</span><a name="line.299"></a>
-<span class="sourceLineNo">300</span>      assertEquals(numLogLines, 
TEST_UTIL.countRows(ht));<a name="line.300"></a>
-<span class="sourceLineNo">301</span>    }<a name="line.301"></a>
-<span class="sourceLineNo">302</span>  }<a name="line.302"></a>
-<span class="sourceLineNo">303</span><a name="line.303"></a>
-<span class="sourceLineNo">304</span>  /**<a name="line.304"></a>
-<span class="sourceLineNo">305</span>   * The original intention of this test 
was to force an abort of a region server and to make sure<a name="line.305"></a>
-<span class="sourceLineNo">306</span>   * that the failure path in the region 
servers is properly evaluated. But it is difficult to<a name="line.306"></a>
-<span class="sourceLineNo">307</span>   * ensure that the region server 
doesn't finish the log splitting before it aborts. Also now,<a 
name="line.307"></a>
-<span class="sourceLineNo">308</span>   * there is this code path where the 
master will preempt the region server when master detects<a name="line.308"></a>
-<span class="sourceLineNo">309</span>   * that the region server has 
aborted.<a name="line.309"></a>
-<span class="sourceLineNo">310</span>   * @throws Exception<a 
name="line.310"></a>
-<span class="sourceLineNo">311</span>   */<a name="line.311"></a>
-<span class="sourceLineNo">312</span>  // Was marked flaky before Distributed 
Log Replay cleanup.<a name="line.312"></a>
-<span class="sourceLineNo">313</span>  @Test<a name="line.313"></a>
-<span class="sourceLineNo">314</span>  public void testWorkerAbort() throws 
Exception {<a name="line.314"></a>
-<span class="sourceLineNo">315</span>    LOG.info("testWorkerAbort");<a 
name="line.315"></a>
-<span class="sourceLineNo">316</span>    startCluster(3);<a 
name="line.316"></a>
-<span class="sourceLineNo">317</span>    int numLogLines = 10000;<a 
name="line.317"></a>
-<span class="sourceLineNo">318</span>    SplitLogManager slm = 
master.getMasterWalManager().getSplitLogManager();<a name="line.318"></a>
-<span class="sourceLineNo">319</span>    FileSystem fs = 
master.getMasterFileSystem().getFileSystem();<a name="line.319"></a>
-<span class="sourceLineNo">320</span><a name="line.320"></a>
-<span class="sourceLineNo">321</span>    List&lt;RegionServerThread&gt; rsts = 
cluster.getLiveRegionServerThreads();<a name="line.321"></a>
-<span class="sourceLineNo">322</span>    HRegionServer hrs = 
findRSToKill(false);<a name="line.322"></a>
-<span class="sourceLineNo">323</span>    Path rootdir = 
FSUtils.getRootDir(conf);<a name="line.323"></a>
-<span class="sourceLineNo">324</span>    final Path logDir = new 
Path(rootdir,<a name="line.324"></a>
-<span class="sourceLineNo">325</span>        
AbstractFSWALProvider.getWALDirectoryName(hrs.getServerName().toString()));<a 
name="line.325"></a>
-<span class="sourceLineNo">326</span><a name="line.326"></a>
-<span class="sourceLineNo">327</span>    try (ZKWatcher zkw = new 
ZKWatcher(conf, "table-creation", null);<a name="line.327"></a>
-<span class="sourceLineNo">328</span>        Table t = installTable(zkw, 40)) 
{<a name="line.328"></a>
-<span class="sourceLineNo">329</span>      makeWAL(hrs, 
ProtobufUtil.getOnlineRegions(hrs.getRSRpcServices()), numLogLines, 100);<a 
name="line.329"></a>
-<span class="sourceLineNo">330</span><a name="line.330"></a>
-<span class="sourceLineNo">331</span>      new Thread() {<a 
name="line.331"></a>
-<span class="sourceLineNo">332</span>        @Override<a name="line.332"></a>
-<span class="sourceLineNo">333</span>        public void run() {<a 
name="line.333"></a>
-<span class="sourceLineNo">334</span>          try {<a name="line.334"></a>
-<span class="sourceLineNo">335</span>            
waitForCounter(tot_wkr_task_acquired, 0, 1, 1000);<a name="line.335"></a>
-<span class="sourceLineNo">336</span>          } catch (InterruptedException 
e) {<a name="line.336"></a>
-<span class="sourceLineNo">337</span>          }<a name="line.337"></a>
-<span class="sourceLineNo">338</span>          for (RegionServerThread rst : 
rsts) {<a name="line.338"></a>
-<span class="sourceLineNo">339</span>            
rst.getRegionServer().abort("testing");<a name="line.339"></a>
-<span class="sourceLineNo">340</span>            break;<a name="line.340"></a>
-<span class="sourceLineNo">341</span>          }<a name="line.341"></a>
-<span class="sourceLineNo">342</span>        }<a name="line.342"></a>
-<span class="sourceLineNo">343</span>      }.start();<a name="line.343"></a>
-<span class="sourceLineNo">344</span>      FileStatus[] logfiles = 
fs.listStatus(logDir);<a name="line.344"></a>
-<span class="sourceLineNo">345</span>      TaskBatch batch = new 
TaskBatch();<a name="line.345"></a>
-<span class="sourceLineNo">346</span>      
slm.enqueueSplitTask(logfiles[0].getPath().toString(), batch);<a 
name="line.346"></a>
-<span class="sourceLineNo">347</span>      // waitForCounter but for one of 
the 2 counters<a name="line.347"></a>
-<span class="sourceLineNo">348</span>      long curt = 
System.currentTimeMillis();<a name="line.348"></a>
-<span class="sourceLineNo">349</span>      long waitTime = 80000;<a 
name="line.349"></a>
-<span class="sourceLineNo">350</span>      long endt = curt + waitTime;<a 
name="line.350"></a>
-<span class="sourceLineNo">351</span>      while (curt &lt; endt) {<a 
name="line.351"></a>
-<span class="sourceLineNo">352</span>        if ((tot_wkr_task_resigned.sum() 
+ tot_wkr_task_err.sum() +<a name="line.352"></a>
-<span class="sourceLineNo">353</span>            
tot_wkr_final_transition_failed.sum() + tot_wkr_task_done.sum() +<a 
name="line.353"></a>
-<span class="sourceLineNo">354</span>            tot_wkr_preempt_task.sum()) 
== 0) {<a name="line.354"></a>
-<span class="sourceLineNo">355</span>          Thread.sleep(100);<a 
name="line.355"></a>
-<span class="sourceLineNo">356</span>          curt = 
System.currentTimeMillis();<a name="line.356"></a>
-<span class="sourceLineNo">357</span>        } else {<a name="line.357"></a>
-<span class="sourceLineNo">358</span>          assertTrue(1 &lt;= 
(tot_wkr_task_resigned.sum() + tot_wkr_task_err.sum() +<a name="line.358"></a>
-<span class="sourceLineNo">359</span>              
tot_wkr_final_transition_failed.sum() + tot_wkr_task_done.sum() +<a 
name="line.359"></a>
-<span class="sourceLineNo">360</span>              
tot_wkr_preempt_task.sum()));<a name="line.360"></a>
-<span class="sourceLineNo">361</span>          return;<a name="line.361"></a>
-<span class="sourceLineNo">362</span>        }<a name="line.362"></a>
-<span class="sourceLineNo">363</span>      }<a name="line.363"></a>
-<span class="sourceLineNo">364</span>      fail("none of the following 
counters went up in " + waitTime + " milliseconds - " +<a name="line.364"></a>
-<span class="sourceLineNo">365</span>          "tot_wkr_task_resigned, 
tot_wkr_task_err, " +<a name="line.365"></a>
-<span class="sourceLineNo">366</span>          
"tot_wkr_final_transition_failed, tot_wkr_task_done, " + 
"tot_wkr_preempt_task");<a name="line.366"></a>
-<span class="sourceLineNo">367</span>    }<a name="line.367"></a>
-<span class="sourceLineNo">368</span>  }<a name="line.368"></a>
-<span class="sourceLineNo">369</span><a name="line.369"></a>
-<span class="sourceLineNo">370</span>  @Test<a name="line.370"></a>
-<span class="sourceLineNo">371</span>  public void testThreeRSAbort() throws 
Exception {<a name="line.371"></a>
-<span class="sourceLineNo">372</span>    LOG.info("testThreeRSAbort");<a 
name="line.372"></a>
-<span class="sourceLineNo">373</span>    int numRegionsToCreate = 40;<a 
name="line.373"></a>
-<span class="sourceLineNo">374</span>    int numRowsPerRegion = 100;<a 
name="line.374"></a>
-<span class="sourceLineNo">375</span><a name="line.375"></a>
-<span class="sourceLineNo">376</span>    startCluster(NUM_RS); // NUM_RS=6.<a 
name="line.376"></a>
-<span class="sourceLineNo">377</span><a name="line.377"></a>
-<span class="sourceLineNo">378</span>    try (ZKWatcher zkw = new 
ZKWatcher(conf, "distributed log splitting test", null);<a name="line.378"></a>
-<span class="sourceLineNo">379</span>        Table table = installTable(zkw, 
numRegionsToCreate)) {<a name="line.379"></a>
-<span class="sourceLineNo">380</span>      
populateDataInTable(numRowsPerRegion);<a name="line.380"></a>
-<span class="sourceLineNo">381</span><a name="line.381"></a>
-<span class="sourceLineNo">382</span>      List&lt;RegionServerThread&gt; rsts 
= cluster.getLiveRegionServerThreads();<a name="line.382"></a>
-<span class="sourceLineNo">383</span>      assertEquals(NUM_RS, 
rsts.size());<a name="line.383"></a>
-<span class="sourceLineNo">384</span>      
cluster.killRegionServer(rsts.get(0).getRegionServer().getServerName());<a 
name="line.384"></a>
-<span class="sourceLineNo">385</span>      
cluster.killRegionServer(rsts.get(1).getRegionServer().getServerName());<a 
name="line.385"></a>
-<span class="sourceLineNo">386</span>      
cluster.killRegionServer(rsts.get(2).getRegionServer().getServerName());<a 
name="line.386"></a>
-<span class="sourceLineNo">387</span><a name="line.387"></a>
-<span class="sourceLineNo">388</span>      TEST_UTIL.waitFor(60000, new 
Waiter.ExplainingPredicate&lt;Exception&gt;() {<a name="line.388"></a>
-<span class="sourceLineNo">389</span><a name="line.389"></a>
-<span class="sourceLineNo">390</span>        @Override<a name="line.390"></a>
-<span class="sourceLineNo">391</span>        public boolean evaluate() throws 
Exception {<a name="line.391"></a>
-<span class="sourceLineNo">392</span>          return 
cluster.getLiveRegionServerThreads().size() &lt;= NUM_RS - 3;<a 
name="line.392"></a>
-<span class="sourceLineNo">393</span>        }<a name="line.393"></a>
-<span class="sourceLineNo">394</span><a name="line.394"></a>
-<span class="sourceLineNo">395</span>        @Override<a name="line.395"></a>
-<span class="sourceLineNo">396</span>        public String explainFailure() 
throws Exception {<a name="line.396"></a>
-<span class="sourceLineNo">397</span>          return "Timed out waiting for 
server aborts.";<a name="line.397"></a>
-<span class="sourceLineNo">398</span>        }<a name="line.398"></a>
-<span class="sourceLineNo">399</span>      });<a name="line.399"></a>
-<span class="sourceLineNo">400</span>      
TEST_UTIL.waitUntilAllRegionsAssigned(tableName);<a name="line.400"></a>
-<span class="sourceLineNo">401</span>      assertEquals(numRegionsToCreate * 
numRowsPerRegion, TEST_UTIL.countRows(table));<a name="line.401"></a>
-<span class="sourceLineNo">402</span>    }<a name="line.402"></a>
-<span class="sourceLineNo">403</span>  }<a name="line.403"></a>
-<span class="sourceLineNo">404</span><a name="line.404"></a>
-<span class="sourceLineNo">405</span>  @Test<a name="line.405"></a>
-<span class="sourceLineNo">406</span>  public void 
testDelayedDeleteOnFailure() throws Exception {<a name="line.406"></a>
-<span class="sourceLineNo">407</span>    
LOG.info("testDelayedDeleteOnFailure");<a name="line.407"></a>
-<span class="sourceLineNo">408</span>    startCluster(1);<a 
name="line.408"></a>
-<span class="sourceLineNo">409</span>    final SplitLogManager slm = 
master.getMasterWalManager().getSplitLogManager();<a name="line.409"></a>
-<span class="sourceLineNo">410</span>    final FileSystem fs = 
master.getMasterFileSystem().getFileSystem();<a name="line.410"></a>
-<span class="sourceLineNo">411</span>    final Path logDir = new Path(new 
Path(FSUtils.getRootDir(conf), HConstants.HREGION_LOGDIR_NAME),<a 
name="line.411"></a>
-<span class="sourceLineNo">412</span>        ServerName.valueOf("x", 1, 
1).toString());<a name="line.412"></a>
-<span class="sourceLineNo">413</span>    fs.mkdirs(logDir);<a 
name="line.413"></a>
-<span class="sourceLineNo">414</span>    ExecutorService executor = null;<a 
name="line.414"></a>
-<span class="sourceLineNo">415</span>    try {<a name="line.415"></a>
-<span class="sourceLineNo">416</span>      final Path corruptedLogFile = new 
Path(logDir, "x");<a name="line.416"></a>
-<span class="sourceLineNo">417</span>      FSDataOutputStream out;<a 
name="line.417"></a>
-<span class="sourceLineNo">418</span>      out = 
fs.create(corruptedLogFile);<a name="line.418"></a>
-<span class="sourceLineNo">419</span>      out.write(0);<a name="line.419"></a>
-<span class="sourceLineNo">420</span>      out.write(Bytes.toBytes("corrupted 
bytes"));<a name="line.420"></a>
-<span class="sourceLineNo">421</span>      out.close();<a name="line.421"></a>
-<span class="sourceLineNo">422</span>      ZKSplitLogManagerCoordination 
coordination =<a name="line.422"></a>
-<span class="sourceLineNo">423</span>          (ZKSplitLogManagerCoordination) 
(master.getCoordinatedStateManager())<a name="line.423"></a>
-<span class="sourceLineNo">424</span>              
.getSplitLogManagerCoordination();<a name="line.424"></a>
-<span class="sourceLineNo">425</span>      
coordination.setIgnoreDeleteForTesting(true);<a name="line.425"></a>
-<span class="sourceLineNo">426</span>      executor = 
Executors.newSingleThreadExecutor();<a name="line.426"></a>
-<span class="sourceLineNo">427</span>      Runnable runnable = new Runnable() 
{<a name="line.427"></a>
-<span class="sourceLineNo">428</span>        @Override<a name="line.428"></a>
-<span class="sourceLineNo">429</span>        public void run() {<a 
name="line.429"></a>
-<span class="sourceLineNo">430</span>          try {<a name="line.430"></a>
-<span class="sourceLineNo">431</span>            // since the logDir is a 
fake, corrupted one, so the split log worker<a name="line.431"></a>
-<span class="sourceLineNo">432</span>            // will finish it quickly 
with error, and this call will fail and throw<a name="line.432"></a>
-<span class="sourceLineNo">433</span>            // an IOException.<a 
name="line.433"></a>
-<span class="sourceLineNo">434</span>            
slm.splitLogDistributed(logDir);<a name="line.434"></a>
-<span class="sourceLineNo">435</span>          } catch (IOException ioe) {<a 
name="line.435"></a>
-<span class="sourceLineNo">436</span>            try {<a name="line.436"></a>
-<span class="sourceLineNo">437</span>              
assertTrue(fs.exists(corruptedLogFile));<a name="line.437"></a>
-<span class="sourceLineNo">438</span>              // this call will block 
waiting for the task to be removed from the<a name="line.438"></a>
-<span class="sourceLineNo">439</span>              // tasks map which is not 
going to happen since ignoreZKDeleteForTesting<a name="line.439"></a>
-<span class="sourceLineNo">440</span>              // is set to true, until it 
is interrupted.<a name="line.440"></a>
-<span class="sourceLineNo">441</span>              
slm.splitLogDistributed(logDir);<a name="line.441"></a>
-<span class="sourceLineNo">442</span>            } catch (IOException e) {<a 
name="line.442"></a>
-<span class="sourceLineNo">443</span>              
assertTrue(Thread.currentThread().isInterrupted());<a name="line.443"></a>
-<span class="sourceLineNo">444</span>              return;<a 
name="line.444"></a>
-<span class="sourceLineNo">445</span>            }<a name="line.445"></a>
-<span class="sourceLineNo">446</span>            fail("did not get the 
expected IOException from the 2nd call");<a name="line.446"></a>
-<span class="sourceLineNo">447</span>          }<a name="line.447"></a>
-<span class="sourceLineNo">448</span>          fail("did not get the expected 
IOException from the 1st call");<a name="line.448"></a>
-<span class="sourceLineNo">449</span>        }<a name="line.449"></a>
-<span class="sourceLineNo">450</span>      };<a name="line.450"></a>
-<span class="sourceLineNo">451</span>      Future&lt;?&gt; result = 
executor.submit(runnable);<a name="line.451"></a>
-<span class="sourceLineNo">452</span>      try {<a name="line.452"></a>
-<span class="sourceLineNo">453</span>        result.get(2000, 
TimeUnit.MILLISECONDS);<a name="line.453"></a>
-<span class="sourceLineNo">454</span>      } catch (TimeoutException te) {<a 
name="line.454"></a>
-<span class="sourceLineNo">455</span>        // it is ok, expected.<a 
name="line.455"></a>
-<span class="sourceLineNo">456</span>      }<a name="line.456"></a>
-<span class="sourceLineNo">457</span>      
waitForCounter(tot_mgr_wait_for_zk_delete, 0, 1, 10000);<a name="line.457"></a>
-<span class="sourceLineNo">458</span>      executor.shutdownNow();<a 
name="line.458"></a>
-<span class="sourceLineNo">459</span>      executor = null;<a 
name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>      // make sure the runnable is 
finished with no exception thrown.<a name="line.461"></a>
-<span class="sourceLineNo">462</span>      result.get();<a name="line.462"></a>
-<span class="sourceLineNo">463</span>    } finally {<a name="line.463"></a>
-<span class="sourceLineNo">464</span>      if (executor != null) {<a 
name="line.464"></a>
-<span class="sourceLineNo">465</span>        // interrupt the thread in case 
the test fails in the middle.<a name="line.465"></a>
-<span class="sourceLineNo">466</span>        // it has no effect if the thread 
is already terminated.<a name="line.466"></a>
-<span class="sourceLineNo">467</span>        executor.shutdownNow();<a 
name="line.467"></a>
-<span class="sourceLineNo">468</span>      }<a name="line.468"></a>
-<span class="sourceLineNo">469</span>      fs.delete(logDir, true);<a 
name="line.469"></a>
-<span class="sourceLineNo">470</span>    }<a name="line.470"></a>
-<span class="sourceLineNo">471</span>  }<a name="line.471"></a>
-<span class="sourceLineNo">472</span><a name="line.472"></a>
-<span class="sourceLineNo">473</span>  @Test<a name="line.473"></a>
-<span class="sourceLineNo">474</span>  public void testReadWriteSeqIdFiles() 
throws Exception {<a name="line.474"></a>
-<span class="sourceLineNo">475</span>    
LOG.info("testReadWriteSeqIdFiles");<a name="line.475"></a>
-<span class="sourceLineNo">476</span>    startCluster(2);<a 
name="line.476"></a>
-<span class="sourceLineNo">477</span>    final ZKWatcher zkw = new 
ZKWatcher(conf, "table-creation", null);<a name="line.477"></a>
-<span class="sourceLineNo">478</span>    Table ht = installTable(zkw, 10);<a 
name="line.478"></a>
-<span class="sourceLineNo">479</span>    try {<a name="line.479"></a>
-<span class="sourceLineNo">480</span>      FileSystem fs = 
master.getMasterFileSystem().getFileSystem();<a name="line.480"></a>
-<span class="sourceLineNo">481</span>      Path tableDir =<a 
name="line.481"></a>
-<span class="sourceLineNo">482</span>          
FSUtils.getTableDir(FSUtils.getRootDir(conf), 
TableName.valueOf(name.getMethodName()));<a name="line.482"></a>
-<span class="sourceLineNo">483</span>      List&lt;Path&gt; regionDirs = 
FSUtils.getRegionDirs(fs, tableDir);<a name="line.483"></a>
-<span class="sourceLineNo">484</span>      long newSeqId = 
WALSplitter.writeRegionSequenceIdFile(fs, regionDirs.get(0), 1L, 1000L);<a 
name="line.484"></a>
-<span class="sourceLineNo">485</span>      
WALSplitter.writeRegionSequenceIdFile(fs, regionDirs.get(0), 1L, 1000L);<a 
name="line.485"></a>
-<span class="sourceLineNo">486</span>      assertEquals(newSeqId + 2000,<a 
name="line.486"></a>
-<span class="sourceLineNo">487</span>        
WALSplitter.writeRegionSequenceIdFile(fs, regionDirs.get(0), 3L, 1000L));<a 
name="line.487"></a>
-<span class="sourceLineNo">488</span><a name="line.488"></a>
-<span class="sourceLineNo">489</span>      Path editsdir = 
WALSplitter.getRegionDirRecoveredEditsDir(regionDirs.get(0));<a 
name="line.489"></a>
-<span class="sourceLineNo">490</span>      FileStatus[] files = 
FSUtils.listStatus(fs, editsdir, new PathFilter() {<a name="line.490"></a>
-<span class="sourceLineNo">491</span>        @Override<a name="line.491"></a>
-<span class="sourceLineNo">492</span>        public boolean accept(Path p) {<a 
name="line.492"></a>
-<span class="sourceLineNo">493</span>          return 
WALSplitter.isSequenceIdFile(p);<a name="line.493"></a>
-<span class="sourceLineNo">494</span>        }<a name="line.494"></a>
-<span class="sourceLineNo">495</span>      });<a name="line.495"></a>
-<span class="sourceLineNo">496</span>      // only one seqid file should 
exist<a name="line.496"></a>
-<span class="sourceLineNo">497</span>      assertEquals(1, files.length);<a 
name="line.497"></a>
-<span class="sourceLineNo">498</span><a name="line.498"></a>
-<span class="sourceLineNo">499</span>      // verify all seqId files aren't 
treated as recovered.edits files<a name="line.499"></a>
-<span class="sourceLineNo">500</span>      NavigableSet&lt;Path&gt; 
recoveredEdits =<a name="line.500"></a>
-<span class="sourceLineNo">501</span>          
WALSplitter.getSplitEditFilesSorted(fs, regionDirs.get(0));<a 
name="line.501"></a>
-<span class="sourceLineNo">502</span>      assertEquals(0, 
recoveredEdits.size());<a name="line.502"></a>
-<span class="sourceLineNo">503</span>    } finally {<a name="line.503"></a>
-<span class="sourceLineNo">504</span>      if (ht != null) ht.close();<a 
name="line.504"></a>
-<span class="sourceLineNo">505</span>      if (zkw != null) zkw.close();<a 
name="line.505"></a>
-<span class="sourceLineNo">506</span>    }<a name="line.506"></a>
-<span class="sourceLineNo">507</span>  }<a name="line.507"></a>
-<span class="sourceLineNo">508</span><a name="line.508"></a>
-<span class="sourceLineNo">509</span>  private Table installTable(ZKWatcher 
zkw, int nrs) throws Exception {<a name="line.509"></a>
-<span class="sourceLineNo">510</span>    return installTable(zkw, nrs, 0);<a 
name="line.510"></a>
-<span class="sourceLineNo">511</span>  }<a name="line.511"></a>
-<span class="sourceLineNo">512</span><a name="line.512"></a>
-<span class="sourceLineNo">513</span>  private Table installTable(ZKWatcher 
zkw, int nrs, int existingRegions) throws Exception {<a name="line.513"></a>
-<span class="sourceLineNo">514</span>    // Create a table with regions<a 
name="line.514"></a>
-<span class="sourceLineNo">515</span>    byte[] family = 
Bytes.toBytes("family");<a name="line.515"></a>
-<span class="sourceLineNo">516</span>    LOG.info("Creating table with " + nrs 
+ " regions");<a name="line.516"></a>
-<span class="sourceLineNo">517</span>    Table table = 
TEST_UTIL.createMultiRegionTable(tableName, family, nrs);<a name="line.517"></a>
-<span class="sourceLineNo">518</span>    int numRegions = -1;<a 
name="line.518"></a>
-<span class="sourceLineNo">519</span>    try (RegionLocator r = 
TEST_UTIL.getConnection().getRegionLocator(tableName)) {<a name="line.519"></a>
-<span class="sourceLineNo">520</span>      numRegions = 
r.getStartKeys().length;<a name="line.520"></a>
-<span class="sourceLineNo">521</span>    }<a name="line.521"></a>
-<span class="sourceLineNo">522</span>    assertEquals(nrs, numRegions);<a 
name="line.522"></a>
-<span class="sourceLineNo">523</span>    LOG.info("Waiting for no more 
RIT\n");<a name="line.523"></a>
-<span class="sourceLineNo">524</span>    blockUntilNoRIT(zkw, master);<a 
name="line.524"></a>
-<span class="sourceLineNo">525</span>    // disable-enable cycle to get rid of 
table's dead regions left behind<a name="line.525"></a>
-<span class="sourceLineNo">526</span>    // by createMultiRegions<a 
name="line.526"></a>
-<span class="sourceLineNo">527</span>    LOG.debug("Disabling table\n");<a 
name="line.527"></a>
-<span class="sourceLineNo">528</span>    
TEST_UTIL.getAdmin().disableTable(tableName);<a name="line.528"></a>
-<span class="sourceLineNo">529</span>    LOG.debug("Waiting for no more 
RIT\n");<a name="line.529"></a>
-<span class="sourceLineNo">530</span>    blockUntilNoRIT(zkw, master);<a 
name="line.530"></a>
-<span class="sourceLineNo">531</span>    NavigableSet&lt;String&gt; regions = 
HBaseTestingUtility.getAllOnlineRegions(cluster);<a name="line.531"></a>
-<span class="sourceLineNo">532</span>    LOG.debug("Verifying only catalog and 
namespace regions are assigned\n");<a name="line.532"></a>
-<span class="sourceLineNo">533</span>    if (regions.size() != 2) {<a 
name="line.533"></a>
-<span class="sourceLineNo">534</span>      for (String oregion : regions)<a 
name="line.534"></a>
-<span class="sourceLineNo">535</span>        LOG.debug("Region still online: " 
+ oregion);<a name="line.535"></a>
-<span class="sourceLineNo">536</span>    }<a name="line.536"></a>
-<span class="sourceLineNo">537</span>    assertEquals(2 + existingRegions, 
regions.size());<a name="line.537"></a>
-<span class="sourceLineNo">538</span>    LOG.debug("Enabling table\n");<a 
name="line.538"></a>
-<span class="sourceLineNo">539</span>    
TEST_UTIL.getAdmin().enableTable(tableName);<a name="line.539"></a>
-<span class="sourceLineNo">540</span>    LOG.debug("Waiting for no more 
RIT\n");<a name="line.540"></a>
-<span class="sourceLineNo">541</span>    blockUntilNoRIT(zkw, master);<a 
name="line.541"></a>
-<span class="sourceLineNo">542</span>    LOG.debug("Verifying there are " + 
numRegions + " assigned on cluster\n");<a name="line.542"></a>
-<span class="sourceLineNo">543</span>    regions = 
HBaseTestingUtility.getAllOnlineRegions(cluster);<a name="line.543"></a>
-<span class="sourceLineNo">544</span>    assertEquals(numRegions + 2 + 
existingRegions, regions.size());<a name="line.544"></a>
-<span class="sourceLineNo">545</span>    return table;<a name="line.545"></a>
-<span class="sourceLineNo">546</span>  }<a name="line.546"></a>
-<span class="sourceLineNo">547</span><a name="line.547"></a>
-<span class="sourceLineNo">548</span>  void populateDataInTable(int nrows) 
throws Exception {<a name="line.548"></a>
-<span class="sourceLineNo">549</span>    List&lt;RegionServerThread&gt; rsts = 
cluster.getLiveRegionServerThreads();<a name="line.549"></a>
-<span class="sourceLineNo">550</span>    assertEquals(NUM_RS, rsts.size());<a 
name="line.550"></a>
-<span class="sourceLineNo">551</span><a name="line.551"></a>
-<span class="sourceLineNo">552</span>    for (RegionServerThread rst : rsts) 
{<a name="line.552"></a>
-<span class="sourceLineNo">553</span>      HRegionServer hrs = 
rst.getRegionServer();<a name="line.553"></a>
-<span class="sourceLineNo">554</span>      List&lt;RegionInfo&gt; hris = 
ProtobufUtil.getOnlineRegions(hrs.getRSRpcServices());<a name="line.554"></a>
-<span class="sourceLineNo">555</span>      for (RegionInfo hri : hris) {<a 
name="line.555"></a>
-<span class="sourceLineNo">556</span>        if 
(hri.getTable().isSystemTable()) {<a name="line.556"></a>
-<span class="sourceLineNo">557</span>          continue;<a name="line.557"></a>
-<span class="sourceLineNo">558</span>        }<a name="line.558"></a>
-<span class="sourceLineNo">559</span>        LOG.debug(<a name="line.559"></a>
-<span class="sourceLineNo">560</span>          "adding data to rs = " + 
rst.getName() + " region = " + hri.getRegionNameAsString());<a 
name="line.560"></a>
-<span class="sourceLineNo">561</span>        Region region = 
hrs.getOnlineRegion(hri.getRegionName());<a name="line.561"></a>
-<span class="sourceLineNo">562</span>        assertTrue(region != null);<a 
name="line.562"></a>
-<span class="sourceLineNo">563</span>        putData(region, 
hri.getStartKey(), nrows, Bytes.toBytes("q"), COLUMN_FAMILY);<a 
name="line.563"></a>
-<span class="sourceLineNo">564</span>      }<a name="line.564"></a>
-<span class="sourceLineNo">565</span>    }<a name="line.565"></a>
-<span class="sourceLineNo">566</span><a name="line.566"></a>
-<span class="sourceLineNo">567</span>    for (MasterThread mt : 
cluster.getLiveMasterThreads()) {<a name="line.567"></a>
-<span class="sourceLineNo">568</span>      HRegionServer hrs = 
mt.getMaster();<a name="line.568"></a>
-<span class="sourceLineNo">569</span>      List&lt;RegionInfo&gt; hris;<a 
name="line.569"></a>
-<span class="sourceLineNo">570</span>      try {<a name="line.570"></a>
-<span class="sourceLineNo">571</span>        hris = 
ProtobufUtil.getOnlineRegions(hrs.getRSRpcServices());<a name="line.571"></a>
-<span class="sourceLineNo">572</span>      } catch 
(ServerNotRunningYetException e) {<a name="line.572"></a>
-<span class="sourceLineNo">573</span>        // It's ok: this master may be a 
backup. Ignored.<a name="line.573"></a>
-<span class="sourceLineNo">574</span>        continue;<a name="line.574"></a>
-<span class="sourceLineNo">575</span>      }<a name="line.575"></a>
-<span class="sourceLineNo">576</span>      for (RegionInfo hri : hris) {<a 
name="line.576"></a>
-<span class="sourceLineNo">577</span>        if 
(hri.getTable().isSystemTable()) {<a name="line.577"></a>
-<span class="sourceLineNo">578</span>          continue;<a name="line.578"></a>
-<span class="sourceLineNo">579</span>        }<a name="line.579"></a>
-<span class="sourceLineNo">580</span>        LOG.debug(<a name="line.580"></a>
-<span class="sourceLineNo">581</span>          "adding data to rs = " + 
mt.getName() + " region = " + hri.getRegionNameAsString());<a 
name="line.581"></a>
-<span class="sourceLineNo">582</span>        Region region = 
hrs.getOnlineRegion(hri.getRegionName());<a name="line.582"></a>
-<span class="sourceLineNo">583</span>        assertTrue(region != null);<a 
name="line.583"></a>
-<span class="sourceLineNo">584</span>        putData(region, 
hri.getStartKey(), nrows, Bytes.toBytes("q"), COLUMN_FAMILY);<a 
name="line.584"></a>
-<span class="sourceLineNo">585</span>      }<a name="line.585"></a>
-<span class="sourceLineNo">586</span>    }<a name="line.586"></a>
-<span class="sourceLineNo">587</span>  }<a name="line.587"></a>
-<span class="sourceLineNo">588</span><a name="line.588"></a>
-<span class="sourceLineNo">589</span>  public void makeWAL(HRegionServer hrs, 
List&lt;RegionInfo&gt; regions, int num_edits, int edit_size)<a 
name="line.589"></a>
-<span class="sourceLineNo">590</span>      throws IOException {<a 
name="line.590"></a>
-<span class="sourceLineNo">591</span>    makeWAL(hrs, regions, num_edits, 
edit_size, true);<a name="line.591"></a>
-<span class="sourceLineNo">592</span>  }<a name="line.592"></a>
-<span class="sourceLineNo">593</span><a name="line.593"></a>
-<span class="sourceLineNo">594</span>  public void makeWAL(HRegionServer hrs, 
List&lt;RegionInfo&gt; regions, int numEdits, int editSize,<a 
name="line.594"></a>
-<span class="sourceLineNo">595</span>      boolean cleanShutdown) throws 
IOException {<a name="line.595"></a>
-<span class="sourceLineNo">596</span>    // remove root and meta region<a 
name="line.596"></a>
-<span class="sourceLineNo">597</span>    
regions.remove(RegionInfoBuilder.FIRST_META_REGIONINFO);<a name="line.597"></a>
-<span class="sourceLineNo">598</span><a name="line.598"></a>
-<span class="sourceLineNo">599</span>    for (Iterator&lt;RegionInfo&gt; iter 
= regions.iterator(); iter.hasNext();) {<a name="line.599"></a>
-<span class="sourceLineNo">600</span>      RegionInfo regionInfo = 
iter.next();<a name="line.600"></a>
-<span class="sourceLineNo">601</span>      if 
(regionInfo.getTable().isSystemTable()) {<a name="line.601"></a>
-<span class="sourceLineNo">602</span>        iter.remove();<a 
name="line.602"></a>
-<span class="sourceLineNo">603</span>      }<a name="line.603"></a>
-<span class="sourceLineNo">604</span>    }<a name="line.604"></a>
-<span class="sourceLineNo">605</span>    byte[] value = new byte[editSize];<a 
name="line.605"></a>
+<span class="sourceLineNo">095</span><a name="line.95"></a>
+<span class="sourceLineNo">096</span>import 
org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;<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> * Base class for testing distributed log 
splitting.<a name="line.99"></a>
+<span class="sourceLineNo">100</span> */<a name="line.100"></a>
+<span class="sourceLineNo">101</span>public abstract class AbstractTestDLS {<a 
name="line.101"></a>
+<span class="sourceLineNo">102</span>  private static final Logger LOG = 
LoggerFactory.getLogger(TestSplitLogManager.class);<a name="line.102"></a>
+<span class="sourceLineNo">103</span><a name="line.103"></a>
+<span class="sourceLineNo">104</span>  private static final 
HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();<a 
name="line.104"></a>
+<span class="sourceLineNo">105</span><a name="line.105"></a>
+<span class="sourceLineNo">106</span>  // Start a cluster with 2 masters and 5 
regionservers<a name="line.106"></a>
+<span class="sourceLineNo">107</span>  private static final int NUM_MASTERS = 
2;<a name="line.107"></a>
+<span class="sourceLineNo">108</span>  private static final int NUM_RS = 5;<a 
name="line.108"></a>
+<span class="sourceLineNo">109</span>  private static byte[] COLUMN_FAMILY = 
Bytes.toBytes("family");<a name="line.109"></a>
+<span class="sourceLineNo">110</span><a name="line.110"></a>
+<span class="sourceLineNo">111</span>  @Rule<a name="line.111"></a>
+<span class="sourceLineNo">112</span>  public TestName testName = new 
TestName();<a name="line.112"></a>
+<span class="sourceLineNo">113</span><a name="line.113"></a>
+<span class="sourceLineNo">114</span>  private TableName tableName;<a 
name="line.114"></a>
+<span class="sourceLineNo">115</span>  private MiniHBaseCluster cluster;<a 
name="line.115"></a>
+<span class="sourceLineNo">116</span>  private HMaster master;<a 
name="line.116"></a>
+<span class="sourceLineNo">117</span>  private Configuration conf;<a 
name="line.117"></a>
+<span class="sourceLineNo">118</span><a name="line.118"></a>
+<span class="sourceLineNo">119</span>  @Rule<a name="line.119"></a>
+<span class="sourceLineNo">120</span>  public TestName name = new 
TestName();<a name="line.120"></a>
+<span class="sourceLineNo">121</span><a name="line.121"></a>
+<span class="sourceLineNo">122</span>  @BeforeClass<a name="line.122"></a>
+<span class="sourceLineNo">123</span>  public static void setup() throws 
Exception {<a name="line.123"></a>
+<span class="sourceLineNo">124</span>    // Uncomment the following line if 
more verbosity is needed for<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    // debugging (see HBASE-12285 for 
details).<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    // 
Logger.getLogger("org.apache.hadoop.hbase").setLevel(Level.DEBUG);<a 
name="line.126"></a>
+<span class="sourceLineNo">127</span>    TEST_UTIL.startMiniZKCluster();<a 
name="line.127"></a>
+<span class="sourceLineNo">128</span>    TEST_UTIL.startMiniDFSCluster(3);<a 
name="line.128"></a>
+<span class="sourceLineNo">129</span>  }<a name="line.129"></a>
+<span class="sourceLineNo">130</span><a name="line.130"></a>
+<span class="sourceLineNo">131</span>  @AfterClass<a name="line.131"></a>
+<span class="sourceLineNo">132</span>  public static void tearDown() throws 
Exception {<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    TEST_UTIL.shutdownMiniCluster();<a 
name="line.133"></a>
+<span class="sourceLineNo">134</span>  }<a name="line.134"></a>
+<span class="sourceLineNo">135</span><a name="line.135"></a>
+<span class="sourceLineNo">136</span>  protected abstract String 
getWalProvider();<a name="line.136"></a>
+<span class="sourceLineNo">137</span><a name="line.137"></a>
+<span class="sourceLineNo">138</span>  private void startCluster(int numRS) 
throws Exception {<a name="line.138"></a>
+<span class="sourceLineNo">139</span>    SplitLogCounters.resetCounters();<a 
name="line.139"></a>
+<span class="sourceLineNo">140</span>    LOG.info("Starting cluster");<a 
name="line.140"></a>
+<span class="sourceLineNo">141</span>    
conf.setLong("hbase.splitlog.max.resubmit", 0);<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    // Make the failure test faster<a 
name="line.142"></a>
+<span class="sourceLineNo">143</span>    
conf.setInt("zookeeper.recovery.retry", 0);<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    
conf.setInt(HConstants.REGIONSERVER_INFO_PORT, -1);<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    
conf.setFloat(HConstants.LOAD_BALANCER_SLOP_KEY, (float) 100.0); // no load 
balancing<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    
conf.setInt("hbase.regionserver.wal.max.splitters", 3);<a name="line.146"></a>
+<span class="sourceLineNo">147</span>    
conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);<a 
name="line.147"></a>
+<span class="sourceLineNo">148</span>    conf.set("hbase.wal.provider", 
getWalProvider());<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    
TEST_UTIL.startMiniHBaseCluster(NUM_MASTERS, numRS);<a name="line.149"></a>
+<span class="sourceLineNo">150</span>    cluster = 
TEST_UTIL.getHBaseCluster();<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    LOG.info("Waiting for active/ready 
master");<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    
cluster.waitForActiveAndReadyMaster();<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    master = cluster.getMaster();<a 
name="line.153"></a>
+<span class="sourceLineNo">154</span>    TEST_UTIL.waitFor(120000, 200, new 
Waiter.Predicate&lt;Exception&gt;() {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>      @Override<a name="line.155"></a>
+<span class="sourceLineNo">156</span>      public boolean evaluate() throws 
Exception {<a name="line.156"></a>
+<span class="sourceLineNo">157</span>        return 
cluster.getLiveRegionServerThreads().size() &gt;= numRS;<a name="line.157"></a>
+<span class="sourceLineNo">158</span>      }<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    });<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>  @Before<a name="line.162"></a>
+<span class="sourceLineNo">163</span>  public void before() throws Exception 
{<a name="line.163"></a>
+<span class="sourceLineNo">164</span>    conf = 
TEST_UTIL.getConfiguration();<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    tableName = 
TableName.valueOf(testName.getMethodName());<a name="line.165"></a>
+<span class="sourceLineNo">166</span>  }<a name="line.166"></a>
+<span class="sourceLineNo">167</span><a name="line.167"></a>
+<span class="sourceLineNo">168</span>  @After<a name="line.168"></a>
+<span class="sourceLineNo">169</span>  public void after() throws Exception 
{<a name="line.169"></a>
+<span class="sourceLineNo">170</span>    
TEST_UTIL.shutdownMiniHBaseCluster();<a name="line.170"></a>
+<span class="sourceLineNo">171</span>    
TEST_UTIL.getTestFileSystem().delete(FSUtils.getRootDir(TEST_UTIL.getConfiguration()),
 true);<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    
ZKUtil.deleteNodeRecursively(TEST_UTIL.getZooKeeperWatcher(), "/hbase");<a 
name="line.172"></a>
+<span class="sourceLineNo">173</span>  }<a name="line.173"></a>
+<span class="sourceLineNo">174</span><a name="line.174"></a>
+<span class="sourceLineNo">175</span>  @Test<a name="line.175"></a>
+<span class="sourceLineNo">176</span>  public void testRecoveredEdits() throws 
Exception {<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    
conf.setLong("hbase.regionserver.hlog.blocksize", 30 * 1024); // create more 
than one wal<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    startCluster(NUM_RS);<a 
name="line.178"></a>
+<span class="sourceLineNo">179</span><a name="line.179"></a>
+<span class="sourceLineNo">180</span>    int numLogLines = 10000;<a 
name="line.180"></a>
+<span class="sourceLineNo">181</span>    SplitLogManager slm = 
master.getMasterWalManager().getSplitLogManager();<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    // turn off load balancing to prevent 
regions from moving around otherwise<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    // they will consume 
recovered.edits<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    master.balanceSwitch(false);<a 
name="line.184"></a>
+<span class="sourceLineNo">185</span>    FileSystem fs = 
master.getMasterFileSystem().getFileSystem();<a name="line.185"></a>
+<span class="sourceLineNo">186</span><a name="line.186"></a>
+<span class="sourceLineNo">187</span>    List&lt;RegionServerThread&gt; rsts = 
cluster.getLiveRegionServerThreads();<a name="line.187"></a>
+<span class="sourceLineNo">188</span><a name="line.188"></a>
+<span class="sourceLineNo">189</span>    Path rootdir = 
FSUtils.getRootDir(conf);<a name="line.189"></a>
+<span class="sourceLineNo">190</span><a name="line.190"></a>
+<span class="sourceLineNo">191</span>    int numRegions = 50;<a 
name="line.191"></a>
+<span class="sourceLineNo">192</span>    try (ZKWatcher zkw = new 
ZKWatcher(conf, "table-creation", null);<a name="line.192"></a>
+<span class="sourceLineNo">193</span>        Table t = installTable(zkw, 
numRegions)) {<a name="line.193"></a>
+<span class="sourceLineNo">194</span>      TableName table = t.getName();<a 
name="line.194"></a>
+<span class="sourceLineNo">195</span>      List&lt;RegionInfo&gt; regions = 
null;<a name="line.195"></a>
+<span class="sourceLineNo">196</span>      HRegionServer hrs = null;<a 
name="line.196"></a>
+<span class="sourceLineNo">197</span>      for (int i = 0; i &lt; NUM_RS; i++) 
{<a name="line.197"></a>
+<span class="sourceLineNo">198</span>        hrs = 
rsts.get(i).getRegionServer();<a name="line.198"></a>
+<span class="sourceLineNo">199</span>        regions = 
ProtobufUtil.getOnlineRegions(hrs.getRSRpcServices());<a name="line.199"></a>
+<span class="sourceLineNo">200</span>        // At least one RS will have 
&gt;= to average number of regions.<a name="line.200"></a>
+<span class="sourceLineNo">201</span>        if (regions.size() &gt;= 
numRegions / NUM_RS) {<a name="line.201"></a>
+<span class="sourceLineNo">202</span>          break;<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>
+<span class="sourceLineNo">205</span>      Path logDir = new Path(rootdir,<a 
name="line.205"></a>
+<span class="sourceLineNo">206</span>          
AbstractFSWALProvider.getWALDirectoryName(hrs.getServerName().toString()));<a 
name="line.206"></a>
+<span class="sourceLineNo">207</span><a name="line.207"></a>
+<span class="sourceLineNo">208</span>      LOG.info("#regions = " + 
regions.size());<a name="line.208"></a>
+<span class="sourceLineNo">209</span>      Iterator&lt;RegionInfo&gt; it = 
regions.iterator();<a name="line.209"></a>
+<span class="sourceLineNo">210</span>      while (it.hasNext()) {<a 
name="line.210"></a>
+<span class="sourceLineNo">211</span>        RegionInfo region = it.next();<a 
name="line.211"></a>
+<span class="sourceLineNo">212</span>        if 
(region.getTable().getNamespaceAsString()<a name="line.212"></a>
+<span class="sourceLineNo">213</span>            
.equals(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR)) {<a name="line.213"></a>
+<span class="sourceLineNo">214</span>          it.remove();<a 
name="line.214"></a>
+<span class="sourceLineNo">215</span>        }<a name="line.215"></a>
+<span class="sourceLineNo">216</span>      }<a name="line.216"></a>
+<span class="sourceLineNo">217</span><a name="line.217"></a>
+<span class="sourceLineNo">218</span>      makeWAL(hrs, regions, numLogLines, 
100);<a name="line.218"></a>
+<span class="sourceLineNo">219</span><a name="line.219"></a>
+<span class="sourceLineNo">220</span>      slm.splitLogDistributed(logDir);<a 
name="line.220"></a>
+<span class="sourceLineNo">221</span><a name="line.221"></a>
+<span class="sourceLineNo">222</span>      int count = 0;<a 
name="line.222"></a>
+<span class="sourceLineNo">223</span>      for (RegionInfo hri : regions) {<a 
name="line.223"></a>
+<span class="sourceLineNo">224</span>        Path tdir = 
FSUtils.getTableDir(rootdir, table);<a name="line.224"></a>
+<span class="sourceLineNo">225</span>        
@SuppressWarnings("deprecation")<a name="line.225"></a>
+<span class="sourceLineNo">226</span>        Path editsdir = WALSplitter<a 
name="line.226"></a>
+<span class="sourceLineNo">227</span>            
.getRegionDirRecoveredEditsDir(HRegion.getRegionDir(tdir, 
hri.getEncodedName()));<a name="line.227"></a>
+<span class="sourceLineNo">228</span>        LOG.debug("checking edits dir " + 
editsdir);<a name="line.228"></a>
+<span class="sourceLineNo">229</span>        FileStatus[] files = 
fs.listStatus(editsdir, new PathFilter() {<a name="line.229"></a>
+<span class="sourceLineNo">230</span>          @Override<a name="line.230"></a>
+<span class="sourceLineNo">231</span>          public boolean accept(Path p) 
{<a name="line.231"></a>
+<span class="sourceLineNo">232</span>            if 
(WALSplitter.isSequenceIdFile(p)) {<a name="line.232"></a>
+<span class="sourceLineNo">233</span>              return false;<a 
name="line.233"></a>
+<span class="sourceLineNo">234</span>            }<a name="line.234"></a>
+<span class="sourceLineNo">235</span>            return true;<a 
name="line.235"></a>
+<span class="sourceLineNo">236</span>          }<a name="line.236"></a>
+<span class="sourceLineNo">237</span>        });<a name="line.237"></a>
+<span class="sourceLineNo">238</span>        assertTrue(<a name="line.238"></a>
+<span class="sourceLineNo">239</span>          "edits dir should have more 
than a single file in it. instead has " + files.length,<a name="line.239"></a>
+<span class="sourceLineNo">240</span>          files.length &gt; 1);<a 
name="line.240"></a>
+<span class="sourceLineNo">241</span>        for (int i = 0; i &lt; 
files.length; i++) {<a name="line.241"></a>
+<span class="sourceLineNo">242</span>          int c = 
countWAL(files[i].getPath(), fs, conf);<a name="line.242"></a>
+<span class="sourceLineNo">243</span>          count += c;<a 
name="line.243"></a>
+<span class="sourceLineNo">244</span>        }<a name="line.244"></a>
+<span class="sourceLineNo">245</span>        LOG.info(count + " edits in " + 
files.length + " recovered edits files.");<a name="line.245"></a>
+<span class="sourceLineNo">246</span>      }<a name="line.246"></a>
+<span class="sourceLineNo">247</span><a name="line.247"></a>
+<span class="sourceLineNo">248</span>      // check that the log file is 
moved<a name="line.248"></a>
+<span class="sourceLineNo">249</span>      assertFalse(fs.exists(logDir));<a 
name="line.249"></a>
+<span class="sourceLineNo">250</span>      assertEquals(numLogLines, count);<a 
name="line.250"></a>
+<span class="sourceLineNo">251</span>    }<a name="line.251"></a>
+<span class="sourceLineNo">252</span>  }<a name="line.252"></a>
+<span class="sourceLineNo">253</span><a name="line.253"></a>
+<span class="sourceLineNo">254</span>  @Test<a name="line.254"></a>
+<span class="sourceLineNo">255</span>  public void 
testMasterStartsUpWithLogSplittingWork() throws Exception {<a 
name="line.255"></a>
+<span class="sourceLineNo">256</span>    
conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, NUM_RS - 1);<a 
name="line.256"></a>
+<span class="sourceLineNo">257</span>    startCluster(NUM_RS);<a 
name="line.257"></a>
+<span class="sourceLineNo">258</span><a name="line.258"></a>
+<span class="sourceLineNo">259</span>    int numRegionsToCreate = 40;<a 
name="line.259"></a>
+<span class="sourceLineNo">260</span>    int numLogLines = 1000;<a 
name="line.260"></a>
+<span class="sourceLineNo">261</span>    // turn off load balancing to prevent 
regions from moving around otherwise<a name="line.261"></a>
+<span class="sourceLineNo">262</span>    // they will consume 
recovered.edits<a name="line.262"></a>
+<span class="sourceLineNo">263</span>    master.balanceSwitch(false);<a 
name="line.263"></a>
+<span class="sourceLineNo">264</span><a name="line.264"></a>
+<span class="sourceLineNo">265</span>    try (ZKWatcher zkw = new 
ZKWatcher(conf, "table-creation", null);<a name="line.265"></a>
+<span class="sourceLineNo">266</span>        Table ht = installTable(zkw, 
numRegionsToCreate)) {<a name="line.266"></a>
+<span class="sourceLineNo">267</span>      HRegionServer hrs = 
findRSToKill(false);<a name="line.267"></a>
+<span class="sourceLineNo">268</span>      List&lt;RegionInfo&gt; regions = 
ProtobufUtil.getOnlineRegions(hrs.getRSRpcServices());<a name="line.268"></a>
+<span class="sourceLineNo">269</span>      makeWAL(hrs, regions, numLogLines, 
100);<a name="line.269"></a>
+<span class="sourceLineNo">270</span><a name="line.270"></a>
+<span class="sourceLineNo">271</span>      // abort master<a 
name="line.271"></a>
+<span class="sourceLineNo">272</span>      abortMaster(cluster);<a 
name="line.272"></a>
+<span class="sourceLineNo">273</span><a name="line.273"></a>
+<span class="sourceLineNo">274</span>      // abort RS<a name="line.274"></a>
+<span class="sourceLineNo">275</span>      LOG.info("Aborting region server: " 
+ hrs.getServerName());<a name="line.275"></a>
+<span class="sourceLineNo">276</span>      hrs.abort("testing");<a 
name="line.276"></a>
+<span class="sourceLineNo">277</span><a name="line.277"></a>
+<span class="sourceLineNo">278</span>      // wait for abort completes<a 
name="line.278"></a>
+<span class="sourceLineNo">279</span>      TEST_UTIL.waitFor(120000, 200, new 
Waiter.Predicate&lt;Exception&gt;() {<a name="line.279"></a>
+<span class="sourceLineNo">280</span>        @Override<a name="line.280"></a>
+<span class="sourceLineNo">281</span>        public boolean evaluate() throws 
Exception {<a name="line.281"></a>
+<span class="sourceLineNo">282</span>          return 
cluster.getLiveRegionServerThreads().size() &lt;= NUM_RS - 1;<a 
name="line.282"></a>
+<span class="sourceLineNo">283</span>        }<a name="line.283"></a>
+<span class="sourceLineNo">284</span>      });<a name="line.284"></a>
+<span class="sourceLineNo">285</span><a name="line.285"></a>
+<span class="sourceLineNo">286</span>      Thread.sleep(2000);<a 
name="line.286"></a>
+<span class="sourceLineNo">287</span>      LOG.info("Current Open Regions:" + 
HBaseTestingUtility.getAllOnlineRegions(cluster).size());<a name="line.287"></a>
+<span class="sourceLineNo">288</span><a name="line.288"></a>
+<span class="sourceLineNo">289</span>      // wait for abort completes<a 
name="line.289"></a>
+<span class="sourceLineNo">290</span>      TEST_UTIL.waitFor(120000, 200, new 
Waiter.Predicate&lt;Exception&gt;() {<a name="line.290"></a>
+<span class="sourceLineNo">291</span>        @Override<a name="line.291"></a>
+<span class="sourceLineNo">292</span>        public boolean evaluate() throws 
Exception {<a name="line.292"></a>
+<span class="sourceLineNo">293</span>          return 
(HBaseTestingUtility.getAllOnlineRegions(cluster)<a name="line.293"></a>
+<span class="sourceLineNo">294</span>              .size() &gt;= 
(numRegionsToCreate + 1));<a name="line.294"></a>
+<span class="sourceLineNo">295</span>        }<a name="line.295"></a>
+<span class="sourceLineNo">296</span>      });<a name="line.296"></a>
+<span class="sourceLineNo">297</span><a name="line.297"></a>
+<span class="sourceLineNo">298</span>      LOG.info("Current Open Regions 
After Master Node Starts Up:" +<a name="line.298"></a>
+<span class="sourceLineNo">299</span>          
HBaseTestingUtility.getAllOnlineRegions(cluster).size());<a name="line.299"></a>
+<span class="sourceLineNo">300</span><a name="line.300"></a>
+<span class="sourceLineNo">301</span>      assertEquals(numLogLines, 
TEST_UTIL.countRows(ht));<a name="line.301"></a>
+<span class="sourceLineNo">302</span>    }<a name="line.302"></a>
+<span class="sourceLineNo">303</span>  }<a name="line.303"></a>
+<span class="sourceLineNo">304</span><a name="line.304"></a>
+<span class="sourceLineNo">305</span>  /**<a name="line.305"></a>
+<span class="sourceLineNo">306</span>   * The original intention of this test 
was to force an abort of a region server and to make sure<a name="line.306"></a>
+<span class="sourceLineNo">307</span>   * that the failure path in the region 
servers is properly evaluated. But it is difficult to<a name="line.307"></a>
+<span class="sourceLineNo">308</span>   * ensure that the region server 
doesn't finish the log splitting before it aborts. Also now,<a 
name="line.308"></a>
+<span class="sourceLineNo">309</span>   * there is this code path where the 
master will preempt the region server when master detects<a name="line.309"></a>
+<span class="sourceLineNo">310</span>   * that the region server has 
aborted.<a name="line.310"></a>
+<span class="sourceLineNo">311</span>   * @throws Exception<a 
name="line.311"></a>
+<span class="sourceLineNo">312</span>   */<a name="line.312"></a>
+<span class="sourceLineNo">313</span>  // Was marked flaky before Distributed 
Log Replay cleanup.<a name="line.313"></a>
+<span class="sourceLineNo">314</span>  @Test<a name="line.314"></a>
+<span class="sourceLineNo">315</span>  public void testWorkerAbort() throws 
Exception {<a name="line.315"></a>
+<span class="sourceLineNo">316</span>    LOG.info("testWorkerAbort");<a 
name="line.316"></a>
+<span class="sourceLineNo">317</span>    startCluster(3);<a 
name="line.317"></a>
+<span class="sourceLineNo">318</span>    int numLogLines = 10000;<a 
name="line.318"></a>
+<span class="sourceLineNo">319</span>    SplitLogManager slm = 
master.getMasterWalManager().getSplitLogManager();<a name="line.319"></a>
+<span class="sourceLineNo">320</span>    FileSystem fs = 
master.getMasterFileSystem().getFileSystem();<a name="line.320"></a>
+<span class="sourceLineNo">321</span><a name="line.321"></a>
+<span class="sourceLineNo">322</span>    List&lt;RegionServerThread&gt; rsts = 
cluster.getLiveRegionServerThreads();<a name="line.322"></a>
+<span class="sourceLineNo">323</span>    HRegionServer hrs = 
findRSToKill(false);<a name="line.323"></a>
+<span class="sourceLineNo">324</span>    Path rootdir = 
FSUtils.getRootDir(conf);<a name="line.324"></a>
+<span class="sourceLineNo">325</span>    final Path logDir = new 
Path(rootdir,<a name="line.325"></a>
+<span class="sourceLineNo">326</span>        
AbstractFSWALProvider.getWALDirectoryName(hrs.getServerName().toString()));<a 
name="line.326"></a>
+<span class="sourceLineNo">327</span><a name="line.327"></a>
+<span class="sourceLineNo">328</span>    try (ZKWatcher zkw = new 
ZKWatcher(conf, "table-creation", null);<a name="line.328"></a>
+<span class="sourceLineNo">329</span>        Table t = installTable(zkw, 40)) 
{<a name="line.329"></a>
+<span class="sourceLineNo">330</span>      makeWAL(hrs, 
ProtobufUtil.getOnlineRegions(hrs.getRSRpcServices()), numLogLines, 100);<a 
name="line.330"></a>
+<span class="sourceLineNo">331</span><a name="line.331"></a>
+<span class="sourceLineNo">332</span>      new Thread() {<a 
name="line.332"></a>
+<span class="sourceLineNo">333</span>        @Override<a name="line.333"></a>
+<span class="sourceLineNo">334</span>        public void run() {<a 
name="line.334"></a>
+<span class="sourceLineNo">335</span>          try {<a name="line.335"></a>
+<span class="sourceLineNo">336</span>            
waitForCounter(tot_wkr_task_acquired, 0, 1, 1000);<a name="line.336"></a>
+<span class="sourceLineNo">337</span>          } catch (InterruptedException 
e) {<a name="line.337"></a>
+<span class="sourceLineNo">338</span>          }<a name="line.338"></a>
+<span class="sourceLineNo">339</span>          for (RegionServerThread rst : 
rsts) {<a name="line.339"></a>
+<span class="sourceLineNo">340</span>            
rst.getRegionServer().abort("testing");<a name="line.340"></a>
+<span class="sourceLineNo">341</span>            break;<a name="line.341"></a>
+<span class="sourceLineNo">342</span>          }<a name="line.342"></a>
+<span class="sourceLineNo">343</span>        }<a name="line.343"></a>
+<span class="sourceLineNo">344</span>      }.start();<a name="line.344"></a>
+<span class="sourceLineNo">345</span>      FileStatus[] logfiles = 
fs.listStatus(logDir);<a name="line.345"></a>
+<span class="sourceLineNo">346</span>      TaskBatch batch = new 
TaskBatch();<a name="line.346"></a>
+<span class="sourceLineNo">347</span>      
slm.enqueueSplitTask(logfiles[0].getPath().toString(), batch);<a 
name="line.347"></a>
+<span class="sourceLineNo">348</span>      // waitForCounter but for one of 
the 2 counters<a name="line.348"></a>
+<span class="sourceLineNo">349</span>      long curt = 
System.currentTimeMillis();<a name="line.349"></a>
+<span class="sourceLineNo">350</span>      long waitTime = 80000;<a 
name="line.350"></a>
+<span class="sourceLineNo">351</span>      long endt = curt + waitTime;<a 
name="line.351"></a>
+<span class="sourceLineNo">352</span>      while (curt &lt; endt) {<a 
name="line.352"></a>
+<span class="sourceLineNo">353</span>        if ((tot_wkr_task_resigned.sum() 
+ tot_wkr_task_err.sum() +<a name="line.353"></a>
+<span class="sourceLineNo">354</span>            
tot_wkr_final_transition_failed.sum() + tot_wkr_task_done.sum() +<a 
name="line.354"></a>
+<span class="sourceLineNo">355</span>            tot_wkr_preempt_task.sum()) 
== 0) {<a name="line.355"></a>
+<span class="sourceLineNo">356</span>          Thread.sleep(100);<a 
name="line.356"></a>
+<span class="sourceLineNo">357</span>          curt = 
System.currentTimeMillis();<a name="line.357"></a>
+<span class="sourceLineNo">358</span>        } else {<a name="line.358"></a>
+<span class="sourceLineNo">359</span>          assertTrue(1 &lt;= 
(tot_wkr_task_resigned.sum() + tot_wkr_task_err.sum() +<a name="line.359"></a>
+<span class="sourceLineNo">360</span>              
tot_wkr_final_transition_failed.sum() + tot_wkr_task_done.sum() +<a 
name="line.360"></a>
+<span class="sourceLineNo">361</span>              
tot_wkr_preempt_task.sum()));<a name="line.361"></a>
+<span class="sourceLineNo">362</span>          return;<a name="line.362"></a>
+<span class="sourceLineNo">363</span>        }<a name="line.363"></a>
+<span class="sourceLineNo">364</span>      }<a name="line.364"></a>
+<span class="sourceLineNo">365</span>      fail("none of the following 
counters went up in " + waitTime + " milliseconds - " +<a name="line.365"></a>
+<span class="sourceLineNo">366</span>          "tot_wkr_task_resigned, 
tot_wkr_task_err, " +<a name="line.366"></a>
+<span class="sourceLineNo">367</span>          
"tot_wkr_final_transition_failed, tot_wkr_task_done, " + 
"tot_wkr_preempt_task");<a name="line.367"></a>
+<span class="sourceLineNo">368</span>    }<a name="line.368"></a>
+<span class="sourceLineNo">369</span>  }<a name="line.369"></a>
+<span class="sourceLineNo">370</span><a name="line.370"></a>
+<span class="sourceLineNo">371</span>  @Test<a name="line.371"></a>
+<span class="sourceLineNo">372</span>  public void testThreeRSAbort() throws 
Exception {<a name="line.372"></a>
+<span class="sourceLineNo">373</span>    LOG.info("testThreeRSAbort");<a 
name="line.373"></a>
+<span class="sourceLineNo">374</span>    int numRegionsToCreate = 40;<a 
name="line.374"></a>
+<span class="sourceLineNo">375</span>    int numRowsPerRegion = 100;<a 
name="line.375"></a>
+<span class="sourceLineNo">376</span><a name="line.376"></a>
+<span class="sourceLineNo">377</span>    startCluster(NUM_RS); // NUM_RS=6.<a 
name="line.377"></a>
+<span class="sourceLineNo">378</span><a name="line.378"></a>
+<span class="sourceLineNo">379</span>    try (ZKWatcher zkw = new 
ZKWatcher(conf, "distributed log splitting test", null);<a name="line.379"></a>
+<span class="sourceLineNo">380</span>        Table table = installTable(zkw, 
numRegionsToCreate)) {<a name="line.380"></a>
+<span class="sourceLineNo">381</span>      
populateDataInTable(numRowsPerRegion);<a name="line.381"></a>
+<span class="sourceLineNo">382</span><a name="line.382"></a>
+<span class="sourceLineNo">383</span>      List&lt;RegionServerThread&gt; rsts 
= cluster.getLiveRegionServerThreads();<a name="line.383"></a>
+<span class="sourceLineNo">384</span>      assertEquals(NUM_RS, 
rsts.size());<a name="line.384"></a>
+<span class="sourceLineNo">385</span>      
cluster.killRegionServer(rsts.get(0).getRegionServer().getServerName());<a 
name="line.385"></a>
+<span class="sourceLineNo">386</span>      
cluster.killRegionServer(rsts.get(1).getRegionServer().getServerName());<a 
name="line.386"></a>
+<span class="sourceLineNo">387</span>      
cluster.killRegionServer(rsts.get(2).getRegionServer().getServerName());<a 
name="line.387"></a>
+<span class="sourceLineNo">388</span><a name="line.388"></a>
+<span class="sourceLineNo">389</span>      TEST_UTIL.waitFor(60000, new 
Waiter.ExplainingPredicate&lt;Exception&gt;() {<a name="line.389"></a>
+<span class="sourceLineNo">390</span><a name="line.390"></a>
+<span class="sourceLineNo">391</span>        @Override<a name="line.391"></a>
+<span class="sourceLineNo">392</span>        public boolean evaluate() throws 
Exception {<a name="line.392"></a>
+<span class="sourceLineNo">393</span>          return 
cluster.getLiveRegionServerThreads().size() &lt;= NUM_RS - 3;<a 
name="line.393"></a>
+<span class="sourceLineNo">394</span>        }<a name="line.394"></a>
+<span class="sourceLineNo">395</span><a name="line.395"></a>
+<span class="sourceLineNo">396</span>        @Override<a na

<TRUNCATED>

Reply via email to