http://git-wip-us.apache.org/repos/asf/hbase-site/blob/a8b6ee53/testdevapidocs/src-html/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.CPRegionServerObserver.html
----------------------------------------------------------------------
diff --git 
a/testdevapidocs/src-html/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.CPRegionServerObserver.html
 
b/testdevapidocs/src-html/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.CPRegionServerObserver.html
index 258fc2b..676ae61 100644
--- 
a/testdevapidocs/src-html/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.CPRegionServerObserver.html
+++ 
b/testdevapidocs/src-html/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.CPRegionServerObserver.html
@@ -80,323 +80,323 @@
 <span class="sourceLineNo">072</span>import 
org.apache.hadoop.hbase.quotas.MasterQuotaManager;<a name="line.72"></a>
 <span class="sourceLineNo">073</span>import 
org.apache.hadoop.hbase.quotas.QuotaExceededException;<a name="line.73"></a>
 <span class="sourceLineNo">074</span>import 
org.apache.hadoop.hbase.quotas.QuotaUtil;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>import 
org.apache.hadoop.hbase.regionserver.Store;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>import 
org.apache.hadoop.hbase.regionserver.StoreFile;<a name="line.76"></a>
-<span class="sourceLineNo">077</span>import 
org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker;<a 
name="line.77"></a>
-<span class="sourceLineNo">078</span>import 
org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest;<a 
name="line.78"></a>
-<span class="sourceLineNo">079</span>import 
org.apache.hadoop.hbase.snapshot.RestoreSnapshotException;<a name="line.79"></a>
-<span class="sourceLineNo">080</span>import 
org.apache.hadoop.hbase.testclassification.MediumTests;<a name="line.80"></a>
-<span class="sourceLineNo">081</span>import 
org.apache.hadoop.hbase.util.Bytes;<a name="line.81"></a>
-<span class="sourceLineNo">082</span>import 
org.apache.hadoop.hbase.util.FSUtils;<a name="line.82"></a>
-<span class="sourceLineNo">083</span>import 
org.apache.hadoop.hbase.util.Threads;<a name="line.83"></a>
-<span class="sourceLineNo">084</span>import 
org.apache.zookeeper.KeeperException;<a name="line.84"></a>
-<span class="sourceLineNo">085</span>import org.junit.After;<a 
name="line.85"></a>
-<span class="sourceLineNo">086</span>import org.junit.AfterClass;<a 
name="line.86"></a>
-<span class="sourceLineNo">087</span>import org.junit.BeforeClass;<a 
name="line.87"></a>
-<span class="sourceLineNo">088</span>import org.junit.ClassRule;<a 
name="line.88"></a>
-<span class="sourceLineNo">089</span>import org.junit.Test;<a 
name="line.89"></a>
-<span class="sourceLineNo">090</span>import 
org.junit.experimental.categories.Category;<a name="line.90"></a>
-<span class="sourceLineNo">091</span>import org.slf4j.Logger;<a 
name="line.91"></a>
-<span class="sourceLineNo">092</span>import org.slf4j.LoggerFactory;<a 
name="line.92"></a>
-<span class="sourceLineNo">093</span><a name="line.93"></a>
-<span class="sourceLineNo">094</span>@Category(MediumTests.class)<a 
name="line.94"></a>
-<span class="sourceLineNo">095</span>public class TestNamespaceAuditor {<a 
name="line.95"></a>
-<span class="sourceLineNo">096</span><a name="line.96"></a>
-<span class="sourceLineNo">097</span>  @ClassRule<a name="line.97"></a>
-<span class="sourceLineNo">098</span>  public static final HBaseClassTestRule 
CLASS_RULE =<a name="line.98"></a>
-<span class="sourceLineNo">099</span>      
HBaseClassTestRule.forClass(TestNamespaceAuditor.class);<a name="line.99"></a>
-<span class="sourceLineNo">100</span><a name="line.100"></a>
-<span class="sourceLineNo">101</span>  private static final Logger LOG = 
LoggerFactory.getLogger(TestNamespaceAuditor.class);<a name="line.101"></a>
-<span class="sourceLineNo">102</span>  private static final 
HBaseTestingUtility UTIL = new HBaseTestingUtility();<a name="line.102"></a>
-<span class="sourceLineNo">103</span>  private static Admin ADMIN;<a 
name="line.103"></a>
-<span class="sourceLineNo">104</span>  private String prefix = 
"TestNamespaceAuditor";<a name="line.104"></a>
-<span class="sourceLineNo">105</span><a name="line.105"></a>
-<span class="sourceLineNo">106</span>  @BeforeClass<a name="line.106"></a>
-<span class="sourceLineNo">107</span>  public static void before() throws 
Exception {<a name="line.107"></a>
-<span class="sourceLineNo">108</span>    Configuration conf = 
UTIL.getConfiguration();<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    
conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, 
CustomObserver.class.getName());<a name="line.109"></a>
-<span class="sourceLineNo">110</span>    conf.setStrings(<a 
name="line.110"></a>
-<span class="sourceLineNo">111</span>      
CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,<a name="line.111"></a>
-<span class="sourceLineNo">112</span>      MasterSyncObserver.class.getName(), 
CPMasterObserver.class.getName());<a name="line.112"></a>
-<span class="sourceLineNo">113</span>    
conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 5);<a name="line.113"></a>
-<span class="sourceLineNo">114</span>    
conf.setBoolean(QuotaUtil.QUOTA_CONF_KEY, true);<a name="line.114"></a>
-<span class="sourceLineNo">115</span>    
conf.setClass("hbase.coprocessor.regionserver.classes", 
CPRegionServerObserver.class,<a name="line.115"></a>
-<span class="sourceLineNo">116</span>      RegionServerObserver.class);<a 
name="line.116"></a>
-<span class="sourceLineNo">117</span>    UTIL.startMiniCluster(1, 1);<a 
name="line.117"></a>
-<span class="sourceLineNo">118</span>    waitForQuotaInitialize(UTIL);<a 
name="line.118"></a>
-<span class="sourceLineNo">119</span>    ADMIN = UTIL.getAdmin();<a 
name="line.119"></a>
-<span class="sourceLineNo">120</span>  }<a name="line.120"></a>
-<span class="sourceLineNo">121</span><a name="line.121"></a>
-<span class="sourceLineNo">122</span>  @AfterClass<a name="line.122"></a>
-<span class="sourceLineNo">123</span>  public static void tearDown() throws 
Exception {<a name="line.123"></a>
-<span class="sourceLineNo">124</span>    UTIL.shutdownMiniCluster();<a 
name="line.124"></a>
-<span class="sourceLineNo">125</span>  }<a name="line.125"></a>
-<span class="sourceLineNo">126</span><a name="line.126"></a>
-<span class="sourceLineNo">127</span>  @After<a name="line.127"></a>
-<span class="sourceLineNo">128</span>  public void cleanup() throws Exception, 
KeeperException {<a name="line.128"></a>
-<span class="sourceLineNo">129</span>    for (HTableDescriptor table : 
ADMIN.listTables()) {<a name="line.129"></a>
-<span class="sourceLineNo">130</span>      
ADMIN.disableTable(table.getTableName());<a name="line.130"></a>
-<span class="sourceLineNo">131</span>      
deleteTable(table.getTableName());<a name="line.131"></a>
-<span class="sourceLineNo">132</span>    }<a name="line.132"></a>
-<span class="sourceLineNo">133</span>    for (NamespaceDescriptor ns : 
ADMIN.listNamespaceDescriptors()) {<a name="line.133"></a>
-<span class="sourceLineNo">134</span>      if 
(ns.getName().startsWith(prefix)) {<a name="line.134"></a>
-<span class="sourceLineNo">135</span>        
ADMIN.deleteNamespace(ns.getName());<a name="line.135"></a>
-<span class="sourceLineNo">136</span>      }<a name="line.136"></a>
-<span class="sourceLineNo">137</span>    }<a name="line.137"></a>
-<span class="sourceLineNo">138</span>    assertTrue("Quota manager not 
initialized", UTIL.getHBaseCluster().getMaster()<a name="line.138"></a>
-<span class="sourceLineNo">139</span>        
.getMasterQuotaManager().isQuotaInitialized());<a name="line.139"></a>
-<span class="sourceLineNo">140</span>  }<a name="line.140"></a>
-<span class="sourceLineNo">141</span><a name="line.141"></a>
-<span class="sourceLineNo">142</span>  @Test<a name="line.142"></a>
-<span class="sourceLineNo">143</span>  public void testTableOperations() 
throws Exception {<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    String nsp = prefix + "_np2";<a 
name="line.144"></a>
-<span class="sourceLineNo">145</span>    NamespaceDescriptor nspDesc =<a 
name="line.145"></a>
-<span class="sourceLineNo">146</span>        
NamespaceDescriptor.create(nsp).addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS,
 "5")<a name="line.146"></a>
-<span class="sourceLineNo">147</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();<a 
name="line.147"></a>
-<span class="sourceLineNo">148</span>    ADMIN.createNamespace(nspDesc);<a 
name="line.148"></a>
-<span class="sourceLineNo">149</span>    assertNotNull("Namespace descriptor 
found null.", ADMIN.getNamespaceDescriptor(nsp));<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    assertEquals(3, 
ADMIN.listNamespaceDescriptors().length);<a name="line.150"></a>
-<span class="sourceLineNo">151</span>    HColumnDescriptor fam1 = new 
HColumnDescriptor("fam1");<a name="line.151"></a>
-<span class="sourceLineNo">152</span><a name="line.152"></a>
-<span class="sourceLineNo">153</span>    HTableDescriptor tableDescOne =<a 
name="line.153"></a>
-<span class="sourceLineNo">154</span>        new 
HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + 
"table1"));<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    tableDescOne.addFamily(fam1);<a 
name="line.155"></a>
-<span class="sourceLineNo">156</span>    HTableDescriptor tableDescTwo =<a 
name="line.156"></a>
-<span class="sourceLineNo">157</span>        new 
HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + 
"table2"));<a name="line.157"></a>
-<span class="sourceLineNo">158</span>    tableDescTwo.addFamily(fam1);<a 
name="line.158"></a>
-<span class="sourceLineNo">159</span>    HTableDescriptor tableDescThree =<a 
name="line.159"></a>
-<span class="sourceLineNo">160</span>        new 
HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + 
"table3"));<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    tableDescThree.addFamily(fam1);<a 
name="line.161"></a>
-<span class="sourceLineNo">162</span>    ADMIN.createTable(tableDescOne);<a 
name="line.162"></a>
-<span class="sourceLineNo">163</span>    boolean constraintViolated = false;<a 
name="line.163"></a>
-<span class="sourceLineNo">164</span>    try {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>      ADMIN.createTable(tableDescTwo, 
Bytes.toBytes("AAA"), Bytes.toBytes("ZZZ"), 5);<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    } catch (Exception exp) {<a 
name="line.166"></a>
-<span class="sourceLineNo">167</span>      assertTrue(exp instanceof 
IOException);<a name="line.167"></a>
-<span class="sourceLineNo">168</span>      constraintViolated = true;<a 
name="line.168"></a>
-<span class="sourceLineNo">169</span>    } finally {<a name="line.169"></a>
-<span class="sourceLineNo">170</span>      assertTrue("Constraint not violated 
for table " + tableDescTwo.getTableName(),<a name="line.170"></a>
-<span class="sourceLineNo">171</span>        constraintViolated);<a 
name="line.171"></a>
-<span class="sourceLineNo">172</span>    }<a name="line.172"></a>
-<span class="sourceLineNo">173</span>    ADMIN.createTable(tableDescTwo, 
Bytes.toBytes("AAA"), Bytes.toBytes("ZZZ"), 4);<a name="line.173"></a>
-<span class="sourceLineNo">174</span>    NamespaceTableAndRegionInfo nspState 
= getQuotaManager().getState(nsp);<a name="line.174"></a>
-<span class="sourceLineNo">175</span>    assertNotNull(nspState);<a 
name="line.175"></a>
-<span class="sourceLineNo">176</span>    
assertTrue(nspState.getTables().size() == 2);<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    assertTrue(nspState.getRegionCount() 
== 5);<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    constraintViolated = false;<a 
name="line.178"></a>
-<span class="sourceLineNo">179</span>    try {<a name="line.179"></a>
-<span class="sourceLineNo">180</span>      
ADMIN.createTable(tableDescThree);<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    } catch (Exception exp) {<a 
name="line.181"></a>
-<span class="sourceLineNo">182</span>      assertTrue(exp instanceof 
IOException);<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      constraintViolated = true;<a 
name="line.183"></a>
-<span class="sourceLineNo">184</span>    } finally {<a name="line.184"></a>
-<span class="sourceLineNo">185</span>      assertTrue("Constraint not violated 
for table " + tableDescThree.getTableName(),<a name="line.185"></a>
-<span class="sourceLineNo">186</span>        constraintViolated);<a 
name="line.186"></a>
-<span class="sourceLineNo">187</span>    }<a name="line.187"></a>
-<span class="sourceLineNo">188</span>  }<a name="line.188"></a>
-<span class="sourceLineNo">189</span><a name="line.189"></a>
-<span class="sourceLineNo">190</span>  @Test<a name="line.190"></a>
-<span class="sourceLineNo">191</span>  public void testValidQuotas() throws 
Exception {<a name="line.191"></a>
-<span class="sourceLineNo">192</span>    boolean exceptionCaught = false;<a 
name="line.192"></a>
-<span class="sourceLineNo">193</span>    FileSystem fs = 
UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();<a 
name="line.193"></a>
-<span class="sourceLineNo">194</span>    Path rootDir = 
UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();<a 
name="line.194"></a>
-<span class="sourceLineNo">195</span>    NamespaceDescriptor nspDesc =<a 
name="line.195"></a>
-<span class="sourceLineNo">196</span>        NamespaceDescriptor.create(prefix 
+ "vq1")<a name="line.196"></a>
-<span class="sourceLineNo">197</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "hihdufh")<a 
name="line.197"></a>
-<span class="sourceLineNo">198</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();<a 
name="line.198"></a>
-<span class="sourceLineNo">199</span>    try {<a name="line.199"></a>
-<span class="sourceLineNo">200</span>      ADMIN.createNamespace(nspDesc);<a 
name="line.200"></a>
-<span class="sourceLineNo">201</span>    } catch (Exception exp) {<a 
name="line.201"></a>
-<span class="sourceLineNo">202</span>      LOG.warn(exp.toString(), exp);<a 
name="line.202"></a>
-<span class="sourceLineNo">203</span>      exceptionCaught = true;<a 
name="line.203"></a>
-<span class="sourceLineNo">204</span>    } finally {<a name="line.204"></a>
-<span class="sourceLineNo">205</span>      assertTrue(exceptionCaught);<a 
name="line.205"></a>
-<span class="sourceLineNo">206</span>      
assertFalse(fs.exists(FSUtils.getNamespaceDir(rootDir, nspDesc.getName())));<a 
name="line.206"></a>
-<span class="sourceLineNo">207</span>    }<a name="line.207"></a>
-<span class="sourceLineNo">208</span>    nspDesc =<a name="line.208"></a>
-<span class="sourceLineNo">209</span>        NamespaceDescriptor.create(prefix 
+ "vq2")<a name="line.209"></a>
-<span class="sourceLineNo">210</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "-456")<a 
name="line.210"></a>
-<span class="sourceLineNo">211</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();<a 
name="line.211"></a>
-<span class="sourceLineNo">212</span>    try {<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      ADMIN.createNamespace(nspDesc);<a 
name="line.213"></a>
-<span class="sourceLineNo">214</span>    } catch (Exception exp) {<a 
name="line.214"></a>
-<span class="sourceLineNo">215</span>      LOG.warn(exp.toString(), exp);<a 
name="line.215"></a>
-<span class="sourceLineNo">216</span>      exceptionCaught = true;<a 
name="line.216"></a>
-<span class="sourceLineNo">217</span>    } finally {<a name="line.217"></a>
-<span class="sourceLineNo">218</span>      assertTrue(exceptionCaught);<a 
name="line.218"></a>
-<span class="sourceLineNo">219</span>      
assertFalse(fs.exists(FSUtils.getNamespaceDir(rootDir, nspDesc.getName())));<a 
name="line.219"></a>
-<span class="sourceLineNo">220</span>    }<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    nspDesc =<a name="line.221"></a>
-<span class="sourceLineNo">222</span>        NamespaceDescriptor.create(prefix 
+ "vq3")<a name="line.222"></a>
-<span class="sourceLineNo">223</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "10")<a 
name="line.223"></a>
-<span class="sourceLineNo">224</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "sciigd").build();<a 
name="line.224"></a>
-<span class="sourceLineNo">225</span>    try {<a name="line.225"></a>
-<span class="sourceLineNo">226</span>      ADMIN.createNamespace(nspDesc);<a 
name="line.226"></a>
-<span class="sourceLineNo">227</span>    } catch (Exception exp) {<a 
name="line.227"></a>
-<span class="sourceLineNo">228</span>      LOG.warn(exp.toString(), exp);<a 
name="line.228"></a>
-<span class="sourceLineNo">229</span>      exceptionCaught = true;<a 
name="line.229"></a>
-<span class="sourceLineNo">230</span>    } finally {<a name="line.230"></a>
-<span class="sourceLineNo">231</span>      assertTrue(exceptionCaught);<a 
name="line.231"></a>
-<span class="sourceLineNo">232</span>      
assertFalse(fs.exists(FSUtils.getNamespaceDir(rootDir, nspDesc.getName())));<a 
name="line.232"></a>
-<span class="sourceLineNo">233</span>    }<a name="line.233"></a>
-<span class="sourceLineNo">234</span>    nspDesc =<a name="line.234"></a>
-<span class="sourceLineNo">235</span>        NamespaceDescriptor.create(prefix 
+ "vq4")<a name="line.235"></a>
-<span class="sourceLineNo">236</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "10")<a 
name="line.236"></a>
-<span class="sourceLineNo">237</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "-1500").build();<a 
name="line.237"></a>
-<span class="sourceLineNo">238</span>    try {<a name="line.238"></a>
-<span class="sourceLineNo">239</span>      ADMIN.createNamespace(nspDesc);<a 
name="line.239"></a>
-<span class="sourceLineNo">240</span>    } catch (Exception exp) {<a 
name="line.240"></a>
-<span class="sourceLineNo">241</span>      LOG.warn(exp.toString(), exp);<a 
name="line.241"></a>
-<span class="sourceLineNo">242</span>      exceptionCaught = true;<a 
name="line.242"></a>
-<span class="sourceLineNo">243</span>    } finally {<a name="line.243"></a>
-<span class="sourceLineNo">244</span>      assertTrue(exceptionCaught);<a 
name="line.244"></a>
-<span class="sourceLineNo">245</span>      
assertFalse(fs.exists(FSUtils.getNamespaceDir(rootDir, nspDesc.getName())));<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><a name="line.248"></a>
-<span class="sourceLineNo">249</span>  @Test<a name="line.249"></a>
-<span class="sourceLineNo">250</span>  public void testDeleteTable() throws 
Exception {<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    String namespace = prefix + 
"_dummy";<a name="line.251"></a>
-<span class="sourceLineNo">252</span>    NamespaceDescriptor nspDesc =<a 
name="line.252"></a>
-<span class="sourceLineNo">253</span>        
NamespaceDescriptor.create(namespace)<a name="line.253"></a>
-<span class="sourceLineNo">254</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "100")<a 
name="line.254"></a>
-<span class="sourceLineNo">255</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "3").build();<a 
name="line.255"></a>
-<span class="sourceLineNo">256</span>    ADMIN.createNamespace(nspDesc);<a 
name="line.256"></a>
-<span class="sourceLineNo">257</span>    assertNotNull("Namespace descriptor 
found null.", ADMIN.getNamespaceDescriptor(namespace));<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    NamespaceTableAndRegionInfo stateInfo 
= getNamespaceState(nspDesc.getName());<a name="line.258"></a>
-<span class="sourceLineNo">259</span>    assertNotNull("Namespace state found 
null for " + namespace, stateInfo);<a name="line.259"></a>
-<span class="sourceLineNo">260</span>    HColumnDescriptor fam1 = new 
HColumnDescriptor("fam1");<a name="line.260"></a>
-<span class="sourceLineNo">261</span>    HTableDescriptor tableDescOne =<a 
name="line.261"></a>
-<span class="sourceLineNo">262</span>        new 
HTableDescriptor(TableName.valueOf(namespace + TableName.NAMESPACE_DELIM + 
"table1"));<a name="line.262"></a>
-<span class="sourceLineNo">263</span>    tableDescOne.addFamily(fam1);<a 
name="line.263"></a>
-<span class="sourceLineNo">264</span>    HTableDescriptor tableDescTwo =<a 
name="line.264"></a>
-<span class="sourceLineNo">265</span>        new 
HTableDescriptor(TableName.valueOf(namespace + TableName.NAMESPACE_DELIM + 
"table2"));<a name="line.265"></a>
-<span class="sourceLineNo">266</span>    tableDescTwo.addFamily(fam1);<a 
name="line.266"></a>
-<span class="sourceLineNo">267</span>    ADMIN.createTable(tableDescOne);<a 
name="line.267"></a>
-<span class="sourceLineNo">268</span>    ADMIN.createTable(tableDescTwo, 
Bytes.toBytes("AAA"), Bytes.toBytes("ZZZ"), 5);<a name="line.268"></a>
-<span class="sourceLineNo">269</span>    stateInfo = 
getNamespaceState(nspDesc.getName());<a name="line.269"></a>
-<span class="sourceLineNo">270</span>    assertNotNull("Namespace state found 
to be null.", stateInfo);<a name="line.270"></a>
-<span class="sourceLineNo">271</span>    assertEquals(2, 
stateInfo.getTables().size());<a name="line.271"></a>
-<span class="sourceLineNo">272</span>    assertEquals(5, 
stateInfo.getRegionCountOfTable(tableDescTwo.getTableName()));<a 
name="line.272"></a>
-<span class="sourceLineNo">273</span>    assertEquals(6, 
stateInfo.getRegionCount());<a name="line.273"></a>
-<span class="sourceLineNo">274</span>    
ADMIN.disableTable(tableDescOne.getTableName());<a name="line.274"></a>
-<span class="sourceLineNo">275</span>    
deleteTable(tableDescOne.getTableName());<a name="line.275"></a>
-<span class="sourceLineNo">276</span>    stateInfo = 
getNamespaceState(nspDesc.getName());<a name="line.276"></a>
-<span class="sourceLineNo">277</span>    assertNotNull("Namespace state found 
to be null.", stateInfo);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>    assertEquals(5, 
stateInfo.getRegionCount());<a name="line.278"></a>
-<span class="sourceLineNo">279</span>    assertEquals(1, 
stateInfo.getTables().size());<a name="line.279"></a>
-<span class="sourceLineNo">280</span>    
ADMIN.disableTable(tableDescTwo.getTableName());<a name="line.280"></a>
-<span class="sourceLineNo">281</span>    
deleteTable(tableDescTwo.getTableName());<a name="line.281"></a>
-<span class="sourceLineNo">282</span>    ADMIN.deleteNamespace(namespace);<a 
name="line.282"></a>
-<span class="sourceLineNo">283</span>    stateInfo = 
getNamespaceState(namespace);<a name="line.283"></a>
-<span class="sourceLineNo">284</span>    assertNull("Namespace state not found 
to be null.", stateInfo);<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>  public static class 
CPRegionServerObserver<a name="line.287"></a>
-<span class="sourceLineNo">288</span>      implements RegionServerCoprocessor, 
RegionServerObserver {<a name="line.288"></a>
-<span class="sourceLineNo">289</span>    private volatile boolean 
shouldFailMerge = false;<a name="line.289"></a>
-<span class="sourceLineNo">290</span><a name="line.290"></a>
-<span class="sourceLineNo">291</span>    public void failMerge(boolean fail) 
{<a name="line.291"></a>
-<span class="sourceLineNo">292</span>      shouldFailMerge = fail;<a 
name="line.292"></a>
-<span class="sourceLineNo">293</span>    }<a name="line.293"></a>
-<span class="sourceLineNo">294</span><a name="line.294"></a>
-<span class="sourceLineNo">295</span>    private boolean triggered = false;<a 
name="line.295"></a>
-<span class="sourceLineNo">296</span><a name="line.296"></a>
-<span class="sourceLineNo">297</span>    public synchronized void 
waitUtilTriggered() throws InterruptedException {<a name="line.297"></a>
-<span class="sourceLineNo">298</span>      while (!triggered) {<a 
name="line.298"></a>
-<span class="sourceLineNo">299</span>        wait();<a name="line.299"></a>
-<span class="sourceLineNo">300</span>      }<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>    @Override<a name="line.303"></a>
-<span class="sourceLineNo">304</span>    public 
Optional&lt;RegionServerObserver&gt; getRegionServerObserver() {<a 
name="line.304"></a>
-<span class="sourceLineNo">305</span>      return Optional.of(this);<a 
name="line.305"></a>
-<span class="sourceLineNo">306</span>    }<a name="line.306"></a>
-<span class="sourceLineNo">307</span>  }<a name="line.307"></a>
-<span class="sourceLineNo">308</span><a name="line.308"></a>
-<span class="sourceLineNo">309</span>  public static class CPMasterObserver 
implements MasterCoprocessor, MasterObserver {<a name="line.309"></a>
-<span class="sourceLineNo">310</span>    private volatile boolean 
shouldFailMerge = false;<a name="line.310"></a>
-<span class="sourceLineNo">311</span><a name="line.311"></a>
-<span class="sourceLineNo">312</span>    public void failMerge(boolean fail) 
{<a name="line.312"></a>
-<span class="sourceLineNo">313</span>      shouldFailMerge = fail;<a 
name="line.313"></a>
-<span class="sourceLineNo">314</span>    }<a name="line.314"></a>
-<span class="sourceLineNo">315</span><a name="line.315"></a>
-<span class="sourceLineNo">316</span>    @Override<a name="line.316"></a>
-<span class="sourceLineNo">317</span>    public Optional&lt;MasterObserver&gt; 
getMasterObserver() {<a name="line.317"></a>
-<span class="sourceLineNo">318</span>      return Optional.of(this);<a 
name="line.318"></a>
-<span class="sourceLineNo">319</span>    }<a name="line.319"></a>
-<span class="sourceLineNo">320</span><a name="line.320"></a>
-<span class="sourceLineNo">321</span>    @Override<a name="line.321"></a>
-<span class="sourceLineNo">322</span>    public synchronized void 
preMergeRegionsAction(<a name="line.322"></a>
-<span class="sourceLineNo">323</span>        final 
ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.323"></a>
-<span class="sourceLineNo">324</span>        final RegionInfo[] 
regionsToMerge) throws IOException {<a name="line.324"></a>
-<span class="sourceLineNo">325</span>      notifyAll();<a name="line.325"></a>
-<span class="sourceLineNo">326</span>      if (shouldFailMerge) {<a 
name="line.326"></a>
-<span class="sourceLineNo">327</span>        throw new IOException("fail 
merge");<a name="line.327"></a>
-<span class="sourceLineNo">328</span>      }<a name="line.328"></a>
-<span class="sourceLineNo">329</span>    }<a name="line.329"></a>
-<span class="sourceLineNo">330</span>  }<a name="line.330"></a>
-<span class="sourceLineNo">331</span><a name="line.331"></a>
-<span class="sourceLineNo">332</span>  @Test<a name="line.332"></a>
-<span class="sourceLineNo">333</span>  public void testRegionMerge() throws 
Exception {<a name="line.333"></a>
-<span class="sourceLineNo">334</span>    String nsp1 = prefix + 
"_regiontest";<a name="line.334"></a>
-<span class="sourceLineNo">335</span>    final int initialRegions = 3;<a 
name="line.335"></a>
-<span class="sourceLineNo">336</span>    NamespaceDescriptor nspDesc =<a 
name="line.336"></a>
-<span class="sourceLineNo">337</span>        
NamespaceDescriptor.create(nsp1)<a name="line.337"></a>
-<span class="sourceLineNo">338</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "" + initialRegions)<a 
name="line.338"></a>
-<span class="sourceLineNo">339</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();<a 
name="line.339"></a>
-<span class="sourceLineNo">340</span>    ADMIN.createNamespace(nspDesc);<a 
name="line.340"></a>
-<span class="sourceLineNo">341</span>    final TableName tableTwo = 
TableName.valueOf(nsp1 + TableName.NAMESPACE_DELIM + "table2");<a 
name="line.341"></a>
-<span class="sourceLineNo">342</span>    byte[] columnFamily = 
Bytes.toBytes("info");<a name="line.342"></a>
-<span class="sourceLineNo">343</span>    HTableDescriptor tableDescOne = new 
HTableDescriptor(tableTwo);<a name="line.343"></a>
-<span class="sourceLineNo">344</span>    tableDescOne.addFamily(new 
HColumnDescriptor(columnFamily));<a name="line.344"></a>
-<span class="sourceLineNo">345</span>    ADMIN.createTable(tableDescOne, 
Bytes.toBytes("0"), Bytes.toBytes("9"), initialRegions);<a name="line.345"></a>
-<span class="sourceLineNo">346</span>    Connection connection = 
ConnectionFactory.createConnection(UTIL.getConfiguration());<a 
name="line.346"></a>
-<span class="sourceLineNo">347</span>    try (Table table = 
connection.getTable(tableTwo)) {<a name="line.347"></a>
-<span class="sourceLineNo">348</span>      UTIL.loadNumericRows(table, 
Bytes.toBytes("info"), 1000, 1999);<a name="line.348"></a>
-<span class="sourceLineNo">349</span>    }<a name="line.349"></a>
-<span class="sourceLineNo">350</span>    ADMIN.flush(tableTwo);<a 
name="line.350"></a>
-<span class="sourceLineNo">351</span>    List&lt;HRegionInfo&gt; hris = 
ADMIN.getTableRegions(tableTwo);<a name="line.351"></a>
-<span class="sourceLineNo">352</span>    assertEquals(initialRegions, 
hris.size());<a name="line.352"></a>
-<span class="sourceLineNo">353</span>    Collections.sort(hris);<a 
name="line.353"></a>
-<span class="sourceLineNo">354</span>    Future&lt;?&gt; f = 
ADMIN.mergeRegionsAsync(<a name="line.354"></a>
-<span class="sourceLineNo">355</span>      
hris.get(0).getEncodedNameAsBytes(),<a name="line.355"></a>
-<span class="sourceLineNo">356</span>      
hris.get(1).getEncodedNameAsBytes(),<a name="line.356"></a>
-<span class="sourceLineNo">357</span>      false);<a name="line.357"></a>
-<span class="sourceLineNo">358</span>    f.get(10, TimeUnit.SECONDS);<a 
name="line.358"></a>
-<span class="sourceLineNo">359</span><a name="line.359"></a>
-<span class="sourceLineNo">360</span>    hris = 
ADMIN.getTableRegions(tableTwo);<a name="line.360"></a>
-<span class="sourceLineNo">361</span>    assertEquals(initialRegions - 1, 
hris.size());<a name="line.361"></a>
-<span class="sourceLineNo">362</span>    Collections.sort(hris);<a 
name="line.362"></a>
-<span class="sourceLineNo">363</span>    ADMIN.split(tableTwo, 
Bytes.toBytes("3"));<a name="line.363"></a>
-<span class="sourceLineNo">364</span>    // Not much we can do here until we 
have split return a Future.<a name="line.364"></a>
-<span class="sourceLineNo">365</span>    Threads.sleep(5000);<a 
name="line.365"></a>
-<span class="sourceLineNo">366</span>    hris = 
ADMIN.getTableRegions(tableTwo);<a name="line.366"></a>
-<span class="sourceLineNo">367</span>    assertEquals(initialRegions, 
hris.size());<a name="line.367"></a>
-<span class="sourceLineNo">368</span>    Collections.sort(hris);<a 
name="line.368"></a>
-<span class="sourceLineNo">369</span><a name="line.369"></a>
-<span class="sourceLineNo">370</span>    // Fail region merge through 
Coprocessor hook<a name="line.370"></a>
-<span class="sourceLineNo">371</span>    MiniHBaseCluster cluster = 
UTIL.getHBaseCluster();<a name="line.371"></a>
-<span class="sourceLineNo">372</span>    MasterCoprocessorHost cpHost = 
cluster.getMaster().getMasterCoprocessorHost();<a name="line.372"></a>
-<span class="sourceLineNo">373</span>    Coprocessor coprocessor = 
cpHost.findCoprocessor(CPMasterObserver.class);<a name="line.373"></a>
-<span class="sourceLineNo">374</span>    CPMasterObserver masterObserver = 
(CPMasterObserver) coprocessor;<a name="line.374"></a>
-<span class="sourceLineNo">375</span>    masterObserver.failMerge(true);<a 
name="line.375"></a>
-<span class="sourceLineNo">376</span><a name="line.376"></a>
-<span class="sourceLineNo">377</span>    f = ADMIN.mergeRegionsAsync(<a 
name="line.377"></a>
-<span class="sourceLineNo">378</span>      
hris.get(1).getEncodedNameAsBytes(),<a name="line.378"></a>
-<span class="sourceLineNo">379</span>      
hris.get(2).getEncodedNameAsBytes(),<a name="line.379"></a>
-<span class="sourceLineNo">380</span>      false);<a name="line.380"></a>
-<span class="sourceLineNo">381</span>    try {<a name="line.381"></a>
-<span class="sourceLineNo">382</span>      f.get(10, TimeUnit.SECONDS);<a 
name="line.382"></a>
-<span class="sourceLineNo">383</span>      fail("Merge was supposed to 
fail!");<a name="line.383"></a>
-<span class="sourceLineNo">384</span>    } catch (ExecutionException ee) {<a 
name="line.384"></a>
-<span class="sourceLineNo">385</span>      // Expected.<a name="line.385"></a>
-<span class="sourceLineNo">386</span>    }<a name="line.386"></a>
-<span class="sourceLineNo">387</span>    hris = 
ADMIN.getTableRegions(tableTwo);<a name="line.387"></a>
-<span class="sourceLineNo">388</span>    assertEquals(initialRegions, 
hris.size());<a name="line.388"></a>
-<span class="sourceLineNo">389</span>    Collections.sort(hris);<a 
name="line.389"></a>
-<span class="sourceLineNo">390</span>    // verify that we cannot split<a 
name="line.390"></a>
-<span class="sourceLineNo">391</span>    HRegionInfo hriToSplit2 = 
hris.get(1);<a name="line.391"></a>
+<span class="sourceLineNo">075</span>import 
org.apache.hadoop.hbase.regionserver.HRegion;<a name="line.75"></a>
+<span class="sourceLineNo">076</span>import 
org.apache.hadoop.hbase.regionserver.Store;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>import 
org.apache.hadoop.hbase.regionserver.StoreFile;<a name="line.77"></a>
+<span class="sourceLineNo">078</span>import 
org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker;<a 
name="line.78"></a>
+<span class="sourceLineNo">079</span>import 
org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest;<a 
name="line.79"></a>
+<span class="sourceLineNo">080</span>import 
org.apache.hadoop.hbase.snapshot.RestoreSnapshotException;<a name="line.80"></a>
+<span class="sourceLineNo">081</span>import 
org.apache.hadoop.hbase.testclassification.MediumTests;<a name="line.81"></a>
+<span class="sourceLineNo">082</span>import 
org.apache.hadoop.hbase.util.Bytes;<a name="line.82"></a>
+<span class="sourceLineNo">083</span>import 
org.apache.hadoop.hbase.util.FSUtils;<a name="line.83"></a>
+<span class="sourceLineNo">084</span>import 
org.apache.hadoop.hbase.util.Threads;<a name="line.84"></a>
+<span class="sourceLineNo">085</span>import 
org.apache.zookeeper.KeeperException;<a name="line.85"></a>
+<span class="sourceLineNo">086</span>import org.junit.After;<a 
name="line.86"></a>
+<span class="sourceLineNo">087</span>import org.junit.AfterClass;<a 
name="line.87"></a>
+<span class="sourceLineNo">088</span>import org.junit.BeforeClass;<a 
name="line.88"></a>
+<span class="sourceLineNo">089</span>import org.junit.ClassRule;<a 
name="line.89"></a>
+<span class="sourceLineNo">090</span>import org.junit.Test;<a 
name="line.90"></a>
+<span class="sourceLineNo">091</span>import 
org.junit.experimental.categories.Category;<a name="line.91"></a>
+<span class="sourceLineNo">092</span>import org.slf4j.Logger;<a 
name="line.92"></a>
+<span class="sourceLineNo">093</span>import org.slf4j.LoggerFactory;<a 
name="line.93"></a>
+<span class="sourceLineNo">094</span><a name="line.94"></a>
+<span class="sourceLineNo">095</span>@Category(MediumTests.class)<a 
name="line.95"></a>
+<span class="sourceLineNo">096</span>public class TestNamespaceAuditor {<a 
name="line.96"></a>
+<span class="sourceLineNo">097</span><a name="line.97"></a>
+<span class="sourceLineNo">098</span>  @ClassRule<a name="line.98"></a>
+<span class="sourceLineNo">099</span>  public static final HBaseClassTestRule 
CLASS_RULE =<a name="line.99"></a>
+<span class="sourceLineNo">100</span>      
HBaseClassTestRule.forClass(TestNamespaceAuditor.class);<a name="line.100"></a>
+<span class="sourceLineNo">101</span><a name="line.101"></a>
+<span class="sourceLineNo">102</span>  private static final Logger LOG = 
LoggerFactory.getLogger(TestNamespaceAuditor.class);<a name="line.102"></a>
+<span class="sourceLineNo">103</span>  private static final 
HBaseTestingUtility UTIL = new HBaseTestingUtility();<a name="line.103"></a>
+<span class="sourceLineNo">104</span>  private static Admin ADMIN;<a 
name="line.104"></a>
+<span class="sourceLineNo">105</span>  private String prefix = 
"TestNamespaceAuditor";<a name="line.105"></a>
+<span class="sourceLineNo">106</span><a name="line.106"></a>
+<span class="sourceLineNo">107</span>  @BeforeClass<a name="line.107"></a>
+<span class="sourceLineNo">108</span>  public static void before() throws 
Exception {<a name="line.108"></a>
+<span class="sourceLineNo">109</span>    Configuration conf = 
UTIL.getConfiguration();<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    
conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, 
CustomObserver.class.getName());<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    conf.setStrings(<a 
name="line.111"></a>
+<span class="sourceLineNo">112</span>      
CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,<a name="line.112"></a>
+<span class="sourceLineNo">113</span>      MasterSyncObserver.class.getName(), 
CPMasterObserver.class.getName());<a name="line.113"></a>
+<span class="sourceLineNo">114</span>    
conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 5);<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    
conf.setBoolean(QuotaUtil.QUOTA_CONF_KEY, true);<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    
conf.setClass("hbase.coprocessor.regionserver.classes", 
CPRegionServerObserver.class,<a name="line.116"></a>
+<span class="sourceLineNo">117</span>      RegionServerObserver.class);<a 
name="line.117"></a>
+<span class="sourceLineNo">118</span>    UTIL.startMiniCluster(1, 1);<a 
name="line.118"></a>
+<span class="sourceLineNo">119</span>    waitForQuotaInitialize(UTIL);<a 
name="line.119"></a>
+<span class="sourceLineNo">120</span>    ADMIN = UTIL.getAdmin();<a 
name="line.120"></a>
+<span class="sourceLineNo">121</span>  }<a name="line.121"></a>
+<span class="sourceLineNo">122</span><a name="line.122"></a>
+<span class="sourceLineNo">123</span>  @AfterClass<a name="line.123"></a>
+<span class="sourceLineNo">124</span>  public static void tearDown() throws 
Exception {<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    UTIL.shutdownMiniCluster();<a 
name="line.125"></a>
+<span class="sourceLineNo">126</span>  }<a name="line.126"></a>
+<span class="sourceLineNo">127</span><a name="line.127"></a>
+<span class="sourceLineNo">128</span>  @After<a name="line.128"></a>
+<span class="sourceLineNo">129</span>  public void cleanup() throws Exception, 
KeeperException {<a name="line.129"></a>
+<span class="sourceLineNo">130</span>    for (HTableDescriptor table : 
ADMIN.listTables()) {<a name="line.130"></a>
+<span class="sourceLineNo">131</span>      
ADMIN.disableTable(table.getTableName());<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      
deleteTable(table.getTableName());<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    }<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    for (NamespaceDescriptor ns : 
ADMIN.listNamespaceDescriptors()) {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>      if 
(ns.getName().startsWith(prefix)) {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>        
ADMIN.deleteNamespace(ns.getName());<a name="line.136"></a>
+<span class="sourceLineNo">137</span>      }<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    }<a name="line.138"></a>
+<span class="sourceLineNo">139</span>    assertTrue("Quota manager not 
initialized", UTIL.getHBaseCluster().getMaster()<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        
.getMasterQuotaManager().isQuotaInitialized());<a name="line.140"></a>
+<span class="sourceLineNo">141</span>  }<a name="line.141"></a>
+<span class="sourceLineNo">142</span><a name="line.142"></a>
+<span class="sourceLineNo">143</span>  @Test<a name="line.143"></a>
+<span class="sourceLineNo">144</span>  public void testTableOperations() 
throws Exception {<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    String nsp = prefix + "_np2";<a 
name="line.145"></a>
+<span class="sourceLineNo">146</span>    NamespaceDescriptor nspDesc =<a 
name="line.146"></a>
+<span class="sourceLineNo">147</span>        
NamespaceDescriptor.create(nsp).addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS,
 "5")<a name="line.147"></a>
+<span class="sourceLineNo">148</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();<a 
name="line.148"></a>
+<span class="sourceLineNo">149</span>    ADMIN.createNamespace(nspDesc);<a 
name="line.149"></a>
+<span class="sourceLineNo">150</span>    assertNotNull("Namespace descriptor 
found null.", ADMIN.getNamespaceDescriptor(nsp));<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    assertEquals(3, 
ADMIN.listNamespaceDescriptors().length);<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    HColumnDescriptor fam1 = new 
HColumnDescriptor("fam1");<a name="line.152"></a>
+<span class="sourceLineNo">153</span><a name="line.153"></a>
+<span class="sourceLineNo">154</span>    HTableDescriptor tableDescOne =<a 
name="line.154"></a>
+<span class="sourceLineNo">155</span>        new 
HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + 
"table1"));<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    tableDescOne.addFamily(fam1);<a 
name="line.156"></a>
+<span class="sourceLineNo">157</span>    HTableDescriptor tableDescTwo =<a 
name="line.157"></a>
+<span class="sourceLineNo">158</span>        new 
HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + 
"table2"));<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    tableDescTwo.addFamily(fam1);<a 
name="line.159"></a>
+<span class="sourceLineNo">160</span>    HTableDescriptor tableDescThree =<a 
name="line.160"></a>
+<span class="sourceLineNo">161</span>        new 
HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + 
"table3"));<a name="line.161"></a>
+<span class="sourceLineNo">162</span>    tableDescThree.addFamily(fam1);<a 
name="line.162"></a>
+<span class="sourceLineNo">163</span>    ADMIN.createTable(tableDescOne);<a 
name="line.163"></a>
+<span class="sourceLineNo">164</span>    boolean constraintViolated = false;<a 
name="line.164"></a>
+<span class="sourceLineNo">165</span>    try {<a name="line.165"></a>
+<span class="sourceLineNo">166</span>      ADMIN.createTable(tableDescTwo, 
Bytes.toBytes("AAA"), Bytes.toBytes("ZZZ"), 5);<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    } catch (Exception exp) {<a 
name="line.167"></a>
+<span class="sourceLineNo">168</span>      assertTrue(exp instanceof 
IOException);<a name="line.168"></a>
+<span class="sourceLineNo">169</span>      constraintViolated = true;<a 
name="line.169"></a>
+<span class="sourceLineNo">170</span>    } finally {<a name="line.170"></a>
+<span class="sourceLineNo">171</span>      assertTrue("Constraint not violated 
for table " + tableDescTwo.getTableName(),<a name="line.171"></a>
+<span class="sourceLineNo">172</span>        constraintViolated);<a 
name="line.172"></a>
+<span class="sourceLineNo">173</span>    }<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    ADMIN.createTable(tableDescTwo, 
Bytes.toBytes("AAA"), Bytes.toBytes("ZZZ"), 4);<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    NamespaceTableAndRegionInfo nspState 
= getQuotaManager().getState(nsp);<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    assertNotNull(nspState);<a 
name="line.176"></a>
+<span class="sourceLineNo">177</span>    
assertTrue(nspState.getTables().size() == 2);<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    assertTrue(nspState.getRegionCount() 
== 5);<a name="line.178"></a>
+<span class="sourceLineNo">179</span>    constraintViolated = false;<a 
name="line.179"></a>
+<span class="sourceLineNo">180</span>    try {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>      
ADMIN.createTable(tableDescThree);<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    } catch (Exception exp) {<a 
name="line.182"></a>
+<span class="sourceLineNo">183</span>      assertTrue(exp instanceof 
IOException);<a name="line.183"></a>
+<span class="sourceLineNo">184</span>      constraintViolated = true;<a 
name="line.184"></a>
+<span class="sourceLineNo">185</span>    } finally {<a name="line.185"></a>
+<span class="sourceLineNo">186</span>      assertTrue("Constraint not violated 
for table " + tableDescThree.getTableName(),<a name="line.186"></a>
+<span class="sourceLineNo">187</span>        constraintViolated);<a 
name="line.187"></a>
+<span class="sourceLineNo">188</span>    }<a name="line.188"></a>
+<span class="sourceLineNo">189</span>  }<a name="line.189"></a>
+<span class="sourceLineNo">190</span><a name="line.190"></a>
+<span class="sourceLineNo">191</span>  @Test<a name="line.191"></a>
+<span class="sourceLineNo">192</span>  public void testValidQuotas() throws 
Exception {<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    boolean exceptionCaught = false;<a 
name="line.193"></a>
+<span class="sourceLineNo">194</span>    FileSystem fs = 
UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();<a 
name="line.194"></a>
+<span class="sourceLineNo">195</span>    Path rootDir = 
UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();<a 
name="line.195"></a>
+<span class="sourceLineNo">196</span>    NamespaceDescriptor nspDesc =<a 
name="line.196"></a>
+<span class="sourceLineNo">197</span>        NamespaceDescriptor.create(prefix 
+ "vq1")<a name="line.197"></a>
+<span class="sourceLineNo">198</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "hihdufh")<a 
name="line.198"></a>
+<span class="sourceLineNo">199</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();<a 
name="line.199"></a>
+<span class="sourceLineNo">200</span>    try {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>      ADMIN.createNamespace(nspDesc);<a 
name="line.201"></a>
+<span class="sourceLineNo">202</span>    } catch (Exception exp) {<a 
name="line.202"></a>
+<span class="sourceLineNo">203</span>      LOG.warn(exp.toString(), exp);<a 
name="line.203"></a>
+<span class="sourceLineNo">204</span>      exceptionCaught = true;<a 
name="line.204"></a>
+<span class="sourceLineNo">205</span>    } finally {<a name="line.205"></a>
+<span class="sourceLineNo">206</span>      assertTrue(exceptionCaught);<a 
name="line.206"></a>
+<span class="sourceLineNo">207</span>      
assertFalse(fs.exists(FSUtils.getNamespaceDir(rootDir, nspDesc.getName())));<a 
name="line.207"></a>
+<span class="sourceLineNo">208</span>    }<a name="line.208"></a>
+<span class="sourceLineNo">209</span>    nspDesc =<a name="line.209"></a>
+<span class="sourceLineNo">210</span>        NamespaceDescriptor.create(prefix 
+ "vq2")<a name="line.210"></a>
+<span class="sourceLineNo">211</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "-456")<a 
name="line.211"></a>
+<span class="sourceLineNo">212</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();<a 
name="line.212"></a>
+<span class="sourceLineNo">213</span>    try {<a name="line.213"></a>
+<span class="sourceLineNo">214</span>      ADMIN.createNamespace(nspDesc);<a 
name="line.214"></a>
+<span class="sourceLineNo">215</span>    } catch (Exception exp) {<a 
name="line.215"></a>
+<span class="sourceLineNo">216</span>      LOG.warn(exp.toString(), exp);<a 
name="line.216"></a>
+<span class="sourceLineNo">217</span>      exceptionCaught = true;<a 
name="line.217"></a>
+<span class="sourceLineNo">218</span>    } finally {<a name="line.218"></a>
+<span class="sourceLineNo">219</span>      assertTrue(exceptionCaught);<a 
name="line.219"></a>
+<span class="sourceLineNo">220</span>      
assertFalse(fs.exists(FSUtils.getNamespaceDir(rootDir, nspDesc.getName())));<a 
name="line.220"></a>
+<span class="sourceLineNo">221</span>    }<a name="line.221"></a>
+<span class="sourceLineNo">222</span>    nspDesc =<a name="line.222"></a>
+<span class="sourceLineNo">223</span>        NamespaceDescriptor.create(prefix 
+ "vq3")<a name="line.223"></a>
+<span class="sourceLineNo">224</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "10")<a 
name="line.224"></a>
+<span class="sourceLineNo">225</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "sciigd").build();<a 
name="line.225"></a>
+<span class="sourceLineNo">226</span>    try {<a name="line.226"></a>
+<span class="sourceLineNo">227</span>      ADMIN.createNamespace(nspDesc);<a 
name="line.227"></a>
+<span class="sourceLineNo">228</span>    } catch (Exception exp) {<a 
name="line.228"></a>
+<span class="sourceLineNo">229</span>      LOG.warn(exp.toString(), exp);<a 
name="line.229"></a>
+<span class="sourceLineNo">230</span>      exceptionCaught = true;<a 
name="line.230"></a>
+<span class="sourceLineNo">231</span>    } finally {<a name="line.231"></a>
+<span class="sourceLineNo">232</span>      assertTrue(exceptionCaught);<a 
name="line.232"></a>
+<span class="sourceLineNo">233</span>      
assertFalse(fs.exists(FSUtils.getNamespaceDir(rootDir, nspDesc.getName())));<a 
name="line.233"></a>
+<span class="sourceLineNo">234</span>    }<a name="line.234"></a>
+<span class="sourceLineNo">235</span>    nspDesc =<a name="line.235"></a>
+<span class="sourceLineNo">236</span>        NamespaceDescriptor.create(prefix 
+ "vq4")<a name="line.236"></a>
+<span class="sourceLineNo">237</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "10")<a 
name="line.237"></a>
+<span class="sourceLineNo">238</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "-1500").build();<a 
name="line.238"></a>
+<span class="sourceLineNo">239</span>    try {<a name="line.239"></a>
+<span class="sourceLineNo">240</span>      ADMIN.createNamespace(nspDesc);<a 
name="line.240"></a>
+<span class="sourceLineNo">241</span>    } catch (Exception exp) {<a 
name="line.241"></a>
+<span class="sourceLineNo">242</span>      LOG.warn(exp.toString(), exp);<a 
name="line.242"></a>
+<span class="sourceLineNo">243</span>      exceptionCaught = true;<a 
name="line.243"></a>
+<span class="sourceLineNo">244</span>    } finally {<a name="line.244"></a>
+<span class="sourceLineNo">245</span>      assertTrue(exceptionCaught);<a 
name="line.245"></a>
+<span class="sourceLineNo">246</span>      
assertFalse(fs.exists(FSUtils.getNamespaceDir(rootDir, nspDesc.getName())));<a 
name="line.246"></a>
+<span class="sourceLineNo">247</span>    }<a name="line.247"></a>
+<span class="sourceLineNo">248</span>  }<a name="line.248"></a>
+<span class="sourceLineNo">249</span><a name="line.249"></a>
+<span class="sourceLineNo">250</span>  @Test<a name="line.250"></a>
+<span class="sourceLineNo">251</span>  public void testDeleteTable() throws 
Exception {<a name="line.251"></a>
+<span class="sourceLineNo">252</span>    String namespace = prefix + 
"_dummy";<a name="line.252"></a>
+<span class="sourceLineNo">253</span>    NamespaceDescriptor nspDesc =<a 
name="line.253"></a>
+<span class="sourceLineNo">254</span>        
NamespaceDescriptor.create(namespace)<a name="line.254"></a>
+<span class="sourceLineNo">255</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "100")<a 
name="line.255"></a>
+<span class="sourceLineNo">256</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "3").build();<a 
name="line.256"></a>
+<span class="sourceLineNo">257</span>    ADMIN.createNamespace(nspDesc);<a 
name="line.257"></a>
+<span class="sourceLineNo">258</span>    assertNotNull("Namespace descriptor 
found null.", ADMIN.getNamespaceDescriptor(namespace));<a name="line.258"></a>
+<span class="sourceLineNo">259</span>    NamespaceTableAndRegionInfo stateInfo 
= getNamespaceState(nspDesc.getName());<a name="line.259"></a>
+<span class="sourceLineNo">260</span>    assertNotNull("Namespace state found 
null for " + namespace, stateInfo);<a name="line.260"></a>
+<span class="sourceLineNo">261</span>    HColumnDescriptor fam1 = new 
HColumnDescriptor("fam1");<a name="line.261"></a>
+<span class="sourceLineNo">262</span>    HTableDescriptor tableDescOne =<a 
name="line.262"></a>
+<span class="sourceLineNo">263</span>        new 
HTableDescriptor(TableName.valueOf(namespace + TableName.NAMESPACE_DELIM + 
"table1"));<a name="line.263"></a>
+<span class="sourceLineNo">264</span>    tableDescOne.addFamily(fam1);<a 
name="line.264"></a>
+<span class="sourceLineNo">265</span>    HTableDescriptor tableDescTwo =<a 
name="line.265"></a>
+<span class="sourceLineNo">266</span>        new 
HTableDescriptor(TableName.valueOf(namespace + TableName.NAMESPACE_DELIM + 
"table2"));<a name="line.266"></a>
+<span class="sourceLineNo">267</span>    tableDescTwo.addFamily(fam1);<a 
name="line.267"></a>
+<span class="sourceLineNo">268</span>    ADMIN.createTable(tableDescOne);<a 
name="line.268"></a>
+<span class="sourceLineNo">269</span>    ADMIN.createTable(tableDescTwo, 
Bytes.toBytes("AAA"), Bytes.toBytes("ZZZ"), 5);<a name="line.269"></a>
+<span class="sourceLineNo">270</span>    stateInfo = 
getNamespaceState(nspDesc.getName());<a name="line.270"></a>
+<span class="sourceLineNo">271</span>    assertNotNull("Namespace state found 
to be null.", stateInfo);<a name="line.271"></a>
+<span class="sourceLineNo">272</span>    assertEquals(2, 
stateInfo.getTables().size());<a name="line.272"></a>
+<span class="sourceLineNo">273</span>    assertEquals(5, 
stateInfo.getRegionCountOfTable(tableDescTwo.getTableName()));<a 
name="line.273"></a>
+<span class="sourceLineNo">274</span>    assertEquals(6, 
stateInfo.getRegionCount());<a name="line.274"></a>
+<span class="sourceLineNo">275</span>    
ADMIN.disableTable(tableDescOne.getTableName());<a name="line.275"></a>
+<span class="sourceLineNo">276</span>    
deleteTable(tableDescOne.getTableName());<a name="line.276"></a>
+<span class="sourceLineNo">277</span>    stateInfo = 
getNamespaceState(nspDesc.getName());<a name="line.277"></a>
+<span class="sourceLineNo">278</span>    assertNotNull("Namespace state found 
to be null.", stateInfo);<a name="line.278"></a>
+<span class="sourceLineNo">279</span>    assertEquals(5, 
stateInfo.getRegionCount());<a name="line.279"></a>
+<span class="sourceLineNo">280</span>    assertEquals(1, 
stateInfo.getTables().size());<a name="line.280"></a>
+<span class="sourceLineNo">281</span>    
ADMIN.disableTable(tableDescTwo.getTableName());<a name="line.281"></a>
+<span class="sourceLineNo">282</span>    
deleteTable(tableDescTwo.getTableName());<a name="line.282"></a>
+<span class="sourceLineNo">283</span>    ADMIN.deleteNamespace(namespace);<a 
name="line.283"></a>
+<span class="sourceLineNo">284</span>    stateInfo = 
getNamespaceState(namespace);<a name="line.284"></a>
+<span class="sourceLineNo">285</span>    assertNull("Namespace state not found 
to be null.", stateInfo);<a name="line.285"></a>
+<span class="sourceLineNo">286</span>  }<a name="line.286"></a>
+<span class="sourceLineNo">287</span><a name="line.287"></a>
+<span class="sourceLineNo">288</span>  public static class 
CPRegionServerObserver<a name="line.288"></a>
+<span class="sourceLineNo">289</span>      implements RegionServerCoprocessor, 
RegionServerObserver {<a name="line.289"></a>
+<span class="sourceLineNo">290</span>    private volatile boolean 
shouldFailMerge = false;<a name="line.290"></a>
+<span class="sourceLineNo">291</span><a name="line.291"></a>
+<span class="sourceLineNo">292</span>    public void failMerge(boolean fail) 
{<a name="line.292"></a>
+<span class="sourceLineNo">293</span>      shouldFailMerge = fail;<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>    private boolean triggered = false;<a 
name="line.296"></a>
+<span class="sourceLineNo">297</span><a name="line.297"></a>
+<span class="sourceLineNo">298</span>    public synchronized void 
waitUtilTriggered() throws InterruptedException {<a name="line.298"></a>
+<span class="sourceLineNo">299</span>      while (!triggered) {<a 
name="line.299"></a>
+<span class="sourceLineNo">300</span>        wait();<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>    @Override<a name="line.304"></a>
+<span class="sourceLineNo">305</span>    public 
Optional&lt;RegionServerObserver&gt; getRegionServerObserver() {<a 
name="line.305"></a>
+<span class="sourceLineNo">306</span>      return Optional.of(this);<a 
name="line.306"></a>
+<span class="sourceLineNo">307</span>    }<a name="line.307"></a>
+<span class="sourceLineNo">308</span>  }<a name="line.308"></a>
+<span class="sourceLineNo">309</span><a name="line.309"></a>
+<span class="sourceLineNo">310</span>  public static class CPMasterObserver 
implements MasterCoprocessor, MasterObserver {<a name="line.310"></a>
+<span class="sourceLineNo">311</span>    private volatile boolean 
shouldFailMerge = false;<a name="line.311"></a>
+<span class="sourceLineNo">312</span><a name="line.312"></a>
+<span class="sourceLineNo">313</span>    public void failMerge(boolean fail) 
{<a name="line.313"></a>
+<span class="sourceLineNo">314</span>      shouldFailMerge = fail;<a 
name="line.314"></a>
+<span class="sourceLineNo">315</span>    }<a name="line.315"></a>
+<span class="sourceLineNo">316</span><a name="line.316"></a>
+<span class="sourceLineNo">317</span>    @Override<a name="line.317"></a>
+<span class="sourceLineNo">318</span>    public Optional&lt;MasterObserver&gt; 
getMasterObserver() {<a name="line.318"></a>
+<span class="sourceLineNo">319</span>      return Optional.of(this);<a 
name="line.319"></a>
+<span class="sourceLineNo">320</span>    }<a name="line.320"></a>
+<span class="sourceLineNo">321</span><a name="line.321"></a>
+<span class="sourceLineNo">322</span>    @Override<a name="line.322"></a>
+<span class="sourceLineNo">323</span>    public synchronized void 
preMergeRegionsAction(<a name="line.323"></a>
+<span class="sourceLineNo">324</span>        final 
ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.324"></a>
+<span class="sourceLineNo">325</span>        final RegionInfo[] 
regionsToMerge) throws IOException {<a name="line.325"></a>
+<span class="sourceLineNo">326</span>      notifyAll();<a name="line.326"></a>
+<span class="sourceLineNo">327</span>      if (shouldFailMerge) {<a 
name="line.327"></a>
+<span class="sourceLineNo">328</span>        throw new IOException("fail 
merge");<a name="line.328"></a>
+<span class="sourceLineNo">329</span>      }<a name="line.329"></a>
+<span class="sourceLineNo">330</span>    }<a name="line.330"></a>
+<span class="sourceLineNo">331</span>  }<a name="line.331"></a>
+<span class="sourceLineNo">332</span><a name="line.332"></a>
+<span class="sourceLineNo">333</span>  @Test<a name="line.333"></a>
+<span class="sourceLineNo">334</span>  public void testRegionMerge() throws 
Exception {<a name="line.334"></a>
+<span class="sourceLineNo">335</span>    String nsp1 = prefix + 
"_regiontest";<a name="line.335"></a>
+<span class="sourceLineNo">336</span>    final int initialRegions = 3;<a 
name="line.336"></a>
+<span class="sourceLineNo">337</span>    NamespaceDescriptor nspDesc =<a 
name="line.337"></a>
+<span class="sourceLineNo">338</span>        
NamespaceDescriptor.create(nsp1)<a name="line.338"></a>
+<span class="sourceLineNo">339</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_REGIONS, "" + initialRegions)<a 
name="line.339"></a>
+<span class="sourceLineNo">340</span>            
.addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();<a 
name="line.340"></a>
+<span class="sourceLineNo">341</span>    ADMIN.createNamespace(nspDesc);<a 
name="line.341"></a>
+<span class="sourceLineNo">342</span>    final TableName tableTwo = 
TableName.valueOf(nsp1 + TableName.NAMESPACE_DELIM + "table2");<a 
name="line.342"></a>
+<span class="sourceLineNo">343</span>    byte[] columnFamily = 
Bytes.toBytes("info");<a name="line.343"></a>
+<span class="sourceLineNo">344</span>    HTableDescriptor tableDescOne = new 
HTableDescriptor(tableTwo);<a name="line.344"></a>
+<span class="sourceLineNo">345</span>    tableDescOne.addFamily(new 
HColumnDescriptor(columnFamily));<a name="line.345"></a>
+<span class="sourceLineNo">346</span>    ADMIN.createTable(tableDescOne, 
Bytes.toBytes("0"), Bytes.toBytes("9"), initialRegions);<a name="line.346"></a>
+<span class="sourceLineNo">347</span>    Connection connection = 
ConnectionFactory.createConnection(UTIL.getConfiguration());<a 
name="line.347"></a>
+<span class="sourceLineNo">348</span>    try (Table table = 
connection.getTable(tableTwo)) {<a name="line.348"></a>
+<span class="sourceLineNo">349</span>      UTIL.loadNumericRows(table, 
Bytes.toBytes("info"), 1000, 1999);<a name="line.349"></a>
+<span class="sourceLineNo">350</span>    }<a name="line.350"></a>
+<span class="sourceLineNo">351</span>    ADMIN.flush(tableTwo);<a 
name="line.351"></a>
+<span class="sourceLineNo">352</span>    List&lt;RegionInfo&gt; hris = 
ADMIN.getRegions(tableTwo);<a name="line.352"></a>
+<span class="sourceLineNo">353</span>    assertEquals(initialRegions, 
hris.size());<a name="line.353"></a>
+<span class="sourceLineNo">354</span>    Collections.sort(hris, 
RegionInfo.COMPARATOR);<a name="line.354"></a>
+<span class="sourceLineNo">355</span>    Future&lt;?&gt; f = 
ADMIN.mergeRegionsAsync(<a name="line.355"></a>
+<span class="sourceLineNo">356</span>      
hris.get(0).getEncodedNameAsBytes(),<a name="line.356"></a>
+<span class="sourceLineNo">357</span>      
hris.get(1).getEncodedNameAsBytes(),<a name="line.357"></a>
+<span class="sourceLineNo">358</span>      false);<a name="line.358"></a>
+<span class="sourceLineNo">359</span>    f.get(10, TimeUnit.SECONDS);<a 
name="line.359"></a>
+<span class="sourceLineNo">360</span><a name="line.360"></a>
+<span class="sourceLineNo">361</span>    hris = ADMIN.getRegions(tableTwo);<a 
name="line.361"></a>
+<span class="sourceLineNo">362</span>    assertEquals(initialRegions - 1, 
hris.size());<a name="line.362"></a>
+<span class="sourceLineNo">363</span>    Collections.sort(hris, 
RegionInfo.COMPARATOR);<a name="line.363"></a>
+<span class="sourceLineNo">364</span>    UTIL.compact(tableTwo, true);<a 
name="line.364"></a>
+<span class="sourceLineNo">365</span>    
ADMIN.splitRegionAsync(hris.get(0).getRegionName(), 
Bytes.toBytes("3")).get(10,<a name="line.365"></a>
+<span class="sourceLineNo">366</span>      TimeUnit.SECONDS);<a 
name="line.366"></a>
+<span class="sourceLineNo">367</span>    hris = ADMIN.getRegions(tableTwo);<a 
name="line.367"></a>
+<span class="sourceLineNo">368</span>    assertEquals(initialRegions, 
hris.size());<a name="line.368"></a>
+<span class="sourceLineNo">369</span>    Collections.sort(hris, 
RegionInfo.COMPARATOR);<a name="line.369"></a>
+<span class="sourceLineNo">370</span><a name="line.370"></a>
+<span class="sourceLineNo">371</span>    // Fail region merge through 
Coprocessor hook<a name="line.371"></a>
+<span class="sourceLineNo">372</span>    MiniHBaseCluster cluster = 
UTIL.getHBaseCluster();<a name="line.372"></a>
+<span class="sourceLineNo">373</span>    MasterCoprocessorHost cpHost = 
cluster.getMaster().getMasterCoprocessorHost();<a name="line.373"></a>
+<span class="sourceLineNo">374</span>    Coprocessor coprocessor = 
cpHost.findCoprocessor(CPMasterObserver.class);<a name="line.374"></a>
+<span class="sourceLineNo">375</span>    CPMasterObserver masterObserver = 
(CPMasterObserver) coprocessor;<a name="line.375"></a>
+<span class="sourceLineNo">376</span>    masterObserver.failMerge(true);<a 
name="line.376"></a>
+<span class="sourceLineNo">377</span><a name="line.377"></a>
+<span class="sourceLineNo">378</span>    f = ADMIN.mergeRegionsAsync(<a 
name="line.378"></a>
+<span class="sourceLineNo">379</span>      
hris.get(1).getEncodedNameAsBytes(),<a name="line.379"></a>
+<span class="sourceLineNo">380</span>      
hris.get(2).getEncodedNameAsBytes(),<a name="line.380"></a>
+<span class="sourceLineNo">381</span>      false);<a name="line.381"></a>
+<span class="sourceLineNo">382</span>    try {<a name="line.382"></a>
+<span class="sourceLineNo">383</span>      f.get(10, TimeUnit.SECONDS);<a 
name="line.383"></a>
+<span class="sourceLineNo">384</span>      fail("Merge was supposed to 
fail!");<a name="line.384"></a>
+<span class="sourceLineNo">385</span>    } catch (ExecutionException ee) {<a 
name="line.385"></a>
+<span class="sourceLineNo">386</span>      // Expected.<a name="line.386"></a>
+<span class="sourceLineNo">387</span>    }<a name="line.387"></a>
+<span class="sourceLineNo">388</span>    hris = ADMIN.getRegions(tableTwo);<a 
name="line.388"></a>
+<span class="sourceLineNo">389</span>    assertEquals(initialRegions, 
hris.size());<a name="line.389"></a>
+<span class="sourceLineNo">390</span>    Collections.sort(hris, 
RegionInfo.COMPARATOR);<a name="line.390"></a>
+<span class="sourceLineNo">391</span>    // verify that we cannot split<a 
name="line.391"></a>
 <span class="sourceLineNo">392</span>    try {<a name="line.392"></a>
 <span class="sourceLineNo">393</span>      ADMIN.split(tableTwo, 
Bytes.toBytes("6"));<a name="line.393"></a>
 <span class="sourceLineNo">394</span>      fail();<a name="line.394"></a>
@@ -404,7 +404,7 @@
 <span class="sourceLineNo">396</span>      // Expected<a name="line.396"></a>
 <span class="sourceLineNo">397</span>    }<a name="line.397"></a>
 <span class="sourceLineNo">398</span>    Thread.sleep(2000);<a 
name="line.398"></a>
-<span class="sourceLineNo">399</span>    assertEquals(initialRegions, 
ADMIN.getTableRegions(tableTwo).size());<a name="line.399"></a>
+<span class="sourceLineNo">399</span>    assertEquals(initialRegions, 
ADMIN.getRegions(tableTwo).size());<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>  /*<a name="line.402"></a>

Reply via email to