hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [10/19] hbase-site git commit: Published site at 1f999c1e2bba62fda0fb426a168afa338b31c251.
Date Tue, 08 Dec 2015 05:36:52 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0aeb993e/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.RedirectServlet.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.RedirectServlet.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.RedirectServlet.html
index 0cc0caf..601f189 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.RedirectServlet.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.RedirectServlet.html
@@ -2194,686 +2194,690 @@
 <span class="sourceLineNo">2186</span>    return masterActiveTime;<a name="line.2186"></a>
 <span class="sourceLineNo">2187</span>  }<a name="line.2187"></a>
 <span class="sourceLineNo">2188</span><a name="line.2188"></a>
-<span class="sourceLineNo">2189</span>  public int getRegionServerInfoPort(final ServerName sn) {<a name="line.2189"></a>
-<span class="sourceLineNo">2190</span>    RegionServerInfo info = this.regionServerTracker.getRegionServerInfo(sn);<a name="line.2190"></a>
-<span class="sourceLineNo">2191</span>    if (info == null || info.getInfoPort() == 0) {<a name="line.2191"></a>
-<span class="sourceLineNo">2192</span>      return conf.getInt(HConstants.REGIONSERVER_INFO_PORT,<a name="line.2192"></a>
-<span class="sourceLineNo">2193</span>        HConstants.DEFAULT_REGIONSERVER_INFOPORT);<a name="line.2193"></a>
-<span class="sourceLineNo">2194</span>    }<a name="line.2194"></a>
-<span class="sourceLineNo">2195</span>    return info.getInfoPort();<a name="line.2195"></a>
-<span class="sourceLineNo">2196</span>  }<a name="line.2196"></a>
-<span class="sourceLineNo">2197</span><a name="line.2197"></a>
-<span class="sourceLineNo">2198</span>  public String getRegionServerVersion(final ServerName sn) {<a name="line.2198"></a>
-<span class="sourceLineNo">2199</span>    RegionServerInfo info = this.regionServerTracker.getRegionServerInfo(sn);<a name="line.2199"></a>
-<span class="sourceLineNo">2200</span>    if (info != null &amp;&amp; info.hasVersionInfo()) {<a name="line.2200"></a>
-<span class="sourceLineNo">2201</span>      return info.getVersionInfo().getVersion();<a name="line.2201"></a>
-<span class="sourceLineNo">2202</span>    }<a name="line.2202"></a>
-<span class="sourceLineNo">2203</span>    return "Unknown";<a name="line.2203"></a>
-<span class="sourceLineNo">2204</span>  }<a name="line.2204"></a>
-<span class="sourceLineNo">2205</span><a name="line.2205"></a>
-<span class="sourceLineNo">2206</span>  /**<a name="line.2206"></a>
-<span class="sourceLineNo">2207</span>   * @return array of coprocessor SimpleNames.<a name="line.2207"></a>
-<span class="sourceLineNo">2208</span>   */<a name="line.2208"></a>
-<span class="sourceLineNo">2209</span>  public String[] getMasterCoprocessors() {<a name="line.2209"></a>
-<span class="sourceLineNo">2210</span>    Set&lt;String&gt; masterCoprocessors = getMasterCoprocessorHost().getCoprocessors();<a name="line.2210"></a>
-<span class="sourceLineNo">2211</span>    return masterCoprocessors.toArray(new String[masterCoprocessors.size()]);<a name="line.2211"></a>
-<span class="sourceLineNo">2212</span>  }<a name="line.2212"></a>
-<span class="sourceLineNo">2213</span><a name="line.2213"></a>
-<span class="sourceLineNo">2214</span>  @Override<a name="line.2214"></a>
-<span class="sourceLineNo">2215</span>  public void abort(final String msg, final Throwable t) {<a name="line.2215"></a>
-<span class="sourceLineNo">2216</span>    if (isAborted() || isStopped()) {<a name="line.2216"></a>
-<span class="sourceLineNo">2217</span>      return;<a name="line.2217"></a>
-<span class="sourceLineNo">2218</span>    }<a name="line.2218"></a>
-<span class="sourceLineNo">2219</span>    if (cpHost != null) {<a name="line.2219"></a>
-<span class="sourceLineNo">2220</span>      // HBASE-4014: dump a list of loaded coprocessors.<a name="line.2220"></a>
-<span class="sourceLineNo">2221</span>      LOG.fatal("Master server abort: loaded coprocessors are: " +<a name="line.2221"></a>
-<span class="sourceLineNo">2222</span>          getLoadedCoprocessors());<a name="line.2222"></a>
-<span class="sourceLineNo">2223</span>    }<a name="line.2223"></a>
-<span class="sourceLineNo">2224</span>    if (t != null) LOG.fatal(msg, t);<a name="line.2224"></a>
-<span class="sourceLineNo">2225</span>    stopMaster();<a name="line.2225"></a>
-<span class="sourceLineNo">2226</span>  }<a name="line.2226"></a>
-<span class="sourceLineNo">2227</span><a name="line.2227"></a>
-<span class="sourceLineNo">2228</span>  @Override<a name="line.2228"></a>
-<span class="sourceLineNo">2229</span>  public ZooKeeperWatcher getZooKeeper() {<a name="line.2229"></a>
-<span class="sourceLineNo">2230</span>    return zooKeeper;<a name="line.2230"></a>
-<span class="sourceLineNo">2231</span>  }<a name="line.2231"></a>
-<span class="sourceLineNo">2232</span><a name="line.2232"></a>
-<span class="sourceLineNo">2233</span>  @Override<a name="line.2233"></a>
-<span class="sourceLineNo">2234</span>  public MasterCoprocessorHost getMasterCoprocessorHost() {<a name="line.2234"></a>
-<span class="sourceLineNo">2235</span>    return cpHost;<a name="line.2235"></a>
-<span class="sourceLineNo">2236</span>  }<a name="line.2236"></a>
-<span class="sourceLineNo">2237</span><a name="line.2237"></a>
-<span class="sourceLineNo">2238</span>  @Override<a name="line.2238"></a>
-<span class="sourceLineNo">2239</span>  public MasterQuotaManager getMasterQuotaManager() {<a name="line.2239"></a>
-<span class="sourceLineNo">2240</span>    return quotaManager;<a name="line.2240"></a>
-<span class="sourceLineNo">2241</span>  }<a name="line.2241"></a>
-<span class="sourceLineNo">2242</span><a name="line.2242"></a>
-<span class="sourceLineNo">2243</span>  @Override<a name="line.2243"></a>
-<span class="sourceLineNo">2244</span>  public ProcedureExecutor&lt;MasterProcedureEnv&gt; getMasterProcedureExecutor() {<a name="line.2244"></a>
-<span class="sourceLineNo">2245</span>    return procedureExecutor;<a name="line.2245"></a>
-<span class="sourceLineNo">2246</span>  }<a name="line.2246"></a>
-<span class="sourceLineNo">2247</span><a name="line.2247"></a>
-<span class="sourceLineNo">2248</span>  @Override<a name="line.2248"></a>
-<span class="sourceLineNo">2249</span>  public ServerName getServerName() {<a name="line.2249"></a>
-<span class="sourceLineNo">2250</span>    return this.serverName;<a name="line.2250"></a>
-<span class="sourceLineNo">2251</span>  }<a name="line.2251"></a>
-<span class="sourceLineNo">2252</span><a name="line.2252"></a>
-<span class="sourceLineNo">2253</span>  @Override<a name="line.2253"></a>
-<span class="sourceLineNo">2254</span>  public AssignmentManager getAssignmentManager() {<a name="line.2254"></a>
-<span class="sourceLineNo">2255</span>    return this.assignmentManager;<a name="line.2255"></a>
-<span class="sourceLineNo">2256</span>  }<a name="line.2256"></a>
-<span class="sourceLineNo">2257</span><a name="line.2257"></a>
-<span class="sourceLineNo">2258</span>  public MemoryBoundedLogMessageBuffer getRegionServerFatalLogBuffer() {<a name="line.2258"></a>
-<span class="sourceLineNo">2259</span>    return rsFatals;<a name="line.2259"></a>
+<span class="sourceLineNo">2189</span>  public int getNumWALFiles() {<a name="line.2189"></a>
+<span class="sourceLineNo">2190</span>    return procedureStore != null ? procedureStore.getActiveLogs().size() : 0;<a name="line.2190"></a>
+<span class="sourceLineNo">2191</span>  }<a name="line.2191"></a>
+<span class="sourceLineNo">2192</span><a name="line.2192"></a>
+<span class="sourceLineNo">2193</span>  public int getRegionServerInfoPort(final ServerName sn) {<a name="line.2193"></a>
+<span class="sourceLineNo">2194</span>    RegionServerInfo info = this.regionServerTracker.getRegionServerInfo(sn);<a name="line.2194"></a>
+<span class="sourceLineNo">2195</span>    if (info == null || info.getInfoPort() == 0) {<a name="line.2195"></a>
+<span class="sourceLineNo">2196</span>      return conf.getInt(HConstants.REGIONSERVER_INFO_PORT,<a name="line.2196"></a>
+<span class="sourceLineNo">2197</span>        HConstants.DEFAULT_REGIONSERVER_INFOPORT);<a name="line.2197"></a>
+<span class="sourceLineNo">2198</span>    }<a name="line.2198"></a>
+<span class="sourceLineNo">2199</span>    return info.getInfoPort();<a name="line.2199"></a>
+<span class="sourceLineNo">2200</span>  }<a name="line.2200"></a>
+<span class="sourceLineNo">2201</span><a name="line.2201"></a>
+<span class="sourceLineNo">2202</span>  public String getRegionServerVersion(final ServerName sn) {<a name="line.2202"></a>
+<span class="sourceLineNo">2203</span>    RegionServerInfo info = this.regionServerTracker.getRegionServerInfo(sn);<a name="line.2203"></a>
+<span class="sourceLineNo">2204</span>    if (info != null &amp;&amp; info.hasVersionInfo()) {<a name="line.2204"></a>
+<span class="sourceLineNo">2205</span>      return info.getVersionInfo().getVersion();<a name="line.2205"></a>
+<span class="sourceLineNo">2206</span>    }<a name="line.2206"></a>
+<span class="sourceLineNo">2207</span>    return "Unknown";<a name="line.2207"></a>
+<span class="sourceLineNo">2208</span>  }<a name="line.2208"></a>
+<span class="sourceLineNo">2209</span><a name="line.2209"></a>
+<span class="sourceLineNo">2210</span>  /**<a name="line.2210"></a>
+<span class="sourceLineNo">2211</span>   * @return array of coprocessor SimpleNames.<a name="line.2211"></a>
+<span class="sourceLineNo">2212</span>   */<a name="line.2212"></a>
+<span class="sourceLineNo">2213</span>  public String[] getMasterCoprocessors() {<a name="line.2213"></a>
+<span class="sourceLineNo">2214</span>    Set&lt;String&gt; masterCoprocessors = getMasterCoprocessorHost().getCoprocessors();<a name="line.2214"></a>
+<span class="sourceLineNo">2215</span>    return masterCoprocessors.toArray(new String[masterCoprocessors.size()]);<a name="line.2215"></a>
+<span class="sourceLineNo">2216</span>  }<a name="line.2216"></a>
+<span class="sourceLineNo">2217</span><a name="line.2217"></a>
+<span class="sourceLineNo">2218</span>  @Override<a name="line.2218"></a>
+<span class="sourceLineNo">2219</span>  public void abort(final String msg, final Throwable t) {<a name="line.2219"></a>
+<span class="sourceLineNo">2220</span>    if (isAborted() || isStopped()) {<a name="line.2220"></a>
+<span class="sourceLineNo">2221</span>      return;<a name="line.2221"></a>
+<span class="sourceLineNo">2222</span>    }<a name="line.2222"></a>
+<span class="sourceLineNo">2223</span>    if (cpHost != null) {<a name="line.2223"></a>
+<span class="sourceLineNo">2224</span>      // HBASE-4014: dump a list of loaded coprocessors.<a name="line.2224"></a>
+<span class="sourceLineNo">2225</span>      LOG.fatal("Master server abort: loaded coprocessors are: " +<a name="line.2225"></a>
+<span class="sourceLineNo">2226</span>          getLoadedCoprocessors());<a name="line.2226"></a>
+<span class="sourceLineNo">2227</span>    }<a name="line.2227"></a>
+<span class="sourceLineNo">2228</span>    if (t != null) LOG.fatal(msg, t);<a name="line.2228"></a>
+<span class="sourceLineNo">2229</span>    stopMaster();<a name="line.2229"></a>
+<span class="sourceLineNo">2230</span>  }<a name="line.2230"></a>
+<span class="sourceLineNo">2231</span><a name="line.2231"></a>
+<span class="sourceLineNo">2232</span>  @Override<a name="line.2232"></a>
+<span class="sourceLineNo">2233</span>  public ZooKeeperWatcher getZooKeeper() {<a name="line.2233"></a>
+<span class="sourceLineNo">2234</span>    return zooKeeper;<a name="line.2234"></a>
+<span class="sourceLineNo">2235</span>  }<a name="line.2235"></a>
+<span class="sourceLineNo">2236</span><a name="line.2236"></a>
+<span class="sourceLineNo">2237</span>  @Override<a name="line.2237"></a>
+<span class="sourceLineNo">2238</span>  public MasterCoprocessorHost getMasterCoprocessorHost() {<a name="line.2238"></a>
+<span class="sourceLineNo">2239</span>    return cpHost;<a name="line.2239"></a>
+<span class="sourceLineNo">2240</span>  }<a name="line.2240"></a>
+<span class="sourceLineNo">2241</span><a name="line.2241"></a>
+<span class="sourceLineNo">2242</span>  @Override<a name="line.2242"></a>
+<span class="sourceLineNo">2243</span>  public MasterQuotaManager getMasterQuotaManager() {<a name="line.2243"></a>
+<span class="sourceLineNo">2244</span>    return quotaManager;<a name="line.2244"></a>
+<span class="sourceLineNo">2245</span>  }<a name="line.2245"></a>
+<span class="sourceLineNo">2246</span><a name="line.2246"></a>
+<span class="sourceLineNo">2247</span>  @Override<a name="line.2247"></a>
+<span class="sourceLineNo">2248</span>  public ProcedureExecutor&lt;MasterProcedureEnv&gt; getMasterProcedureExecutor() {<a name="line.2248"></a>
+<span class="sourceLineNo">2249</span>    return procedureExecutor;<a name="line.2249"></a>
+<span class="sourceLineNo">2250</span>  }<a name="line.2250"></a>
+<span class="sourceLineNo">2251</span><a name="line.2251"></a>
+<span class="sourceLineNo">2252</span>  @Override<a name="line.2252"></a>
+<span class="sourceLineNo">2253</span>  public ServerName getServerName() {<a name="line.2253"></a>
+<span class="sourceLineNo">2254</span>    return this.serverName;<a name="line.2254"></a>
+<span class="sourceLineNo">2255</span>  }<a name="line.2255"></a>
+<span class="sourceLineNo">2256</span><a name="line.2256"></a>
+<span class="sourceLineNo">2257</span>  @Override<a name="line.2257"></a>
+<span class="sourceLineNo">2258</span>  public AssignmentManager getAssignmentManager() {<a name="line.2258"></a>
+<span class="sourceLineNo">2259</span>    return this.assignmentManager;<a name="line.2259"></a>
 <span class="sourceLineNo">2260</span>  }<a name="line.2260"></a>
 <span class="sourceLineNo">2261</span><a name="line.2261"></a>
-<span class="sourceLineNo">2262</span>  public void shutdown() {<a name="line.2262"></a>
-<span class="sourceLineNo">2263</span>    if (cpHost != null) {<a name="line.2263"></a>
-<span class="sourceLineNo">2264</span>      try {<a name="line.2264"></a>
-<span class="sourceLineNo">2265</span>        cpHost.preShutdown();<a name="line.2265"></a>
-<span class="sourceLineNo">2266</span>      } catch (IOException ioe) {<a name="line.2266"></a>
-<span class="sourceLineNo">2267</span>        LOG.error("Error call master coprocessor preShutdown()", ioe);<a name="line.2267"></a>
-<span class="sourceLineNo">2268</span>      }<a name="line.2268"></a>
-<span class="sourceLineNo">2269</span>    }<a name="line.2269"></a>
-<span class="sourceLineNo">2270</span><a name="line.2270"></a>
-<span class="sourceLineNo">2271</span>    if (this.serverManager != null) {<a name="line.2271"></a>
-<span class="sourceLineNo">2272</span>      this.serverManager.shutdownCluster();<a name="line.2272"></a>
+<span class="sourceLineNo">2262</span>  public MemoryBoundedLogMessageBuffer getRegionServerFatalLogBuffer() {<a name="line.2262"></a>
+<span class="sourceLineNo">2263</span>    return rsFatals;<a name="line.2263"></a>
+<span class="sourceLineNo">2264</span>  }<a name="line.2264"></a>
+<span class="sourceLineNo">2265</span><a name="line.2265"></a>
+<span class="sourceLineNo">2266</span>  public void shutdown() {<a name="line.2266"></a>
+<span class="sourceLineNo">2267</span>    if (cpHost != null) {<a name="line.2267"></a>
+<span class="sourceLineNo">2268</span>      try {<a name="line.2268"></a>
+<span class="sourceLineNo">2269</span>        cpHost.preShutdown();<a name="line.2269"></a>
+<span class="sourceLineNo">2270</span>      } catch (IOException ioe) {<a name="line.2270"></a>
+<span class="sourceLineNo">2271</span>        LOG.error("Error call master coprocessor preShutdown()", ioe);<a name="line.2271"></a>
+<span class="sourceLineNo">2272</span>      }<a name="line.2272"></a>
 <span class="sourceLineNo">2273</span>    }<a name="line.2273"></a>
-<span class="sourceLineNo">2274</span>    if (this.clusterStatusTracker != null){<a name="line.2274"></a>
-<span class="sourceLineNo">2275</span>      try {<a name="line.2275"></a>
-<span class="sourceLineNo">2276</span>        this.clusterStatusTracker.setClusterDown();<a name="line.2276"></a>
-<span class="sourceLineNo">2277</span>      } catch (KeeperException e) {<a name="line.2277"></a>
-<span class="sourceLineNo">2278</span>        LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);<a name="line.2278"></a>
-<span class="sourceLineNo">2279</span>      }<a name="line.2279"></a>
-<span class="sourceLineNo">2280</span>    }<a name="line.2280"></a>
-<span class="sourceLineNo">2281</span>  }<a name="line.2281"></a>
-<span class="sourceLineNo">2282</span><a name="line.2282"></a>
-<span class="sourceLineNo">2283</span>  public void stopMaster() {<a name="line.2283"></a>
-<span class="sourceLineNo">2284</span>    if (cpHost != null) {<a name="line.2284"></a>
-<span class="sourceLineNo">2285</span>      try {<a name="line.2285"></a>
-<span class="sourceLineNo">2286</span>        cpHost.preStopMaster();<a name="line.2286"></a>
-<span class="sourceLineNo">2287</span>      } catch (IOException ioe) {<a name="line.2287"></a>
-<span class="sourceLineNo">2288</span>        LOG.error("Error call master coprocessor preStopMaster()", ioe);<a name="line.2288"></a>
-<span class="sourceLineNo">2289</span>      }<a name="line.2289"></a>
-<span class="sourceLineNo">2290</span>    }<a name="line.2290"></a>
-<span class="sourceLineNo">2291</span>    stop("Stopped by " + Thread.currentThread().getName());<a name="line.2291"></a>
-<span class="sourceLineNo">2292</span>  }<a name="line.2292"></a>
-<span class="sourceLineNo">2293</span><a name="line.2293"></a>
-<span class="sourceLineNo">2294</span>  void checkServiceStarted() throws ServerNotRunningYetException {<a name="line.2294"></a>
-<span class="sourceLineNo">2295</span>    if (!serviceStarted) {<a name="line.2295"></a>
-<span class="sourceLineNo">2296</span>      throw new ServerNotRunningYetException("Server is not running yet");<a name="line.2296"></a>
-<span class="sourceLineNo">2297</span>    }<a name="line.2297"></a>
-<span class="sourceLineNo">2298</span>  }<a name="line.2298"></a>
-<span class="sourceLineNo">2299</span><a name="line.2299"></a>
-<span class="sourceLineNo">2300</span>  void checkInitialized() throws PleaseHoldException, ServerNotRunningYetException {<a name="line.2300"></a>
-<span class="sourceLineNo">2301</span>    checkServiceStarted();<a name="line.2301"></a>
-<span class="sourceLineNo">2302</span>    if (!this.initialized) {<a name="line.2302"></a>
-<span class="sourceLineNo">2303</span>      throw new PleaseHoldException("Master is initializing");<a name="line.2303"></a>
-<span class="sourceLineNo">2304</span>    }<a name="line.2304"></a>
-<span class="sourceLineNo">2305</span>  }<a name="line.2305"></a>
-<span class="sourceLineNo">2306</span><a name="line.2306"></a>
-<span class="sourceLineNo">2307</span>  void checkNamespaceManagerReady() throws IOException {<a name="line.2307"></a>
-<span class="sourceLineNo">2308</span>    checkInitialized();<a name="line.2308"></a>
-<span class="sourceLineNo">2309</span>    if (tableNamespaceManager == null ||<a name="line.2309"></a>
-<span class="sourceLineNo">2310</span>        !tableNamespaceManager.isTableAvailableAndInitialized(true)) {<a name="line.2310"></a>
-<span class="sourceLineNo">2311</span>      throw new IOException("Table Namespace Manager not ready yet, try again later");<a name="line.2311"></a>
-<span class="sourceLineNo">2312</span>    }<a name="line.2312"></a>
-<span class="sourceLineNo">2313</span>  }<a name="line.2313"></a>
-<span class="sourceLineNo">2314</span>  /**<a name="line.2314"></a>
-<span class="sourceLineNo">2315</span>   * Report whether this master is currently the active master or not.<a name="line.2315"></a>
-<span class="sourceLineNo">2316</span>   * If not active master, we are parked on ZK waiting to become active.<a name="line.2316"></a>
-<span class="sourceLineNo">2317</span>   *<a name="line.2317"></a>
-<span class="sourceLineNo">2318</span>   * This method is used for testing.<a name="line.2318"></a>
-<span class="sourceLineNo">2319</span>   *<a name="line.2319"></a>
-<span class="sourceLineNo">2320</span>   * @return true if active master, false if not.<a name="line.2320"></a>
-<span class="sourceLineNo">2321</span>   */<a name="line.2321"></a>
-<span class="sourceLineNo">2322</span>  public boolean isActiveMaster() {<a name="line.2322"></a>
-<span class="sourceLineNo">2323</span>    return isActiveMaster;<a name="line.2323"></a>
-<span class="sourceLineNo">2324</span>  }<a name="line.2324"></a>
-<span class="sourceLineNo">2325</span><a name="line.2325"></a>
-<span class="sourceLineNo">2326</span>  /**<a name="line.2326"></a>
-<span class="sourceLineNo">2327</span>   * Report whether this master has completed with its initialization and is<a name="line.2327"></a>
-<span class="sourceLineNo">2328</span>   * ready.  If ready, the master is also the active master.  A standby master<a name="line.2328"></a>
-<span class="sourceLineNo">2329</span>   * is never ready.<a name="line.2329"></a>
-<span class="sourceLineNo">2330</span>   *<a name="line.2330"></a>
-<span class="sourceLineNo">2331</span>   * This method is used for testing.<a name="line.2331"></a>
-<span class="sourceLineNo">2332</span>   *<a name="line.2332"></a>
-<span class="sourceLineNo">2333</span>   * @return true if master is ready to go, false if not.<a name="line.2333"></a>
-<span class="sourceLineNo">2334</span>   */<a name="line.2334"></a>
-<span class="sourceLineNo">2335</span>  @Override<a name="line.2335"></a>
-<span class="sourceLineNo">2336</span>  public boolean isInitialized() {<a name="line.2336"></a>
-<span class="sourceLineNo">2337</span>    return initialized;<a name="line.2337"></a>
-<span class="sourceLineNo">2338</span>  }<a name="line.2338"></a>
-<span class="sourceLineNo">2339</span><a name="line.2339"></a>
-<span class="sourceLineNo">2340</span>  /**<a name="line.2340"></a>
-<span class="sourceLineNo">2341</span>   * ServerCrashProcessingEnabled is set false before completing assignMeta to prevent processing<a name="line.2341"></a>
-<span class="sourceLineNo">2342</span>   * of crashed servers.<a name="line.2342"></a>
-<span class="sourceLineNo">2343</span>   * @return true if assignMeta has completed;<a name="line.2343"></a>
-<span class="sourceLineNo">2344</span>   */<a name="line.2344"></a>
-<span class="sourceLineNo">2345</span>  @Override<a name="line.2345"></a>
-<span class="sourceLineNo">2346</span>  public boolean isServerCrashProcessingEnabled() {<a name="line.2346"></a>
-<span class="sourceLineNo">2347</span>    return this.serverCrashProcessingEnabled;<a name="line.2347"></a>
-<span class="sourceLineNo">2348</span>  }<a name="line.2348"></a>
-<span class="sourceLineNo">2349</span><a name="line.2349"></a>
-<span class="sourceLineNo">2350</span>  @VisibleForTesting<a name="line.2350"></a>
-<span class="sourceLineNo">2351</span>  public void setServerCrashProcessingEnabled(final boolean b) {<a name="line.2351"></a>
-<span class="sourceLineNo">2352</span>    this.serverCrashProcessingEnabled = b;<a name="line.2352"></a>
-<span class="sourceLineNo">2353</span>  }<a name="line.2353"></a>
-<span class="sourceLineNo">2354</span><a name="line.2354"></a>
-<span class="sourceLineNo">2355</span>  /**<a name="line.2355"></a>
-<span class="sourceLineNo">2356</span>   * Report whether this master has started initialization and is about to do meta region assignment<a name="line.2356"></a>
-<span class="sourceLineNo">2357</span>   * @return true if master is in initialization &amp;amp; about to assign hbase:meta regions<a name="line.2357"></a>
-<span class="sourceLineNo">2358</span>   */<a name="line.2358"></a>
-<span class="sourceLineNo">2359</span>  public boolean isInitializationStartsMetaRegionAssignment() {<a name="line.2359"></a>
-<span class="sourceLineNo">2360</span>    return this.initializationBeforeMetaAssignment;<a name="line.2360"></a>
-<span class="sourceLineNo">2361</span>  }<a name="line.2361"></a>
-<span class="sourceLineNo">2362</span><a name="line.2362"></a>
-<span class="sourceLineNo">2363</span>  public void assignRegion(HRegionInfo hri) {<a name="line.2363"></a>
-<span class="sourceLineNo">2364</span>    assignmentManager.assign(hri);<a name="line.2364"></a>
+<span class="sourceLineNo">2274</span><a name="line.2274"></a>
+<span class="sourceLineNo">2275</span>    if (this.serverManager != null) {<a name="line.2275"></a>
+<span class="sourceLineNo">2276</span>      this.serverManager.shutdownCluster();<a name="line.2276"></a>
+<span class="sourceLineNo">2277</span>    }<a name="line.2277"></a>
+<span class="sourceLineNo">2278</span>    if (this.clusterStatusTracker != null){<a name="line.2278"></a>
+<span class="sourceLineNo">2279</span>      try {<a name="line.2279"></a>
+<span class="sourceLineNo">2280</span>        this.clusterStatusTracker.setClusterDown();<a name="line.2280"></a>
+<span class="sourceLineNo">2281</span>      } catch (KeeperException e) {<a name="line.2281"></a>
+<span class="sourceLineNo">2282</span>        LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);<a name="line.2282"></a>
+<span class="sourceLineNo">2283</span>      }<a name="line.2283"></a>
+<span class="sourceLineNo">2284</span>    }<a name="line.2284"></a>
+<span class="sourceLineNo">2285</span>  }<a name="line.2285"></a>
+<span class="sourceLineNo">2286</span><a name="line.2286"></a>
+<span class="sourceLineNo">2287</span>  public void stopMaster() {<a name="line.2287"></a>
+<span class="sourceLineNo">2288</span>    if (cpHost != null) {<a name="line.2288"></a>
+<span class="sourceLineNo">2289</span>      try {<a name="line.2289"></a>
+<span class="sourceLineNo">2290</span>        cpHost.preStopMaster();<a name="line.2290"></a>
+<span class="sourceLineNo">2291</span>      } catch (IOException ioe) {<a name="line.2291"></a>
+<span class="sourceLineNo">2292</span>        LOG.error("Error call master coprocessor preStopMaster()", ioe);<a name="line.2292"></a>
+<span class="sourceLineNo">2293</span>      }<a name="line.2293"></a>
+<span class="sourceLineNo">2294</span>    }<a name="line.2294"></a>
+<span class="sourceLineNo">2295</span>    stop("Stopped by " + Thread.currentThread().getName());<a name="line.2295"></a>
+<span class="sourceLineNo">2296</span>  }<a name="line.2296"></a>
+<span class="sourceLineNo">2297</span><a name="line.2297"></a>
+<span class="sourceLineNo">2298</span>  void checkServiceStarted() throws ServerNotRunningYetException {<a name="line.2298"></a>
+<span class="sourceLineNo">2299</span>    if (!serviceStarted) {<a name="line.2299"></a>
+<span class="sourceLineNo">2300</span>      throw new ServerNotRunningYetException("Server is not running yet");<a name="line.2300"></a>
+<span class="sourceLineNo">2301</span>    }<a name="line.2301"></a>
+<span class="sourceLineNo">2302</span>  }<a name="line.2302"></a>
+<span class="sourceLineNo">2303</span><a name="line.2303"></a>
+<span class="sourceLineNo">2304</span>  void checkInitialized() throws PleaseHoldException, ServerNotRunningYetException {<a name="line.2304"></a>
+<span class="sourceLineNo">2305</span>    checkServiceStarted();<a name="line.2305"></a>
+<span class="sourceLineNo">2306</span>    if (!this.initialized) {<a name="line.2306"></a>
+<span class="sourceLineNo">2307</span>      throw new PleaseHoldException("Master is initializing");<a name="line.2307"></a>
+<span class="sourceLineNo">2308</span>    }<a name="line.2308"></a>
+<span class="sourceLineNo">2309</span>  }<a name="line.2309"></a>
+<span class="sourceLineNo">2310</span><a name="line.2310"></a>
+<span class="sourceLineNo">2311</span>  void checkNamespaceManagerReady() throws IOException {<a name="line.2311"></a>
+<span class="sourceLineNo">2312</span>    checkInitialized();<a name="line.2312"></a>
+<span class="sourceLineNo">2313</span>    if (tableNamespaceManager == null ||<a name="line.2313"></a>
+<span class="sourceLineNo">2314</span>        !tableNamespaceManager.isTableAvailableAndInitialized(true)) {<a name="line.2314"></a>
+<span class="sourceLineNo">2315</span>      throw new IOException("Table Namespace Manager not ready yet, try again later");<a name="line.2315"></a>
+<span class="sourceLineNo">2316</span>    }<a name="line.2316"></a>
+<span class="sourceLineNo">2317</span>  }<a name="line.2317"></a>
+<span class="sourceLineNo">2318</span>  /**<a name="line.2318"></a>
+<span class="sourceLineNo">2319</span>   * Report whether this master is currently the active master or not.<a name="line.2319"></a>
+<span class="sourceLineNo">2320</span>   * If not active master, we are parked on ZK waiting to become active.<a name="line.2320"></a>
+<span class="sourceLineNo">2321</span>   *<a name="line.2321"></a>
+<span class="sourceLineNo">2322</span>   * This method is used for testing.<a name="line.2322"></a>
+<span class="sourceLineNo">2323</span>   *<a name="line.2323"></a>
+<span class="sourceLineNo">2324</span>   * @return true if active master, false if not.<a name="line.2324"></a>
+<span class="sourceLineNo">2325</span>   */<a name="line.2325"></a>
+<span class="sourceLineNo">2326</span>  public boolean isActiveMaster() {<a name="line.2326"></a>
+<span class="sourceLineNo">2327</span>    return isActiveMaster;<a name="line.2327"></a>
+<span class="sourceLineNo">2328</span>  }<a name="line.2328"></a>
+<span class="sourceLineNo">2329</span><a name="line.2329"></a>
+<span class="sourceLineNo">2330</span>  /**<a name="line.2330"></a>
+<span class="sourceLineNo">2331</span>   * Report whether this master has completed with its initialization and is<a name="line.2331"></a>
+<span class="sourceLineNo">2332</span>   * ready.  If ready, the master is also the active master.  A standby master<a name="line.2332"></a>
+<span class="sourceLineNo">2333</span>   * is never ready.<a name="line.2333"></a>
+<span class="sourceLineNo">2334</span>   *<a name="line.2334"></a>
+<span class="sourceLineNo">2335</span>   * This method is used for testing.<a name="line.2335"></a>
+<span class="sourceLineNo">2336</span>   *<a name="line.2336"></a>
+<span class="sourceLineNo">2337</span>   * @return true if master is ready to go, false if not.<a name="line.2337"></a>
+<span class="sourceLineNo">2338</span>   */<a name="line.2338"></a>
+<span class="sourceLineNo">2339</span>  @Override<a name="line.2339"></a>
+<span class="sourceLineNo">2340</span>  public boolean isInitialized() {<a name="line.2340"></a>
+<span class="sourceLineNo">2341</span>    return initialized;<a name="line.2341"></a>
+<span class="sourceLineNo">2342</span>  }<a name="line.2342"></a>
+<span class="sourceLineNo">2343</span><a name="line.2343"></a>
+<span class="sourceLineNo">2344</span>  /**<a name="line.2344"></a>
+<span class="sourceLineNo">2345</span>   * ServerCrashProcessingEnabled is set false before completing assignMeta to prevent processing<a name="line.2345"></a>
+<span class="sourceLineNo">2346</span>   * of crashed servers.<a name="line.2346"></a>
+<span class="sourceLineNo">2347</span>   * @return true if assignMeta has completed;<a name="line.2347"></a>
+<span class="sourceLineNo">2348</span>   */<a name="line.2348"></a>
+<span class="sourceLineNo">2349</span>  @Override<a name="line.2349"></a>
+<span class="sourceLineNo">2350</span>  public boolean isServerCrashProcessingEnabled() {<a name="line.2350"></a>
+<span class="sourceLineNo">2351</span>    return this.serverCrashProcessingEnabled;<a name="line.2351"></a>
+<span class="sourceLineNo">2352</span>  }<a name="line.2352"></a>
+<span class="sourceLineNo">2353</span><a name="line.2353"></a>
+<span class="sourceLineNo">2354</span>  @VisibleForTesting<a name="line.2354"></a>
+<span class="sourceLineNo">2355</span>  public void setServerCrashProcessingEnabled(final boolean b) {<a name="line.2355"></a>
+<span class="sourceLineNo">2356</span>    this.serverCrashProcessingEnabled = b;<a name="line.2356"></a>
+<span class="sourceLineNo">2357</span>  }<a name="line.2357"></a>
+<span class="sourceLineNo">2358</span><a name="line.2358"></a>
+<span class="sourceLineNo">2359</span>  /**<a name="line.2359"></a>
+<span class="sourceLineNo">2360</span>   * Report whether this master has started initialization and is about to do meta region assignment<a name="line.2360"></a>
+<span class="sourceLineNo">2361</span>   * @return true if master is in initialization &amp;amp; about to assign hbase:meta regions<a name="line.2361"></a>
+<span class="sourceLineNo">2362</span>   */<a name="line.2362"></a>
+<span class="sourceLineNo">2363</span>  public boolean isInitializationStartsMetaRegionAssignment() {<a name="line.2363"></a>
+<span class="sourceLineNo">2364</span>    return this.initializationBeforeMetaAssignment;<a name="line.2364"></a>
 <span class="sourceLineNo">2365</span>  }<a name="line.2365"></a>
 <span class="sourceLineNo">2366</span><a name="line.2366"></a>
-<span class="sourceLineNo">2367</span>  /**<a name="line.2367"></a>
-<span class="sourceLineNo">2368</span>   * Compute the average load across all region servers.<a name="line.2368"></a>
-<span class="sourceLineNo">2369</span>   * Currently, this uses a very naive computation - just uses the number of<a name="line.2369"></a>
-<span class="sourceLineNo">2370</span>   * regions being served, ignoring stats about number of requests.<a name="line.2370"></a>
-<span class="sourceLineNo">2371</span>   * @return the average load<a name="line.2371"></a>
-<span class="sourceLineNo">2372</span>   */<a name="line.2372"></a>
-<span class="sourceLineNo">2373</span>  public double getAverageLoad() {<a name="line.2373"></a>
-<span class="sourceLineNo">2374</span>    if (this.assignmentManager == null) {<a name="line.2374"></a>
-<span class="sourceLineNo">2375</span>      return 0;<a name="line.2375"></a>
-<span class="sourceLineNo">2376</span>    }<a name="line.2376"></a>
-<span class="sourceLineNo">2377</span><a name="line.2377"></a>
-<span class="sourceLineNo">2378</span>    RegionStates regionStates = this.assignmentManager.getRegionStates();<a name="line.2378"></a>
-<span class="sourceLineNo">2379</span>    if (regionStates == null) {<a name="line.2379"></a>
-<span class="sourceLineNo">2380</span>      return 0;<a name="line.2380"></a>
-<span class="sourceLineNo">2381</span>    }<a name="line.2381"></a>
-<span class="sourceLineNo">2382</span>    return regionStates.getAverageLoad();<a name="line.2382"></a>
-<span class="sourceLineNo">2383</span>  }<a name="line.2383"></a>
-<span class="sourceLineNo">2384</span><a name="line.2384"></a>
-<span class="sourceLineNo">2385</span>  @Override<a name="line.2385"></a>
-<span class="sourceLineNo">2386</span>  public boolean registerService(Service instance) {<a name="line.2386"></a>
-<span class="sourceLineNo">2387</span>    /*<a name="line.2387"></a>
-<span class="sourceLineNo">2388</span>     * No stacking of instances is allowed for a single service name<a name="line.2388"></a>
-<span class="sourceLineNo">2389</span>     */<a name="line.2389"></a>
-<span class="sourceLineNo">2390</span>    Descriptors.ServiceDescriptor serviceDesc = instance.getDescriptorForType();<a name="line.2390"></a>
-<span class="sourceLineNo">2391</span>    if (coprocessorServiceHandlers.containsKey(serviceDesc.getFullName())) {<a name="line.2391"></a>
-<span class="sourceLineNo">2392</span>      LOG.error("Coprocessor service "+serviceDesc.getFullName()+<a name="line.2392"></a>
-<span class="sourceLineNo">2393</span>          " already registered, rejecting request from "+instance<a name="line.2393"></a>
-<span class="sourceLineNo">2394</span>      );<a name="line.2394"></a>
-<span class="sourceLineNo">2395</span>      return false;<a name="line.2395"></a>
-<span class="sourceLineNo">2396</span>    }<a name="line.2396"></a>
-<span class="sourceLineNo">2397</span><a name="line.2397"></a>
-<span class="sourceLineNo">2398</span>    coprocessorServiceHandlers.put(serviceDesc.getFullName(), instance);<a name="line.2398"></a>
-<span class="sourceLineNo">2399</span>    if (LOG.isDebugEnabled()) {<a name="line.2399"></a>
-<span class="sourceLineNo">2400</span>      LOG.debug("Registered master coprocessor service: service="+serviceDesc.getFullName());<a name="line.2400"></a>
-<span class="sourceLineNo">2401</span>    }<a name="line.2401"></a>
-<span class="sourceLineNo">2402</span>    return true;<a name="line.2402"></a>
-<span class="sourceLineNo">2403</span>  }<a name="line.2403"></a>
-<span class="sourceLineNo">2404</span><a name="line.2404"></a>
-<span class="sourceLineNo">2405</span>  /**<a name="line.2405"></a>
-<span class="sourceLineNo">2406</span>   * Utility for constructing an instance of the passed HMaster class.<a name="line.2406"></a>
-<span class="sourceLineNo">2407</span>   * @param masterClass<a name="line.2407"></a>
-<span class="sourceLineNo">2408</span>   * @param conf<a name="line.2408"></a>
-<span class="sourceLineNo">2409</span>   * @return HMaster instance.<a name="line.2409"></a>
-<span class="sourceLineNo">2410</span>   */<a name="line.2410"></a>
-<span class="sourceLineNo">2411</span>  public static HMaster constructMaster(Class&lt;? extends HMaster&gt; masterClass,<a name="line.2411"></a>
-<span class="sourceLineNo">2412</span>      final Configuration conf, final CoordinatedStateManager cp)  {<a name="line.2412"></a>
-<span class="sourceLineNo">2413</span>    try {<a name="line.2413"></a>
-<span class="sourceLineNo">2414</span>      Constructor&lt;? extends HMaster&gt; c =<a name="line.2414"></a>
-<span class="sourceLineNo">2415</span>        masterClass.getConstructor(Configuration.class, CoordinatedStateManager.class);<a name="line.2415"></a>
-<span class="sourceLineNo">2416</span>      return c.newInstance(conf, cp);<a name="line.2416"></a>
-<span class="sourceLineNo">2417</span>    } catch(Exception e) {<a name="line.2417"></a>
-<span class="sourceLineNo">2418</span>      Throwable error = e;<a name="line.2418"></a>
-<span class="sourceLineNo">2419</span>      if (e instanceof InvocationTargetException &amp;&amp;<a name="line.2419"></a>
-<span class="sourceLineNo">2420</span>          ((InvocationTargetException)e).getTargetException() != null) {<a name="line.2420"></a>
-<span class="sourceLineNo">2421</span>        error = ((InvocationTargetException)e).getTargetException();<a name="line.2421"></a>
-<span class="sourceLineNo">2422</span>      }<a name="line.2422"></a>
-<span class="sourceLineNo">2423</span>      throw new RuntimeException("Failed construction of Master: " + masterClass.toString() + ". "<a name="line.2423"></a>
-<span class="sourceLineNo">2424</span>        , error);<a name="line.2424"></a>
-<span class="sourceLineNo">2425</span>    }<a name="line.2425"></a>
-<span class="sourceLineNo">2426</span>  }<a name="line.2426"></a>
-<span class="sourceLineNo">2427</span><a name="line.2427"></a>
-<span class="sourceLineNo">2428</span>  /**<a name="line.2428"></a>
-<span class="sourceLineNo">2429</span>   * @see org.apache.hadoop.hbase.master.HMasterCommandLine<a name="line.2429"></a>
-<span class="sourceLineNo">2430</span>   */<a name="line.2430"></a>
-<span class="sourceLineNo">2431</span>  public static void main(String [] args) {<a name="line.2431"></a>
-<span class="sourceLineNo">2432</span>    VersionInfo.logVersion();<a name="line.2432"></a>
-<span class="sourceLineNo">2433</span>    new HMasterCommandLine(HMaster.class).doMain(args);<a name="line.2433"></a>
-<span class="sourceLineNo">2434</span>  }<a name="line.2434"></a>
-<span class="sourceLineNo">2435</span><a name="line.2435"></a>
-<span class="sourceLineNo">2436</span>  public HFileCleaner getHFileCleaner() {<a name="line.2436"></a>
-<span class="sourceLineNo">2437</span>    return this.hfileCleaner;<a name="line.2437"></a>
+<span class="sourceLineNo">2367</span>  public void assignRegion(HRegionInfo hri) {<a name="line.2367"></a>
+<span class="sourceLineNo">2368</span>    assignmentManager.assign(hri);<a name="line.2368"></a>
+<span class="sourceLineNo">2369</span>  }<a name="line.2369"></a>
+<span class="sourceLineNo">2370</span><a name="line.2370"></a>
+<span class="sourceLineNo">2371</span>  /**<a name="line.2371"></a>
+<span class="sourceLineNo">2372</span>   * Compute the average load across all region servers.<a name="line.2372"></a>
+<span class="sourceLineNo">2373</span>   * Currently, this uses a very naive computation - just uses the number of<a name="line.2373"></a>
+<span class="sourceLineNo">2374</span>   * regions being served, ignoring stats about number of requests.<a name="line.2374"></a>
+<span class="sourceLineNo">2375</span>   * @return the average load<a name="line.2375"></a>
+<span class="sourceLineNo">2376</span>   */<a name="line.2376"></a>
+<span class="sourceLineNo">2377</span>  public double getAverageLoad() {<a name="line.2377"></a>
+<span class="sourceLineNo">2378</span>    if (this.assignmentManager == null) {<a name="line.2378"></a>
+<span class="sourceLineNo">2379</span>      return 0;<a name="line.2379"></a>
+<span class="sourceLineNo">2380</span>    }<a name="line.2380"></a>
+<span class="sourceLineNo">2381</span><a name="line.2381"></a>
+<span class="sourceLineNo">2382</span>    RegionStates regionStates = this.assignmentManager.getRegionStates();<a name="line.2382"></a>
+<span class="sourceLineNo">2383</span>    if (regionStates == null) {<a name="line.2383"></a>
+<span class="sourceLineNo">2384</span>      return 0;<a name="line.2384"></a>
+<span class="sourceLineNo">2385</span>    }<a name="line.2385"></a>
+<span class="sourceLineNo">2386</span>    return regionStates.getAverageLoad();<a name="line.2386"></a>
+<span class="sourceLineNo">2387</span>  }<a name="line.2387"></a>
+<span class="sourceLineNo">2388</span><a name="line.2388"></a>
+<span class="sourceLineNo">2389</span>  @Override<a name="line.2389"></a>
+<span class="sourceLineNo">2390</span>  public boolean registerService(Service instance) {<a name="line.2390"></a>
+<span class="sourceLineNo">2391</span>    /*<a name="line.2391"></a>
+<span class="sourceLineNo">2392</span>     * No stacking of instances is allowed for a single service name<a name="line.2392"></a>
+<span class="sourceLineNo">2393</span>     */<a name="line.2393"></a>
+<span class="sourceLineNo">2394</span>    Descriptors.ServiceDescriptor serviceDesc = instance.getDescriptorForType();<a name="line.2394"></a>
+<span class="sourceLineNo">2395</span>    if (coprocessorServiceHandlers.containsKey(serviceDesc.getFullName())) {<a name="line.2395"></a>
+<span class="sourceLineNo">2396</span>      LOG.error("Coprocessor service "+serviceDesc.getFullName()+<a name="line.2396"></a>
+<span class="sourceLineNo">2397</span>          " already registered, rejecting request from "+instance<a name="line.2397"></a>
+<span class="sourceLineNo">2398</span>      );<a name="line.2398"></a>
+<span class="sourceLineNo">2399</span>      return false;<a name="line.2399"></a>
+<span class="sourceLineNo">2400</span>    }<a name="line.2400"></a>
+<span class="sourceLineNo">2401</span><a name="line.2401"></a>
+<span class="sourceLineNo">2402</span>    coprocessorServiceHandlers.put(serviceDesc.getFullName(), instance);<a name="line.2402"></a>
+<span class="sourceLineNo">2403</span>    if (LOG.isDebugEnabled()) {<a name="line.2403"></a>
+<span class="sourceLineNo">2404</span>      LOG.debug("Registered master coprocessor service: service="+serviceDesc.getFullName());<a name="line.2404"></a>
+<span class="sourceLineNo">2405</span>    }<a name="line.2405"></a>
+<span class="sourceLineNo">2406</span>    return true;<a name="line.2406"></a>
+<span class="sourceLineNo">2407</span>  }<a name="line.2407"></a>
+<span class="sourceLineNo">2408</span><a name="line.2408"></a>
+<span class="sourceLineNo">2409</span>  /**<a name="line.2409"></a>
+<span class="sourceLineNo">2410</span>   * Utility for constructing an instance of the passed HMaster class.<a name="line.2410"></a>
+<span class="sourceLineNo">2411</span>   * @param masterClass<a name="line.2411"></a>
+<span class="sourceLineNo">2412</span>   * @param conf<a name="line.2412"></a>
+<span class="sourceLineNo">2413</span>   * @return HMaster instance.<a name="line.2413"></a>
+<span class="sourceLineNo">2414</span>   */<a name="line.2414"></a>
+<span class="sourceLineNo">2415</span>  public static HMaster constructMaster(Class&lt;? extends HMaster&gt; masterClass,<a name="line.2415"></a>
+<span class="sourceLineNo">2416</span>      final Configuration conf, final CoordinatedStateManager cp)  {<a name="line.2416"></a>
+<span class="sourceLineNo">2417</span>    try {<a name="line.2417"></a>
+<span class="sourceLineNo">2418</span>      Constructor&lt;? extends HMaster&gt; c =<a name="line.2418"></a>
+<span class="sourceLineNo">2419</span>        masterClass.getConstructor(Configuration.class, CoordinatedStateManager.class);<a name="line.2419"></a>
+<span class="sourceLineNo">2420</span>      return c.newInstance(conf, cp);<a name="line.2420"></a>
+<span class="sourceLineNo">2421</span>    } catch(Exception e) {<a name="line.2421"></a>
+<span class="sourceLineNo">2422</span>      Throwable error = e;<a name="line.2422"></a>
+<span class="sourceLineNo">2423</span>      if (e instanceof InvocationTargetException &amp;&amp;<a name="line.2423"></a>
+<span class="sourceLineNo">2424</span>          ((InvocationTargetException)e).getTargetException() != null) {<a name="line.2424"></a>
+<span class="sourceLineNo">2425</span>        error = ((InvocationTargetException)e).getTargetException();<a name="line.2425"></a>
+<span class="sourceLineNo">2426</span>      }<a name="line.2426"></a>
+<span class="sourceLineNo">2427</span>      throw new RuntimeException("Failed construction of Master: " + masterClass.toString() + ". "<a name="line.2427"></a>
+<span class="sourceLineNo">2428</span>        , error);<a name="line.2428"></a>
+<span class="sourceLineNo">2429</span>    }<a name="line.2429"></a>
+<span class="sourceLineNo">2430</span>  }<a name="line.2430"></a>
+<span class="sourceLineNo">2431</span><a name="line.2431"></a>
+<span class="sourceLineNo">2432</span>  /**<a name="line.2432"></a>
+<span class="sourceLineNo">2433</span>   * @see org.apache.hadoop.hbase.master.HMasterCommandLine<a name="line.2433"></a>
+<span class="sourceLineNo">2434</span>   */<a name="line.2434"></a>
+<span class="sourceLineNo">2435</span>  public static void main(String [] args) {<a name="line.2435"></a>
+<span class="sourceLineNo">2436</span>    VersionInfo.logVersion();<a name="line.2436"></a>
+<span class="sourceLineNo">2437</span>    new HMasterCommandLine(HMaster.class).doMain(args);<a name="line.2437"></a>
 <span class="sourceLineNo">2438</span>  }<a name="line.2438"></a>
 <span class="sourceLineNo">2439</span><a name="line.2439"></a>
-<span class="sourceLineNo">2440</span>  /**<a name="line.2440"></a>
-<span class="sourceLineNo">2441</span>   * Exposed for TESTING!<a name="line.2441"></a>
-<span class="sourceLineNo">2442</span>   * @return the underlying snapshot manager<a name="line.2442"></a>
-<span class="sourceLineNo">2443</span>   */<a name="line.2443"></a>
-<span class="sourceLineNo">2444</span>  public SnapshotManager getSnapshotManagerForTesting() {<a name="line.2444"></a>
-<span class="sourceLineNo">2445</span>    return this.snapshotManager;<a name="line.2445"></a>
-<span class="sourceLineNo">2446</span>  }<a name="line.2446"></a>
-<span class="sourceLineNo">2447</span><a name="line.2447"></a>
-<span class="sourceLineNo">2448</span>  @Override<a name="line.2448"></a>
-<span class="sourceLineNo">2449</span>  public void createNamespace(<a name="line.2449"></a>
-<span class="sourceLineNo">2450</span>      final NamespaceDescriptor descriptor,<a name="line.2450"></a>
-<span class="sourceLineNo">2451</span>      final long nonceGroup,<a name="line.2451"></a>
-<span class="sourceLineNo">2452</span>      final long nonce) throws IOException {<a name="line.2452"></a>
-<span class="sourceLineNo">2453</span>    TableName.isLegalNamespaceName(Bytes.toBytes(descriptor.getName()));<a name="line.2453"></a>
-<span class="sourceLineNo">2454</span>    checkNamespaceManagerReady();<a name="line.2454"></a>
-<span class="sourceLineNo">2455</span>    if (cpHost != null) {<a name="line.2455"></a>
-<span class="sourceLineNo">2456</span>      if (cpHost.preCreateNamespace(descriptor)) {<a name="line.2456"></a>
-<span class="sourceLineNo">2457</span>        return;<a name="line.2457"></a>
-<span class="sourceLineNo">2458</span>      }<a name="line.2458"></a>
-<span class="sourceLineNo">2459</span>    }<a name="line.2459"></a>
-<span class="sourceLineNo">2460</span>    createNamespaceSync(descriptor, nonceGroup, nonce);<a name="line.2460"></a>
-<span class="sourceLineNo">2461</span>    if (cpHost != null) {<a name="line.2461"></a>
-<span class="sourceLineNo">2462</span>      cpHost.postCreateNamespace(descriptor);<a name="line.2462"></a>
+<span class="sourceLineNo">2440</span>  public HFileCleaner getHFileCleaner() {<a name="line.2440"></a>
+<span class="sourceLineNo">2441</span>    return this.hfileCleaner;<a name="line.2441"></a>
+<span class="sourceLineNo">2442</span>  }<a name="line.2442"></a>
+<span class="sourceLineNo">2443</span><a name="line.2443"></a>
+<span class="sourceLineNo">2444</span>  /**<a name="line.2444"></a>
+<span class="sourceLineNo">2445</span>   * Exposed for TESTING!<a name="line.2445"></a>
+<span class="sourceLineNo">2446</span>   * @return the underlying snapshot manager<a name="line.2446"></a>
+<span class="sourceLineNo">2447</span>   */<a name="line.2447"></a>
+<span class="sourceLineNo">2448</span>  public SnapshotManager getSnapshotManagerForTesting() {<a name="line.2448"></a>
+<span class="sourceLineNo">2449</span>    return this.snapshotManager;<a name="line.2449"></a>
+<span class="sourceLineNo">2450</span>  }<a name="line.2450"></a>
+<span class="sourceLineNo">2451</span><a name="line.2451"></a>
+<span class="sourceLineNo">2452</span>  @Override<a name="line.2452"></a>
+<span class="sourceLineNo">2453</span>  public void createNamespace(<a name="line.2453"></a>
+<span class="sourceLineNo">2454</span>      final NamespaceDescriptor descriptor,<a name="line.2454"></a>
+<span class="sourceLineNo">2455</span>      final long nonceGroup,<a name="line.2455"></a>
+<span class="sourceLineNo">2456</span>      final long nonce) throws IOException {<a name="line.2456"></a>
+<span class="sourceLineNo">2457</span>    TableName.isLegalNamespaceName(Bytes.toBytes(descriptor.getName()));<a name="line.2457"></a>
+<span class="sourceLineNo">2458</span>    checkNamespaceManagerReady();<a name="line.2458"></a>
+<span class="sourceLineNo">2459</span>    if (cpHost != null) {<a name="line.2459"></a>
+<span class="sourceLineNo">2460</span>      if (cpHost.preCreateNamespace(descriptor)) {<a name="line.2460"></a>
+<span class="sourceLineNo">2461</span>        return;<a name="line.2461"></a>
+<span class="sourceLineNo">2462</span>      }<a name="line.2462"></a>
 <span class="sourceLineNo">2463</span>    }<a name="line.2463"></a>
-<span class="sourceLineNo">2464</span>  }<a name="line.2464"></a>
-<span class="sourceLineNo">2465</span><a name="line.2465"></a>
-<span class="sourceLineNo">2466</span>  @Override<a name="line.2466"></a>
-<span class="sourceLineNo">2467</span>  public void createNamespaceSync(<a name="line.2467"></a>
-<span class="sourceLineNo">2468</span>      final NamespaceDescriptor descriptor,<a name="line.2468"></a>
-<span class="sourceLineNo">2469</span>      final long nonceGroup,<a name="line.2469"></a>
-<span class="sourceLineNo">2470</span>      final long nonce) throws IOException {<a name="line.2470"></a>
-<span class="sourceLineNo">2471</span>    LOG.info(getClientIdAuditPrefix() + " creating " + descriptor);<a name="line.2471"></a>
-<span class="sourceLineNo">2472</span>    // Execute the operation synchronously - wait for the operation to complete before continuing.<a name="line.2472"></a>
-<span class="sourceLineNo">2473</span>    long procId = this.procedureExecutor.submitProcedure(<a name="line.2473"></a>
-<span class="sourceLineNo">2474</span>      new CreateNamespaceProcedure(procedureExecutor.getEnvironment(), descriptor),<a name="line.2474"></a>
-<span class="sourceLineNo">2475</span>      nonceGroup,<a name="line.2475"></a>
-<span class="sourceLineNo">2476</span>      nonce);<a name="line.2476"></a>
-<span class="sourceLineNo">2477</span>    ProcedureSyncWait.waitForProcedureToComplete(procedureExecutor, procId);<a name="line.2477"></a>
-<span class="sourceLineNo">2478</span>  }<a name="line.2478"></a>
-<span class="sourceLineNo">2479</span><a name="line.2479"></a>
-<span class="sourceLineNo">2480</span>  @Override<a name="line.2480"></a>
-<span class="sourceLineNo">2481</span>  public void modifyNamespace(<a name="line.2481"></a>
-<span class="sourceLineNo">2482</span>      final NamespaceDescriptor descriptor,<a name="line.2482"></a>
-<span class="sourceLineNo">2483</span>      final long nonceGroup,<a name="line.2483"></a>
-<span class="sourceLineNo">2484</span>      final long nonce) throws IOException {<a name="line.2484"></a>
-<span class="sourceLineNo">2485</span>    TableName.isLegalNamespaceName(Bytes.toBytes(descriptor.getName()));<a name="line.2485"></a>
-<span class="sourceLineNo">2486</span>    checkNamespaceManagerReady();<a name="line.2486"></a>
-<span class="sourceLineNo">2487</span>    if (cpHost != null) {<a name="line.2487"></a>
-<span class="sourceLineNo">2488</span>      if (cpHost.preModifyNamespace(descriptor)) {<a name="line.2488"></a>
-<span class="sourceLineNo">2489</span>        return;<a name="line.2489"></a>
-<span class="sourceLineNo">2490</span>      }<a name="line.2490"></a>
-<span class="sourceLineNo">2491</span>    }<a name="line.2491"></a>
-<span class="sourceLineNo">2492</span>    LOG.info(getClientIdAuditPrefix() + " modify " + descriptor);<a name="line.2492"></a>
-<span class="sourceLineNo">2493</span>    // Execute the operation synchronously - wait for the operation to complete before continuing.<a name="line.2493"></a>
-<span class="sourceLineNo">2494</span>    long procId = this.procedureExecutor.submitProcedure(<a name="line.2494"></a>
-<span class="sourceLineNo">2495</span>      new ModifyNamespaceProcedure(procedureExecutor.getEnvironment(), descriptor),<a name="line.2495"></a>
-<span class="sourceLineNo">2496</span>      nonceGroup,<a name="line.2496"></a>
-<span class="sourceLineNo">2497</span>      nonce);<a name="line.2497"></a>
-<span class="sourceLineNo">2498</span>    ProcedureSyncWait.waitForProcedureToComplete(procedureExecutor, procId);<a name="line.2498"></a>
-<span class="sourceLineNo">2499</span>    if (cpHost != null) {<a name="line.2499"></a>
-<span class="sourceLineNo">2500</span>      cpHost.postModifyNamespace(descriptor);<a name="line.2500"></a>
-<span class="sourceLineNo">2501</span>    }<a name="line.2501"></a>
-<span class="sourceLineNo">2502</span>  }<a name="line.2502"></a>
-<span class="sourceLineNo">2503</span><a name="line.2503"></a>
-<span class="sourceLineNo">2504</span>  @Override<a name="line.2504"></a>
-<span class="sourceLineNo">2505</span>  public void deleteNamespace(<a name="line.2505"></a>
-<span class="sourceLineNo">2506</span>      final String name,<a name="line.2506"></a>
-<span class="sourceLineNo">2507</span>      final long nonceGroup,<a name="line.2507"></a>
-<span class="sourceLineNo">2508</span>      final long nonce) throws IOException {<a name="line.2508"></a>
-<span class="sourceLineNo">2509</span>    checkNamespaceManagerReady();<a name="line.2509"></a>
-<span class="sourceLineNo">2510</span>    if (cpHost != null) {<a name="line.2510"></a>
-<span class="sourceLineNo">2511</span>      if (cpHost.preDeleteNamespace(name)) {<a name="line.2511"></a>
-<span class="sourceLineNo">2512</span>        return;<a name="line.2512"></a>
-<span class="sourceLineNo">2513</span>      }<a name="line.2513"></a>
-<span class="sourceLineNo">2514</span>    }<a name="line.2514"></a>
-<span class="sourceLineNo">2515</span>    LOG.info(getClientIdAuditPrefix() + " delete " + name);<a name="line.2515"></a>
-<span class="sourceLineNo">2516</span>    // Execute the operation synchronously - wait for the operation to complete before continuing.<a name="line.2516"></a>
-<span class="sourceLineNo">2517</span>    long procId = this.procedureExecutor.submitProcedure(<a name="line.2517"></a>
-<span class="sourceLineNo">2518</span>      new DeleteNamespaceProcedure(procedureExecutor.getEnvironment(), name),<a name="line.2518"></a>
-<span class="sourceLineNo">2519</span>      nonceGroup,<a name="line.2519"></a>
-<span class="sourceLineNo">2520</span>      nonce);<a name="line.2520"></a>
-<span class="sourceLineNo">2521</span>    ProcedureSyncWait.waitForProcedureToComplete(procedureExecutor, procId);<a name="line.2521"></a>
-<span class="sourceLineNo">2522</span>    if (cpHost != null) {<a name="line.2522"></a>
-<span class="sourceLineNo">2523</span>      cpHost.postDeleteNamespace(name);<a name="line.2523"></a>
-<span class="sourceLineNo">2524</span>    }<a name="line.2524"></a>
-<span class="sourceLineNo">2525</span>  }<a name="line.2525"></a>
-<span class="sourceLineNo">2526</span><a name="line.2526"></a>
-<span class="sourceLineNo">2527</span>  /**<a name="line.2527"></a>
-<span class="sourceLineNo">2528</span>   * Ensure that the specified namespace exists, otherwise throws a NamespaceNotFoundException<a name="line.2528"></a>
-<span class="sourceLineNo">2529</span>   *<a name="line.2529"></a>
-<span class="sourceLineNo">2530</span>   * @param name the namespace to check<a name="line.2530"></a>
-<span class="sourceLineNo">2531</span>   * @throws IOException if the namespace manager is not ready yet.<a name="line.2531"></a>
-<span class="sourceLineNo">2532</span>   * @throws NamespaceNotFoundException if the namespace does not exists<a name="line.2532"></a>
-<span class="sourceLineNo">2533</span>   */<a name="line.2533"></a>
-<span class="sourceLineNo">2534</span>  private void ensureNamespaceExists(final String name)<a name="line.2534"></a>
-<span class="sourceLineNo">2535</span>      throws IOException, NamespaceNotFoundException {<a name="line.2535"></a>
-<span class="sourceLineNo">2536</span>    checkNamespaceManagerReady();<a name="line.2536"></a>
-<span class="sourceLineNo">2537</span>    NamespaceDescriptor nsd = tableNamespaceManager.get(name);<a name="line.2537"></a>
-<span class="sourceLineNo">2538</span>    if (nsd == null) {<a name="line.2538"></a>
-<span class="sourceLineNo">2539</span>      throw new NamespaceNotFoundException(name);<a name="line.2539"></a>
-<span class="sourceLineNo">2540</span>    }<a name="line.2540"></a>
-<span class="sourceLineNo">2541</span>  }<a name="line.2541"></a>
-<span class="sourceLineNo">2542</span><a name="line.2542"></a>
-<span class="sourceLineNo">2543</span>  @Override<a name="line.2543"></a>
-<span class="sourceLineNo">2544</span>  public NamespaceDescriptor getNamespaceDescriptor(String name) throws IOException {<a name="line.2544"></a>
-<span class="sourceLineNo">2545</span>    checkNamespaceManagerReady();<a name="line.2545"></a>
+<span class="sourceLineNo">2464</span>    createNamespaceSync(descriptor, nonceGroup, nonce);<a name="line.2464"></a>
+<span class="sourceLineNo">2465</span>    if (cpHost != null) {<a name="line.2465"></a>
+<span class="sourceLineNo">2466</span>      cpHost.postCreateNamespace(descriptor);<a name="line.2466"></a>
+<span class="sourceLineNo">2467</span>    }<a name="line.2467"></a>
+<span class="sourceLineNo">2468</span>  }<a name="line.2468"></a>
+<span class="sourceLineNo">2469</span><a name="line.2469"></a>
+<span class="sourceLineNo">2470</span>  @Override<a name="line.2470"></a>
+<span class="sourceLineNo">2471</span>  public void createNamespaceSync(<a name="line.2471"></a>
+<span class="sourceLineNo">2472</span>      final NamespaceDescriptor descriptor,<a name="line.2472"></a>
+<span class="sourceLineNo">2473</span>      final long nonceGroup,<a name="line.2473"></a>
+<span class="sourceLineNo">2474</span>      final long nonce) throws IOException {<a name="line.2474"></a>
+<span class="sourceLineNo">2475</span>    LOG.info(getClientIdAuditPrefix() + " creating " + descriptor);<a name="line.2475"></a>
+<span class="sourceLineNo">2476</span>    // Execute the operation synchronously - wait for the operation to complete before continuing.<a name="line.2476"></a>
+<span class="sourceLineNo">2477</span>    long procId = this.procedureExecutor.submitProcedure(<a name="line.2477"></a>
+<span class="sourceLineNo">2478</span>      new CreateNamespaceProcedure(procedureExecutor.getEnvironment(), descriptor),<a name="line.2478"></a>
+<span class="sourceLineNo">2479</span>      nonceGroup,<a name="line.2479"></a>
+<span class="sourceLineNo">2480</span>      nonce);<a name="line.2480"></a>
+<span class="sourceLineNo">2481</span>    ProcedureSyncWait.waitForProcedureToComplete(procedureExecutor, procId);<a name="line.2481"></a>
+<span class="sourceLineNo">2482</span>  }<a name="line.2482"></a>
+<span class="sourceLineNo">2483</span><a name="line.2483"></a>
+<span class="sourceLineNo">2484</span>  @Override<a name="line.2484"></a>
+<span class="sourceLineNo">2485</span>  public void modifyNamespace(<a name="line.2485"></a>
+<span class="sourceLineNo">2486</span>      final NamespaceDescriptor descriptor,<a name="line.2486"></a>
+<span class="sourceLineNo">2487</span>      final long nonceGroup,<a name="line.2487"></a>
+<span class="sourceLineNo">2488</span>      final long nonce) throws IOException {<a name="line.2488"></a>
+<span class="sourceLineNo">2489</span>    TableName.isLegalNamespaceName(Bytes.toBytes(descriptor.getName()));<a name="line.2489"></a>
+<span class="sourceLineNo">2490</span>    checkNamespaceManagerReady();<a name="line.2490"></a>
+<span class="sourceLineNo">2491</span>    if (cpHost != null) {<a name="line.2491"></a>
+<span class="sourceLineNo">2492</span>      if (cpHost.preModifyNamespace(descriptor)) {<a name="line.2492"></a>
+<span class="sourceLineNo">2493</span>        return;<a name="line.2493"></a>
+<span class="sourceLineNo">2494</span>      }<a name="line.2494"></a>
+<span class="sourceLineNo">2495</span>    }<a name="line.2495"></a>
+<span class="sourceLineNo">2496</span>    LOG.info(getClientIdAuditPrefix() + " modify " + descriptor);<a name="line.2496"></a>
+<span class="sourceLineNo">2497</span>    // Execute the operation synchronously - wait for the operation to complete before continuing.<a name="line.2497"></a>
+<span class="sourceLineNo">2498</span>    long procId = this.procedureExecutor.submitProcedure(<a name="line.2498"></a>
+<span class="sourceLineNo">2499</span>      new ModifyNamespaceProcedure(procedureExecutor.getEnvironment(), descriptor),<a name="line.2499"></a>
+<span class="sourceLineNo">2500</span>      nonceGroup,<a name="line.2500"></a>
+<span class="sourceLineNo">2501</span>      nonce);<a name="line.2501"></a>
+<span class="sourceLineNo">2502</span>    ProcedureSyncWait.waitForProcedureToComplete(procedureExecutor, procId);<a name="line.2502"></a>
+<span class="sourceLineNo">2503</span>    if (cpHost != null) {<a name="line.2503"></a>
+<span class="sourceLineNo">2504</span>      cpHost.postModifyNamespace(descriptor);<a name="line.2504"></a>
+<span class="sourceLineNo">2505</span>    }<a name="line.2505"></a>
+<span class="sourceLineNo">2506</span>  }<a name="line.2506"></a>
+<span class="sourceLineNo">2507</span><a name="line.2507"></a>
+<span class="sourceLineNo">2508</span>  @Override<a name="line.2508"></a>
+<span class="sourceLineNo">2509</span>  public void deleteNamespace(<a name="line.2509"></a>
+<span class="sourceLineNo">2510</span>      final String name,<a name="line.2510"></a>
+<span class="sourceLineNo">2511</span>      final long nonceGroup,<a name="line.2511"></a>
+<span class="sourceLineNo">2512</span>      final long nonce) throws IOException {<a name="line.2512"></a>
+<span class="sourceLineNo">2513</span>    checkNamespaceManagerReady();<a name="line.2513"></a>
+<span class="sourceLineNo">2514</span>    if (cpHost != null) {<a name="line.2514"></a>
+<span class="sourceLineNo">2515</span>      if (cpHost.preDeleteNamespace(name)) {<a name="line.2515"></a>
+<span class="sourceLineNo">2516</span>        return;<a name="line.2516"></a>
+<span class="sourceLineNo">2517</span>      }<a name="line.2517"></a>
+<span class="sourceLineNo">2518</span>    }<a name="line.2518"></a>
+<span class="sourceLineNo">2519</span>    LOG.info(getClientIdAuditPrefix() + " delete " + name);<a name="line.2519"></a>
+<span class="sourceLineNo">2520</span>    // Execute the operation synchronously - wait for the operation to complete before continuing.<a name="line.2520"></a>
+<span class="sourceLineNo">2521</span>    long procId = this.procedureExecutor.submitProcedure(<a name="line.2521"></a>
+<span class="sourceLineNo">2522</span>      new DeleteNamespaceProcedure(procedureExecutor.getEnvironment(), name),<a name="line.2522"></a>
+<span class="sourceLineNo">2523</span>      nonceGroup,<a name="line.2523"></a>
+<span class="sourceLineNo">2524</span>      nonce);<a name="line.2524"></a>
+<span class="sourceLineNo">2525</span>    ProcedureSyncWait.waitForProcedureToComplete(procedureExecutor, procId);<a name="line.2525"></a>
+<span class="sourceLineNo">2526</span>    if (cpHost != null) {<a name="line.2526"></a>
+<span class="sourceLineNo">2527</span>      cpHost.postDeleteNamespace(name);<a name="line.2527"></a>
+<span class="sourceLineNo">2528</span>    }<a name="line.2528"></a>
+<span class="sourceLineNo">2529</span>  }<a name="line.2529"></a>
+<span class="sourceLineNo">2530</span><a name="line.2530"></a>
+<span class="sourceLineNo">2531</span>  /**<a name="line.2531"></a>
+<span class="sourceLineNo">2532</span>   * Ensure that the specified namespace exists, otherwise throws a NamespaceNotFoundException<a name="line.2532"></a>
+<span class="sourceLineNo">2533</span>   *<a name="line.2533"></a>
+<span class="sourceLineNo">2534</span>   * @param name the namespace to check<a name="line.2534"></a>
+<span class="sourceLineNo">2535</span>   * @throws IOException if the namespace manager is not ready yet.<a name="line.2535"></a>
+<span class="sourceLineNo">2536</span>   * @throws NamespaceNotFoundException if the namespace does not exists<a name="line.2536"></a>
+<span class="sourceLineNo">2537</span>   */<a name="line.2537"></a>
+<span class="sourceLineNo">2538</span>  private void ensureNamespaceExists(final String name)<a name="line.2538"></a>
+<span class="sourceLineNo">2539</span>      throws IOException, NamespaceNotFoundException {<a name="line.2539"></a>
+<span class="sourceLineNo">2540</span>    checkNamespaceManagerReady();<a name="line.2540"></a>
+<span class="sourceLineNo">2541</span>    NamespaceDescriptor nsd = tableNamespaceManager.get(name);<a name="line.2541"></a>
+<span class="sourceLineNo">2542</span>    if (nsd == null) {<a name="line.2542"></a>
+<span class="sourceLineNo">2543</span>      throw new NamespaceNotFoundException(name);<a name="line.2543"></a>
+<span class="sourceLineNo">2544</span>    }<a name="line.2544"></a>
+<span class="sourceLineNo">2545</span>  }<a name="line.2545"></a>
 <span class="sourceLineNo">2546</span><a name="line.2546"></a>
-<span class="sourceLineNo">2547</span>    if (cpHost != null) {<a name="line.2547"></a>
-<span class="sourceLineNo">2548</span>      cpHost.preGetNamespaceDescriptor(name);<a name="line.2548"></a>
-<span class="sourceLineNo">2549</span>    }<a name="line.2549"></a>
+<span class="sourceLineNo">2547</span>  @Override<a name="line.2547"></a>
+<span class="sourceLineNo">2548</span>  public NamespaceDescriptor getNamespaceDescriptor(String name) throws IOException {<a name="line.2548"></a>
+<span class="sourceLineNo">2549</span>    checkNamespaceManagerReady();<a name="line.2549"></a>
 <span class="sourceLineNo">2550</span><a name="line.2550"></a>
-<span class="sourceLineNo">2551</span>    NamespaceDescriptor nsd = tableNamespaceManager.get(name);<a name="line.2551"></a>
-<span class="sourceLineNo">2552</span>    if (nsd == null) {<a name="line.2552"></a>
-<span class="sourceLineNo">2553</span>      throw new NamespaceNotFoundException(name);<a name="line.2553"></a>
-<span class="sourceLineNo">2554</span>    }<a name="line.2554"></a>
-<span class="sourceLineNo">2555</span><a name="line.2555"></a>
-<span class="sourceLineNo">2556</span>    if (cpHost != null) {<a name="line.2556"></a>
-<span class="sourceLineNo">2557</span>      cpHost.postGetNamespaceDescriptor(nsd);<a name="line.2557"></a>
+<span class="sourceLineNo">2551</span>    if (cpHost != null) {<a name="line.2551"></a>
+<span class="sourceLineNo">2552</span>      cpHost.preGetNamespaceDescriptor(name);<a name="line.2552"></a>
+<span class="sourceLineNo">2553</span>    }<a name="line.2553"></a>
+<span class="sourceLineNo">2554</span><a name="line.2554"></a>
+<span class="sourceLineNo">2555</span>    NamespaceDescriptor nsd = tableNamespaceManager.get(name);<a name="line.2555"></a>
+<span class="sourceLineNo">2556</span>    if (nsd == null) {<a name="line.2556"></a>
+<span class="sourceLineNo">2557</span>      throw new NamespaceNotFoundException(name);<a name="line.2557"></a>
 <span class="sourceLineNo">2558</span>    }<a name="line.2558"></a>
 <span class="sourceLineNo">2559</span><a name="line.2559"></a>
-<span class="sourceLineNo">2560</span>    return nsd;<a name="line.2560"></a>
-<span class="sourceLineNo">2561</span>  }<a name="line.2561"></a>
-<span class="sourceLineNo">2562</span><a name="line.2562"></a>
-<span class="sourceLineNo">2563</span>  @Override<a name="line.2563"></a>
-<span class="sourceLineNo">2564</span>  public List&lt;NamespaceDescriptor&gt; listNamespaceDescriptors() throws IOException {<a name="line.2564"></a>
-<span class="sourceLineNo">2565</span>    checkNamespaceManagerReady();<a name="line.2565"></a>
+<span class="sourceLineNo">2560</span>    if (cpHost != null) {<a name="line.2560"></a>
+<span class="sourceLineNo">2561</span>      cpHost.postGetNamespaceDescriptor(nsd);<a name="line.2561"></a>
+<span class="sourceLineNo">2562</span>    }<a name="line.2562"></a>
+<span class="sourceLineNo">2563</span><a name="line.2563"></a>
+<span class="sourceLineNo">2564</span>    return nsd;<a name="line.2564"></a>
+<span class="sourceLineNo">2565</span>  }<a name="line.2565"></a>
 <span class="sourceLineNo">2566</span><a name="line.2566"></a>
-<span class="sourceLineNo">2567</span>    final List&lt;NamespaceDescriptor&gt; descriptors = new ArrayList&lt;NamespaceDescriptor&gt;();<a name="line.2567"></a>
-<span class="sourceLineNo">2568</span>    boolean bypass = false;<a name="line.2568"></a>
-<span class="sourceLineNo">2569</span>    if (cpHost != null) {<a name="line.2569"></a>
-<span class="sourceLineNo">2570</span>      bypass = cpHost.preListNamespaceDescriptors(descriptors);<a name="line.2570"></a>
-<span class="sourceLineNo">2571</span>    }<a name="line.2571"></a>
-<span class="sourceLineNo">2572</span><a name="line.2572"></a>
-<span class="sourceLineNo">2573</span>    if (!bypass) {<a name="line.2573"></a>
-<span class="sourceLineNo">2574</span>      descriptors.addAll(tableNamespaceManager.list());<a name="line.2574"></a>
-<span class="sourceLineNo">2575</span><a name="line.2575"></a>
-<span class="sourceLineNo">2576</span>      if (cpHost != null) {<a name="line.2576"></a>
-<span class="sourceLineNo">2577</span>        cpHost.postListNamespaceDescriptors(descriptors);<a name="line.2577"></a>
-<span class="sourceLineNo">2578</span>      }<a name="line.2578"></a>
-<span class="sourceLineNo">2579</span>    }<a name="line.2579"></a>
-<span class="sourceLineNo">2580</span>    return descriptors;<a name="line.2580"></a>
-<span class="sourceLineNo">2581</span>  }<a name="line.2581"></a>
-<span class="sourceLineNo">2582</span><a name="line.2582"></a>
-<span class="sourceLineNo">2583</span>  @Override<a name="line.2583"></a>
-<span class="sourceLineNo">2584</span>  public boolean abortProcedure(final long procId, final boolean mayInterruptIfRunning)<a name="line.2584"></a>
-<span class="sourceLineNo">2585</span>      throws IOException {<a name="line.2585"></a>
-<span class="sourceLineNo">2586</span>    if (cpHost != null) {<a name="line.2586"></a>
-<span class="sourceLineNo">2587</span>      cpHost.preAbortProcedure(this.procedureExecutor, procId);<a name="line.2587"></a>
-<span class="sourceLineNo">2588</span>    }<a name="line.2588"></a>
-<span class="sourceLineNo">2589</span><a name="line.2589"></a>
-<span class="sourceLineNo">2590</span>    final boolean result = this.procedureExecutor.abort(procId, mayInterruptIfRunning);<a name="line.2590"></a>
-<span class="sourceLineNo">2591</span><a name="line.2591"></a>
-<span class="sourceLineNo">2592</span>    if (cpHost != null) {<a name="line.2592"></a>
-<span class="sourceLineNo">2593</span>      cpHost.postAbortProcedure();<a name="line.2593"></a>
-<span class="sourceLineNo">2594</span>    }<a name="line.2594"></a>
+<span class="sourceLineNo">2567</span>  @Override<a name="line.2567"></a>
+<span class="sourceLineNo">2568</span>  public List&lt;NamespaceDescriptor&gt; listNamespaceDescriptors() throws IOException {<a name="line.2568"></a>
+<span class="sourceLineNo">2569</span>    checkNamespaceManagerReady();<a name="line.2569"></a>
+<span class="sourceLineNo">2570</span><a name="line.2570"></a>
+<span class="sourceLineNo">2571</span>    final List&lt;NamespaceDescriptor&gt; descriptors = new ArrayList&lt;NamespaceDescriptor&gt;();<a name="line.2571"></a>
+<span class="sourceLineNo">2572</span>    boolean bypass = false;<a name="line.2572"></a>
+<span class="sourceLineNo">2573</span>    if (cpHost != null) {<a name="line.2573"></a>
+<span class="sourceLineNo">2574</span>      bypass = cpHost.preListNamespaceDescriptors(descriptors);<a name="line.2574"></a>
+<span class="sourceLineNo">2575</span>    }<a name="line.2575"></a>
+<span class="sourceLineNo">2576</span><a name="line.2576"></a>
+<span class="sourceLineNo">2577</span>    if (!bypass) {<a name="line.2577"></a>
+<span class="sourceLineNo">2578</span>      descriptors.addAll(tableNamespaceManager.list());<a name="line.2578"></a>
+<span class="sourceLineNo">2579</span><a name="line.2579"></a>
+<span class="sourceLineNo">2580</span>      if (cpHost != null) {<a name="line.2580"></a>
+<span class="sourceLineNo">2581</span>        cpHost.postListNamespaceDescriptors(descriptors);<a name="line.2581"></a>
+<span class="sourceLineNo">2582</span>      }<a name="line.2582"></a>
+<span class="sourceLineNo">2583</span>    }<a name="line.2583"></a>
+<span class="sourceLineNo">2584</span>    return descriptors;<a name="line.2584"></a>
+<span class="sourceLineNo">2585</span>  }<a name="line.2585"></a>
+<span class="sourceLineNo">2586</span><a name="line.2586"></a>
+<span class="sourceLineNo">2587</span>  @Override<a name="line.2587"></a>
+<span class="sourceLineNo">2588</span>  public boolean abortProcedure(final long procId, final boolean mayInterruptIfRunning)<a name="line.2588"></a>
+<span class="sourceLineNo">2589</span>      throws IOException {<a name="line.2589"></a>
+<span class="sourceLineNo">2590</span>    if (cpHost != null) {<a name="line.2590"></a>
+<span class="sourceLineNo">2591</span>      cpHost.preAbortProcedure(this.procedureExecutor, procId);<a name="line.2591"></a>
+<span class="sourceLineNo">2592</span>    }<a name="line.2592"></a>
+<span class="sourceLineNo">2593</span><a name="line.2593"></a>
+<span class="sourceLineNo">2594</span>    final boolean result = this.procedureExecutor.abort(procId, mayInterruptIfRunning);<a name="line.2594"></a>
 <span class="sourceLineNo">2595</span><a name="line.2595"></a>
-<span class="sourceLineNo">2596</span>    return result;<a name="line.2596"></a>
-<span class="sourceLineNo">2597</span>  }<a name="line.2597"></a>
-<span class="sourceLineNo">2598</span><a name="line.2598"></a>
-<span class="sourceLineNo">2599</span>  @Override<a name="line.2599"></a>
-<span class="sourceLineNo">2600</span>  public List&lt;ProcedureInfo&gt; listProcedures() throws IOException {<a name="line.2600"></a>
-<span class="sourceLineNo">2601</span>    if (cpHost != null) {<a name="line.2601"></a>
-<span class="sourceLineNo">2602</span>      cpHost.preListProcedures();<a name="line.2602"></a>
-<span class="sourceLineNo">2603</span>    }<a name="line.2603"></a>
-<span class="sourceLineNo">2604</span><a name="line.2604"></a>
-<span class="sourceLineNo">2605</span>    final List&lt;ProcedureInfo&gt; procInfoList = this.procedureExecutor.listProcedures();<a name="line.2605"></a>
-<span class="sourceLineNo">2606</span><a name="line.2606"></a>
-<span class="sourceLineNo">2607</span>    if (cpHost != null) {<a name="line.2607"></a>
-<span class="sourceLineNo">2608</span>      cpHost.postListProcedures(procInfoList);<a name="line.2608"></a>
-<span class="sourceLineNo">2609</span>    }<a name="line.2609"></a>
+<span class="sourceLineNo">2596</span>    if (cpHost != null) {<a name="line.2596"></a>
+<span class="sourceLineNo">2597</span>      cpHost.postAbortProcedure();<a name="line.2597"></a>
+<span class="sourceLineNo">2598</span>    }<a name="line.2598"></a>
+<span class="sourceLineNo">2599</span><a name="line.2599"></a>
+<span class="sourceLineNo">2600</span>    return result;<a name="line.2600"></a>
+<span class="sourceLineNo">2601</span>  }<a name="line.2601"></a>
+<span class="sourceLineNo">2602</span><a name="line.2602"></a>
+<span class="sourceLineNo">2603</span>  @Override<a name="line.2603"></a>
+<span class="sourceLineNo">2604</span>  public List&lt;ProcedureInfo&gt; listProcedures() throws IOException {<a name="line.2604"></a>
+<span class="sourceLineNo">2605</span>    if (cpHost != null) {<a name="line.2605"></a>
+<span class="sourceLineNo">2606</span>      cpHost.preListProcedures();<a name="line.2606"></a>
+<span class="sourceLineNo">2607</span>    }<a name="line.2607"></a>
+<span class="sourceLineNo">2608</span><a name="line.2608"></a>
+<span class="sourceLineNo">2609</span>    final List&lt;ProcedureInfo&gt; procInfoList = this.procedureExecutor.listProcedures();<a name="line.2609"></a>
 <span class="sourceLineNo">2610</span><a name="line.2610"></a>
-<span class="sourceLineNo">2611</span>    return procInfoList;<a name="line.2611"></a>
-<span class="sourceLineNo">2612</span>  }<a name="line.2612"></a>
-<span class="sourceLineNo">2613</span><a name="line.2613"></a>
-<span class="sourceLineNo">2614</span>  @Override<a name="line.2614"></a>
-<span class="sourceLineNo">2615</span>  public List&lt;HTableDescriptor&gt; listTableDescriptorsByNamespace(String name) throws IOException {<a name="line.2615"></a>
-<span class="sourceLineNo">2616</span>    ensureNamespaceExists(name);<a name="line.2616"></a>
-<span class="sourceLineNo">2617</span>    return listTableDescriptors(name, null, null, true);<a name="line.2617"></a>
-<span class="sourceLineNo">2618</span>  }<a name="line.2618"></a>
-<span class="sourceLineNo">2619</span><a name="line.2619"></a>
-<span class="sourceLineNo">2620</span>  @Override<a name="line.2620"></a>
-<span class="sourceLineNo">2621</span>  public List&lt;TableName&gt; listTableNamesByNamespace(String name) throws IOException {<a name="line.2621"></a>
-<span class="sourceLineNo">2622</span>    ensureNamespaceExists(name);<a name="line.2622"></a>
-<span class="sourceLineNo">2623</span>    return listTableNames(name, null, true);<a name="line.2623"></a>
-<span class="sourceLineNo">2624</span>  }<a name="line.2624"></a>
-<span class="sourceLineNo">2625</span><a name="line.2625"></a>
-<span class="sourceLineNo">2626</span>  /**<a name="line.2626"></a>
-<span class="sourceLineNo">2627</span>   * Returns the list of table descriptors that match the specified request<a name="line.2627"></a>
-<span class="sourceLineNo">2628</span>   *<a name="line.2628"></a>
-<span class="sourceLineNo">2629</span>   * @param namespace the namespace to query, or null if querying for all<a name="line.2629"></a>
-<span class="sourceLineNo">2630</span>   * @param regex The regular expression to match against, or null if querying for all<a name="line.2630"></a>
-<span class="sourceLineNo">2631</span>   * @param tableNameList the list of table names, or null if querying for all<a name="line.2631"></a>
-<span class="sourceLineNo">2632</span>   * @param includeSysTables False to match only against userspace tables<a name="line.2632"></a>
-<span class="sourceLineNo">2633</span>   * @return the list of table descriptors<a name="line.2633"></a>
-<span class="sourceLineNo">2634</span>   */<a name="line.2634"></a>
-<span class="sourceLineNo">2635</span>  public List&lt;HTableDescriptor&gt; listTableDescriptors(final String namespace, final String regex,<a name="line.2635"></a>
-<span class="sourceLineNo">2636</span>      final List&lt;TableName&gt; tableNameList, final boolean includeSysTables)<a name="line.2636"></a>
-<span class="sourceLineNo">2637</span>      throws IOException {<a name="line.2637"></a>
-<span class="sourceLineNo">2638</span>    final List&lt;HTableDescriptor&gt; descriptors = new ArrayList&lt;HTableDescriptor&gt;();<a name="line.2638"></a>
-<span class="sourceLineNo">2639</span><a name="line.2639"></a>
-<span class="sourceLineNo">2640</span>    boolean bypass = false;<a name="line.2640"></a>
-<span class="sourceLineNo">2641</span>    if (cpHost != null) {<a name="line.2641"></a>
-<span class="sourceLineNo">2642</span>      bypass = cpHost.preGetTableDescriptors(tableNameList, descriptors, regex);<a name="line.2642"></a>
-<span class="sourceLineNo">2643</span>    }<a name="line.2643"></a>
-<span class="sourceLineNo">2644</span><a name="line.2644"></a>
-<span class="sourceLineNo">2645</span>    if (!bypass) {<a name="line.2645"></a>
-<span class="sourceLineNo">2646</span>      if (tableNameList == null || tableNameList.size() == 0) {<a name="line.2646"></a>
-<span class="sourceLineNo">2647</span>        // request for all TableDescriptors<a name="line.2647"></a>
-<span class="sourceLineNo">2648</span>        Collection&lt;HTableDescriptor&gt; htds;<a name="line.2648"></a>
-<span class="sourceLineNo">2649</span>        if (namespace != null &amp;&amp; namespace.length() &gt; 0) {<a name="line.2649"></a>
-<span class="sourceLineNo">2650</span>          htds = tableDescriptors.getByNamespace(namespace).values();<a name="line.2650"></a>
-<span class="sourceLineNo">2651</span>        } else {<a name="line.2651"></a>
-<span class="sourceLineNo">2652</span>          htds = tableDescriptors.getAll().values();<a name="line.2652"></a>
-<span class="sourceLineNo">2653</span>        }<a name="line.2653"></a>
-<span class="sourceLineNo">2654</span><a name="line.2654"></a>
-<span class="sourceLineNo">2655</span>        for (HTableDescriptor desc: htds) {<a name="line.2655"></a>
-<span class="sourceLineNo">2656</span>          if (tableStateManager.isTablePresent(desc.getTableName())<a name="line.2656"></a>
-<span class="sourceLineNo">2657</span>              &amp;&amp; (includeSysTables || !desc.getTableName().isSystemTable())) {<a name="line.2657"></a>
-<span class="sourceLineNo">2658</span>            descriptors.add(desc);<a name="line.2658"></a>
-<span class="sourceLineNo">2659</span>          }<a name="line.2659"></a>
-<span class="sourceLineNo">2660</span>        }<a name="line.2660"></a>
-<span class="sourceLineNo">2661</span>      } else {<a name="line.2661"></a>
-<span class="sourceLineNo">2662</span>        for (TableName s: tableNameList) {<a name="line.2662"></a>
-<span class="sourceLineNo">2663</span>          if (tableStateManager.isTablePresent(s)) {<a name="line.2663"></a>
-<span class="sourceLineNo">2664</span>            HTableDescriptor desc = tableDescriptors.get(s);<a name="line.2664"></a>
-<span class="sourceLineNo">2665</span>            if (desc != null) {<a name="line.2665"></a>
-<span class="sourceLineNo">2666</span>              descriptors.add(desc);<a name="line.2666"></a>
-<span class="sourceLineNo">2667</span>            }<a name="line.2667"></a>
-<span class="sourceLineNo">2668</span>          }<a name="line.2668"></a>
-<span class="sourceLineNo">2669</span>        }<a name="line.2669"></a>
-<span class="sourceLineNo">2670</span>      }<a name="line.2670"></a>
-<span class="sourceLineNo">2671</span><a name="line.2671"></a>
-<span class="sourceLineNo">2672</span>      // Retains only those matched by regular expression.<a name="line.2672"></a>
-<span class="sourceLineNo">2673</span>      if (regex != null) {<a name="line.2673"></a>
-<span class="sourceLineNo">2674</span>        filterTablesByRegex(descriptors, Pattern.compile(regex));<a name="line.2674"></a>
-<span class="sourceLineNo">2675</span>      }<a name="line.2675"></a>
-<span class="sourceLineNo">2676</span><a name="line.2676"></a>
-<span class="sourceLineNo">2677</span>      if (cpHost != null) {<a name="line.2677"></a>
-<span class="sourceLineNo">2678</span>        cpHost.postGetTableDescriptors(tableNameList, descriptors, regex);<a name="line.2678"></a>
+<span class="sourceLineNo">2611</span>    if (cpHost != null) {<a name="line.2611"></a>
+<span class="sourceLineNo">2612</span>      cpHost.postListProcedures(procInfoList);<a name="line.2612"></a>
+<span class="sourceLineNo">2613</span>    }<a name="line.2613"></a>
+<span class="sourceLineNo">2614</span><a name="line.2614"></a>
+<span class="sourceLineNo">2615</span>    return procInfoList;<a name="line.2615"></a>
+<span class="sourceLineNo">2616</span>  }<a name="line.2616"></a>
+<span class="sourceLineNo">2617</span><a name="line.2617"></a>
+<span class="sourceLineNo">2618</span>  @Override<a name="line.2618"></a>
+<span class="sourceLineNo">2619</span>  public List&lt;HTableDescriptor&gt; listTableDescriptorsByNamespace(String name) throws IOException {<a name="line.2619"></a>
+<span class="sourceLineNo">2620</span>    ensureNamespaceExists(name);<a name="line.2620"></a>
+<span class="sourceLineNo">2621</span>    return listTableDescriptors(name, null, null, true);<a name="line.2621"></a>
+<span class="sourceLineNo">2622</span>  }<a name="line.2622"></a>
+<span class="sourceLineNo">2623</span><a name="line.2623"></a>
+<span class="sourceLineNo">2624</span>  @Override<a name="line.2624"></a>
+<span class="sourceLineNo">2625</span>  public List&lt;TableName&gt; listTableNamesByNamespace(String name) throws IOException {<a name="line.2625"></a>
+<span class="sourceLineNo">2626</span>    ensureNamespaceExists(name);<a name="line.2626"></a>
+<span class="sourceLineNo">2627</span>    return listTableNames(name, null, true);<a name="line.2627"></a>
+<span class="sourceLineNo">2628</span>  }<a name="line.2628"></a>
+<span class="sourceLineNo">2629</span><a name="line.2629"></a>
+<span class="sourceLineNo">2630</span>  /**<a name="line.2630"></a>
+<span class="sourceLineNo">2631</span>   * Returns the list of table descriptors that match the specified request<a name="line.2631"></a>
+<span class="sourceLineNo">2632</span>   *<a name="line.2632"></a>
+<span class="sourceLineNo">2633</span>   * @param namespace the namespace to query, or null if querying for all<a name="line.2633"></a>
+<span class="sourceLineNo">2634</span>   * @param regex The regular expression to match against, or null if querying for all<a name="line.2634"></a>
+<span class="sourceLineNo">2635</span>   * @param tableNameList the list of table names, or null if querying for all<a name="line.2635"></a>
+<span class="sourceLineNo">2636</span>   * @param includeSysTables False to match only against userspace tables<a name="line.2636"></a>
+<span class="sourceLineNo">2637</span>   * @return the list of table descriptors<a name="line.2637"></a>
+<span class="sourceLineNo">2638</span>   */<a name="line.2638"></a>
+<span class="sourceLineNo">2639</span>  public List&lt;HTableDescriptor&gt; listTableDescriptors(final String namespace, final String regex,<a name="line.2639"></a>
+<span class="sourceLineNo">2640</span>      final List&lt;TableName&gt; tableNameList, final boolean includeSysTables)<a name="line.2640"></a>
+<span class="sourceLineNo">2641</span>      throws IOException {<a name="line.2641"></a>
+<span class="sourceLineNo">2642</span>    final List&lt;HTableDescriptor&gt; descriptors = new ArrayList&lt;HTableDescriptor&gt;();<a name="line.2642"></a>
+<span class="sourceLineNo">2643</span><a name="line.2643"></a>
+<span class="sourceLineNo">2644</span>    boolean bypass = false;<a name="line.2644"></a>
+<span class="sourceLineNo">2645</span>    if (cpHost != null) {<a name="line.2645"></a>
+<span class="sourceLineNo">2646</span>      bypass = cpHost.preGetTableDescriptors(tableNameList, descriptors, regex);<a name="line.2646"></a>
+<span class="sourceLineNo">2647</span>    }<a name="line.2647"></a>
+<span class="sourceLineNo">2648</span><a name="line.2648"></a>
+<span class="sourceLineNo">2649</span>    if (!bypass) {<a name="line.2649"></a>
+<span class="sourceLineNo">2650</span>      if (tableNameList == null || tableNameList.size() == 0) {<a name="line.2650"></a>
+<span class="sourceLineNo">2651</span>        // request for all TableDescriptors<a name="line.2651"></a>
+<span class="sourceLineNo">2652</span>        Collection&lt;HTableDescriptor&gt; htds;<a name="line.2652"></a>
+<span class="sourceLineNo">2653</span>        if (namespace !

<TRUNCATED>

Mime
View raw message