hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [01/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Wed, 10 May 2017 14:59:42 GMT
Repository: hbase-site
Updated Branches:
  refs/heads/asf-site 8678c699d -> dd7176bfc


http://git-wip-us.apache.org/repos/asf/hbase-site/blob/dd7176bf/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.InitializationMonitor.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.InitializationMonitor.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.InitializationMonitor.html
index 17bc96c..1642d61 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.InitializationMonitor.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/HMaster.InitializationMonitor.html
@@ -2317,7 +2317,7 @@
 <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>  public long restoreSnapshot(final SnapshotDescription snapshotDesc,<a name="line.2311"></a>
-<span class="sourceLineNo">2312</span>      final long nonceGroup, final long nonce) throws IOException {<a name="line.2312"></a>
+<span class="sourceLineNo">2312</span>      final long nonceGroup, final long nonce, final boolean restoreAcl) throws IOException {<a name="line.2312"></a>
 <span class="sourceLineNo">2313</span>    checkInitialized();<a name="line.2313"></a>
 <span class="sourceLineNo">2314</span>    getSnapshotManager().checkSnapshotSupport();<a name="line.2314"></a>
 <span class="sourceLineNo">2315</span><a name="line.2315"></a>
@@ -2329,1031 +2329,1032 @@
 <span class="sourceLineNo">2321</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2321"></a>
 <span class="sourceLineNo">2322</span>      @Override<a name="line.2322"></a>
 <span class="sourceLineNo">2323</span>      protected void run() throws IOException {<a name="line.2323"></a>
-<span class="sourceLineNo">2324</span>        setProcId(getSnapshotManager().restoreOrCloneSnapshot(snapshotDesc, getNonceKey()));<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>      @Override<a name="line.2327"></a>
-<span class="sourceLineNo">2328</span>      protected String getDescription() {<a name="line.2328"></a>
-<span class="sourceLineNo">2329</span>        return "RestoreSnapshotProcedure";<a name="line.2329"></a>
-<span class="sourceLineNo">2330</span>      }<a name="line.2330"></a>
-<span class="sourceLineNo">2331</span>    });<a name="line.2331"></a>
-<span class="sourceLineNo">2332</span>  }<a name="line.2332"></a>
-<span class="sourceLineNo">2333</span><a name="line.2333"></a>
-<span class="sourceLineNo">2334</span>  @Override<a name="line.2334"></a>
-<span class="sourceLineNo">2335</span>  public void checkTableModifiable(final TableName tableName)<a name="line.2335"></a>
-<span class="sourceLineNo">2336</span>      throws IOException, TableNotFoundException, TableNotDisabledException {<a name="line.2336"></a>
-<span class="sourceLineNo">2337</span>    if (isCatalogTable(tableName)) {<a name="line.2337"></a>
-<span class="sourceLineNo">2338</span>      throw new IOException("Can't modify catalog tables");<a name="line.2338"></a>
-<span class="sourceLineNo">2339</span>    }<a name="line.2339"></a>
-<span class="sourceLineNo">2340</span>    if (!MetaTableAccessor.tableExists(getConnection(), tableName)) {<a name="line.2340"></a>
-<span class="sourceLineNo">2341</span>      throw new TableNotFoundException(tableName);<a name="line.2341"></a>
-<span class="sourceLineNo">2342</span>    }<a name="line.2342"></a>
-<span class="sourceLineNo">2343</span>    if (!getTableStateManager().isTableState(tableName, TableState.State.DISABLED)) {<a name="line.2343"></a>
-<span class="sourceLineNo">2344</span>      throw new TableNotDisabledException(tableName);<a name="line.2344"></a>
-<span class="sourceLineNo">2345</span>    }<a name="line.2345"></a>
-<span class="sourceLineNo">2346</span>  }<a name="line.2346"></a>
-<span class="sourceLineNo">2347</span><a name="line.2347"></a>
-<span class="sourceLineNo">2348</span>  /**<a name="line.2348"></a>
-<span class="sourceLineNo">2349</span>   * @return cluster status<a name="line.2349"></a>
-<span class="sourceLineNo">2350</span>   */<a name="line.2350"></a>
-<span class="sourceLineNo">2351</span>  public ClusterStatus getClusterStatus() throws InterruptedIOException {<a name="line.2351"></a>
-<span class="sourceLineNo">2352</span>    // Build Set of backup masters from ZK nodes<a name="line.2352"></a>
-<span class="sourceLineNo">2353</span>    List&lt;String&gt; backupMasterStrings;<a name="line.2353"></a>
-<span class="sourceLineNo">2354</span>    try {<a name="line.2354"></a>
-<span class="sourceLineNo">2355</span>      backupMasterStrings = ZKUtil.listChildrenNoWatch(this.zooKeeper,<a name="line.2355"></a>
-<span class="sourceLineNo">2356</span>        this.zooKeeper.znodePaths.backupMasterAddressesZNode);<a name="line.2356"></a>
-<span class="sourceLineNo">2357</span>    } catch (KeeperException e) {<a name="line.2357"></a>
-<span class="sourceLineNo">2358</span>      LOG.warn(this.zooKeeper.prefix("Unable to list backup servers"), e);<a name="line.2358"></a>
-<span class="sourceLineNo">2359</span>      backupMasterStrings = null;<a name="line.2359"></a>
-<span class="sourceLineNo">2360</span>    }<a name="line.2360"></a>
-<span class="sourceLineNo">2361</span><a name="line.2361"></a>
-<span class="sourceLineNo">2362</span>    List&lt;ServerName&gt; backupMasters = null;<a name="line.2362"></a>
-<span class="sourceLineNo">2363</span>    if (backupMasterStrings != null &amp;&amp; !backupMasterStrings.isEmpty()) {<a name="line.2363"></a>
-<span class="sourceLineNo">2364</span>      backupMasters = new ArrayList&lt;&gt;(backupMasterStrings.size());<a name="line.2364"></a>
-<span class="sourceLineNo">2365</span>      for (String s: backupMasterStrings) {<a name="line.2365"></a>
-<span class="sourceLineNo">2366</span>        try {<a name="line.2366"></a>
-<span class="sourceLineNo">2367</span>          byte [] bytes;<a name="line.2367"></a>
-<span class="sourceLineNo">2368</span>          try {<a name="line.2368"></a>
-<span class="sourceLineNo">2369</span>            bytes = ZKUtil.getData(this.zooKeeper, ZKUtil.joinZNode(<a name="line.2369"></a>
-<span class="sourceLineNo">2370</span>                this.zooKeeper.znodePaths.backupMasterAddressesZNode, s));<a name="line.2370"></a>
-<span class="sourceLineNo">2371</span>          } catch (InterruptedException e) {<a name="line.2371"></a>
-<span class="sourceLineNo">2372</span>            throw new InterruptedIOException();<a name="line.2372"></a>
-<span class="sourceLineNo">2373</span>          }<a name="line.2373"></a>
-<span class="sourceLineNo">2374</span>          if (bytes != null) {<a name="line.2374"></a>
-<span class="sourceLineNo">2375</span>            ServerName sn;<a name="line.2375"></a>
-<span class="sourceLineNo">2376</span>            try {<a name="line.2376"></a>
-<span class="sourceLineNo">2377</span>              sn = ProtobufUtil.parseServerNameFrom(bytes);<a name="line.2377"></a>
-<span class="sourceLineNo">2378</span>            } catch (DeserializationException e) {<a name="line.2378"></a>
-<span class="sourceLineNo">2379</span>              LOG.warn("Failed parse, skipping registering backup server", e);<a name="line.2379"></a>
-<span class="sourceLineNo">2380</span>              continue;<a name="line.2380"></a>
-<span class="sourceLineNo">2381</span>            }<a name="line.2381"></a>
-<span class="sourceLineNo">2382</span>            backupMasters.add(sn);<a name="line.2382"></a>
-<span class="sourceLineNo">2383</span>          }<a name="line.2383"></a>
-<span class="sourceLineNo">2384</span>        } catch (KeeperException e) {<a name="line.2384"></a>
-<span class="sourceLineNo">2385</span>          LOG.warn(this.zooKeeper.prefix("Unable to get information about " +<a name="line.2385"></a>
-<span class="sourceLineNo">2386</span>                   "backup servers"), e);<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>      Collections.sort(backupMasters, new Comparator&lt;ServerName&gt;() {<a name="line.2389"></a>
-<span class="sourceLineNo">2390</span>        @Override<a name="line.2390"></a>
-<span class="sourceLineNo">2391</span>        public int compare(ServerName s1, ServerName s2) {<a name="line.2391"></a>
-<span class="sourceLineNo">2392</span>          return s1.getServerName().compareTo(s2.getServerName());<a name="line.2392"></a>
-<span class="sourceLineNo">2393</span>        }});<a name="line.2393"></a>
-<span class="sourceLineNo">2394</span>    }<a name="line.2394"></a>
-<span class="sourceLineNo">2395</span><a name="line.2395"></a>
-<span class="sourceLineNo">2396</span>    String clusterId = fileSystemManager != null ?<a name="line.2396"></a>
-<span class="sourceLineNo">2397</span>      fileSystemManager.getClusterId().toString() : null;<a name="line.2397"></a>
-<span class="sourceLineNo">2398</span>    Set&lt;RegionState&gt; regionsInTransition = assignmentManager != null ?<a name="line.2398"></a>
-<span class="sourceLineNo">2399</span>      assignmentManager.getRegionStates().getRegionsInTransition() : null;<a name="line.2399"></a>
-<span class="sourceLineNo">2400</span>    String[] coprocessors = cpHost != null ? getMasterCoprocessors() : null;<a name="line.2400"></a>
-<span class="sourceLineNo">2401</span>    boolean balancerOn = loadBalancerTracker != null ?<a name="line.2401"></a>
-<span class="sourceLineNo">2402</span>      loadBalancerTracker.isBalancerOn() : false;<a name="line.2402"></a>
-<span class="sourceLineNo">2403</span>    Map&lt;ServerName, ServerLoad&gt; onlineServers = null;<a name="line.2403"></a>
-<span class="sourceLineNo">2404</span>    Set&lt;ServerName&gt; deadServers = null;<a name="line.2404"></a>
-<span class="sourceLineNo">2405</span>    if (serverManager != null) {<a name="line.2405"></a>
-<span class="sourceLineNo">2406</span>      deadServers = serverManager.getDeadServers().copyServerNames();<a name="line.2406"></a>
-<span class="sourceLineNo">2407</span>      onlineServers = serverManager.getOnlineServers();<a name="line.2407"></a>
-<span class="sourceLineNo">2408</span>    }<a name="line.2408"></a>
-<span class="sourceLineNo">2409</span>    return new ClusterStatus(VersionInfo.getVersion(), clusterId,<a name="line.2409"></a>
-<span class="sourceLineNo">2410</span>      onlineServers, deadServers, serverName, backupMasters,<a name="line.2410"></a>
-<span class="sourceLineNo">2411</span>      regionsInTransition, coprocessors, balancerOn);<a name="line.2411"></a>
-<span class="sourceLineNo">2412</span>  }<a name="line.2412"></a>
-<span class="sourceLineNo">2413</span><a name="line.2413"></a>
-<span class="sourceLineNo">2414</span>  /**<a name="line.2414"></a>
-<span class="sourceLineNo">2415</span>   * The set of loaded coprocessors is stored in a static set. Since it's<a name="line.2415"></a>
-<span class="sourceLineNo">2416</span>   * statically allocated, it does not require that HMaster's cpHost be<a name="line.2416"></a>
-<span class="sourceLineNo">2417</span>   * initialized prior to accessing it.<a name="line.2417"></a>
-<span class="sourceLineNo">2418</span>   * @return a String representation of the set of names of the loaded coprocessors.<a name="line.2418"></a>
-<span class="sourceLineNo">2419</span>   */<a name="line.2419"></a>
-<span class="sourceLineNo">2420</span>  public static String getLoadedCoprocessors() {<a name="line.2420"></a>
-<span class="sourceLineNo">2421</span>    return CoprocessorHost.getLoadedCoprocessors().toString();<a name="line.2421"></a>
-<span class="sourceLineNo">2422</span>  }<a name="line.2422"></a>
-<span class="sourceLineNo">2423</span><a name="line.2423"></a>
-<span class="sourceLineNo">2424</span>  /**<a name="line.2424"></a>
-<span class="sourceLineNo">2425</span>   * @return timestamp in millis when HMaster was started.<a name="line.2425"></a>
-<span class="sourceLineNo">2426</span>   */<a name="line.2426"></a>
-<span class="sourceLineNo">2427</span>  public long getMasterStartTime() {<a name="line.2427"></a>
-<span class="sourceLineNo">2428</span>    return startcode;<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>   * @return timestamp in millis when HMaster became the active master.<a name="line.2432"></a>
-<span class="sourceLineNo">2433</span>   */<a name="line.2433"></a>
-<span class="sourceLineNo">2434</span>  public long getMasterActiveTime() {<a name="line.2434"></a>
-<span class="sourceLineNo">2435</span>    return masterActiveTime;<a name="line.2435"></a>
-<span class="sourceLineNo">2436</span>  }<a name="line.2436"></a>
-<span class="sourceLineNo">2437</span><a name="line.2437"></a>
-<span class="sourceLineNo">2438</span>  public int getNumWALFiles() {<a name="line.2438"></a>
-<span class="sourceLineNo">2439</span>    return procedureStore != null ? procedureStore.getActiveLogs().size() : 0;<a name="line.2439"></a>
-<span class="sourceLineNo">2440</span>  }<a name="line.2440"></a>
-<span class="sourceLineNo">2441</span><a name="line.2441"></a>
-<span class="sourceLineNo">2442</span>  public WALProcedureStore getWalProcedureStore() {<a name="line.2442"></a>
-<span class="sourceLineNo">2443</span>    return procedureStore;<a name="line.2443"></a>
-<span class="sourceLineNo">2444</span>  }<a name="line.2444"></a>
-<span class="sourceLineNo">2445</span><a name="line.2445"></a>
-<span class="sourceLineNo">2446</span>  public int getRegionServerInfoPort(final ServerName sn) {<a name="line.2446"></a>
-<span class="sourceLineNo">2447</span>    RegionServerInfo info = this.regionServerTracker.getRegionServerInfo(sn);<a name="line.2447"></a>
-<span class="sourceLineNo">2448</span>    if (info == null || info.getInfoPort() == 0) {<a name="line.2448"></a>
-<span class="sourceLineNo">2449</span>      return conf.getInt(HConstants.REGIONSERVER_INFO_PORT,<a name="line.2449"></a>
-<span class="sourceLineNo">2450</span>        HConstants.DEFAULT_REGIONSERVER_INFOPORT);<a name="line.2450"></a>
-<span class="sourceLineNo">2451</span>    }<a name="line.2451"></a>
-<span class="sourceLineNo">2452</span>    return info.getInfoPort();<a name="line.2452"></a>
-<span class="sourceLineNo">2453</span>  }<a name="line.2453"></a>
-<span class="sourceLineNo">2454</span><a name="line.2454"></a>
-<span class="sourceLineNo">2455</span>  public String getRegionServerVersion(final ServerName sn) {<a name="line.2455"></a>
-<span class="sourceLineNo">2456</span>    RegionServerInfo info = this.regionServerTracker.getRegionServerInfo(sn);<a name="line.2456"></a>
-<span class="sourceLineNo">2457</span>    if (info != null &amp;&amp; info.hasVersionInfo()) {<a name="line.2457"></a>
-<span class="sourceLineNo">2458</span>      return info.getVersionInfo().getVersion();<a name="line.2458"></a>
-<span class="sourceLineNo">2459</span>    }<a name="line.2459"></a>
-<span class="sourceLineNo">2460</span>    return "Unknown";<a name="line.2460"></a>
-<span class="sourceLineNo">2461</span>  }<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>   * @return array of coprocessor SimpleNames.<a name="line.2464"></a>
-<span class="sourceLineNo">2465</span>   */<a name="line.2465"></a>
-<span class="sourceLineNo">2466</span>  public String[] getMasterCoprocessors() {<a name="line.2466"></a>
-<span class="sourceLineNo">2467</span>    Set&lt;String&gt; masterCoprocessors = getMasterCoprocessorHost().getCoprocessors();<a name="line.2467"></a>
-<span class="sourceLineNo">2468</span>    return masterCoprocessors.toArray(new String[masterCoprocessors.size()]);<a name="line.2468"></a>
-<span class="sourceLineNo">2469</span>  }<a name="line.2469"></a>
-<span class="sourceLineNo">2470</span><a name="line.2470"></a>
-<span class="sourceLineNo">2471</span>  @Override<a name="line.2471"></a>
-<span class="sourceLineNo">2472</span>  public void abort(final String msg, final Throwable t) {<a name="line.2472"></a>
-<span class="sourceLineNo">2473</span>    if (isAborted() || isStopped()) {<a name="line.2473"></a>
-<span class="sourceLineNo">2474</span>      return;<a name="line.2474"></a>
-<span class="sourceLineNo">2475</span>    }<a name="line.2475"></a>
-<span class="sourceLineNo">2476</span>    if (cpHost != null) {<a name="line.2476"></a>
-<span class="sourceLineNo">2477</span>      // HBASE-4014: dump a list of loaded coprocessors.<a name="line.2477"></a>
-<span class="sourceLineNo">2478</span>      LOG.fatal("Master server abort: loaded coprocessors are: " +<a name="line.2478"></a>
-<span class="sourceLineNo">2479</span>          getLoadedCoprocessors());<a name="line.2479"></a>
-<span class="sourceLineNo">2480</span>    }<a name="line.2480"></a>
-<span class="sourceLineNo">2481</span>    if (t != null) LOG.fatal(msg, t);<a name="line.2481"></a>
-<span class="sourceLineNo">2482</span>    try {<a name="line.2482"></a>
-<span class="sourceLineNo">2483</span>      stopMaster();<a name="line.2483"></a>
-<span class="sourceLineNo">2484</span>    } catch (IOException e) {<a name="line.2484"></a>
-<span class="sourceLineNo">2485</span>      LOG.error("Exception occurred while stopping master", e);<a name="line.2485"></a>
-<span class="sourceLineNo">2486</span>    }<a name="line.2486"></a>
-<span class="sourceLineNo">2487</span>  }<a name="line.2487"></a>
-<span class="sourceLineNo">2488</span><a name="line.2488"></a>
-<span class="sourceLineNo">2489</span>  @Override<a name="line.2489"></a>
-<span class="sourceLineNo">2490</span>  public ZooKeeperWatcher getZooKeeper() {<a name="line.2490"></a>
-<span class="sourceLineNo">2491</span>    return zooKeeper;<a name="line.2491"></a>
-<span class="sourceLineNo">2492</span>  }<a name="line.2492"></a>
-<span class="sourceLineNo">2493</span><a name="line.2493"></a>
-<span class="sourceLineNo">2494</span>  @Override<a name="line.2494"></a>
-<span class="sourceLineNo">2495</span>  public MasterCoprocessorHost getMasterCoprocessorHost() {<a name="line.2495"></a>
-<span class="sourceLineNo">2496</span>    return cpHost;<a name="line.2496"></a>
-<span class="sourceLineNo">2497</span>  }<a name="line.2497"></a>
-<span class="sourceLineNo">2498</span><a name="line.2498"></a>
-<span class="sourceLineNo">2499</span>  @Override<a name="line.2499"></a>
-<span class="sourceLineNo">2500</span>  public MasterQuotaManager getMasterQuotaManager() {<a name="line.2500"></a>
-<span class="sourceLineNo">2501</span>    return quotaManager;<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 ProcedureExecutor&lt;MasterProcedureEnv&gt; getMasterProcedureExecutor() {<a name="line.2505"></a>
-<span class="sourceLineNo">2506</span>    return procedureExecutor;<a name="line.2506"></a>
-<span class="sourceLineNo">2507</span>  }<a name="line.2507"></a>
-<span class="sourceLineNo">2508</span><a name="line.2508"></a>
-<span class="sourceLineNo">2509</span>  @Override<a name="line.2509"></a>
-<span class="sourceLineNo">2510</span>  public ServerName getServerName() {<a name="line.2510"></a>
-<span class="sourceLineNo">2511</span>    return this.serverName;<a name="line.2511"></a>
-<span class="sourceLineNo">2512</span>  }<a name="line.2512"></a>
-<span class="sourceLineNo">2513</span><a name="line.2513"></a>
-<span class="sourceLineNo">2514</span>  @Override<a name="line.2514"></a>
-<span class="sourceLineNo">2515</span>  public AssignmentManager getAssignmentManager() {<a name="line.2515"></a>
-<span class="sourceLineNo">2516</span>    return this.assignmentManager;<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>  @Override<a name="line.2519"></a>
-<span class="sourceLineNo">2520</span>  public CatalogJanitor getCatalogJanitor() {<a name="line.2520"></a>
-<span class="sourceLineNo">2521</span>    return this.catalogJanitorChore;<a name="line.2521"></a>
-<span class="sourceLineNo">2522</span>  }<a name="line.2522"></a>
-<span class="sourceLineNo">2523</span><a name="line.2523"></a>
-<span class="sourceLineNo">2524</span>  public MemoryBoundedLogMessageBuffer getRegionServerFatalLogBuffer() {<a name="line.2524"></a>
-<span class="sourceLineNo">2525</span>    return rsFatals;<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>  public void shutdown() throws IOException {<a name="line.2528"></a>
-<span class="sourceLineNo">2529</span>    if (cpHost != null) {<a name="line.2529"></a>
-<span class="sourceLineNo">2530</span>      cpHost.preShutdown();<a name="line.2530"></a>
-<span class="sourceLineNo">2531</span>    }<a name="line.2531"></a>
-<span class="sourceLineNo">2532</span><a name="line.2532"></a>
-<span class="sourceLineNo">2533</span>    if (this.serverManager != null) {<a name="line.2533"></a>
-<span class="sourceLineNo">2534</span>      this.serverManager.shutdownCluster();<a name="line.2534"></a>
-<span class="sourceLineNo">2535</span>    }<a name="line.2535"></a>
-<span class="sourceLineNo">2536</span>    if (this.clusterStatusTracker != null){<a name="line.2536"></a>
-<span class="sourceLineNo">2537</span>      try {<a name="line.2537"></a>
-<span class="sourceLineNo">2538</span>        this.clusterStatusTracker.setClusterDown();<a name="line.2538"></a>
-<span class="sourceLineNo">2539</span>      } catch (KeeperException e) {<a name="line.2539"></a>
-<span class="sourceLineNo">2540</span>        LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);<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>  }<a name="line.2543"></a>
-<span class="sourceLineNo">2544</span><a name="line.2544"></a>
-<span class="sourceLineNo">2545</span>  public void stopMaster() throws IOException {<a name="line.2545"></a>
-<span class="sourceLineNo">2546</span>    if (cpHost != null) {<a name="line.2546"></a>
-<span class="sourceLineNo">2547</span>      cpHost.preStopMaster();<a name="line.2547"></a>
-<span class="sourceLineNo">2548</span>    }<a name="line.2548"></a>
-<span class="sourceLineNo">2549</span>    stop("Stopped by " + Thread.currentThread().getName());<a name="line.2549"></a>
-<span class="sourceLineNo">2550</span>  }<a name="line.2550"></a>
-<span class="sourceLineNo">2551</span><a name="line.2551"></a>
-<span class="sourceLineNo">2552</span>  void checkServiceStarted() throws ServerNotRunningYetException {<a name="line.2552"></a>
-<span class="sourceLineNo">2553</span>    if (!serviceStarted) {<a name="line.2553"></a>
-<span class="sourceLineNo">2554</span>      throw new ServerNotRunningYetException("Server is not running yet");<a name="line.2554"></a>
-<span class="sourceLineNo">2555</span>    }<a name="line.2555"></a>
-<span class="sourceLineNo">2556</span>  }<a name="line.2556"></a>
-<span class="sourceLineNo">2557</span><a name="line.2557"></a>
-<span class="sourceLineNo">2558</span>  void checkInitialized()<a name="line.2558"></a>
-<span class="sourceLineNo">2559</span>      throws PleaseHoldException, ServerNotRunningYetException, MasterNotRunningException {<a name="line.2559"></a>
-<span class="sourceLineNo">2560</span>    checkServiceStarted();<a name="line.2560"></a>
-<span class="sourceLineNo">2561</span>    if (!isInitialized()) throw new PleaseHoldException("Master is initializing");<a name="line.2561"></a>
-<span class="sourceLineNo">2562</span>    if (isStopped()) throw new MasterNotRunningException();<a name="line.2562"></a>
-<span class="sourceLineNo">2563</span>  }<a name="line.2563"></a>
-<span class="sourceLineNo">2564</span><a name="line.2564"></a>
-<span class="sourceLineNo">2565</span>  /**<a name="line.2565"></a>
-<span class="sourceLineNo">2566</span>   * Report whether this master is currently the active master or not.<a name="line.2566"></a>
-<span class="sourceLineNo">2567</span>   * If not active master, we are parked on ZK waiting to become active.<a name="line.2567"></a>
-<span class="sourceLineNo">2568</span>   *<a name="line.2568"></a>
-<span class="sourceLineNo">2569</span>   * This method is used for testing.<a name="line.2569"></a>
-<span class="sourceLineNo">2570</span>   *<a name="line.2570"></a>
-<span class="sourceLineNo">2571</span>   * @return true if active master, false if not.<a name="line.2571"></a>
-<span class="sourceLineNo">2572</span>   */<a name="line.2572"></a>
-<span class="sourceLineNo">2573</span>  @Override<a name="line.2573"></a>
-<span class="sourceLineNo">2574</span>  public boolean isActiveMaster() {<a name="line.2574"></a>
-<span class="sourceLineNo">2575</span>    return activeMaster;<a name="line.2575"></a>
-<span class="sourceLineNo">2576</span>  }<a name="line.2576"></a>
-<span class="sourceLineNo">2577</span><a name="line.2577"></a>
-<span class="sourceLineNo">2578</span>  /**<a name="line.2578"></a>
-<span class="sourceLineNo">2579</span>   * Report whether this master has completed with its initialization and is<a name="line.2579"></a>
-<span class="sourceLineNo">2580</span>   * ready.  If ready, the master is also the active master.  A standby master<a name="line.2580"></a>
-<span class="sourceLineNo">2581</span>   * is never ready.<a name="line.2581"></a>
-<span class="sourceLineNo">2582</span>   *<a name="line.2582"></a>
-<span class="sourceLineNo">2583</span>   * This method is used for testing.<a name="line.2583"></a>
-<span class="sourceLineNo">2584</span>   *<a name="line.2584"></a>
-<span class="sourceLineNo">2585</span>   * @return true if master is ready to go, false if not.<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 isInitialized() {<a name="line.2588"></a>
-<span class="sourceLineNo">2589</span>    return initialized.isReady();<a name="line.2589"></a>
-<span class="sourceLineNo">2590</span>  }<a name="line.2590"></a>
-<span class="sourceLineNo">2591</span><a name="line.2591"></a>
-<span class="sourceLineNo">2592</span>  /**<a name="line.2592"></a>
-<span class="sourceLineNo">2593</span>   * Report whether this master is in maintenance mode.<a name="line.2593"></a>
-<span class="sourceLineNo">2594</span>   *<a name="line.2594"></a>
-<span class="sourceLineNo">2595</span>   * @return true if master is in maintenanceMode<a name="line.2595"></a>
-<span class="sourceLineNo">2596</span>   */<a name="line.2596"></a>
-<span class="sourceLineNo">2597</span>  @Override<a name="line.2597"></a>
-<span class="sourceLineNo">2598</span>  public boolean isInMaintenanceMode() {<a name="line.2598"></a>
-<span class="sourceLineNo">2599</span>    return maintenanceModeTracker.isInMaintenanceMode();<a name="line.2599"></a>
-<span class="sourceLineNo">2600</span>  }<a name="line.2600"></a>
-<span class="sourceLineNo">2601</span><a name="line.2601"></a>
-<span class="sourceLineNo">2602</span>  @VisibleForTesting<a name="line.2602"></a>
-<span class="sourceLineNo">2603</span>  public void setInitialized(boolean isInitialized) {<a name="line.2603"></a>
-<span class="sourceLineNo">2604</span>    procedureExecutor.getEnvironment().setEventReady(initialized, isInitialized);<a name="line.2604"></a>
-<span class="sourceLineNo">2605</span>  }<a name="line.2605"></a>
-<span class="sourceLineNo">2606</span><a name="line.2606"></a>
-<span class="sourceLineNo">2607</span>  public ProcedureEvent getInitializedEvent() {<a name="line.2607"></a>
-<span class="sourceLineNo">2608</span>    return initialized;<a name="line.2608"></a>
-<span class="sourceLineNo">2609</span>  }<a name="line.2609"></a>
-<span class="sourceLineNo">2610</span><a name="line.2610"></a>
-<span class="sourceLineNo">2611</span>  /**<a name="line.2611"></a>
-<span class="sourceLineNo">2612</span>   * ServerCrashProcessingEnabled is set false before completing assignMeta to prevent processing<a name="line.2612"></a>
-<span class="sourceLineNo">2613</span>   * of crashed servers.<a name="line.2613"></a>
-<span class="sourceLineNo">2614</span>   * @return true if assignMeta has completed;<a name="line.2614"></a>
-<span class="sourceLineNo">2615</span>   */<a name="line.2615"></a>
-<span class="sourceLineNo">2616</span>  @Override<a name="line.2616"></a>
-<span class="sourceLineNo">2617</span>  public boolean isServerCrashProcessingEnabled() {<a name="line.2617"></a>
-<span class="sourceLineNo">2618</span>    return serverCrashProcessingEnabled.isReady();<a name="line.2618"></a>
-<span class="sourceLineNo">2619</span>  }<a name="line.2619"></a>
-<span class="sourceLineNo">2620</span><a name="line.2620"></a>
-<span class="sourceLineNo">2621</span>  @VisibleForTesting<a name="line.2621"></a>
-<span class="sourceLineNo">2622</span>  public void setServerCrashProcessingEnabled(final boolean b) {<a name="line.2622"></a>
-<span class="sourceLineNo">2623</span>    procedureExecutor.getEnvironment().setEventReady(serverCrashProcessingEnabled, b);<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>  public ProcedureEvent getServerCrashProcessingEnabledEvent() {<a name="line.2626"></a>
-<span class="sourceLineNo">2627</span>    return serverCrashProcessingEnabled;<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>   * Report whether this master has started initialization and is about to do meta region assignment<a name="line.2631"></a>
-<span class="sourceLineNo">2632</span>   * @return true if master is in initialization &amp;amp; about to assign hbase:meta regions<a name="line.2632"></a>
-<span class="sourceLineNo">2633</span>   */<a name="line.2633"></a>
-<span class="sourceLineNo">2634</span>  public boolean isInitializationStartsMetaRegionAssignment() {<a name="line.2634"></a>
-<span class="sourceLineNo">2635</span>    return this.initializationBeforeMetaAssignment;<a name="line.2635"></a>
-<span class="sourceLineNo">2636</span>  }<a name="line.2636"></a>
-<span class="sourceLineNo">2637</span><a name="line.2637"></a>
-<span class="sourceLineNo">2638</span>  /**<a name="line.2638"></a>
-<span class="sourceLineNo">2639</span>   * Compute the average load across all region servers.<a name="line.2639"></a>
-<span class="sourceLineNo">2640</span>   * Currently, this uses a very naive computation - just uses the number of<a name="line.2640"></a>
-<span class="sourceLineNo">2641</span>   * regions being served, ignoring stats about number of requests.<a name="line.2641"></a>
-<span class="sourceLineNo">2642</span>   * @return the average load<a name="line.2642"></a>
-<span class="sourceLineNo">2643</span>   */<a name="line.2643"></a>
-<span class="sourceLineNo">2644</span>  public double getAverageLoad() {<a name="line.2644"></a>
-<span class="sourceLineNo">2645</span>    if (this.assignmentManager == null) {<a name="line.2645"></a>
-<span class="sourceLineNo">2646</span>      return 0;<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>    RegionStates regionStates = this.assignmentManager.getRegionStates();<a name="line.2649"></a>
-<span class="sourceLineNo">2650</span>    if (regionStates == null) {<a name="line.2650"></a>
-<span class="sourceLineNo">2651</span>      return 0;<a name="line.2651"></a>
-<span class="sourceLineNo">2652</span>    }<a name="line.2652"></a>
-<span class="sourceLineNo">2653</span>    return regionStates.getAverageLoad();<a name="line.2653"></a>
-<span class="sourceLineNo">2654</span>  }<a name="line.2654"></a>
-<span class="sourceLineNo">2655</span><a name="line.2655"></a>
-<span class="sourceLineNo">2656</span>  /*<a name="line.2656"></a>
-<span class="sourceLineNo">2657</span>   * @return the count of region split plans executed<a name="line.2657"></a>
-<span class="sourceLineNo">2658</span>   */<a name="line.2658"></a>
-<span class="sourceLineNo">2659</span>  public long getSplitPlanCount() {<a name="line.2659"></a>
-<span class="sourceLineNo">2660</span>    return splitPlanCount;<a name="line.2660"></a>
-<span class="sourceLineNo">2661</span>  }<a name="line.2661"></a>
-<span class="sourceLineNo">2662</span><a name="line.2662"></a>
-<span class="sourceLineNo">2663</span>  /*<a name="line.2663"></a>
-<span class="sourceLineNo">2664</span>   * @return the count of region merge plans executed<a name="line.2664"></a>
-<span class="sourceLineNo">2665</span>   */<a name="line.2665"></a>
-<span class="sourceLineNo">2666</span>  public long getMergePlanCount() {<a name="line.2666"></a>
-<span class="sourceLineNo">2667</span>    return mergePlanCount;<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>  @Override<a name="line.2670"></a>
-<span class="sourceLineNo">2671</span>  public boolean registerService(Service instance) {<a name="line.2671"></a>
-<span class="sourceLineNo">2672</span>    /*<a name="line.2672"></a>
-<span class="sourceLineNo">2673</span>     * No stacking of instances is allowed for a single service name<a name="line.2673"></a>
-<span class="sourceLineNo">2674</span>     */<a name="line.2674"></a>
-<span class="sourceLineNo">2675</span>    Descriptors.ServiceDescriptor serviceDesc = instance.getDescriptorForType();<a name="line.2675"></a>
-<span class="sourceLineNo">2676</span>    String serviceName = CoprocessorRpcUtils.getServiceName(serviceDesc);<a name="line.2676"></a>
-<span class="sourceLineNo">2677</span>    if (coprocessorServiceHandlers.containsKey(serviceName)) {<a name="line.2677"></a>
-<span class="sourceLineNo">2678</span>      LOG.error("Coprocessor service "+serviceName+<a name="line.2678"></a>
-<span class="sourceLineNo">2679</span>          " already registered, rejecting request from "+instance<a name="line.2679"></a>
-<span class="sourceLineNo">2680</span>      );<a name="line.2680"></a>
-<span class="sourceLineNo">2681</span>      return false;<a name="line.2681"></a>
-<span class="sourceLineNo">2682</span>    }<a name="line.2682"></a>
-<span class="sourceLineNo">2683</span><a name="line.2683"></a>
-<span class="sourceLineNo">2684</span>    coprocessorServiceHandlers.put(serviceName, instance);<a name="line.2684"></a>
-<span class="sourceLineNo">2685</span>    if (LOG.isDebugEnabled()) {<a name="line.2685"></a>
-<span class="sourceLineNo">2686</span>      LOG.debug("Registered master coprocessor service: service="+serviceName);<a name="line.2686"></a>
-<span class="sourceLineNo">2687</span>    }<a name="line.2687"></a>
-<span class="sourceLineNo">2688</span>    return true;<a name="line.2688"></a>
-<span class="sourceLineNo">2689</span>  }<a name="line.2689"></a>
-<span class="sourceLineNo">2690</span><a name="line.2690"></a>
-<span class="sourceLineNo">2691</span>  /**<a name="line.2691"></a>
-<span class="sourceLineNo">2692</span>   * Utility for constructing an instance of the passed HMaster class.<a name="line.2692"></a>
-<span class="sourceLineNo">2693</span>   * @param masterClass<a name="line.2693"></a>
-<span class="sourceLineNo">2694</span>   * @return HMaster instance.<a name="line.2694"></a>
-<span class="sourceLineNo">2695</span>   */<a name="line.2695"></a>
-<span class="sourceLineNo">2696</span>  public static HMaster constructMaster(Class&lt;? extends HMaster&gt; masterClass,<a name="line.2696"></a>
-<span class="sourceLineNo">2697</span>      final Configuration conf, final CoordinatedStateManager cp)  {<a name="line.2697"></a>
-<span class="sourceLineNo">2698</span>    try {<a name="line.2698"></a>
-<span class="sourceLineNo">2699</span>      Constructor&lt;? extends HMaster&gt; c =<a name="line.2699"></a>
-<span class="sourceLineNo">2700</span>        masterClass.getConstructor(Configuration.class, CoordinatedStateManager.class);<a name="line.2700"></a>
-<span class="sourceLineNo">2701</span>      return c.newInstance(conf, cp);<a name="line.2701"></a>
-<span class="sourceLineNo">2702</span>    } catch(Exception e) {<a name="line.2702"></a>
-<span class="sourceLineNo">2703</span>      Throwable error = e;<a name="line.2703"></a>
-<span class="sourceLineNo">2704</span>      if (e instanceof InvocationTargetException &amp;&amp;<a name="line.2704"></a>
-<span class="sourceLineNo">2705</span>          ((InvocationTargetException)e).getTargetException() != null) {<a name="line.2705"></a>
-<span class="sourceLineNo">2706</span>        error = ((InvocationTargetException)e).getTargetException();<a name="line.2706"></a>
-<span class="sourceLineNo">2707</span>      }<a name="line.2707"></a>
-<span class="sourceLineNo">2708</span>      throw new RuntimeException("Failed construction of Master: " + masterClass.toString() + ". "<a name="line.2708"></a>
-<span class="sourceLineNo">2709</span>        , error);<a name="line.2709"></a>
-<span class="sourceLineNo">2710</span>    }<a name="line.2710"></a>
-<span class="sourceLineNo">2711</span>  }<a name="line.2711"></a>
-<span class="sourceLineNo">2712</span><a name="line.2712"></a>
-<span class="sourceLineNo">2713</span>  /**<a name="line.2713"></a>
-<span class="sourceLineNo">2714</span>   * @see org.apache.hadoop.hbase.master.HMasterCommandLine<a name="line.2714"></a>
-<span class="sourceLineNo">2715</span>   */<a name="line.2715"></a>
-<span class="sourceLineNo">2716</span>  public static void main(String [] args) {<a name="line.2716"></a>
-<span class="sourceLineNo">2717</span>    LOG.info("***** STARTING service '" + HMaster.class.getSimpleName() + "' *****");<a name="line.2717"></a>
-<span class="sourceLineNo">2718</span>    VersionInfo.logVersion();<a name="line.2718"></a>
-<span class="sourceLineNo">2719</span>    new HMasterCommandLine(HMaster.class).doMain(args);<a name="line.2719"></a>
-<span class="sourceLineNo">2720</span>  }<a name="line.2720"></a>
-<span class="sourceLineNo">2721</span><a name="line.2721"></a>
-<span class="sourceLineNo">2722</span>  public HFileCleaner getHFileCleaner() {<a name="line.2722"></a>
-<span class="sourceLineNo">2723</span>    return this.hfileCleaner;<a name="line.2723"></a>
-<span class="sourceLineNo">2724</span>  }<a name="line.2724"></a>
-<span class="sourceLineNo">2725</span><a name="line.2725"></a>
-<span class="sourceLineNo">2726</span>  public LogCleaner getLogCleaner() {<a name="line.2726"></a>
-<span class="sourceLineNo">2727</span>    return this.logCleaner;<a name="line.2727"></a>
-<span class="sourceLineNo">2728</span>  }<a name="line.2728"></a>
-<span class="sourceLineNo">2729</span><a name="line.2729"></a>
-<span class="sourceLineNo">2730</span>  /**<a name="line.2730"></a>
-<span class="sourceLineNo">2731</span>   * @return the underlying snapshot manager<a name="line.2731"></a>
-<span class="sourceLineNo">2732</span>   */<a name="line.2732"></a>
-<span class="sourceLineNo">2733</span>  @Override<a name="line.2733"></a>
-<span class="sourceLineNo">2734</span>  public SnapshotManager getSnapshotManager() {<a name="line.2734"></a>
-<span class="sourceLineNo">2735</span>    return this.snapshotManager;<a name="line.2735"></a>
-<span class="sourceLineNo">2736</span>  }<a name="line.2736"></a>
-<span class="sourceLineNo">2737</span><a name="line.2737"></a>
-<span class="sourceLineNo">2738</span>  /**<a name="line.2738"></a>
-<span class="sourceLineNo">2739</span>   * @return the underlying MasterProcedureManagerHost<a name="line.2739"></a>
-<span class="sourceLineNo">2740</span>   */<a name="line.2740"></a>
-<span class="sourceLineNo">2741</span>  @Override<a name="line.2741"></a>
-<span class="sourceLineNo">2742</span>  public MasterProcedureManagerHost getMasterProcedureManagerHost() {<a name="line.2742"></a>
-<span class="sourceLineNo">2743</span>    return mpmHost;<a name="line.2743"></a>
-<span class="sourceLineNo">2744</span>  }<a name="line.2744"></a>
-<span class="sourceLineNo">2745</span><a name="line.2745"></a>
-<span class="sourceLineNo">2746</span>  @Override<a name="line.2746"></a>
-<span class="sourceLineNo">2747</span>  public ClusterSchema getClusterSchema() {<a name="line.2747"></a>
-<span class="sourceLineNo">2748</span>    return this.clusterSchemaService;<a name="line.2748"></a>
-<span class="sourceLineNo">2749</span>  }<a name="line.2749"></a>
-<span class="sourceLineNo">2750</span><a name="line.2750"></a>
-<span class="sourceLineNo">2751</span>  /**<a name="line.2751"></a>
-<span class="sourceLineNo">2752</span>   * Create a new Namespace.<a name="line.2752"></a>
-<span class="sourceLineNo">2753</span>   * @param namespaceDescriptor descriptor for new Namespace<a name="line.2753"></a>
-<span class="sourceLineNo">2754</span>   * @param nonceGroup Identifier for the source of the request, a client or process.<a name="line.2754"></a>
-<span class="sourceLineNo">2755</span>   * @param nonce A unique identifier for this operation from the client or process identified by<a name="line.2755"></a>
-<span class="sourceLineNo">2756</span>   * &lt;code&gt;nonceGroup&lt;/code&gt; (the source must ensure each operation gets a unique id).<a name="line.2756"></a>
-<span class="sourceLineNo">2757</span>   * @return procedure id<a name="line.2757"></a>
-<span class="sourceLineNo">2758</span>   */<a name="line.2758"></a>
-<span class="sourceLineNo">2759</span>  long createNamespace(final NamespaceDescriptor namespaceDescriptor, final long nonceGroup,<a name="line.2759"></a>
-<span class="sourceLineNo">2760</span>      final long nonce) throws IOException {<a name="line.2760"></a>
-<span class="sourceLineNo">2761</span>    checkInitialized();<a name="line.2761"></a>
-<span class="sourceLineNo">2762</span><a name="line.2762"></a>
-<span class="sourceLineNo">2763</span>    TableName.isLegalNamespaceName(Bytes.toBytes(namespaceDescriptor.getName()));<a name="line.2763"></a>
-<span class="sourceLineNo">2764</span><a name="line.2764"></a>
-<span class="sourceLineNo">2765</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2765"></a>
-<span class="sourceLineNo">2766</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2766"></a>
-<span class="sourceLineNo">2767</span>      @Override<a name="line.2767"></a>
-<span class="sourceLineNo">2768</span>      protected void run() throws IOException {<a name="line.2768"></a>
-<span class="sourceLineNo">2769</span>        if (getMaster().getMasterCoprocessorHost().preCreateNamespace(namespaceDescriptor)) {<a name="line.2769"></a>
-<span class="sourceLineNo">2770</span>          throw new BypassCoprocessorException();<a name="line.2770"></a>
-<span class="sourceLineNo">2771</span>        }<a name="line.2771"></a>
-<span class="sourceLineNo">2772</span>        LOG.info(getClientIdAuditPrefix() + " creating " + namespaceDescriptor);<a name="line.2772"></a>
-<span class="sourceLineNo">2773</span>        // Execute the operation synchronously - wait for the operation to complete before<a name="line.2773"></a>
-<span class="sourceLineNo">2774</span>        // continuing.<a name="line.2774"></a>
-<span class="sourceLineNo">2775</span>        setProcId(getClusterSchema().createNamespace(namespaceDescriptor, getNonceKey()));<a name="line.2775"></a>
-<span class="sourceLineNo">2776</span>        getMaster().getMasterCoprocessorHost().postCreateNamespace(namespaceDescriptor);<a name="line.2776"></a>
-<span class="sourceLineNo">2777</span>      }<a name="line.2777"></a>
-<span class="sourceLineNo">2778</span><a name="line.2778"></a>
-<span class="sourceLineNo">2779</span>      @Override<a name="line.2779"></a>
-<span class="sourceLineNo">2780</span>      protected String getDescription() {<a name="line.2780"></a>
-<span class="sourceLineNo">2781</span>        return "CreateNamespaceProcedure";<a name="line.2781"></a>
-<span class="sourceLineNo">2782</span>      }<a name="line.2782"></a>
-<span class="sourceLineNo">2783</span>    });<a name="line.2783"></a>
-<span class="sourceLineNo">2784</span>  }<a name="line.2784"></a>
-<span class="sourceLineNo">2785</span><a name="line.2785"></a>
-<span class="sourceLineNo">2786</span>  /**<a name="line.2786"></a>
-<span class="sourceLineNo">2787</span>   * Modify an existing Namespace.<a name="line.2787"></a>
-<span class="sourceLineNo">2788</span>   * @param nonceGroup Identifier for the source of the request, a client or process.<a name="line.2788"></a>
-<span class="sourceLineNo">2789</span>   * @param nonce A unique identifier for this operation from the client or process identified by<a name="line.2789"></a>
-<span class="sourceLineNo">2790</span>   * &lt;code&gt;nonceGroup&lt;/code&gt; (the source must ensure each operation gets a unique id).<a name="line.2790"></a>
-<span class="sourceLineNo">2791</span>   * @return procedure id<a name="line.2791"></a>
-<span class="sourceLineNo">2792</span>   */<a name="line.2792"></a>
-<span class="sourceLineNo">2793</span>  long modifyNamespace(final NamespaceDescriptor namespaceDescriptor, final long nonceGroup,<a name="line.2793"></a>
-<span class="sourceLineNo">2794</span>      final long nonce) throws IOException {<a name="line.2794"></a>
-<span class="sourceLineNo">2795</span>    checkInitialized();<a name="line.2795"></a>
-<span class="sourceLineNo">2796</span><a name="line.2796"></a>
-<span class="sourceLineNo">2797</span>    TableName.isLegalNamespaceName(Bytes.toBytes(namespaceDescriptor.getName()));<a name="line.2797"></a>
-<span class="sourceLineNo">2798</span><a name="line.2798"></a>
-<span class="sourceLineNo">2799</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2799"></a>
-<span class="sourceLineNo">2800</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2800"></a>
-<span class="sourceLineNo">2801</span>      @Override<a name="line.2801"></a>
-<span class="sourceLineNo">2802</span>      protected void run() throws IOException {<a name="line.2802"></a>
-<span class="sourceLineNo">2803</span>        if (getMaster().getMasterCoprocessorHost().preModifyNamespace(namespaceDescriptor)) {<a name="line.2803"></a>
-<span class="sourceLineNo">2804</span>          throw new BypassCoprocessorException();<a name="line.2804"></a>
-<span class="sourceLineNo">2805</span>        }<a name="line.2805"></a>
-<span class="sourceLineNo">2806</span>        LOG.info(getClientIdAuditPrefix() + " modify " + namespaceDescriptor);<a name="line.2806"></a>
-<span class="sourceLineNo">2807</span>        // Execute the operation synchronously - wait for the operation to complete before<a name="line.2807"></a>
-<span class="sourceLineNo">2808</span>        // continuing.<a name="line.2808"></a>
-<span class="sourceLineNo">2809</span>        setProcId(getClusterSchema().modifyNamespace(namespaceDescriptor, getNonceKey()));<a name="line.2809"></a>
-<span class="sourceLineNo">2810</span>        getMaster().getMasterCoprocessorHost().postModifyNamespace(namespaceDescriptor);<a name="line.2810"></a>
-<span class="sourceLineNo">2811</span>      }<a name="line.2811"></a>
-<span class="sourceLineNo">2812</span><a name="line.2812"></a>
-<span class="sourceLineNo">2813</span>      @Override<a name="line.2813"></a>
-<span class="sourceLineNo">2814</span>      protected String getDescription() {<a name="line.2814"></a>
-<span class="sourceLineNo">2815</span>        return "ModifyNamespaceProcedure";<a name="line.2815"></a>
-<span class="sourceLineNo">2816</span>      }<a name="line.2816"></a>
-<span class="sourceLineNo">2817</span>    });<a name="line.2817"></a>
-<span class="sourceLineNo">2818</span>  }<a name="line.2818"></a>
-<span class="sourceLineNo">2819</span><a name="line.2819"></a>
-<span class="sourceLineNo">2820</span>  /**<a name="line.2820"></a>
-<span class="sourceLineNo">2821</span>   * Delete an existing Namespace. Only empty Namespaces (no tables) can be removed.<a name="line.2821"></a>
-<span class="sourceLineNo">2822</span>   * @param nonceGroup Identifier for the source of the request, a client or process.<a name="line.2822"></a>
-<span class="sourceLineNo">2823</span>   * @param nonce A unique identifier for this operation from the client or process identified by<a name="line.2823"></a>
-<span class="sourceLineNo">2824</span>   * &lt;code&gt;nonceGroup&lt;/code&gt; (the source must ensure each operation gets a unique id).<a name="line.2824"></a>
-<span class="sourceLineNo">2825</span>   * @return procedure id<a name="line.2825"></a>
-<span class="sourceLineNo">2826</span>   */<a name="line.2826"></a>
-<span class="sourceLineNo">2827</span>  long deleteNamespace(final String name, final long nonceGroup, final long nonce)<a name="line.2827"></a>
-<span class="sourceLineNo">2828</span>      throws IOException {<a name="line.2828"></a>
-<span class="sourceLineNo">2829</span>    checkInitialized();<a name="line.2829"></a>
-<span class="sourceLineNo">2830</span><a name="line.2830"></a>
-<span class="sourceLineNo">2831</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2831"></a>
-<span class="sourceLineNo">2832</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2832"></a>
-<span class="sourceLineNo">2833</span>      @Override<a name="line.2833"></a>
-<span class="sourceLineNo">2834</span>      protected void run() throws IOException {<a name="line.2834"></a>
-<span class="sourceLineNo">2835</span>        if (getMaster().getMasterCoprocessorHost().preDeleteNamespace(name)) {<a name="line.2835"></a>
-<span class="sourceLineNo">2836</span>          throw new BypassCoprocessorException();<a name="line.2836"></a>
-<span class="sourceLineNo">2837</span>        }<a name="line.2837"></a>
-<span class="sourceLineNo">2838</span>        LOG.info(getClientIdAuditPrefix() + " delete " + name);<a name="line.2838"></a>
-<span class="sourceLineNo">2839</span>        // Execute the operation synchronously - wait for the operation to complete before<a name="line.2839"></a>
-<span class="sourceLineNo">2840</span>        // continuing.<a name="line.2840"></a>
-<span class="sourceLineNo">2841</span>        setProcId(getClusterSchema().deleteNamespace(name, getNonceKey()));<a name="line.2841"></a>
-<span class="sourceLineNo">2842</span>        getMaster().getMasterCoprocessorHost().postDeleteNamespace(name);<a name="line.2842"></a>
-<span class="sourceLineNo">2843</span>      }<a name="line.2843"></a>
-<span class="sourceLineNo">2844</span><a name="line.2844"></a>
-<span class="sourceLineNo">2845</span>      @Override<a name="line.2845"></a>
-<span class="sourceLineNo">2846</span>      protected String getDescription() {<a name="line.2846"></a>
-<span class="sourceLineNo">2847</span>        return "DeleteNamespaceProcedure";<a name="line.2847"></a>
-<span class="sourceLineNo">2848</span>      }<a name="line.2848"></a>
-<span class="sourceLineNo">2849</span>    });<a name="line.2849"></a>
-<span class="sourceLineNo">2850</span>  }<a name="line.2850"></a>
-<span class="sourceLineNo">2851</span><a name="line.2851"></a>
-<span class="sourceLineNo">2852</span>  /**<a name="line.2852"></a>
-<span class="sourceLineNo">2853</span>   * Get a Namespace<a name="line.2853"></a>
-<span class="sourceLineNo">2854</span>   * @param name Name of the Namespace<a name="line.2854"></a>
-<span class="sourceLineNo">2855</span>   * @return Namespace descriptor for &lt;code&gt;name&lt;/code&gt;<a name="line.2855"></a>
-<span class="sourceLineNo">2856</span>   */<a name="line.2856"></a>
-<span class="sourceLineNo">2857</span>  NamespaceDescriptor getNamespace(String name) throws IOException {<a name="line.2857"></a>
-<span class="sourceLineNo">2858</span>    checkInitialized();<a name="line.2858"></a>
-<span class="sourceLineNo">2859</span>    if (this.cpHost != null) this.cpHost.preGetNamespaceDescriptor(name);<a name="line.2859"></a>
-<span class="sourceLineNo">2860</span>    NamespaceDescriptor nsd = this.clusterSchemaService.getNamespace(name);<a name="line.2860"></a>
-<span class="sourceLineNo">2861</span>    if (this.cpHost != null) this.cpHost.postGetNamespaceDescriptor(nsd);<a name="line.2861"></a>
-<span class="sourceLineNo">2862</span>    return nsd;<a name="line.2862"></a>
-<span class="sourceLineNo">2863</span>  }<a name="line.2863"></a>
-<span class="sourceLineNo">2864</span><a name="line.2864"></a>
-<span class="sourceLineNo">2865</span>  /**<a name="line.2865"></a>
-<span class="sourceLineNo">2866</span>   * Get all Namespaces<a name="line.2866"></a>
-<span class="sourceLineNo">2867</span>   * @return All Namespace descriptors<a name="line.2867"></a>
-<span class="sourceLineNo">2868</span>   */<a name="line.2868"></a>
-<span class="sourceLineNo">2869</span>  List&lt;NamespaceDescriptor&gt; getNamespaces() throws IOException {<a name="line.2869"></a>
-<span class="sourceLineNo">2870</span>    checkInitialized();<a name="line.2870"></a>
-<span class="sourceLineNo">2871</span>    final List&lt;NamespaceDescriptor&gt; nsds = new ArrayList&lt;&gt;();<a name="line.2871"></a>
-<span class="sourceLineNo">2872</span>    boolean bypass = false;<a name="line.2872"></a>
-<span class="sourceLineNo">2873</span>    if (cpHost != null) {<a name="line.2873"></a>
-<span class="sourceLineNo">2874</span>      bypass = cpHost.preListNamespaceDescriptors(nsds);<a name="line.2874"></a>
-<span class="sourceLineNo">2875</span>    }<a name="line.2875"></a>
-<span class="sourceLineNo">2876</span>    if (!bypass) {<a name="line.2876"></a>
-<span class="sourceLineNo">2877</span>      nsds.addAll(this.clusterSchemaService.getNamespaces());<a name="line.2877"></a>
-<span class="sourceLineNo">2878</span>      if (this.cpHost != null) this.cpHost.postListNamespaceDescriptors(nsds);<a name="line.2878"></a>
-<span class="sourceLineNo">2879</span>    }<a name="line.2879"></a>
-<span class="sourceLineNo">2880</span>    return nsds;<a name="line.2880"></a>
-<span class="sourceLineNo">2881</span>  }<a name="line.2881"></a>
-<span class="sourceLineNo">2882</span><a name="line.2882"></a>
-<span class="sourceLineNo">2883</span>  @Override<a name="line.2883"></a>
-<span class="sourceLineNo">2884</span>  public List&lt;TableName&gt; listTableNamesByNamespace(String name) throws IOException {<a name="line.2884"></a>
-<span class="sourceLineNo">2885</span>    checkInitialized();<a name="line.2885"></a>
-<span class="sourceLineNo">2886</span>    return listTableNames(name, null, true);<a name="line.2886"></a>
-<span class="sourceLineNo">2887</span>  }<a name="line.2887"></a>
-<span class="sourceLineNo">2888</span><a name="line.2888"></a>
-<span class="sourceLineNo">2889</span>  @Override<a name="line.2889"></a>
-<span class="sourceLineNo">2890</span>  public List&lt;HTableDescriptor&gt; listTableDescriptorsByNamespace(String name) throws IOException {<a name="line.2890"></a>
-<span class="sourceLineNo">2891</span>    checkInitialized();<a name="line.2891"></a>
-<span class="sourceLineNo">2892</span>    return listTableDescriptors(name, null, null, true);<a name="line.2892"></a>
-<span class="sourceLineNo">2893</span>  }<a name="line.2893"></a>
-<span class="sourceLineNo">2894</span><a name="line.2894"></a>
-<span class="sourceLineNo">2895</span>  @Override<a name="line.2895"></a>
-<span class="sourceLineNo">2896</span>  public boolean abortProcedure(final long procId, final boolean mayInterruptIfRunning)<a name="line.2896"></a>
-<span class="sourceLineNo">2897</span>      throws IOException {<a name="line.2897"></a>
-<span class="sourceLineNo">2898</span>    if (cpHost != null) {<a name="line.2898"></a>
-<span class="sourceLineNo">2899</span>      cpHost.preAbortProcedure(this.procedureExecutor, procId);<a name="line.2899"></a>
-<span class="sourceLineNo">2900</span>    }<a name="line.2900"></a>
-<span class="sourceLineNo">2901</span><a name="line.2901"></a>
-<span class="sourceLineNo">2902</span>    final boolean result = this.procedureExecutor.abort(procId, mayInterruptIfRunning);<a name="line.2902"></a>
-<span class="sourceLineNo">2903</span><a name="line.2903"></a>
-<span class="sourceLineNo">2904</span>    if (cpHost != null) {<a name="line.2904"></a>
-<span class="sourceLineNo">2905</span>      cpHost.postAbortProcedure();<a name="line.2905"></a>
-<span class="sourceLineNo">2906</span>    }<a name="line.2906"></a>
-<span class="sourceLineNo">2907</span><a name="line.2907"></a>
-<span class="sourceLineNo">2908</span>    return result;<a name="line.2908"></a>
-<span class="sourceLineNo">2909</span>  }<a name="line.2909"></a>
-<span class="sourceLineNo">2910</span><a name="line.2910"></a>
-<span class="sourceLineNo">2911</span>  @Override<a name="line.2911"></a>
-<span class="sourceLineNo">2912</span>  public List&lt;ProcedureInfo&gt; listProcedures() throws IOException {<a name="line.2912"></a>
-<span class="sourceLineNo">2913</span>    if (cpHost != null) {<a name="line.2913"></a>
-<span class="sourceLineNo">2914</span>      cpHost.preListProcedures();<a name="line.2914"></a>
-<span class="sourceLineNo">2915</span>    }<a name="line.2915"></a>
-<span class="sourceLineNo">2916</span><a name="line.2916"></a>
-<span class="sourceLineNo">2917</span>    final List&lt;ProcedureInfo&gt; procInfoList = this.procedureExecutor.listProcedures();<a name="line.2917"></a>
-<span class="sourceLineNo">2918</span><a name="line.2918"></a>
-<span class="sourceLineNo">2919</span>    if (cpHost != null) {<a name="line.2919"></a>
-<span class="sourceLineNo">2920</span>      cpHost.postListProcedures(procInfoList);<a name="line.2920"></a>
-<span class="sourceLineNo">2921</span>    }<a name="line.2921"></a>
-<span class="sourceLineNo">2922</span><a name="line.2922"></a>
-<span class="sourceLineNo">2923</span>    return procInfoList;<a name="line.2923"></a>
-<span class="sourceLineNo">2924</span>  }<a name="line.2924"></a>
-<span class="sourceLineNo">2925</span><a name="line.2925"></a>
-<span class="sourceLineNo">2926</span>  private Map&lt;Long, ProcedureInfo&gt; getProcedureInfos() {<a name="line.2926"></a>
-<span class="sourceLineNo">2927</span>    final List&lt;ProcedureInfo&gt; list = procedureExecutor.listProcedures();<a name="line.2927"></a>
-<span class="sourceLineNo">2928</span>    final Map&lt;Long, ProcedureInfo&gt; map = new HashMap&lt;&gt;();<a name="line.2928"></a>
-<span class="sourceLineNo">2929</span><a name="line.2929"></a>
-<span class="sourceLineNo">2930</span>    for (ProcedureInfo procedureInfo : list) {<a name="line.2930"></a>
-<span class="sourceLineNo">2931</span>      map.put(procedureInfo.getProcId(), procedureInfo);<a name="line.2931"></a>
-<span class="sourceLineNo">2932</span>    }<a name="line.2932"></a>
-<span class="sourceLineNo">2933</span><a name="line.2933"></a>
-<span class="sourceLineNo">2934</span>    return map;<a name="line.2934"></a>
-<span class="sourceLineNo">2935</span>  }<a name="line.2935"></a>
-<span class="sourceLineNo">2936</span><a name="line.2936"></a>
-<span class="sourceLineNo">2937</span>  @Override<a name="line.2937"></a>
-<span class="sourceLineNo">2938</span>  public List&lt;LockInfo&gt; listLocks() throws IOException {<a name="line.2938"></a>
-<span class="sourceLineNo">2939</span>    if (cpHost != null) {<a name="line.2939"></a>
-<span class="sourceLineNo">2940</span>      cpHost.preListLocks();<a name="line.2940"></a>
-<span class="sourceLineNo">2941</span>    }<a name="line.2941"></a>
-<span class="sourceLineNo">2942</span><a name="line.2942"></a>
-<span class="sourceLineNo">2943</span>    MasterProcedureScheduler procedureScheduler = procedureExecutor.getEnvironment().getProcedureScheduler();<a name="line.2943"></a>
-<span class="sourceLineNo">2944</span><a name="line.2944"></a>
-<span class="sourceLineNo">2945</span>    final List&lt;LockInfo&gt; lockInfoList = procedureScheduler.listLocks();<a name="line.2945"></a>
-<span class="sourceLineNo">2946</span><a name="line.2946"></a>
-<span class="sourceLineNo">2947</span>    if (cpHost != null) {<a name="line.2947"></a>
-<span class="sourceLineNo">2948</span>      cpHost.postListLocks(lockInfoList);<a name="line.2948"></a>
-<span class="sourceLineNo">2949</span>    }<a name="line.2949"></a>
-<span class="sourceLineNo">2950</span><a name="line.2950"></a>
-<span class="sourceLineNo">2951</span>    return lockInfoList;<a name="line.2951"></a>
-<span class="sourceLineNo">2952</span>  }<a name="line.2952"></a>
-<span class="sourceLineNo">2953</span><a name="line.2953"></a>
-<span class="sourceLineNo">2954</span>  /**<a name="line.2954"></a>
-<span class="sourceLineNo">2955</span>   * Returns the list of table descriptors that match the specified request<a name="line.2955"></a>
-<span class="sourceLineNo">2956</span>   * @param namespace the namespace to query, or null if querying for all<a name="line.2956"></a>
-<span class="sourceLineNo">2957</span>   * @param regex The regular expression to match against, or null if querying for all<a name="line.2957"></a>
-<span class="sourceLineNo">2958</span>   * @param tableNameList the list of table names, or null if querying for all<a name="line.2958"></a>
-<span class="sourceLineNo">2959</span>   * @param includeSysTables False to match only against userspace tables<a name="line.2959"></a>
-<span class="sourceLineNo">2960</span>   * @return the list of table descriptors<a name="line.2960"></a>
-<span class="sourceLineNo">2961</span>   */<a name="line.2961"></a>
-<span class="sourceLineNo">2962</span>  public List&lt;HTableDescriptor&gt; listTableDescriptors(final String namespace, final String regex,<a name="line.2962"></a>
-<span class="sourceLineNo">2963</span>      final List&lt;TableName&gt; tableNameList, final boolean includeSysTables)<a name="line.2963"></a>
-<span class="sourceLineNo">2964</span>  throws IOException {<a name="line.2964"></a>
-<span class="sourceLineNo">2965</span>    List&lt;HTableDescriptor&gt; htds = new ArrayList&lt;&gt;();<a name="line.2965"></a>
-<span class="sourceLineNo">2966</span>    boolean bypass = cpHost != null?<a name="line.2966"></a>
-<span class="sourceLineNo">2967</span>        cpHost.preGetTableDescriptors(tableNameList, htds, regex): false;<a name="line.2967"></a>
-<span class="sourceLineNo">2968</span>    if (!bypass) {<a name="line.2968"></a>
-<span class="sourceLineNo">2969</span>      htds = getTableDescriptors(htds, namespace, regex, tableNameList, includeSysTables);<a name="line.2969"></a>
-<span class="sourceLineNo">2970</span>      if (cpHost != null) {<a name="line.2970"></a>
-<span class="sourceLineNo">2971</span>        cpHost.postGetTableDescriptors(tableNameList, htds, regex);<a name="line.2971"></a>
-<span class="sourceLineNo">2972</span>      }<a name="line.2972"></a>
-<span class="sourceLineNo">2973</span>    }<a name="line.2973"></a>
-<span class="sourceLineNo">2974</span>    return htds;<a name="line.2974"></a>
-<span class="sourceLineNo">2975</span>  }<a name="line.2975"></a>
-<span class="sourceLineNo">2976</span><a name="line.2976"></a>
-<span class="sourceLineNo">2977</span>  /**<a name="line.2977"></a>
-<span class="sourceLineNo">2978</span>   * Returns the list of table names that match the specified request<a name="line.2978"></a>
-<span class="sourceLineNo">2979</span>   * @param regex The regular expression to match against, or null if querying for all<a name="line.2979"></a>
-<span class="sourceLineNo">2980</span>   * @param namespace the namespace to query, or null if querying for all<a name="line.2980"></a>
-<span class="sourceLineNo">2981</span>   * @param includeSysTables False to match only against userspace tables<a name="line.2981"></a>
-<span class="sourceLineNo">2982</span>   * @return the list of table names<a name="line.2982"></a>
-<span class="sourceLineNo">2983</span>   */<a name="line.2983"></a>
-<span class="sourceLineNo">2984</span>  public List&lt;TableName&gt; listTableNames(final String namespace, final String regex,<a name="line.2984"></a>
-<span class="sourceLineNo">2985</span>      final boolean includeSysTables) throws IOException {<a name="line.2985"></a>
-<span class="sourceLineNo">2986</span>    List&lt;HTableDescriptor&gt; htds = new ArrayList&lt;&gt;();<a name="line.2986"></a>
-<span class="sourceLineNo">2987</span>    boolean bypass = cpHost != null? cpHost.preGetTableNames(htds, regex): false;<a name="line.2987"></a>
-<span class="sourceLineNo">2988</span>    if (!bypass) {<a name="line.2988"></a>
-<span class="sourceLineNo">2989</span>      htds = getTableDescriptors(htds, namespace, regex, null, includeSysTables);<a name="line.2989"></a>
-<span class="sourceLineNo">2990</span>      if (cpHost != null) cpHost.postGetTableNames(htds, regex);<a name="line.2990"></a>
-<span class="sourceLineNo">2991</span>    }<a name="line.2991"></a>
-<span class="sourceLineNo">2992</span>    List&lt;TableName&gt; result = new ArrayList&lt;&gt;(htds.size());<a name="line.2992"></a>
-<span class="sourceLineNo">2993</span>    for (HTableDescriptor htd: htds) result.add(htd.getTableName());<a name="line.2993"></a>
-<span class="sourceLineNo">2994</span>    return result;<a name="line.2994"></a>
-<span class="sourceLineNo">2995</span>  }<a name="line.2995"></a>
-<span class="sourceLineNo">2996</span><a name="line.2996"></a>
-<span class="sourceLineNo">2997</span>  /**<a name="line.2997"></a>
-<span class="sourceLineNo">2998</span>   * @return list of table table descriptors after filtering by regex and whether to include system<a name="line.2998"></a>
-<span class="sourceLineNo">2999</span>   *    tables, etc.<a name="line.2999"></a>
-<span class="sourceLineNo">3000</span>   * @throws IOException<a name="line.3000"></a>
-<span class="sourceLineNo">3001</span>   */<a name="line.3001"></a>
-<span class="sourceLineNo">3002</span>  private List&lt;HTableDescriptor&gt; getTableDescriptors(final List&lt;HTableDescriptor&gt; htds,<a name="line.3002"></a>
-<span class="sourceLineNo">3003</span>      final String namespace, final String regex, final List&lt;TableName&gt; tableNameList,<a name="line.3003"></a>
-<span class="sourceLineNo">3004</span>      final boolean includeSysTables)<a name="line.3004"></a>
-<span class="sourceLineNo">3005</span>  throws IOException {<a name="line.3005"></a>
-<span class="sourceLineNo">3006</span>    if (tableNameList == null || tableNameList.isEmpty()) {<a name="line.3006"></a>
-<span class="sourceLineNo">3007</span>      // request for all TableDescriptors<a name="line.3007"></a>
-<span class="sourceLineNo">3008</span>      Collection&lt;HTableDescriptor&gt; allHtds;<a name="line.3008"></a>
-<span class="sourceLineNo">3009</span>      if (namespace != null &amp;&amp; namespace.length() &gt; 0) {<a name="line.3009"></a>
-<span class="sourceLineNo">3010</span>        // Do a check on the namespace existence. Will fail if does not exist.<a name="line.3010"></a>
-<span class="sourceLineNo">3011</span>        this.clusterSchemaService.getNamespace(namespace);<a name="line.3011"></a>
-<span class="sourceLineNo">3012</span>        allHtds = tableDescriptors.getByNamespace(namespace).values();<a name="line.3012"></a>
-<span class="sourceLineNo">3013</span>      } else {<a name="line.3013"></a>
-<span class="sourceLineNo">3014</span>        allHtds = tableDescriptors.getAll().values();<a name="line.3014"></a>
-<span class="sourceLineNo">3015</span>      }<a name="line.3015"></a>
-<span class="sourceLineNo">3016</span>      for (HTableDescriptor desc: allHtds) {<a name="line.3016"></a>
-<span class="sourceLineNo">3017</span>        if (tableStateManager.isTablePresent(desc.getTableName())<a name="line.3017"></a>
-<span class="sourceLineNo">3018</span>            &amp;&amp; (includeSysTables || !desc.getTableName().isSystemTable())) {<a name="line.3018"></a>
-<span class="sourceLineNo">3019</span>          htds.add(desc);<a name="line.3019"></a>
-<span class="sourceLineNo">3020</span>        }<a name="line.3020"></a>
-<span class="sourceLineNo">3021</span>      }<a name="line.3021"></a>
-<span class="sourceLineNo">3022</span>    } else {<a name="line.3022"></a>
-<span class="sourceLineNo">3023</span>      for (TableName s: tableNameList) {<a name="line.3023"></a>
-<span class="sourceLineNo">3024</span>        if (tableStateManager.isTablePresent(s)) {<a name="line.3024"></a>
-<span class="sourceLineNo">3025</span>          HTableDescriptor desc = tableDescriptors.get(s);<a name="line.3025"></a>
-<span class="sourceLineNo">3026</span>          if (desc != null) {<a name="line.3026"></a>
-<span class="sourceLineNo">3027</span>            htds.add(desc);<a name="line.3027"></a>
-<span class="sourceLineNo">3028</span>          }<a name="line.3028"></a>
-<span class="sourceLineNo">3029</span>        }<a name="line.3029"></a>
-<span class="sourceLineNo">3030</span>      }<a name="line.3030"></a>
-<span class="sourceLineNo">3031</span>    }<a name="line.3031"></a>
-<span class="sourceLineNo">3032</span><a name="line.3032"></a>
-<span class="sourceLineNo">3033</span>    // Retains only those matched by regular expression.<a name="line.3033"></a>
-<span class="sourceLineNo">3034</span>    if (regex != null) filterTablesByRegex(htds, Pattern.compile(regex));<a name="line.3034"></a>
-<span class="sourceLineNo">3035</span>    return htds;<a name="line.3035"></a>
-<span class="sourceLineNo">3036</span>  }<a name="line.3036"></a>
-<span class="sourceLineNo">3037</span><a name="line.3037"></a>
-<span class="sourceLineNo">3038</span>  /**<a name="line.3038"></a>
-<span class="sourceLineNo">3039</span>   * Removes the table descriptors that don't match the pattern.<a name="line.3039"></a>
-<span class="sourceLineNo">3040</span>   * @param descriptors list of table descriptors to filter<a name="line.3040"></a>
-<span class="sourceLineNo">3041</span>   * @param pattern the regex to use<a name="line.3041"></a>
-<span class="sourceLineNo">3042</span>   */<a name="line.3042"></a>
-<span class="sourceLineNo">3043</span>  private static void filterTablesByRegex(final Collection&lt;HTableDescriptor&gt; descriptors,<a name="line.3043"></a>
-<span class="sourceLineNo">3044</span>      final Pattern pattern) {<a name="line.3044"></a>
-<span class="sourceLineNo">3045</span>    final String defaultNS = NamespaceDescriptor.DEFAULT_NAMESPACE_NAME_STR;<a name="line.3045"></a>
-<span class="sourceLineNo">3046</span>    Iterator&lt;HTableDescriptor&gt; itr = descriptors.iterator();<a name="line.3046"></a>
-<span class="sourceLineNo">3047</span>    while (itr.hasNext()) {<a name="line.3047"></a>
-<span class="sourceLineNo">3048</span>      HTableDescriptor htd = itr.next();<a name="line.3048"></a>
-<span class="sourceLineNo">3049</span>      String tableName = htd.getTableName().getNameAsString();<a name="line.3049"></a>
-<span class="sourceLineNo">3050</span>      boolean matched = pattern.matcher(tableName).matches();<a name="line.3050"></a>
-<span class="sourceLineNo">3051</span>      if (!matched &amp;&amp; htd.getTableName().getNamespaceAsString().equals(defaultNS)) {<a name="line.3051"></a>
-<span class="sourceLineNo">3052</span>        matched = pattern.matcher(defaultNS + TableName.NAMESPACE_DELIM + tableName).matches();<a name="line.3052"></a>
-<span class="sourceLineNo">3053</span>      }<a name="line.3053"></a>
-<span class="sourceLineNo">3054</span>      if (!matched) {<a name="line.3054"></a>
-<span class="sourceLineNo">3055</span>        itr.remove();<a name="line.3055"></a>
-<span class="sourceLineNo">3056</span>      }<a name="line.3056"></a>
-<span class="sourceLineNo">3057</span>    }<a name="line.3057"></a>
-<span class="sourceLineNo">3058</span>  }<a name="line.3058"></a>
-<span class="sourceLineNo">3059</span><a name="line.3059"></a>
-<span class="sourceLineNo">3060</span>  @Override<a name="line.3060"></a>
-<span class="sourceLineNo">3061</span>  public long getLastMajorCompactionTimestamp(TableName table) throws IOException {<a name="line.3061"></a>
-<span class="sourceLineNo">3062</span>    return getClusterStatus().getLastMajorCompactionTsForTable(table);<a name="line.3062"></a>
-<span class="sourceLineNo">3063</span>  }<a name="line.3063"></a>
-<span class="sourceLineNo">3064</span><a name="line.3064"></a>
-<span class="sourceLineNo">3065</span>  @Override<a name="line.3065"></a>
-<span class="sourceLineNo">3066</span>  public long getLastMajorCompactionTimestampForRegion(byte[] regionName) throws IOException {<a name="line.3066"></a>
-<span class="sourceLineNo">3067</span>    return getClusterStatus().getLastMajorCompactionTsForRegion(regionName);<a name="line.3067"></a>
-<span class="sourceLineNo">3068</span>  }<a name="line.3068"></a>
-<span class="sourceLineNo">3069</span><a name="line.3069"></a>
-<span class="sourceLineNo">3070</span>  /**<a name="line.3070"></a>
-<span class="sourceLineNo">3071</span>   * Gets the mob file compaction state for a specific table.<a name="line.3071"></a>
-<span class="sourceLineNo">3072</span>   * Whether all the mob files are selected is known during the compaction execution, but<a name="line.3072"></a>
-<span class="sourceLineNo">3073</span>   * the statistic is done just before compaction starts, it is hard to know the compaction<a name="line.3073"></a>
-<span class="sourceLineNo">3074</span>   * type at that time, so the rough statistics are chosen for the mob file compaction. Only two<a name="line.3074"></a>
-<span class="sourceLineNo">3075</span>   * compaction states are available, CompactionState.MAJOR_AND_MINOR and CompactionState.NONE.<a name="line.3075"></a>
-<span class="sourceLineNo">3076</span>   * @param tableName The current table name.<a name="line.3076"></a>
-<span class="sourceLineNo">3077</span>   * @return If a given table is in mob file compaction now.<a name="line.3077"></a>
-<span class="sourceLineNo">3078</span>   */<a name="line.3078"></a>
-<span class="sourceLineNo">3079</span>  public CompactionState getMobCompactionState(TableName tableName) {<a name="line.3079"></a>
-<span class="sourceLineNo">3080</span>    AtomicInteger compactionsCount = mobCompactionStates.get(tableName);<a name="line.3080"></a>
-<span class="sourceLineNo">3081</span>    if (compactionsCount != null &amp;&amp; compactionsCount.get() != 0) {<a name="line.3081"></a>
-<span class="sourceLineNo">3082</span>      return CompactionState.MAJOR_AND_MINOR;<a name="line.3082"></a>
-<span class="sourceLineNo">3083</span>    }<a name="line.3083"></a>
-<span class="sourceLineNo">3084</span>    return CompactionState.NONE;<a name="line.3084"></a>
-<span class="sourceLineNo">3085</span>  }<a name="line.3085"></a>
-<span class="sourceLineNo">3086</span><a name="line.3086"></a>
-<span class="sourceLineNo">3087</span>  public void reportMobCompactionStart(TableName tableName) throws IOException {<a name="line.3087"></a>
-<span class="sourceLineNo">3088</span>    IdLock.Entry lockEntry = null;<a name="line.3088"></a>
-<span class="sourceLineNo">3089</span>    try {<a name="line.3089"></a>
-<span class="sourceLineNo">3090</span>      lockEntry = mobCompactionLock.getLockEntry(tableName.hashCode());<a name="line.3090"></a>
-<span class="sourceLineNo">3091</span>      AtomicInteger compactionsCount = mobCompactionStates.get(tableName);<a name="line.3091"></a>
-<span class="sourceLineNo">3092</span>      if (compactionsCount == null) {<a name="line.3092"></a>
-<span class="sourceLineNo">3093</span>        compactionsCount = new AtomicInteger(0);<a name="line.3093"></a>
-<span class="sourceLineNo">3094</span>        mobCompactionStates.put(tableName, compactionsCount);<a name="line.3094"></a>
-<span class="sourceLineNo">3095</span>      }<a name="line.3095"></a>
-<span class="sourceLineNo">3096</span>      compactionsCount.incrementAndGet();<a name="line.3096"></a>
-<span class="sourceLineNo">3097</span>    } finally {<a name="line.3097"></a>
-<span class="sourceLineNo">3098</span>      if (lockEntry != null) {<a name="line.3098"></a>
-<span class="sourceLineNo">3099</span>        mobCompactionLock.releaseLockEntry(lockEntry);<a name="line.3099"></a>
-<span class="sourceLineNo">3100</span>      }<a name="line.3100"></a>
-<span class="sourceLineNo">3101</span>    }<a name="line.3101"></a>
-<span class="sourceLineNo">3102</span>  }<a name="line.3102"></a>
-<span class="sourceLineNo">3103</span><a name="line.3103"></a>
-<span class="sourceLineNo">3104</span>  public void reportMobCompactionEnd(TableName tableName) throws IOException {<a name="line.3104"></a>
-<span class="sourceLineNo">3105</span>    IdLock.Entry lockEntry = null;<a name="line.3105"></a>
-<span class="sourceLineNo">3106</span>    try {<a name="line.3106"></a>
-<span class="sourceLineNo">3107</span>      lockEntry = mobCompactionLock.getLockEntry(tableName.hashCode());<a name="line.3107"></a>
-<span class="sourceLineNo">3108</span>      AtomicInteger compactionsCount = mobCompactionStates.get(tableName);<a name="line.3108"></a>
-<span class="sourceLineNo">3109</span>      if (compactionsCount != null) {<a name="line.3109"></a>
-<span class="sourceLineNo">3110</span>        int count = compactionsCount.decrementAndGet();<a name="line.3110"></a>
-<span class="sourceLineNo">3111</span>        // remove the entry if the count is 0.<a name="line.3111"></a>
-<span class="sourceLineNo">3112</span>        if (count == 0) {<a name="line.3112"></a>
-<span class="sourceLineNo">3113</span>          mobCompactionStates.remove(tableName);<a name="line.3113"></a>
-<span class="sourceLineNo">3114</span>        }<a name="line.3114"></a>
-<span class="sourceLineNo">3115</span>      }<a name="line.3115"></a>
-<span class="sourceLineNo">3116</span>    } finally {<a name="line.3116"></a>
-<span class="sourceLineNo">3117</span>      if (lockEntry != null) {<a name="line.3117"></a>
-<span class="sourceLineNo">3118</span>        mobCompactionLock.releaseLockEntry(lockEntry);<a name="line.3118"></a>
-<span class="sourceLineNo">3119</span>      }<a name="line.3119"></a>
-<span class="sourceLineNo">3120</span>    }<a name="line.3120"></a>
-<span class="sourceLineNo">3121</span>  }<a name="line.3121"></a>
-<span class="sourceLineNo">3122</span><a name="line.3122"></a>
-<span class="sourceLineNo">3123</span>  /**<a name="line.3123"></a>
-<span class="sourceLineNo">3124</span>   * Requests mob compaction.<a name="line.3124"></a>
-<span class="sourceLineNo">3125</span>   * @param tableName The table the compact.<a name="line.3125"></a>
-<span class="sourceLineNo">3126</span>   * @param columns The compacted columns.<a name="line.3126"></a>
-<span class="sourceLineNo">3127</span>   * @param allFiles Whether add all mob files into the compaction.<a name="line.3127"></a>
-<span class="sourceLineNo">3128</span>   */<a name="line.3128"></a>
-<span class="sourceLineNo">3129</span>  public void requestMobCompaction(TableName tableName,<a name="line.3129"></a>
-<span class="sourceLineNo">3130</span>    List&lt;HColumnDescriptor&gt; columns, boolean allFiles) throws IOException {<a name="line.3130"></a>
-<span class="sourceLineNo">3131</span>    mobCompactThread.requestMobCompaction(conf, fs, tableName, columns, allFiles);<a name="line.3131"></a>
-<span class="sourceLineNo">3132</span>  }<a name="line.3132"></a>
-<span class="sourceLineNo">3133</span><a name="line.3133"></a>
-<span class="sourceLineNo">3134</span>  /**<a name="line.3134"></a>
-<span class="sourceLineNo">3135</span>   * Queries the state of the {@link LoadBalancerTracker}. If the balancer is not initialized,<a name="line.3135"></a>
-<span class="sourceLineNo">3136</span>   * false is returned.<a name="line.3136"></a>
-<span class="sourceLineNo">3137</span>   *<a name="line.3137"></a>
-<span class="sourceLineNo">3138</span>   * @return The state of the load balancer, or false if the load balancer isn't defined.<a name="line.3138"></a>
-<span class="sourceLineNo">3139</span>   */<a name="line.3139"></a>
-<span class="sourceLineNo">3140</span>  public boolean isBalancerOn() {<a name="line.3140"></a>
-<span class="sourceLineNo">3141</span>    if (null == loadBalancerTracker || isInMaintenanceMode()) {<a name="line.3141"></a>
-<span class="sourceLineNo">3142</span>      return false;<a name="line.3142"></a>
-<span class="sourceLineNo">3143</span>    }<a name="line.3143"></a>
-<span class="sourceLineNo">3144</span>    return loadBalancerTracker.isBalancerOn();<a name="line.3144"></a>
-<span class="sourceLineNo">3145</span>  }<a name="line.3145"></a>
-<span class="sourceLineNo">3146</span><a name="line.3146"></a>
-<span class="sourceLineNo">3147</span>  /**<a name="line.3147"></a>
-<span class="sourceLineNo">3148</span>   * Queries the state of the {@link RegionNormalizerTracker}. If it's not initialized,<a name="line.3148"></a>
-<span class="sourceLineNo">3149</span>   * false is returned.<a name="line.3149"></a>
-<span class="sourceLineNo">3150</span>   */<a name="line.3150"></a>
-<span class="sourceLineNo">3151</span>  public boolean isNormalizerOn() {<a name="line.3151"></a>
-<span class="sourceLineNo">3152</span>    return (null == regionNormalizerTracker || isInMaintenanceMode()) ?<a name="line.3152"></a>
-<span class="sourceLineNo">3153</span>        false: regionNormalizerTracker.isNormalizerOn();<a name="line.3153"></a>
-<span class="sourceLineNo">3154</span>  }<a name="line.3154"></a>
-<span class="sourceLineNo">3155</span><a name="line.3155"></a>
-<span class="sourceLineNo">3156</span>  /**<a name="line.3156"></a>
-<span class="sourceLineNo">3157</span>   * Queries the state of the {@link SplitOrMergeTracker}. If it is not initialized,<a name="line.3157"></a>
-<span class="sourceLineNo">3158</span>   * false is returned. If switchType is illegal, false will return.<a name="line.3158"></a>
-<span class="sourceLineNo">3159</span>   * @param switchType see {@link org.apache.hadoop.hbase.client.MasterSwitchType}<a name="line.3159"></a>
-<span class="sourceLineNo">3160</span>   * @return The state of the switch<a name="line.3160"></a>
-<span class="sourceLineNo">3161</span>   */<a name="line.3161"></a>
-<span class="sourceLineNo">3162</span>  public boolean isSplitOrMergeEnabled(MasterSwitchType switchType) {<a name="line.3162"></a>
-<span class="sourceLineNo">3163</span>    if (null == splitOrMergeTracker || isInMaintenanceMode()) {<a name="line.3163"></a>
-<span class="sourceLineNo">3164</span>      return false;<a name="line.3164"></a>
-<span class="sourceLineNo">3165</span>    }<a name="line.3165"></a>
-<span class="sourceLineNo">3166</span>    return splitOrMergeTracker.isSplitOrMergeEnabled(switchType);<a name="line.3166"></a>
-<span class="sourceLineNo">3167</span>  }<a name="line.3167"></a>
-<span class="sourceLineNo">3168</span><a name="line.3168"></a>
-<span class="sourceLineNo">3169</span>  /**<a name="line.3169"></a>
-<span class="sourceLineNo">3170</span>   * Fetch the configured {@link LoadBalancer} class name. If none is set, a default is returned.<a name="line.3170"></a>
-<span class="sourceLineNo">3171</span>   *<a name="line.3171"></a>
-<span class="sourceLineNo">3172</span>   * @return The name of the {@link LoadBalancer} in use.<a name="line.3172"></a>
-<span class="sourceLineNo">3173</span>   */<a name="line.3173"></a>
-<span class="sourceLineNo">3174</span>  public String getLoadBalancerClassName() {<a name="line.3174"></a>
-<span class="sourceLineNo">3175</span>    return conf.get(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, LoadBalancerFactory<a name="line.3175"></a>
-<span class="sourceLineNo">3176</span>        .getDefaultLoadBalancerClass().getName());<a name="line.3176"></a>
-<span class="sourceLineNo">3177</span>  }<a name="line.3177"></a>
-<span class="sourceLineNo">3178</span><a name="line.3178"></a>
-<span class="sourceLineNo">3179</span>  /**<a name="line.3179"></a>
-<span class="sourceLineNo">3180</span>   * @return RegionNormalizerTracker instance<a name="line.3180"></a>
-<span class="sourceLineNo">3181</span>   */<a name="line.3181"></a>
-<span class="sourceLineNo">3182</span>  public RegionNormalizerTracker getRegionNormalizerTracker() {<a name="line.3182"></a>
-<span class="sourceLineNo">3183</span>    return regionNormalizerTracker;<a name="line.3183"></a>
-<span class="sourceLineNo">3184</span>  }<a name="line.3184"></a>
-<span class="sourceLineNo">3185</span><a name="line.3185"></a>
-<span class="sourceLineNo">3186</span>  public SplitOrMergeTracker getSplitOrMergeTracker() {<a name="line.3186"></a>
-<span class="sourceLineNo">3187</span>    return splitOrMergeTracker;<a name="line.3187"></a>
-<span class="sourceLineNo">3188</span>  }<a name="line.3188"></a>
-<span class="sourceLineNo">3189</span><a name="line.3189"></a>
-<span class="sourceLineNo">3190</span>  @Override<a name="line.3190"></a>
-<span class="sourceLineNo">3191</span>  public LoadBalancer getLoadBalancer() {<a name="line.3191"></a>
-<span class="sourceLineNo">3192</span>    return balancer;<a name="line.3192"></a>
-<span class="sourceLineNo">3193</span>  }<a name="line.3193"></a>
-<span class="sourceLineNo">3194</span><a name="line.3194"></a>
-<span class="sourceLineNo">3195</span>  @Override<a name="line.3195"></a>
-<span class="sourceLineNo">3196</span>  public FavoredNodesManager getFavoredNodesManager() {<a name="line.3196"></a>
-<span class="sourceLineNo">3197</span>    return favoredNodesManager;<a name="line.3197"></a>
-<span class="sourceLineNo">3198</span>  }<a name="line.3198"></a>
-<span class="sourceLineNo">3199</span><a name="line.3199"></a>
-<span class="sourceLineNo">3200</span>  @Override<a name="line.3200"></a>
-<span class="sourceLineNo">3201</span>  public void addReplicationPeer(String peerId, ReplicationPeerConfig peerConfig)<a name="line.3201"></a>
-<span class="sourceLineNo">3202</span>      throws ReplicationException, IOException {<a name="line.3202"></a>
-<span class="sourceLineNo">3203</span>    if (cpHost != null) {<a name="line.3203"></a>
-<span class="sourceLineNo">3204</span>      cpHost.preAddReplicationPeer(peerId, peerConfig);<a name="line.3204"></a>
-<span class="sourceLineNo">3205</span>    }<a name="line.3205"></a>
-<span class="sourceLineNo">3206</span>    LOG.info(getClientIdAuditPrefix() + " creating replication peer, id=" + peerId + ", config="<a name="line.3206"></a>
-<span class="sourceLineNo">3207</span>        + peerConfig);<a name="line.3207"></a>
-<span class="sourceLineNo">3208</span>    this.replicationManager.addReplicationPeer(peerId, peerConfig);<a name="line.3208"></a>
-<span class="sourceLineNo">3209</span>    if (cpHost != null) {<a name="line.3209"></a>
-<span class="sourceLineNo">3210</span>      cpHost.postAddReplicationPeer(peerId, peerConfig);<a name="line.3210"></a>
-<span class="sourceLineNo">3211</span>    }<a name="line.3211"></a>
-<span class="sourceLineNo">3212</span>  }<a name="line.3212"></a>
-<span class="sourceLineNo">3213</span><a name="line.3213"></a>
-<span class="sourceLineNo">3214</span>  @Override<a name="line.3214"></a>
-<span class="sourceLineNo">3215</span>  public void removeReplicationPeer(String peerId) throws ReplicationException, IOException {<a name="line.3215"></a>
-<span class="sourceLineNo">3216</span>    if (cpHost != null) {<a name="line.3216"></a>
-<span class="sourceLineNo">3217</span>      cpHost.preRemoveReplicationPeer(peerId);<a name="line.3217"></a>
-<span class="sourceLineNo">3218</span>    }<a name="line.3218"></a>
-<span class="sourceLineNo">3219</span>    LOG.info(getClientIdAuditPrefix() + " removing replication peer, id=" + peerId);<a name="line.3219"></a>
-<span class="sourceLineNo">3220</span>    this.replicationManager.removeReplicationPeer(peerId);<a name="line.3220"></a>
-<span class="sourceLineNo">3221</span>    if (cpHost != null) {<a name="line.3221"></a>
-<span class="sourceLineNo">3222</span>      cpHost.postRemoveReplicationPeer(peerId);<a name="line.3222"></a>
-<span class="sourceLineNo">3223</span>    }<a name="line.3223"></a>
-<span class="sourceLineNo">3224</span>  }<a name="line.3224"></a>
-<span class="sourceLineNo">3225</span><a name="line.3225"></a>
-<span class="sourceLineNo">3226</span>  @Override<a name="line.3226"></a>
-<span class="sourceLineNo">3227</span>  public void enableReplicationPeer(String peerId) throws ReplicationException, IOException {<a name="line.3227"></a>
-<span class="sourceLineNo">3228</span>    if (cpHos

<TRUNCATED>

Mime
View raw message