hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [13/45] hbase-site git commit: Published site at 04622254f7209c5cfeadcfa137a97fbed161075a.
Date Mon, 14 Dec 2015 16:38:24 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/736088b3/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestStoreScanner.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestStoreScanner.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestStoreScanner.html
index 139d5ca..b5e49bc 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestStoreScanner.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestStoreScanner.html
@@ -462,9 +462,9 @@
 <span class="sourceLineNo">454</span>    // normally cause an NPE because scan.store is null.  So as long as we get through these<a name="line.454"></a>
 <span class="sourceLineNo">455</span>    // two calls we are good and the bug was quashed.<a name="line.455"></a>
 <span class="sourceLineNo">456</span><a name="line.456"></a>
-<span class="sourceLineNo">457</span>    scan.updateReaders();<a name="line.457"></a>
+<span class="sourceLineNo">457</span>    scan.updateReaders(new ArrayList&lt;StoreFile&gt;());<a name="line.457"></a>
 <span class="sourceLineNo">458</span><a name="line.458"></a>
-<span class="sourceLineNo">459</span>    scan.updateReaders();<a name="line.459"></a>
+<span class="sourceLineNo">459</span>    scan.updateReaders(new ArrayList&lt;StoreFile&gt;());<a name="line.459"></a>
 <span class="sourceLineNo">460</span><a name="line.460"></a>
 <span class="sourceLineNo">461</span>    scan.peek();<a name="line.461"></a>
 <span class="sourceLineNo">462</span>  }<a name="line.462"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/736088b3/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestWideScanner.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestWideScanner.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestWideScanner.html
index f58b223..c122e77 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestWideScanner.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestWideScanner.html
@@ -138,7 +138,7 @@
 <span class="sourceLineNo">130</span>          ((HRegion.RegionScannerImpl)s).storeHeap.getHeap().iterator();<a name="line.130"></a>
 <span class="sourceLineNo">131</span>        while (scanners.hasNext()) {<a name="line.131"></a>
 <span class="sourceLineNo">132</span>          StoreScanner ss = (StoreScanner)scanners.next();<a name="line.132"></a>
-<span class="sourceLineNo">133</span>          ss.updateReaders();<a name="line.133"></a>
+<span class="sourceLineNo">133</span>          ss.updateReaders(new ArrayList&lt;StoreFile&gt;());<a name="line.133"></a>
 <span class="sourceLineNo">134</span>        }<a name="line.134"></a>
 <span class="sourceLineNo">135</span>      } while (more);<a name="line.135"></a>
 <span class="sourceLineNo">136</span><a name="line.136"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/736088b3/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.html
----------------------------------------------------------------------
diff --git a/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.html b/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.html
index 8c2bc05..2ffc548 100644
--- a/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.html
+++ b/testdevapidocs/src-html/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.html
@@ -168,7 +168,7 @@
 <span class="sourceLineNo">160</span>   * Test snapshotting a table that is online without flushing<a name="line.160"></a>
 <span class="sourceLineNo">161</span>   * @throws Exception<a name="line.161"></a>
 <span class="sourceLineNo">162</span>   */<a name="line.162"></a>
-<span class="sourceLineNo">163</span>  @Ignore ("Flakey test") @Test(timeout=30000)<a name="line.163"></a>
+<span class="sourceLineNo">163</span>  @Test(timeout=30000)<a name="line.163"></a>
 <span class="sourceLineNo">164</span>  public void testSkipFlushTableSnapshot() throws Exception {<a name="line.164"></a>
 <span class="sourceLineNo">165</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.165"></a>
 <span class="sourceLineNo">166</span>    // make sure we don't fail on listing snapshots<a name="line.166"></a>
@@ -177,364 +177,365 @@
 <span class="sourceLineNo">169</span>    // put some stuff in the table<a name="line.169"></a>
 <span class="sourceLineNo">170</span>    Table table = UTIL.getConnection().getTable(TABLE_NAME);<a name="line.170"></a>
 <span class="sourceLineNo">171</span>    UTIL.loadTable(table, TEST_FAM);<a name="line.171"></a>
-<span class="sourceLineNo">172</span><a name="line.172"></a>
-<span class="sourceLineNo">173</span>    LOG.debug("FS state before snapshot:");<a name="line.173"></a>
-<span class="sourceLineNo">174</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.174"></a>
-<span class="sourceLineNo">175</span><a name="line.175"></a>
-<span class="sourceLineNo">176</span>    // take a snapshot of the enabled table<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    String snapshotString = "skipFlushTableSnapshot";<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    byte[] snapshot = Bytes.toBytes(snapshotString);<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    admin.snapshot(snapshotString, TABLE_NAME, SnapshotDescription.Type.SKIPFLUSH);<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    LOG.debug("Snapshot completed.");<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>    // make sure we have the snapshot<a name="line.182"></a>
-<span class="sourceLineNo">183</span>    List&lt;SnapshotDescription&gt; snapshots = SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,<a name="line.183"></a>
-<span class="sourceLineNo">184</span>        snapshot, TABLE_NAME);<a name="line.184"></a>
-<span class="sourceLineNo">185</span><a name="line.185"></a>
-<span class="sourceLineNo">186</span>    // make sure its a valid snapshot<a name="line.186"></a>
-<span class="sourceLineNo">187</span>    LOG.debug("FS state after snapshot:");<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.188"></a>
-<span class="sourceLineNo">189</span><a name="line.189"></a>
-<span class="sourceLineNo">190</span>    SnapshotTestingUtils.confirmSnapshotValid(UTIL, snapshots.get(0), TABLE_NAME, TEST_FAM);<a name="line.190"></a>
-<span class="sourceLineNo">191</span><a name="line.191"></a>
-<span class="sourceLineNo">192</span>    admin.deleteSnapshot(snapshot);<a name="line.192"></a>
-<span class="sourceLineNo">193</span>    snapshots = admin.listSnapshots();<a name="line.193"></a>
-<span class="sourceLineNo">194</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.194"></a>
-<span class="sourceLineNo">195</span>  }<a name="line.195"></a>
-<span class="sourceLineNo">196</span><a name="line.196"></a>
+<span class="sourceLineNo">172</span>    UTIL.flush(TABLE_NAME);<a name="line.172"></a>
+<span class="sourceLineNo">173</span><a name="line.173"></a>
+<span class="sourceLineNo">174</span>    LOG.debug("FS state before snapshot:");<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.175"></a>
+<span class="sourceLineNo">176</span><a name="line.176"></a>
+<span class="sourceLineNo">177</span>    // take a snapshot of the enabled table<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    String snapshotString = "skipFlushTableSnapshot";<a name="line.178"></a>
+<span class="sourceLineNo">179</span>    byte[] snapshot = Bytes.toBytes(snapshotString);<a name="line.179"></a>
+<span class="sourceLineNo">180</span>    admin.snapshot(snapshotString, TABLE_NAME, SnapshotDescription.Type.SKIPFLUSH);<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    LOG.debug("Snapshot completed.");<a name="line.181"></a>
+<span class="sourceLineNo">182</span><a name="line.182"></a>
+<span class="sourceLineNo">183</span>    // make sure we have the snapshot<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    List&lt;SnapshotDescription&gt; snapshots = SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,<a name="line.184"></a>
+<span class="sourceLineNo">185</span>        snapshot, TABLE_NAME);<a name="line.185"></a>
+<span class="sourceLineNo">186</span><a name="line.186"></a>
+<span class="sourceLineNo">187</span>    // make sure its a valid snapshot<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    LOG.debug("FS state after snapshot:");<a name="line.188"></a>
+<span class="sourceLineNo">189</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.189"></a>
+<span class="sourceLineNo">190</span><a name="line.190"></a>
+<span class="sourceLineNo">191</span>    SnapshotTestingUtils.confirmSnapshotValid(UTIL, snapshots.get(0), TABLE_NAME, TEST_FAM);<a name="line.191"></a>
+<span class="sourceLineNo">192</span><a name="line.192"></a>
+<span class="sourceLineNo">193</span>    admin.deleteSnapshot(snapshot);<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    snapshots = admin.listSnapshots();<a name="line.194"></a>
+<span class="sourceLineNo">195</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.195"></a>
+<span class="sourceLineNo">196</span>  }<a name="line.196"></a>
 <span class="sourceLineNo">197</span><a name="line.197"></a>
-<span class="sourceLineNo">198</span>  /**<a name="line.198"></a>
-<span class="sourceLineNo">199</span>   * Test simple flush snapshotting a table that is online<a name="line.199"></a>
-<span class="sourceLineNo">200</span>   * @throws Exception<a name="line.200"></a>
-<span class="sourceLineNo">201</span>   */<a name="line.201"></a>
-<span class="sourceLineNo">202</span>  @Test (timeout=300000)<a name="line.202"></a>
-<span class="sourceLineNo">203</span>  public void testFlushTableSnapshotWithProcedure() throws Exception {<a name="line.203"></a>
-<span class="sourceLineNo">204</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    // make sure we don't fail on listing snapshots<a name="line.205"></a>
-<span class="sourceLineNo">206</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.206"></a>
-<span class="sourceLineNo">207</span><a name="line.207"></a>
-<span class="sourceLineNo">208</span>    // put some stuff in the table<a name="line.208"></a>
-<span class="sourceLineNo">209</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, DEFAULT_NUM_ROWS, TEST_FAM);<a name="line.209"></a>
-<span class="sourceLineNo">210</span><a name="line.210"></a>
-<span class="sourceLineNo">211</span>    LOG.debug("FS state before snapshot:");<a name="line.211"></a>
-<span class="sourceLineNo">212</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.212"></a>
-<span class="sourceLineNo">213</span><a name="line.213"></a>
-<span class="sourceLineNo">214</span>    // take a snapshot of the enabled table<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    String snapshotString = "offlineTableSnapshot";<a name="line.215"></a>
-<span class="sourceLineNo">216</span>    byte[] snapshot = Bytes.toBytes(snapshotString);<a name="line.216"></a>
-<span class="sourceLineNo">217</span>    Map&lt;String, String&gt; props = new HashMap&lt;String, String&gt;();<a name="line.217"></a>
-<span class="sourceLineNo">218</span>    props.put("table", TABLE_NAME.getNameAsString());<a name="line.218"></a>
-<span class="sourceLineNo">219</span>    admin.execProcedure(SnapshotManager.ONLINE_SNAPSHOT_CONTROLLER_DESCRIPTION,<a name="line.219"></a>
-<span class="sourceLineNo">220</span>        snapshotString, props);<a name="line.220"></a>
-<span class="sourceLineNo">221</span><a name="line.221"></a>
+<span class="sourceLineNo">198</span><a name="line.198"></a>
+<span class="sourceLineNo">199</span>  /**<a name="line.199"></a>
+<span class="sourceLineNo">200</span>   * Test simple flush snapshotting a table that is online<a name="line.200"></a>
+<span class="sourceLineNo">201</span>   * @throws Exception<a name="line.201"></a>
+<span class="sourceLineNo">202</span>   */<a name="line.202"></a>
+<span class="sourceLineNo">203</span>  @Test (timeout=300000)<a name="line.203"></a>
+<span class="sourceLineNo">204</span>  public void testFlushTableSnapshotWithProcedure() throws Exception {<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    // make sure we don't fail on listing snapshots<a name="line.206"></a>
+<span class="sourceLineNo">207</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.207"></a>
+<span class="sourceLineNo">208</span><a name="line.208"></a>
+<span class="sourceLineNo">209</span>    // put some stuff in the table<a name="line.209"></a>
+<span class="sourceLineNo">210</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, DEFAULT_NUM_ROWS, TEST_FAM);<a name="line.210"></a>
+<span class="sourceLineNo">211</span><a name="line.211"></a>
+<span class="sourceLineNo">212</span>    LOG.debug("FS state before snapshot:");<a name="line.212"></a>
+<span class="sourceLineNo">213</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.213"></a>
+<span class="sourceLineNo">214</span><a name="line.214"></a>
+<span class="sourceLineNo">215</span>    // take a snapshot of the enabled table<a name="line.215"></a>
+<span class="sourceLineNo">216</span>    String snapshotString = "offlineTableSnapshot";<a name="line.216"></a>
+<span class="sourceLineNo">217</span>    byte[] snapshot = Bytes.toBytes(snapshotString);<a name="line.217"></a>
+<span class="sourceLineNo">218</span>    Map&lt;String, String&gt; props = new HashMap&lt;String, String&gt;();<a name="line.218"></a>
+<span class="sourceLineNo">219</span>    props.put("table", TABLE_NAME.getNameAsString());<a name="line.219"></a>
+<span class="sourceLineNo">220</span>    admin.execProcedure(SnapshotManager.ONLINE_SNAPSHOT_CONTROLLER_DESCRIPTION,<a name="line.220"></a>
+<span class="sourceLineNo">221</span>        snapshotString, props);<a name="line.221"></a>
 <span class="sourceLineNo">222</span><a name="line.222"></a>
-<span class="sourceLineNo">223</span>    LOG.debug("Snapshot completed.");<a name="line.223"></a>
-<span class="sourceLineNo">224</span><a name="line.224"></a>
-<span class="sourceLineNo">225</span>    // make sure we have the snapshot<a name="line.225"></a>
-<span class="sourceLineNo">226</span>    List&lt;SnapshotDescription&gt; snapshots = SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,<a name="line.226"></a>
-<span class="sourceLineNo">227</span>      snapshot, TABLE_NAME);<a name="line.227"></a>
-<span class="sourceLineNo">228</span><a name="line.228"></a>
-<span class="sourceLineNo">229</span>    // make sure its a valid snapshot<a name="line.229"></a>
-<span class="sourceLineNo">230</span>    LOG.debug("FS state after snapshot:");<a name="line.230"></a>
-<span class="sourceLineNo">231</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.231"></a>
-<span class="sourceLineNo">232</span><a name="line.232"></a>
-<span class="sourceLineNo">233</span>    SnapshotTestingUtils.confirmSnapshotValid(UTIL, snapshots.get(0), TABLE_NAME, TEST_FAM);<a name="line.233"></a>
-<span class="sourceLineNo">234</span>  }<a name="line.234"></a>
-<span class="sourceLineNo">235</span><a name="line.235"></a>
-<span class="sourceLineNo">236</span>  @Test (timeout=300000)<a name="line.236"></a>
-<span class="sourceLineNo">237</span>  public void testSnapshotFailsOnNonExistantTable() throws Exception {<a name="line.237"></a>
-<span class="sourceLineNo">238</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.238"></a>
-<span class="sourceLineNo">239</span>    // make sure we don't fail on listing snapshots<a name="line.239"></a>
-<span class="sourceLineNo">240</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.240"></a>
-<span class="sourceLineNo">241</span>    TableName tableName = TableName.valueOf("_not_a_table");<a name="line.241"></a>
-<span class="sourceLineNo">242</span><a name="line.242"></a>
-<span class="sourceLineNo">243</span>    // make sure the table doesn't exist<a name="line.243"></a>
-<span class="sourceLineNo">244</span>    boolean fail = false;<a name="line.244"></a>
-<span class="sourceLineNo">245</span>    do {<a name="line.245"></a>
-<span class="sourceLineNo">246</span>    try {<a name="line.246"></a>
-<span class="sourceLineNo">247</span>      admin.getTableDescriptor(tableName);<a name="line.247"></a>
-<span class="sourceLineNo">248</span>      fail = true;<a name="line.248"></a>
-<span class="sourceLineNo">249</span>      LOG.error("Table:" + tableName + " already exists, checking a new name");<a name="line.249"></a>
-<span class="sourceLineNo">250</span>      tableName = TableName.valueOf(tableName+"!");<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    } catch (TableNotFoundException e) {<a name="line.251"></a>
-<span class="sourceLineNo">252</span>      fail = false;<a name="line.252"></a>
-<span class="sourceLineNo">253</span>      }<a name="line.253"></a>
-<span class="sourceLineNo">254</span>    } while (fail);<a name="line.254"></a>
-<span class="sourceLineNo">255</span><a name="line.255"></a>
-<span class="sourceLineNo">256</span>    // snapshot the non-existant table<a name="line.256"></a>
-<span class="sourceLineNo">257</span>    try {<a name="line.257"></a>
-<span class="sourceLineNo">258</span>      admin.snapshot("fail", tableName, SnapshotDescription.Type.FLUSH);<a name="line.258"></a>
-<span class="sourceLineNo">259</span>      fail("Snapshot succeeded even though there is not table.");<a name="line.259"></a>
-<span class="sourceLineNo">260</span>    } catch (SnapshotCreationException e) {<a name="line.260"></a>
-<span class="sourceLineNo">261</span>      LOG.info("Correctly failed to snapshot a non-existant table:" + e.getMessage());<a name="line.261"></a>
-<span class="sourceLineNo">262</span>    }<a name="line.262"></a>
-<span class="sourceLineNo">263</span>  }<a name="line.263"></a>
-<span class="sourceLineNo">264</span><a name="line.264"></a>
-<span class="sourceLineNo">265</span>  @Test(timeout = 300000)<a name="line.265"></a>
-<span class="sourceLineNo">266</span>  public void testAsyncFlushSnapshot() throws Exception {<a name="line.266"></a>
-<span class="sourceLineNo">267</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.267"></a>
-<span class="sourceLineNo">268</span>    SnapshotDescription snapshot = SnapshotDescription.newBuilder().setName("asyncSnapshot")<a name="line.268"></a>
-<span class="sourceLineNo">269</span>        .setTable(TABLE_NAME.getNameAsString())<a name="line.269"></a>
-<span class="sourceLineNo">270</span>        .setType(SnapshotDescription.Type.FLUSH)<a name="line.270"></a>
-<span class="sourceLineNo">271</span>        .build();<a name="line.271"></a>
-<span class="sourceLineNo">272</span><a name="line.272"></a>
-<span class="sourceLineNo">273</span>    // take the snapshot async<a name="line.273"></a>
-<span class="sourceLineNo">274</span>    admin.takeSnapshotAsync(snapshot);<a name="line.274"></a>
-<span class="sourceLineNo">275</span><a name="line.275"></a>
-<span class="sourceLineNo">276</span>    // constantly loop, looking for the snapshot to complete<a name="line.276"></a>
-<span class="sourceLineNo">277</span>    HMaster master = UTIL.getMiniHBaseCluster().getMaster();<a name="line.277"></a>
-<span class="sourceLineNo">278</span>    SnapshotTestingUtils.waitForSnapshotToComplete(master, snapshot, 200);<a name="line.278"></a>
-<span class="sourceLineNo">279</span>    LOG.info(" === Async Snapshot Completed ===");<a name="line.279"></a>
-<span class="sourceLineNo">280</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.280"></a>
-<span class="sourceLineNo">281</span><a name="line.281"></a>
-<span class="sourceLineNo">282</span>    // make sure we get the snapshot<a name="line.282"></a>
-<span class="sourceLineNo">283</span>    SnapshotTestingUtils.assertOneSnapshotThatMatches(admin, snapshot);<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>  @Test (timeout=300000)<a name="line.286"></a>
-<span class="sourceLineNo">287</span>  public void testSnapshotStateAfterMerge() throws Exception {<a name="line.287"></a>
-<span class="sourceLineNo">288</span>    int numRows = DEFAULT_NUM_ROWS;<a name="line.288"></a>
-<span class="sourceLineNo">289</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.289"></a>
-<span class="sourceLineNo">290</span>    // make sure we don't fail on listing snapshots<a name="line.290"></a>
-<span class="sourceLineNo">291</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.291"></a>
-<span class="sourceLineNo">292</span>    // load the table so we have some data<a name="line.292"></a>
-<span class="sourceLineNo">293</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, numRows, TEST_FAM);<a name="line.293"></a>
-<span class="sourceLineNo">294</span><a name="line.294"></a>
-<span class="sourceLineNo">295</span>    // Take a snapshot<a name="line.295"></a>
-<span class="sourceLineNo">296</span>    String snapshotBeforeMergeName = "snapshotBeforeMerge";<a name="line.296"></a>
-<span class="sourceLineNo">297</span>    admin.snapshot(snapshotBeforeMergeName, TABLE_NAME, SnapshotDescription.Type.FLUSH);<a name="line.297"></a>
-<span class="sourceLineNo">298</span><a name="line.298"></a>
-<span class="sourceLineNo">299</span>    // Clone the table<a name="line.299"></a>
-<span class="sourceLineNo">300</span>    TableName cloneBeforeMergeName = TableName.valueOf("cloneBeforeMerge");<a name="line.300"></a>
-<span class="sourceLineNo">301</span>    admin.cloneSnapshot(snapshotBeforeMergeName, cloneBeforeMergeName);<a name="line.301"></a>
-<span class="sourceLineNo">302</span>    SnapshotTestingUtils.waitForTableToBeOnline(UTIL, cloneBeforeMergeName);<a name="line.302"></a>
-<span class="sourceLineNo">303</span><a name="line.303"></a>
-<span class="sourceLineNo">304</span>    // Merge two regions<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    List&lt;HRegionInfo&gt; regions = admin.getTableRegions(TABLE_NAME);<a name="line.305"></a>
-<span class="sourceLineNo">306</span>    Collections.sort(regions, new Comparator&lt;HRegionInfo&gt;() {<a name="line.306"></a>
-<span class="sourceLineNo">307</span>      public int compare(HRegionInfo r1, HRegionInfo r2) {<a name="line.307"></a>
-<span class="sourceLineNo">308</span>        return Bytes.compareTo(r1.getStartKey(), r2.getStartKey());<a name="line.308"></a>
-<span class="sourceLineNo">309</span>      }<a name="line.309"></a>
-<span class="sourceLineNo">310</span>    });<a name="line.310"></a>
-<span class="sourceLineNo">311</span><a name="line.311"></a>
-<span class="sourceLineNo">312</span>    int numRegions = admin.getTableRegions(TABLE_NAME).size();<a name="line.312"></a>
-<span class="sourceLineNo">313</span>    int numRegionsAfterMerge = numRegions - 2;<a name="line.313"></a>
-<span class="sourceLineNo">314</span>    admin.mergeRegions(regions.get(1).getEncodedNameAsBytes(),<a name="line.314"></a>
-<span class="sourceLineNo">315</span>        regions.get(2).getEncodedNameAsBytes(), true);<a name="line.315"></a>
-<span class="sourceLineNo">316</span>    admin.mergeRegions(regions.get(5).getEncodedNameAsBytes(),<a name="line.316"></a>
-<span class="sourceLineNo">317</span>        regions.get(6).getEncodedNameAsBytes(), true);<a name="line.317"></a>
-<span class="sourceLineNo">318</span><a name="line.318"></a>
-<span class="sourceLineNo">319</span>    // Verify that there's one region less<a name="line.319"></a>
-<span class="sourceLineNo">320</span>    waitRegionsAfterMerge(numRegionsAfterMerge);<a name="line.320"></a>
-<span class="sourceLineNo">321</span>    assertEquals(numRegionsAfterMerge, admin.getTableRegions(TABLE_NAME).size());<a name="line.321"></a>
-<span class="sourceLineNo">322</span><a name="line.322"></a>
-<span class="sourceLineNo">323</span>    // Clone the table<a name="line.323"></a>
-<span class="sourceLineNo">324</span>    TableName cloneAfterMergeName = TableName.valueOf("cloneAfterMerge");<a name="line.324"></a>
-<span class="sourceLineNo">325</span>    admin.cloneSnapshot(snapshotBeforeMergeName, cloneAfterMergeName);<a name="line.325"></a>
-<span class="sourceLineNo">326</span>    SnapshotTestingUtils.waitForTableToBeOnline(UTIL, cloneAfterMergeName);<a name="line.326"></a>
-<span class="sourceLineNo">327</span><a name="line.327"></a>
-<span class="sourceLineNo">328</span>    verifyRowCount(UTIL, TABLE_NAME, numRows);<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    verifyRowCount(UTIL, cloneBeforeMergeName, numRows);<a name="line.329"></a>
-<span class="sourceLineNo">330</span>    verifyRowCount(UTIL, cloneAfterMergeName, numRows);<a name="line.330"></a>
-<span class="sourceLineNo">331</span><a name="line.331"></a>
-<span class="sourceLineNo">332</span>    // test that we can delete the snapshot<a name="line.332"></a>
-<span class="sourceLineNo">333</span>    UTIL.deleteTable(cloneAfterMergeName);<a name="line.333"></a>
-<span class="sourceLineNo">334</span>    UTIL.deleteTable(cloneBeforeMergeName);<a name="line.334"></a>
-<span class="sourceLineNo">335</span>  }<a name="line.335"></a>
-<span class="sourceLineNo">336</span><a name="line.336"></a>
-<span class="sourceLineNo">337</span>  @Test (timeout=300000)<a name="line.337"></a>
-<span class="sourceLineNo">338</span>  public void testTakeSnapshotAfterMerge() throws Exception {<a name="line.338"></a>
-<span class="sourceLineNo">339</span>    int numRows = DEFAULT_NUM_ROWS;<a name="line.339"></a>
-<span class="sourceLineNo">340</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.340"></a>
-<span class="sourceLineNo">341</span>    // make sure we don't fail on listing snapshots<a name="line.341"></a>
-<span class="sourceLineNo">342</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.342"></a>
-<span class="sourceLineNo">343</span>    // load the table so we have some data<a name="line.343"></a>
-<span class="sourceLineNo">344</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, numRows, TEST_FAM);<a name="line.344"></a>
-<span class="sourceLineNo">345</span><a name="line.345"></a>
-<span class="sourceLineNo">346</span>    // Merge two regions<a name="line.346"></a>
-<span class="sourceLineNo">347</span>    List&lt;HRegionInfo&gt; regions = admin.getTableRegions(TABLE_NAME);<a name="line.347"></a>
-<span class="sourceLineNo">348</span>    Collections.sort(regions, new Comparator&lt;HRegionInfo&gt;() {<a name="line.348"></a>
-<span class="sourceLineNo">349</span>      public int compare(HRegionInfo r1, HRegionInfo r2) {<a name="line.349"></a>
-<span class="sourceLineNo">350</span>        return Bytes.compareTo(r1.getStartKey(), r2.getStartKey());<a name="line.350"></a>
-<span class="sourceLineNo">351</span>      }<a name="line.351"></a>
-<span class="sourceLineNo">352</span>    });<a name="line.352"></a>
-<span class="sourceLineNo">353</span><a name="line.353"></a>
-<span class="sourceLineNo">354</span>    int numRegions = admin.getTableRegions(TABLE_NAME).size();<a name="line.354"></a>
-<span class="sourceLineNo">355</span>    int numRegionsAfterMerge = numRegions - 2;<a name="line.355"></a>
-<span class="sourceLineNo">356</span>    admin.mergeRegions(regions.get(1).getEncodedNameAsBytes(),<a name="line.356"></a>
-<span class="sourceLineNo">357</span>        regions.get(2).getEncodedNameAsBytes(), true);<a name="line.357"></a>
-<span class="sourceLineNo">358</span>    admin.mergeRegions(regions.get(5).getEncodedNameAsBytes(),<a name="line.358"></a>
-<span class="sourceLineNo">359</span>        regions.get(6).getEncodedNameAsBytes(), true);<a name="line.359"></a>
-<span class="sourceLineNo">360</span><a name="line.360"></a>
-<span class="sourceLineNo">361</span>    waitRegionsAfterMerge(numRegionsAfterMerge);<a name="line.361"></a>
-<span class="sourceLineNo">362</span>    assertEquals(numRegionsAfterMerge, admin.getTableRegions(TABLE_NAME).size());<a name="line.362"></a>
-<span class="sourceLineNo">363</span><a name="line.363"></a>
-<span class="sourceLineNo">364</span>    // Take a snapshot<a name="line.364"></a>
-<span class="sourceLineNo">365</span>    String snapshotName = "snapshotAfterMerge";<a name="line.365"></a>
-<span class="sourceLineNo">366</span>    SnapshotTestingUtils.snapshot(admin, snapshotName, TABLE_NAME.getNameAsString(),<a name="line.366"></a>
-<span class="sourceLineNo">367</span>      SnapshotDescription.Type.FLUSH, 3);<a name="line.367"></a>
-<span class="sourceLineNo">368</span><a name="line.368"></a>
-<span class="sourceLineNo">369</span>    // Clone the table<a name="line.369"></a>
-<span class="sourceLineNo">370</span>    TableName cloneName = TableName.valueOf("cloneMerge");<a name="line.370"></a>
-<span class="sourceLineNo">371</span>    admin.cloneSnapshot(snapshotName, cloneName);<a name="line.371"></a>
-<span class="sourceLineNo">372</span>    SnapshotTestingUtils.waitForTableToBeOnline(UTIL, cloneName);<a name="line.372"></a>
-<span class="sourceLineNo">373</span><a name="line.373"></a>
-<span class="sourceLineNo">374</span>    verifyRowCount(UTIL, TABLE_NAME, numRows);<a name="line.374"></a>
-<span class="sourceLineNo">375</span>    verifyRowCount(UTIL, cloneName, numRows);<a name="line.375"></a>
-<span class="sourceLineNo">376</span><a name="line.376"></a>
-<span class="sourceLineNo">377</span>    // test that we can delete the snapshot<a name="line.377"></a>
-<span class="sourceLineNo">378</span>    UTIL.deleteTable(cloneName);<a name="line.378"></a>
-<span class="sourceLineNo">379</span>  }<a name="line.379"></a>
-<span class="sourceLineNo">380</span><a name="line.380"></a>
-<span class="sourceLineNo">381</span>  /**<a name="line.381"></a>
-<span class="sourceLineNo">382</span>   * Basic end-to-end test of simple-flush-based snapshots<a name="line.382"></a>
-<span class="sourceLineNo">383</span>   */<a name="line.383"></a>
-<span class="sourceLineNo">384</span>  @Test (timeout=300000)<a name="line.384"></a>
-<span class="sourceLineNo">385</span>  public void testFlushCreateListDestroy() throws Exception {<a name="line.385"></a>
-<span class="sourceLineNo">386</span>    LOG.debug("------- Starting Snapshot test -------------");<a name="line.386"></a>
-<span class="sourceLineNo">387</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.387"></a>
-<span class="sourceLineNo">388</span>    // make sure we don't fail on listing snapshots<a name="line.388"></a>
-<span class="sourceLineNo">389</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.389"></a>
-<span class="sourceLineNo">390</span>    // load the table so we have some data<a name="line.390"></a>
-<span class="sourceLineNo">391</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, DEFAULT_NUM_ROWS, TEST_FAM);<a name="line.391"></a>
-<span class="sourceLineNo">392</span><a name="line.392"></a>
-<span class="sourceLineNo">393</span>    String snapshotName = "flushSnapshotCreateListDestroy";<a name="line.393"></a>
-<span class="sourceLineNo">394</span>    FileSystem fs = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();<a name="line.394"></a>
-<span class="sourceLineNo">395</span>    Path rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();<a name="line.395"></a>
-<span class="sourceLineNo">396</span>    SnapshotTestingUtils.createSnapshotAndValidate(admin, TABLE_NAME, Bytes.toString(TEST_FAM),<a name="line.396"></a>
-<span class="sourceLineNo">397</span>      snapshotName, rootDir, fs, true);<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>  /**<a name="line.400"></a>
-<span class="sourceLineNo">401</span>   * Demonstrate that we reject snapshot requests if there is a snapshot already running on the<a name="line.401"></a>
-<span class="sourceLineNo">402</span>   * same table currently running and that concurrent snapshots on different tables can both<a name="line.402"></a>
-<span class="sourceLineNo">403</span>   * succeed concurretly.<a name="line.403"></a>
-<span class="sourceLineNo">404</span>   */<a name="line.404"></a>
-<span class="sourceLineNo">405</span>  @Test(timeout=300000)<a name="line.405"></a>
-<span class="sourceLineNo">406</span>  public void testConcurrentSnapshottingAttempts() throws IOException, InterruptedException {<a name="line.406"></a>
-<span class="sourceLineNo">407</span>    final TableName TABLE2_NAME = TableName.valueOf(TABLE_NAME + "2");<a name="line.407"></a>
-<span class="sourceLineNo">408</span><a name="line.408"></a>
-<span class="sourceLineNo">409</span>    int ssNum = 20;<a name="line.409"></a>
-<span class="sourceLineNo">410</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.410"></a>
-<span class="sourceLineNo">411</span>    // make sure we don't fail on listing snapshots<a name="line.411"></a>
-<span class="sourceLineNo">412</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.412"></a>
-<span class="sourceLineNo">413</span>    // create second testing table<a name="line.413"></a>
-<span class="sourceLineNo">414</span>    SnapshotTestingUtils.createTable(UTIL, TABLE2_NAME, TEST_FAM);<a name="line.414"></a>
-<span class="sourceLineNo">415</span>    // load the table so we have some data<a name="line.415"></a>
-<span class="sourceLineNo">416</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, DEFAULT_NUM_ROWS, TEST_FAM);<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    SnapshotTestingUtils.loadData(UTIL, TABLE2_NAME, DEFAULT_NUM_ROWS, TEST_FAM);<a name="line.417"></a>
-<span class="sourceLineNo">418</span><a name="line.418"></a>
-<span class="sourceLineNo">419</span>    final CountDownLatch toBeSubmitted = new CountDownLatch(ssNum);<a name="line.419"></a>
-<span class="sourceLineNo">420</span>    // We'll have one of these per thread<a name="line.420"></a>
-<span class="sourceLineNo">421</span>    class SSRunnable implements Runnable {<a name="line.421"></a>
-<span class="sourceLineNo">422</span>      SnapshotDescription ss;<a name="line.422"></a>
-<span class="sourceLineNo">423</span>      SSRunnable(SnapshotDescription ss) {<a name="line.423"></a>
-<span class="sourceLineNo">424</span>        this.ss = ss;<a name="line.424"></a>
-<span class="sourceLineNo">425</span>      }<a name="line.425"></a>
-<span class="sourceLineNo">426</span><a name="line.426"></a>
-<span class="sourceLineNo">427</span>      @Override<a name="line.427"></a>
-<span class="sourceLineNo">428</span>      public void run() {<a name="line.428"></a>
-<span class="sourceLineNo">429</span>        try {<a name="line.429"></a>
-<span class="sourceLineNo">430</span>          Admin admin = UTIL.getHBaseAdmin();<a name="line.430"></a>
-<span class="sourceLineNo">431</span>          LOG.info("Submitting snapshot request: " + ClientSnapshotDescriptionUtils.toString(ss));<a name="line.431"></a>
-<span class="sourceLineNo">432</span>          admin.takeSnapshotAsync(ss);<a name="line.432"></a>
-<span class="sourceLineNo">433</span>        } catch (Exception e) {<a name="line.433"></a>
-<span class="sourceLineNo">434</span>          LOG.info("Exception during snapshot request: " + ClientSnapshotDescriptionUtils.toString(<a name="line.434"></a>
-<span class="sourceLineNo">435</span>              ss)<a name="line.435"></a>
-<span class="sourceLineNo">436</span>              + ".  This is ok, we expect some", e);<a name="line.436"></a>
-<span class="sourceLineNo">437</span>        }<a name="line.437"></a>
-<span class="sourceLineNo">438</span>        LOG.info("Submitted snapshot request: " + ClientSnapshotDescriptionUtils.toString(ss));<a name="line.438"></a>
-<span class="sourceLineNo">439</span>        toBeSubmitted.countDown();<a name="line.439"></a>
-<span class="sourceLineNo">440</span>      }<a name="line.440"></a>
-<span class="sourceLineNo">441</span>    };<a name="line.441"></a>
-<span class="sourceLineNo">442</span><a name="line.442"></a>
-<span class="sourceLineNo">443</span>    // build descriptions<a name="line.443"></a>
-<span class="sourceLineNo">444</span>    SnapshotDescription[] descs = new SnapshotDescription[ssNum];<a name="line.444"></a>
-<span class="sourceLineNo">445</span>    for (int i = 0; i &lt; ssNum; i++) {<a name="line.445"></a>
-<span class="sourceLineNo">446</span>      SnapshotDescription.Builder builder = SnapshotDescription.newBuilder();<a name="line.446"></a>
-<span class="sourceLineNo">447</span>      builder.setTable(((i % 2) == 0 ? TABLE_NAME : TABLE2_NAME).getNameAsString());<a name="line.447"></a>
-<span class="sourceLineNo">448</span>      builder.setName("ss"+i);<a name="line.448"></a>
-<span class="sourceLineNo">449</span>      builder.setType(SnapshotDescription.Type.FLUSH);<a name="line.449"></a>
-<span class="sourceLineNo">450</span>      descs[i] = builder.build();<a name="line.450"></a>
-<span class="sourceLineNo">451</span>    }<a name="line.451"></a>
-<span class="sourceLineNo">452</span><a name="line.452"></a>
-<span class="sourceLineNo">453</span>    // kick each off its own thread<a name="line.453"></a>
-<span class="sourceLineNo">454</span>    for (int i=0 ; i &lt; ssNum; i++) {<a name="line.454"></a>
-<span class="sourceLineNo">455</span>      new Thread(new SSRunnable(descs[i])).start();<a name="line.455"></a>
-<span class="sourceLineNo">456</span>    }<a name="line.456"></a>
-<span class="sourceLineNo">457</span><a name="line.457"></a>
-<span class="sourceLineNo">458</span>    // wait until all have been submitted<a name="line.458"></a>
-<span class="sourceLineNo">459</span>    toBeSubmitted.await();<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>    // loop until all are done.<a name="line.461"></a>
-<span class="sourceLineNo">462</span>    while (true) {<a name="line.462"></a>
-<span class="sourceLineNo">463</span>      int doneCount = 0;<a name="line.463"></a>
-<span class="sourceLineNo">464</span>      for (SnapshotDescription ss : descs) {<a name="line.464"></a>
-<span class="sourceLineNo">465</span>        try {<a name="line.465"></a>
-<span class="sourceLineNo">466</span>          if (admin.isSnapshotFinished(ss)) {<a name="line.466"></a>
-<span class="sourceLineNo">467</span>            doneCount++;<a name="line.467"></a>
-<span class="sourceLineNo">468</span>          }<a name="line.468"></a>
-<span class="sourceLineNo">469</span>        } catch (Exception e) {<a name="line.469"></a>
-<span class="sourceLineNo">470</span>          LOG.warn("Got an exception when checking for snapshot " + ss.getName(), e);<a name="line.470"></a>
-<span class="sourceLineNo">471</span>          doneCount++;<a name="line.471"></a>
-<span class="sourceLineNo">472</span>        }<a name="line.472"></a>
-<span class="sourceLineNo">473</span>      }<a name="line.473"></a>
-<span class="sourceLineNo">474</span>      if (doneCount == descs.length) {<a name="line.474"></a>
-<span class="sourceLineNo">475</span>        break;<a name="line.475"></a>
-<span class="sourceLineNo">476</span>      }<a name="line.476"></a>
-<span class="sourceLineNo">477</span>      Thread.sleep(100);<a name="line.477"></a>
-<span class="sourceLineNo">478</span>    }<a name="line.478"></a>
-<span class="sourceLineNo">479</span><a name="line.479"></a>
-<span class="sourceLineNo">480</span>    // dump for debugging<a name="line.480"></a>
-<span class="sourceLineNo">481</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.481"></a>
-<span class="sourceLineNo">482</span><a name="line.482"></a>
-<span class="sourceLineNo">483</span>    List&lt;SnapshotDescription&gt; taken = admin.listSnapshots();<a name="line.483"></a>
-<span class="sourceLineNo">484</span>    int takenSize = taken.size();<a name="line.484"></a>
-<span class="sourceLineNo">485</span>    LOG.info("Taken " + takenSize + " snapshots:  " + taken);<a name="line.485"></a>
-<span class="sourceLineNo">486</span>    assertTrue("We expect at least 1 request to be rejected because of we concurrently" +<a name="line.486"></a>
-<span class="sourceLineNo">487</span>        " issued many requests", takenSize &lt; ssNum &amp;&amp; takenSize &gt; 0);<a name="line.487"></a>
-<span class="sourceLineNo">488</span><a name="line.488"></a>
-<span class="sourceLineNo">489</span>    // Verify that there's at least one snapshot per table<a name="line.489"></a>
-<span class="sourceLineNo">490</span>    int t1SnapshotsCount = 0;<a name="line.490"></a>
-<span class="sourceLineNo">491</span>    int t2SnapshotsCount = 0;<a name="line.491"></a>
-<span class="sourceLineNo">492</span>    for (SnapshotDescription ss : taken) {<a name="line.492"></a>
-<span class="sourceLineNo">493</span>      if (TableName.valueOf(ss.getTable()).equals(TABLE_NAME)) {<a name="line.493"></a>
-<span class="sourceLineNo">494</span>        t1SnapshotsCount++;<a name="line.494"></a>
-<span class="sourceLineNo">495</span>      } else if (TableName.valueOf(ss.getTable()).equals(TABLE2_NAME)) {<a name="line.495"></a>
-<span class="sourceLineNo">496</span>        t2SnapshotsCount++;<a name="line.496"></a>
-<span class="sourceLineNo">497</span>      }<a name="line.497"></a>
-<span class="sourceLineNo">498</span>    }<a name="line.498"></a>
-<span class="sourceLineNo">499</span>    assertTrue("We expect at least 1 snapshot of table1 ", t1SnapshotsCount &gt; 0);<a name="line.499"></a>
-<span class="sourceLineNo">500</span>    assertTrue("We expect at least 1 snapshot of table2 ", t2SnapshotsCount &gt; 0);<a name="line.500"></a>
-<span class="sourceLineNo">501</span><a name="line.501"></a>
-<span class="sourceLineNo">502</span>    UTIL.deleteTable(TABLE2_NAME);<a name="line.502"></a>
-<span class="sourceLineNo">503</span>  }<a name="line.503"></a>
-<span class="sourceLineNo">504</span><a name="line.504"></a>
-<span class="sourceLineNo">505</span>  private void waitRegionsAfterMerge(final long numRegionsAfterMerge)<a name="line.505"></a>
-<span class="sourceLineNo">506</span>      throws IOException, InterruptedException {<a name="line.506"></a>
-<span class="sourceLineNo">507</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.507"></a>
-<span class="sourceLineNo">508</span>    // Verify that there's one region less<a name="line.508"></a>
-<span class="sourceLineNo">509</span>    long startTime = System.currentTimeMillis();<a name="line.509"></a>
-<span class="sourceLineNo">510</span>    while (admin.getTableRegions(TABLE_NAME).size() != numRegionsAfterMerge) {<a name="line.510"></a>
-<span class="sourceLineNo">511</span>      // This may be flaky... if after 15sec the merge is not complete give up<a name="line.511"></a>
-<span class="sourceLineNo">512</span>      // it will fail in the assertEquals(numRegionsAfterMerge).<a name="line.512"></a>
-<span class="sourceLineNo">513</span>      if ((System.currentTimeMillis() - startTime) &gt; 15000)<a name="line.513"></a>
-<span class="sourceLineNo">514</span>        break;<a name="line.514"></a>
-<span class="sourceLineNo">515</span>      Thread.sleep(100);<a name="line.515"></a>
-<span class="sourceLineNo">516</span>    }<a name="line.516"></a>
-<span class="sourceLineNo">517</span>    SnapshotTestingUtils.waitForTableToBeOnline(UTIL, TABLE_NAME);<a name="line.517"></a>
-<span class="sourceLineNo">518</span>  }<a name="line.518"></a>
-<span class="sourceLineNo">519</span><a name="line.519"></a>
+<span class="sourceLineNo">223</span><a name="line.223"></a>
+<span class="sourceLineNo">224</span>    LOG.debug("Snapshot completed.");<a name="line.224"></a>
+<span class="sourceLineNo">225</span><a name="line.225"></a>
+<span class="sourceLineNo">226</span>    // make sure we have the snapshot<a name="line.226"></a>
+<span class="sourceLineNo">227</span>    List&lt;SnapshotDescription&gt; snapshots = SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,<a name="line.227"></a>
+<span class="sourceLineNo">228</span>      snapshot, TABLE_NAME);<a name="line.228"></a>
+<span class="sourceLineNo">229</span><a name="line.229"></a>
+<span class="sourceLineNo">230</span>    // make sure its a valid snapshot<a name="line.230"></a>
+<span class="sourceLineNo">231</span>    LOG.debug("FS state after snapshot:");<a name="line.231"></a>
+<span class="sourceLineNo">232</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.232"></a>
+<span class="sourceLineNo">233</span><a name="line.233"></a>
+<span class="sourceLineNo">234</span>    SnapshotTestingUtils.confirmSnapshotValid(UTIL, snapshots.get(0), TABLE_NAME, TEST_FAM);<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>  @Test (timeout=300000)<a name="line.237"></a>
+<span class="sourceLineNo">238</span>  public void testSnapshotFailsOnNonExistantTable() throws Exception {<a name="line.238"></a>
+<span class="sourceLineNo">239</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.239"></a>
+<span class="sourceLineNo">240</span>    // make sure we don't fail on listing snapshots<a name="line.240"></a>
+<span class="sourceLineNo">241</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.241"></a>
+<span class="sourceLineNo">242</span>    TableName tableName = TableName.valueOf("_not_a_table");<a name="line.242"></a>
+<span class="sourceLineNo">243</span><a name="line.243"></a>
+<span class="sourceLineNo">244</span>    // make sure the table doesn't exist<a name="line.244"></a>
+<span class="sourceLineNo">245</span>    boolean fail = false;<a name="line.245"></a>
+<span class="sourceLineNo">246</span>    do {<a name="line.246"></a>
+<span class="sourceLineNo">247</span>    try {<a name="line.247"></a>
+<span class="sourceLineNo">248</span>      admin.getTableDescriptor(tableName);<a name="line.248"></a>
+<span class="sourceLineNo">249</span>      fail = true;<a name="line.249"></a>
+<span class="sourceLineNo">250</span>      LOG.error("Table:" + tableName + " already exists, checking a new name");<a name="line.250"></a>
+<span class="sourceLineNo">251</span>      tableName = TableName.valueOf(tableName+"!");<a name="line.251"></a>
+<span class="sourceLineNo">252</span>    } catch (TableNotFoundException e) {<a name="line.252"></a>
+<span class="sourceLineNo">253</span>      fail = false;<a name="line.253"></a>
+<span class="sourceLineNo">254</span>      }<a name="line.254"></a>
+<span class="sourceLineNo">255</span>    } while (fail);<a name="line.255"></a>
+<span class="sourceLineNo">256</span><a name="line.256"></a>
+<span class="sourceLineNo">257</span>    // snapshot the non-existant table<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    try {<a name="line.258"></a>
+<span class="sourceLineNo">259</span>      admin.snapshot("fail", tableName, SnapshotDescription.Type.FLUSH);<a name="line.259"></a>
+<span class="sourceLineNo">260</span>      fail("Snapshot succeeded even though there is not table.");<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    } catch (SnapshotCreationException e) {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>      LOG.info("Correctly failed to snapshot a non-existant table:" + e.getMessage());<a name="line.262"></a>
+<span class="sourceLineNo">263</span>    }<a name="line.263"></a>
+<span class="sourceLineNo">264</span>  }<a name="line.264"></a>
+<span class="sourceLineNo">265</span><a name="line.265"></a>
+<span class="sourceLineNo">266</span>  @Test(timeout = 300000)<a name="line.266"></a>
+<span class="sourceLineNo">267</span>  public void testAsyncFlushSnapshot() throws Exception {<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.268"></a>
+<span class="sourceLineNo">269</span>    SnapshotDescription snapshot = SnapshotDescription.newBuilder().setName("asyncSnapshot")<a name="line.269"></a>
+<span class="sourceLineNo">270</span>        .setTable(TABLE_NAME.getNameAsString())<a name="line.270"></a>
+<span class="sourceLineNo">271</span>        .setType(SnapshotDescription.Type.FLUSH)<a name="line.271"></a>
+<span class="sourceLineNo">272</span>        .build();<a name="line.272"></a>
+<span class="sourceLineNo">273</span><a name="line.273"></a>
+<span class="sourceLineNo">274</span>    // take the snapshot async<a name="line.274"></a>
+<span class="sourceLineNo">275</span>    admin.takeSnapshotAsync(snapshot);<a name="line.275"></a>
+<span class="sourceLineNo">276</span><a name="line.276"></a>
+<span class="sourceLineNo">277</span>    // constantly loop, looking for the snapshot to complete<a name="line.277"></a>
+<span class="sourceLineNo">278</span>    HMaster master = UTIL.getMiniHBaseCluster().getMaster();<a name="line.278"></a>
+<span class="sourceLineNo">279</span>    SnapshotTestingUtils.waitForSnapshotToComplete(master, snapshot, 200);<a name="line.279"></a>
+<span class="sourceLineNo">280</span>    LOG.info(" === Async Snapshot Completed ===");<a name="line.280"></a>
+<span class="sourceLineNo">281</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.281"></a>
+<span class="sourceLineNo">282</span><a name="line.282"></a>
+<span class="sourceLineNo">283</span>    // make sure we get the snapshot<a name="line.283"></a>
+<span class="sourceLineNo">284</span>    SnapshotTestingUtils.assertOneSnapshotThatMatches(admin, snapshot);<a name="line.284"></a>
+<span class="sourceLineNo">285</span>  }<a name="line.285"></a>
+<span class="sourceLineNo">286</span><a name="line.286"></a>
+<span class="sourceLineNo">287</span>  @Test (timeout=300000)<a name="line.287"></a>
+<span class="sourceLineNo">288</span>  public void testSnapshotStateAfterMerge() throws Exception {<a name="line.288"></a>
+<span class="sourceLineNo">289</span>    int numRows = DEFAULT_NUM_ROWS;<a name="line.289"></a>
+<span class="sourceLineNo">290</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.290"></a>
+<span class="sourceLineNo">291</span>    // make sure we don't fail on listing snapshots<a name="line.291"></a>
+<span class="sourceLineNo">292</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.292"></a>
+<span class="sourceLineNo">293</span>    // load the table so we have some data<a name="line.293"></a>
+<span class="sourceLineNo">294</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, numRows, TEST_FAM);<a name="line.294"></a>
+<span class="sourceLineNo">295</span><a name="line.295"></a>
+<span class="sourceLineNo">296</span>    // Take a snapshot<a name="line.296"></a>
+<span class="sourceLineNo">297</span>    String snapshotBeforeMergeName = "snapshotBeforeMerge";<a name="line.297"></a>
+<span class="sourceLineNo">298</span>    admin.snapshot(snapshotBeforeMergeName, TABLE_NAME, SnapshotDescription.Type.FLUSH);<a name="line.298"></a>
+<span class="sourceLineNo">299</span><a name="line.299"></a>
+<span class="sourceLineNo">300</span>    // Clone the table<a name="line.300"></a>
+<span class="sourceLineNo">301</span>    TableName cloneBeforeMergeName = TableName.valueOf("cloneBeforeMerge");<a name="line.301"></a>
+<span class="sourceLineNo">302</span>    admin.cloneSnapshot(snapshotBeforeMergeName, cloneBeforeMergeName);<a name="line.302"></a>
+<span class="sourceLineNo">303</span>    SnapshotTestingUtils.waitForTableToBeOnline(UTIL, cloneBeforeMergeName);<a name="line.303"></a>
+<span class="sourceLineNo">304</span><a name="line.304"></a>
+<span class="sourceLineNo">305</span>    // Merge two regions<a name="line.305"></a>
+<span class="sourceLineNo">306</span>    List&lt;HRegionInfo&gt; regions = admin.getTableRegions(TABLE_NAME);<a name="line.306"></a>
+<span class="sourceLineNo">307</span>    Collections.sort(regions, new Comparator&lt;HRegionInfo&gt;() {<a name="line.307"></a>
+<span class="sourceLineNo">308</span>      public int compare(HRegionInfo r1, HRegionInfo r2) {<a name="line.308"></a>
+<span class="sourceLineNo">309</span>        return Bytes.compareTo(r1.getStartKey(), r2.getStartKey());<a name="line.309"></a>
+<span class="sourceLineNo">310</span>      }<a name="line.310"></a>
+<span class="sourceLineNo">311</span>    });<a name="line.311"></a>
+<span class="sourceLineNo">312</span><a name="line.312"></a>
+<span class="sourceLineNo">313</span>    int numRegions = admin.getTableRegions(TABLE_NAME).size();<a name="line.313"></a>
+<span class="sourceLineNo">314</span>    int numRegionsAfterMerge = numRegions - 2;<a name="line.314"></a>
+<span class="sourceLineNo">315</span>    admin.mergeRegions(regions.get(1).getEncodedNameAsBytes(),<a name="line.315"></a>
+<span class="sourceLineNo">316</span>        regions.get(2).getEncodedNameAsBytes(), true);<a name="line.316"></a>
+<span class="sourceLineNo">317</span>    admin.mergeRegions(regions.get(5).getEncodedNameAsBytes(),<a name="line.317"></a>
+<span class="sourceLineNo">318</span>        regions.get(6).getEncodedNameAsBytes(), true);<a name="line.318"></a>
+<span class="sourceLineNo">319</span><a name="line.319"></a>
+<span class="sourceLineNo">320</span>    // Verify that there's one region less<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    waitRegionsAfterMerge(numRegionsAfterMerge);<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    assertEquals(numRegionsAfterMerge, admin.getTableRegions(TABLE_NAME).size());<a name="line.322"></a>
+<span class="sourceLineNo">323</span><a name="line.323"></a>
+<span class="sourceLineNo">324</span>    // Clone the table<a name="line.324"></a>
+<span class="sourceLineNo">325</span>    TableName cloneAfterMergeName = TableName.valueOf("cloneAfterMerge");<a name="line.325"></a>
+<span class="sourceLineNo">326</span>    admin.cloneSnapshot(snapshotBeforeMergeName, cloneAfterMergeName);<a name="line.326"></a>
+<span class="sourceLineNo">327</span>    SnapshotTestingUtils.waitForTableToBeOnline(UTIL, cloneAfterMergeName);<a name="line.327"></a>
+<span class="sourceLineNo">328</span><a name="line.328"></a>
+<span class="sourceLineNo">329</span>    verifyRowCount(UTIL, TABLE_NAME, numRows);<a name="line.329"></a>
+<span class="sourceLineNo">330</span>    verifyRowCount(UTIL, cloneBeforeMergeName, numRows);<a name="line.330"></a>
+<span class="sourceLineNo">331</span>    verifyRowCount(UTIL, cloneAfterMergeName, numRows);<a name="line.331"></a>
+<span class="sourceLineNo">332</span><a name="line.332"></a>
+<span class="sourceLineNo">333</span>    // test that we can delete the snapshot<a name="line.333"></a>
+<span class="sourceLineNo">334</span>    UTIL.deleteTable(cloneAfterMergeName);<a name="line.334"></a>
+<span class="sourceLineNo">335</span>    UTIL.deleteTable(cloneBeforeMergeName);<a name="line.335"></a>
+<span class="sourceLineNo">336</span>  }<a name="line.336"></a>
+<span class="sourceLineNo">337</span><a name="line.337"></a>
+<span class="sourceLineNo">338</span>  @Test (timeout=300000)<a name="line.338"></a>
+<span class="sourceLineNo">339</span>  public void testTakeSnapshotAfterMerge() throws Exception {<a name="line.339"></a>
+<span class="sourceLineNo">340</span>    int numRows = DEFAULT_NUM_ROWS;<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.341"></a>
+<span class="sourceLineNo">342</span>    // make sure we don't fail on listing snapshots<a name="line.342"></a>
+<span class="sourceLineNo">343</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.343"></a>
+<span class="sourceLineNo">344</span>    // load the table so we have some data<a name="line.344"></a>
+<span class="sourceLineNo">345</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, numRows, TEST_FAM);<a name="line.345"></a>
+<span class="sourceLineNo">346</span><a name="line.346"></a>
+<span class="sourceLineNo">347</span>    // Merge two regions<a name="line.347"></a>
+<span class="sourceLineNo">348</span>    List&lt;HRegionInfo&gt; regions = admin.getTableRegions(TABLE_NAME);<a name="line.348"></a>
+<span class="sourceLineNo">349</span>    Collections.sort(regions, new Comparator&lt;HRegionInfo&gt;() {<a name="line.349"></a>
+<span class="sourceLineNo">350</span>      public int compare(HRegionInfo r1, HRegionInfo r2) {<a name="line.350"></a>
+<span class="sourceLineNo">351</span>        return Bytes.compareTo(r1.getStartKey(), r2.getStartKey());<a name="line.351"></a>
+<span class="sourceLineNo">352</span>      }<a name="line.352"></a>
+<span class="sourceLineNo">353</span>    });<a name="line.353"></a>
+<span class="sourceLineNo">354</span><a name="line.354"></a>
+<span class="sourceLineNo">355</span>    int numRegions = admin.getTableRegions(TABLE_NAME).size();<a name="line.355"></a>
+<span class="sourceLineNo">356</span>    int numRegionsAfterMerge = numRegions - 2;<a name="line.356"></a>
+<span class="sourceLineNo">357</span>    admin.mergeRegions(regions.get(1).getEncodedNameAsBytes(),<a name="line.357"></a>
+<span class="sourceLineNo">358</span>        regions.get(2).getEncodedNameAsBytes(), true);<a name="line.358"></a>
+<span class="sourceLineNo">359</span>    admin.mergeRegions(regions.get(5).getEncodedNameAsBytes(),<a name="line.359"></a>
+<span class="sourceLineNo">360</span>        regions.get(6).getEncodedNameAsBytes(), true);<a name="line.360"></a>
+<span class="sourceLineNo">361</span><a name="line.361"></a>
+<span class="sourceLineNo">362</span>    waitRegionsAfterMerge(numRegionsAfterMerge);<a name="line.362"></a>
+<span class="sourceLineNo">363</span>    assertEquals(numRegionsAfterMerge, admin.getTableRegions(TABLE_NAME).size());<a name="line.363"></a>
+<span class="sourceLineNo">364</span><a name="line.364"></a>
+<span class="sourceLineNo">365</span>    // Take a snapshot<a name="line.365"></a>
+<span class="sourceLineNo">366</span>    String snapshotName = "snapshotAfterMerge";<a name="line.366"></a>
+<span class="sourceLineNo">367</span>    SnapshotTestingUtils.snapshot(admin, snapshotName, TABLE_NAME.getNameAsString(),<a name="line.367"></a>
+<span class="sourceLineNo">368</span>      SnapshotDescription.Type.FLUSH, 3);<a name="line.368"></a>
+<span class="sourceLineNo">369</span><a name="line.369"></a>
+<span class="sourceLineNo">370</span>    // Clone the table<a name="line.370"></a>
+<span class="sourceLineNo">371</span>    TableName cloneName = TableName.valueOf("cloneMerge");<a name="line.371"></a>
+<span class="sourceLineNo">372</span>    admin.cloneSnapshot(snapshotName, cloneName);<a name="line.372"></a>
+<span class="sourceLineNo">373</span>    SnapshotTestingUtils.waitForTableToBeOnline(UTIL, cloneName);<a name="line.373"></a>
+<span class="sourceLineNo">374</span><a name="line.374"></a>
+<span class="sourceLineNo">375</span>    verifyRowCount(UTIL, TABLE_NAME, numRows);<a name="line.375"></a>
+<span class="sourceLineNo">376</span>    verifyRowCount(UTIL, cloneName, numRows);<a name="line.376"></a>
+<span class="sourceLineNo">377</span><a name="line.377"></a>
+<span class="sourceLineNo">378</span>    // test that we can delete the snapshot<a name="line.378"></a>
+<span class="sourceLineNo">379</span>    UTIL.deleteTable(cloneName);<a name="line.379"></a>
+<span class="sourceLineNo">380</span>  }<a name="line.380"></a>
+<span class="sourceLineNo">381</span><a name="line.381"></a>
+<span class="sourceLineNo">382</span>  /**<a name="line.382"></a>
+<span class="sourceLineNo">383</span>   * Basic end-to-end test of simple-flush-based snapshots<a name="line.383"></a>
+<span class="sourceLineNo">384</span>   */<a name="line.384"></a>
+<span class="sourceLineNo">385</span>  @Test (timeout=300000)<a name="line.385"></a>
+<span class="sourceLineNo">386</span>  public void testFlushCreateListDestroy() throws Exception {<a name="line.386"></a>
+<span class="sourceLineNo">387</span>    LOG.debug("------- Starting Snapshot test -------------");<a name="line.387"></a>
+<span class="sourceLineNo">388</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.388"></a>
+<span class="sourceLineNo">389</span>    // make sure we don't fail on listing snapshots<a name="line.389"></a>
+<span class="sourceLineNo">390</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.390"></a>
+<span class="sourceLineNo">391</span>    // load the table so we have some data<a name="line.391"></a>
+<span class="sourceLineNo">392</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, DEFAULT_NUM_ROWS, TEST_FAM);<a name="line.392"></a>
+<span class="sourceLineNo">393</span><a name="line.393"></a>
+<span class="sourceLineNo">394</span>    String snapshotName = "flushSnapshotCreateListDestroy";<a name="line.394"></a>
+<span class="sourceLineNo">395</span>    FileSystem fs = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();<a name="line.395"></a>
+<span class="sourceLineNo">396</span>    Path rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();<a name="line.396"></a>
+<span class="sourceLineNo">397</span>    SnapshotTestingUtils.createSnapshotAndValidate(admin, TABLE_NAME, Bytes.toString(TEST_FAM),<a name="line.397"></a>
+<span class="sourceLineNo">398</span>      snapshotName, rootDir, fs, true);<a name="line.398"></a>
+<span class="sourceLineNo">399</span>  }<a name="line.399"></a>
+<span class="sourceLineNo">400</span><a name="line.400"></a>
+<span class="sourceLineNo">401</span>  /**<a name="line.401"></a>
+<span class="sourceLineNo">402</span>   * Demonstrate that we reject snapshot requests if there is a snapshot already running on the<a name="line.402"></a>
+<span class="sourceLineNo">403</span>   * same table currently running and that concurrent snapshots on different tables can both<a name="line.403"></a>
+<span class="sourceLineNo">404</span>   * succeed concurretly.<a name="line.404"></a>
+<span class="sourceLineNo">405</span>   */<a name="line.405"></a>
+<span class="sourceLineNo">406</span>  @Test(timeout=300000)<a name="line.406"></a>
+<span class="sourceLineNo">407</span>  public void testConcurrentSnapshottingAttempts() throws IOException, InterruptedException {<a name="line.407"></a>
+<span class="sourceLineNo">408</span>    final TableName TABLE2_NAME = TableName.valueOf(TABLE_NAME + "2");<a name="line.408"></a>
+<span class="sourceLineNo">409</span><a name="line.409"></a>
+<span class="sourceLineNo">410</span>    int ssNum = 20;<a name="line.410"></a>
+<span class="sourceLineNo">411</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.411"></a>
+<span class="sourceLineNo">412</span>    // make sure we don't fail on listing snapshots<a name="line.412"></a>
+<span class="sourceLineNo">413</span>    SnapshotTestingUtils.assertNoSnapshots(admin);<a name="line.413"></a>
+<span class="sourceLineNo">414</span>    // create second testing table<a name="line.414"></a>
+<span class="sourceLineNo">415</span>    SnapshotTestingUtils.createTable(UTIL, TABLE2_NAME, TEST_FAM);<a name="line.415"></a>
+<span class="sourceLineNo">416</span>    // load the table so we have some data<a name="line.416"></a>
+<span class="sourceLineNo">417</span>    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, DEFAULT_NUM_ROWS, TEST_FAM);<a name="line.417"></a>
+<span class="sourceLineNo">418</span>    SnapshotTestingUtils.loadData(UTIL, TABLE2_NAME, DEFAULT_NUM_ROWS, TEST_FAM);<a name="line.418"></a>
+<span class="sourceLineNo">419</span><a name="line.419"></a>
+<span class="sourceLineNo">420</span>    final CountDownLatch toBeSubmitted = new CountDownLatch(ssNum);<a name="line.420"></a>
+<span class="sourceLineNo">421</span>    // We'll have one of these per thread<a name="line.421"></a>
+<span class="sourceLineNo">422</span>    class SSRunnable implements Runnable {<a name="line.422"></a>
+<span class="sourceLineNo">423</span>      SnapshotDescription ss;<a name="line.423"></a>
+<span class="sourceLineNo">424</span>      SSRunnable(SnapshotDescription ss) {<a name="line.424"></a>
+<span class="sourceLineNo">425</span>        this.ss = ss;<a name="line.425"></a>
+<span class="sourceLineNo">426</span>      }<a name="line.426"></a>
+<span class="sourceLineNo">427</span><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>          Admin admin = UTIL.getHBaseAdmin();<a name="line.431"></a>
+<span class="sourceLineNo">432</span>          LOG.info("Submitting snapshot request: " + ClientSnapshotDescriptionUtils.toString(ss));<a name="line.432"></a>
+<span class="sourceLineNo">433</span>          admin.takeSnapshotAsync(ss);<a name="line.433"></a>
+<span class="sourceLineNo">434</span>        } catch (Exception e) {<a name="line.434"></a>
+<span class="sourceLineNo">435</span>          LOG.info("Exception during snapshot request: " + ClientSnapshotDescriptionUtils.toString(<a name="line.435"></a>
+<span class="sourceLineNo">436</span>              ss)<a name="line.436"></a>
+<span class="sourceLineNo">437</span>              + ".  This is ok, we expect some", e);<a name="line.437"></a>
+<span class="sourceLineNo">438</span>        }<a name="line.438"></a>
+<span class="sourceLineNo">439</span>        LOG.info("Submitted snapshot request: " + ClientSnapshotDescriptionUtils.toString(ss));<a name="line.439"></a>
+<span class="sourceLineNo">440</span>        toBeSubmitted.countDown();<a name="line.440"></a>
+<span class="sourceLineNo">441</span>      }<a name="line.441"></a>
+<span class="sourceLineNo">442</span>    };<a name="line.442"></a>
+<span class="sourceLineNo">443</span><a name="line.443"></a>
+<span class="sourceLineNo">444</span>    // build descriptions<a name="line.444"></a>
+<span class="sourceLineNo">445</span>    SnapshotDescription[] descs = new SnapshotDescription[ssNum];<a name="line.445"></a>
+<span class="sourceLineNo">446</span>    for (int i = 0; i &lt; ssNum; i++) {<a name="line.446"></a>
+<span class="sourceLineNo">447</span>      SnapshotDescription.Builder builder = SnapshotDescription.newBuilder();<a name="line.447"></a>
+<span class="sourceLineNo">448</span>      builder.setTable(((i % 2) == 0 ? TABLE_NAME : TABLE2_NAME).getNameAsString());<a name="line.448"></a>
+<span class="sourceLineNo">449</span>      builder.setName("ss"+i);<a name="line.449"></a>
+<span class="sourceLineNo">450</span>      builder.setType(SnapshotDescription.Type.FLUSH);<a name="line.450"></a>
+<span class="sourceLineNo">451</span>      descs[i] = builder.build();<a name="line.451"></a>
+<span class="sourceLineNo">452</span>    }<a name="line.452"></a>
+<span class="sourceLineNo">453</span><a name="line.453"></a>
+<span class="sourceLineNo">454</span>    // kick each off its own thread<a name="line.454"></a>
+<span class="sourceLineNo">455</span>    for (int i=0 ; i &lt; ssNum; i++) {<a name="line.455"></a>
+<span class="sourceLineNo">456</span>      new Thread(new SSRunnable(descs[i])).start();<a name="line.456"></a>
+<span class="sourceLineNo">457</span>    }<a name="line.457"></a>
+<span class="sourceLineNo">458</span><a name="line.458"></a>
+<span class="sourceLineNo">459</span>    // wait until all have been submitted<a name="line.459"></a>
+<span class="sourceLineNo">460</span>    toBeSubmitted.await();<a name="line.460"></a>
+<span class="sourceLineNo">461</span><a name="line.461"></a>
+<span class="sourceLineNo">462</span>    // loop until all are done.<a name="line.462"></a>
+<span class="sourceLineNo">463</span>    while (true) {<a name="line.463"></a>
+<span class="sourceLineNo">464</span>      int doneCount = 0;<a name="line.464"></a>
+<span class="sourceLineNo">465</span>      for (SnapshotDescription ss : descs) {<a name="line.465"></a>
+<span class="sourceLineNo">466</span>        try {<a name="line.466"></a>
+<span class="sourceLineNo">467</span>          if (admin.isSnapshotFinished(ss)) {<a name="line.467"></a>
+<span class="sourceLineNo">468</span>            doneCount++;<a name="line.468"></a>
+<span class="sourceLineNo">469</span>          }<a name="line.469"></a>
+<span class="sourceLineNo">470</span>        } catch (Exception e) {<a name="line.470"></a>
+<span class="sourceLineNo">471</span>          LOG.warn("Got an exception when checking for snapshot " + ss.getName(), e);<a name="line.471"></a>
+<span class="sourceLineNo">472</span>          doneCount++;<a name="line.472"></a>
+<span class="sourceLineNo">473</span>        }<a name="line.473"></a>
+<span class="sourceLineNo">474</span>      }<a name="line.474"></a>
+<span class="sourceLineNo">475</span>      if (doneCount == descs.length) {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>        break;<a name="line.476"></a>
+<span class="sourceLineNo">477</span>      }<a name="line.477"></a>
+<span class="sourceLineNo">478</span>      Thread.sleep(100);<a name="line.478"></a>
+<span class="sourceLineNo">479</span>    }<a name="line.479"></a>
+<span class="sourceLineNo">480</span><a name="line.480"></a>
+<span class="sourceLineNo">481</span>    // dump for debugging<a name="line.481"></a>
+<span class="sourceLineNo">482</span>    UTIL.getHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG);<a name="line.482"></a>
+<span class="sourceLineNo">483</span><a name="line.483"></a>
+<span class="sourceLineNo">484</span>    List&lt;SnapshotDescription&gt; taken = admin.listSnapshots();<a name="line.484"></a>
+<span class="sourceLineNo">485</span>    int takenSize = taken.size();<a name="line.485"></a>
+<span class="sourceLineNo">486</span>    LOG.info("Taken " + takenSize + " snapshots:  " + taken);<a name="line.486"></a>
+<span class="sourceLineNo">487</span>    assertTrue("We expect at least 1 request to be rejected because of we concurrently" +<a name="line.487"></a>
+<span class="sourceLineNo">488</span>        " issued many requests", takenSize &lt; ssNum &amp;&amp; takenSize &gt; 0);<a name="line.488"></a>
+<span class="sourceLineNo">489</span><a name="line.489"></a>
+<span class="sourceLineNo">490</span>    // Verify that there's at least one snapshot per table<a name="line.490"></a>
+<span class="sourceLineNo">491</span>    int t1SnapshotsCount = 0;<a name="line.491"></a>
+<span class="sourceLineNo">492</span>    int t2SnapshotsCount = 0;<a name="line.492"></a>
+<span class="sourceLineNo">493</span>    for (SnapshotDescription ss : taken) {<a name="line.493"></a>
+<span class="sourceLineNo">494</span>      if (TableName.valueOf(ss.getTable()).equals(TABLE_NAME)) {<a name="line.494"></a>
+<span class="sourceLineNo">495</span>        t1SnapshotsCount++;<a name="line.495"></a>
+<span class="sourceLineNo">496</span>      } else if (TableName.valueOf(ss.getTable()).equals(TABLE2_NAME)) {<a name="line.496"></a>
+<span class="sourceLineNo">497</span>        t2SnapshotsCount++;<a name="line.497"></a>
+<span class="sourceLineNo">498</span>      }<a name="line.498"></a>
+<span class="sourceLineNo">499</span>    }<a name="line.499"></a>
+<span class="sourceLineNo">500</span>    assertTrue("We expect at least 1 snapshot of table1 ", t1SnapshotsCount &gt; 0);<a name="line.500"></a>
+<span class="sourceLineNo">501</span>    assertTrue("We expect at least 1 snapshot of table2 ", t2SnapshotsCount &gt; 0);<a name="line.501"></a>
+<span class="sourceLineNo">502</span><a name="line.502"></a>
+<span class="sourceLineNo">503</span>    UTIL.deleteTable(TABLE2_NAME);<a name="line.503"></a>
+<span class="sourceLineNo">504</span>  }<a name="line.504"></a>
+<span class="sourceLineNo">505</span><a name="line.505"></a>
+<span class="sourceLineNo">506</span>  private void waitRegionsAfterMerge(final long numRegionsAfterMerge)<a name="line.506"></a>
+<span class="sourceLineNo">507</span>      throws IOException, InterruptedException {<a name="line.507"></a>
+<span class="sourceLineNo">508</span>    Admin admin = UTIL.getHBaseAdmin();<a name="line.508"></a>
+<span class="sourceLineNo">509</span>    // Verify that there's one region less<a name="line.509"></a>
+<span class="sourceLineNo">510</span>    long startTime = System.currentTimeMillis();<a name="line.510"></a>
+<span class="sourceLineNo">511</span>    while (admin.getTableRegions(TABLE_NAME).size() != numRegionsAfterMerge) {<a name="line.511"></a>
+<span class="sourceLineNo">512</span>      // This may be flaky... if after 15sec the merge is not complete give up<a name="line.512"></a>
+<span class="sourceLineNo">513</span>      // it will fail in the assertEquals(numRegionsAfterMerge).<a name="line.513"></a>
+<span class="sourceLineNo">514</span>      if ((System.currentTimeMillis() - startTime) &gt; 15000)<a name="line.514"></a>
+<span class="sourceLineNo">515</span>        break;<a name="line.515"></a>
+<span class="sourceLineNo">516</span>      Thread.sleep(100);<a name="line.516"></a>
+<span class="sourceLineNo">517</span>    }<a name="line.517"></a>
+<span class="sourceLineNo">518</span>    SnapshotTestingUtils.waitForTableToBeOnline(UTIL, TABLE_NAME);<a name="line.518"></a>
+<span class="sourceLineNo">519</span>  }<a name="line.519"></a>
 <span class="sourceLineNo">520</span><a name="line.520"></a>
-<span class="sourceLineNo">521</span>  protected void verifyRowCount(final HBaseTestingUtility util, final TableName tableName,<a name="line.521"></a>
-<span class="sourceLineNo">522</span>      long expectedRows) throws IOException {<a name="line.522"></a>
-<span class="sourceLineNo">523</span>    SnapshotTestingUtils.verifyRowCount(util, tableName, expectedRows);<a name="line.523"></a>
-<span class="sourceLineNo">524</span>  }<a name="line.524"></a>
-<span class="sourceLineNo">525</span><a name="line.525"></a>
-<span class="sourceLineNo">526</span>  protected int countRows(final Table table, final byte[]... families) throws IOException {<a name="line.526"></a>
-<span class="sourceLineNo">527</span>    return UTIL.countRows(table, families);<a name="line.527"></a>
-<span class="sourceLineNo">528</span>  }<a name="line.528"></a>
-<span class="sourceLineNo">529</span>}<a name="line.529"></a>
+<span class="sourceLineNo">521</span><a name="line.521"></a>
+<span class="sourceLineNo">522</span>  protected void verifyRowCount(final HBaseTestingUtility util, final TableName tableName,<a name="line.522"></a>
+<span class="sourceLineNo">523</span>      long expectedRows) throws IOException {<a name="line.523"></a>
+<span class="sourceLineNo">524</span>    SnapshotTestingUtils.verifyRowCount(util, tableName, expectedRows);<a name="line.524"></a>
+<span class="sourceLineNo">525</span>  }<a name="line.525"></a>
+<span class="sourceLineNo">526</span><a name="line.526"></a>
+<span class="sourceLineNo">527</span>  protected int countRows(final Table table, final byte[]... families) throws IOException {<a name="line.527"></a>
+<span class="sourceLineNo">528</span>    return UTIL.countRows(table, families);<a name="line.528"></a>
+<span class="sourceLineNo">529</span>  }<a name="line.529"></a>
+<span class="sourceLineNo">530</span>}<a name="line.530"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/736088b3/xref-test/allclasses-frame.html
----------------------------------------------------------------------
diff --git a/xref-test/allclasses-frame.html b/xref-test/allclasses-frame.html
index 492f0de..7f456de 100644
--- a/xref-test/allclasses-frame.html
+++ b/xref-test/allclasses-frame.html
@@ -2568,6 +2568,9 @@
 				<a href="org/apache/hadoop/hbase/regionserver/TestColumnSeeking.html" target="classFrame">TestColumnSeeking</a>
 			</li>
 						<li>
+				<a href="org/apache/hadoop/hbase/io/hfile/TestCombinedBlockCache.html" target="classFrame">TestCombinedBlockCache</a>
+			</li>
+						<li>
 				<a href="org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.html" target="classFrame">TestCompactSplitThread</a>
 			</li>
 						<li>


Mime
View raw message