hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [11/51] [partial] hbase-site git commit: Published site at .
Date Wed, 30 Aug 2017 15:13:57 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0d6dd914/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 fa9b7a2..cf855f5 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
@@ -1808,7 +1808,7 @@
 <span class="sourceLineNo">1800</span>    if (!conf.getBoolean(CONF_KEY, true)) {<a name="line.1800"></a>
 <span class="sourceLineNo">1801</span>      logWarn = true;<a name="line.1801"></a>
 <span class="sourceLineNo">1802</span>    }<a name="line.1802"></a>
-<span class="sourceLineNo">1803</span>    String tableVal = htd.getConfigurationValue(CONF_KEY);<a name="line.1803"></a>
+<span class="sourceLineNo">1803</span>    String tableVal = htd.getValue(CONF_KEY);<a name="line.1803"></a>
 <span class="sourceLineNo">1804</span>    if (tableVal != null &amp;&amp; !Boolean.valueOf(tableVal)) {<a name="line.1804"></a>
 <span class="sourceLineNo">1805</span>      logWarn = true;<a name="line.1805"></a>
 <span class="sourceLineNo">1806</span>    }<a name="line.1806"></a>
@@ -1933,1585 +1933,1584 @@
 <span class="sourceLineNo">1925</span>      throws IOException {<a name="line.1925"></a>
 <span class="sourceLineNo">1926</span>    // FIFO compaction has some requirements<a name="line.1926"></a>
 <span class="sourceLineNo">1927</span>    // Actually FCP ignores periodic major compactions<a name="line.1927"></a>
-<span class="sourceLineNo">1928</span>    String className =<a name="line.1928"></a>
-<span class="sourceLineNo">1929</span>        htd.getConfigurationValue(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY);<a name="line.1929"></a>
-<span class="sourceLineNo">1930</span>    if (className == null) {<a name="line.1930"></a>
-<span class="sourceLineNo">1931</span>      className =<a name="line.1931"></a>
-<span class="sourceLineNo">1932</span>          conf.get(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY,<a name="line.1932"></a>
-<span class="sourceLineNo">1933</span>            ExploringCompactionPolicy.class.getName());<a name="line.1933"></a>
-<span class="sourceLineNo">1934</span>    }<a name="line.1934"></a>
-<span class="sourceLineNo">1935</span><a name="line.1935"></a>
-<span class="sourceLineNo">1936</span>    int blockingFileCount = HStore.DEFAULT_BLOCKING_STOREFILE_COUNT;<a name="line.1936"></a>
-<span class="sourceLineNo">1937</span>    String sv = htd.getConfigurationValue(HStore.BLOCKING_STOREFILES_KEY);<a name="line.1937"></a>
-<span class="sourceLineNo">1938</span>    if (sv != null) {<a name="line.1938"></a>
-<span class="sourceLineNo">1939</span>      blockingFileCount = Integer.parseInt(sv);<a name="line.1939"></a>
-<span class="sourceLineNo">1940</span>    } else {<a name="line.1940"></a>
-<span class="sourceLineNo">1941</span>      blockingFileCount = conf.getInt(HStore.BLOCKING_STOREFILES_KEY, blockingFileCount);<a name="line.1941"></a>
-<span class="sourceLineNo">1942</span>    }<a name="line.1942"></a>
-<span class="sourceLineNo">1943</span><a name="line.1943"></a>
-<span class="sourceLineNo">1944</span>    for (ColumnFamilyDescriptor hcd : htd.getColumnFamilies()) {<a name="line.1944"></a>
-<span class="sourceLineNo">1945</span>      String compactionPolicy =<a name="line.1945"></a>
-<span class="sourceLineNo">1946</span>          hcd.getConfigurationValue(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY);<a name="line.1946"></a>
-<span class="sourceLineNo">1947</span>      if (compactionPolicy == null) {<a name="line.1947"></a>
-<span class="sourceLineNo">1948</span>        compactionPolicy = className;<a name="line.1948"></a>
-<span class="sourceLineNo">1949</span>      }<a name="line.1949"></a>
-<span class="sourceLineNo">1950</span>      if (!compactionPolicy.equals(FIFOCompactionPolicy.class.getName())) {<a name="line.1950"></a>
-<span class="sourceLineNo">1951</span>        continue;<a name="line.1951"></a>
-<span class="sourceLineNo">1952</span>      }<a name="line.1952"></a>
-<span class="sourceLineNo">1953</span>      // FIFOCompaction<a name="line.1953"></a>
-<span class="sourceLineNo">1954</span>      String message = null;<a name="line.1954"></a>
-<span class="sourceLineNo">1955</span><a name="line.1955"></a>
-<span class="sourceLineNo">1956</span>      // 1. Check TTL<a name="line.1956"></a>
-<span class="sourceLineNo">1957</span>      if (hcd.getTimeToLive() == ColumnFamilyDescriptorBuilder.DEFAULT_TTL) {<a name="line.1957"></a>
-<span class="sourceLineNo">1958</span>        message = "Default TTL is not supported for FIFO compaction";<a name="line.1958"></a>
-<span class="sourceLineNo">1959</span>        throw new IOException(message);<a name="line.1959"></a>
-<span class="sourceLineNo">1960</span>      }<a name="line.1960"></a>
-<span class="sourceLineNo">1961</span><a name="line.1961"></a>
-<span class="sourceLineNo">1962</span>      // 2. Check min versions<a name="line.1962"></a>
-<span class="sourceLineNo">1963</span>      if (hcd.getMinVersions() &gt; 0) {<a name="line.1963"></a>
-<span class="sourceLineNo">1964</span>        message = "MIN_VERSION &gt; 0 is not supported for FIFO compaction";<a name="line.1964"></a>
-<span class="sourceLineNo">1965</span>        throw new IOException(message);<a name="line.1965"></a>
-<span class="sourceLineNo">1966</span>      }<a name="line.1966"></a>
-<span class="sourceLineNo">1967</span><a name="line.1967"></a>
-<span class="sourceLineNo">1968</span>      // 3. blocking file count<a name="line.1968"></a>
-<span class="sourceLineNo">1969</span>      sv = hcd.getConfigurationValue(HStore.BLOCKING_STOREFILES_KEY);<a name="line.1969"></a>
-<span class="sourceLineNo">1970</span>      if (sv != null) {<a name="line.1970"></a>
-<span class="sourceLineNo">1971</span>        blockingFileCount = Integer.parseInt(sv);<a name="line.1971"></a>
-<span class="sourceLineNo">1972</span>      }<a name="line.1972"></a>
-<span class="sourceLineNo">1973</span>      if (blockingFileCount &lt; 1000) {<a name="line.1973"></a>
-<span class="sourceLineNo">1974</span>        message =<a name="line.1974"></a>
-<span class="sourceLineNo">1975</span>            "Blocking file count '" + HStore.BLOCKING_STOREFILES_KEY + "' " + blockingFileCount<a name="line.1975"></a>
-<span class="sourceLineNo">1976</span>                + " is below recommended minimum of 1000 for column family "+ hcd.getNameAsString();<a name="line.1976"></a>
-<span class="sourceLineNo">1977</span>        throw new IOException(message);<a name="line.1977"></a>
-<span class="sourceLineNo">1978</span>      }<a name="line.1978"></a>
-<span class="sourceLineNo">1979</span>    }<a name="line.1979"></a>
-<span class="sourceLineNo">1980</span>  }<a name="line.1980"></a>
-<span class="sourceLineNo">1981</span><a name="line.1981"></a>
-<span class="sourceLineNo">1982</span>  // HBASE-13350 - Helper method to log warning on sanity check failures if checks disabled.<a name="line.1982"></a>
-<span class="sourceLineNo">1983</span>  private static void warnOrThrowExceptionForFailure(boolean logWarn, String confKey,<a name="line.1983"></a>
-<span class="sourceLineNo">1984</span>      String message, Exception cause) throws IOException {<a name="line.1984"></a>
-<span class="sourceLineNo">1985</span>    if (!logWarn) {<a name="line.1985"></a>
-<span class="sourceLineNo">1986</span>      throw new DoNotRetryIOException(message + " Set " + confKey +<a name="line.1986"></a>
-<span class="sourceLineNo">1987</span>          " to false at conf or table descriptor if you want to bypass sanity checks", cause);<a name="line.1987"></a>
-<span class="sourceLineNo">1988</span>    }<a name="line.1988"></a>
-<span class="sourceLineNo">1989</span>    LOG.warn(message);<a name="line.1989"></a>
-<span class="sourceLineNo">1990</span>  }<a name="line.1990"></a>
-<span class="sourceLineNo">1991</span><a name="line.1991"></a>
-<span class="sourceLineNo">1992</span>  private void startActiveMasterManager(int infoPort) throws KeeperException {<a name="line.1992"></a>
-<span class="sourceLineNo">1993</span>    String backupZNode = ZKUtil.joinZNode(<a name="line.1993"></a>
-<span class="sourceLineNo">1994</span>      zooKeeper.znodePaths.backupMasterAddressesZNode, serverName.toString());<a name="line.1994"></a>
-<span class="sourceLineNo">1995</span>    /*<a name="line.1995"></a>
-<span class="sourceLineNo">1996</span>    * Add a ZNode for ourselves in the backup master directory since we<a name="line.1996"></a>
-<span class="sourceLineNo">1997</span>    * may not become the active master. If so, we want the actual active<a name="line.1997"></a>
-<span class="sourceLineNo">1998</span>    * master to know we are backup masters, so that it won't assign<a name="line.1998"></a>
-<span class="sourceLineNo">1999</span>    * regions to us if so configured.<a name="line.1999"></a>
-<span class="sourceLineNo">2000</span>    *<a name="line.2000"></a>
-<span class="sourceLineNo">2001</span>    * If we become the active master later, ActiveMasterManager will delete<a name="line.2001"></a>
-<span class="sourceLineNo">2002</span>    * this node explicitly.  If we crash before then, ZooKeeper will delete<a name="line.2002"></a>
-<span class="sourceLineNo">2003</span>    * this node for us since it is ephemeral.<a name="line.2003"></a>
-<span class="sourceLineNo">2004</span>    */<a name="line.2004"></a>
-<span class="sourceLineNo">2005</span>    LOG.info("Adding backup master ZNode " + backupZNode);<a name="line.2005"></a>
-<span class="sourceLineNo">2006</span>    if (!MasterAddressTracker.setMasterAddress(zooKeeper, backupZNode,<a name="line.2006"></a>
-<span class="sourceLineNo">2007</span>        serverName, infoPort)) {<a name="line.2007"></a>
-<span class="sourceLineNo">2008</span>      LOG.warn("Failed create of " + backupZNode + " by " + serverName);<a name="line.2008"></a>
-<span class="sourceLineNo">2009</span>    }<a name="line.2009"></a>
-<span class="sourceLineNo">2010</span><a name="line.2010"></a>
-<span class="sourceLineNo">2011</span>    activeMasterManager.setInfoPort(infoPort);<a name="line.2011"></a>
-<span class="sourceLineNo">2012</span>    // Start a thread to try to become the active master, so we won't block here<a name="line.2012"></a>
-<span class="sourceLineNo">2013</span>    Threads.setDaemonThreadRunning(new Thread(new Runnable() {<a name="line.2013"></a>
-<span class="sourceLineNo">2014</span>      @Override<a name="line.2014"></a>
-<span class="sourceLineNo">2015</span>      public void run() {<a name="line.2015"></a>
-<span class="sourceLineNo">2016</span>        int timeout = conf.getInt(HConstants.ZK_SESSION_TIMEOUT,<a name="line.2016"></a>
-<span class="sourceLineNo">2017</span>          HConstants.DEFAULT_ZK_SESSION_TIMEOUT);<a name="line.2017"></a>
-<span class="sourceLineNo">2018</span>        // If we're a backup master, stall until a primary to writes his address<a name="line.2018"></a>
-<span class="sourceLineNo">2019</span>        if (conf.getBoolean(HConstants.MASTER_TYPE_BACKUP,<a name="line.2019"></a>
-<span class="sourceLineNo">2020</span>          HConstants.DEFAULT_MASTER_TYPE_BACKUP)) {<a name="line.2020"></a>
-<span class="sourceLineNo">2021</span>          LOG.debug("HMaster started in backup mode. "<a name="line.2021"></a>
-<span class="sourceLineNo">2022</span>            + "Stalling until master znode is written.");<a name="line.2022"></a>
-<span class="sourceLineNo">2023</span>          // This will only be a minute or so while the cluster starts up,<a name="line.2023"></a>
-<span class="sourceLineNo">2024</span>          // so don't worry about setting watches on the parent znode<a name="line.2024"></a>
-<span class="sourceLineNo">2025</span>          while (!activeMasterManager.hasActiveMaster()) {<a name="line.2025"></a>
-<span class="sourceLineNo">2026</span>            LOG.debug("Waiting for master address ZNode to be written "<a name="line.2026"></a>
-<span class="sourceLineNo">2027</span>              + "(Also watching cluster state node)");<a name="line.2027"></a>
-<span class="sourceLineNo">2028</span>            Threads.sleep(timeout);<a name="line.2028"></a>
-<span class="sourceLineNo">2029</span>          }<a name="line.2029"></a>
-<span class="sourceLineNo">2030</span>        }<a name="line.2030"></a>
-<span class="sourceLineNo">2031</span>        MonitoredTask status = TaskMonitor.get().createStatus("Master startup");<a name="line.2031"></a>
-<span class="sourceLineNo">2032</span>        status.setDescription("Master startup");<a name="line.2032"></a>
-<span class="sourceLineNo">2033</span>        try {<a name="line.2033"></a>
-<span class="sourceLineNo">2034</span>          if (activeMasterManager.blockUntilBecomingActiveMaster(timeout, status)) {<a name="line.2034"></a>
-<span class="sourceLineNo">2035</span>            finishActiveMasterInitialization(status);<a name="line.2035"></a>
-<span class="sourceLineNo">2036</span>          }<a name="line.2036"></a>
-<span class="sourceLineNo">2037</span>        } catch (Throwable t) {<a name="line.2037"></a>
-<span class="sourceLineNo">2038</span>          status.setStatus("Failed to become active: " + t.getMessage());<a name="line.2038"></a>
-<span class="sourceLineNo">2039</span>          LOG.fatal("Failed to become active master", t);<a name="line.2039"></a>
-<span class="sourceLineNo">2040</span>          // HBASE-5680: Likely hadoop23 vs hadoop 20.x/1.x incompatibility<a name="line.2040"></a>
-<span class="sourceLineNo">2041</span>          if (t instanceof NoClassDefFoundError &amp;&amp;<a name="line.2041"></a>
-<span class="sourceLineNo">2042</span>            t.getMessage()<a name="line.2042"></a>
-<span class="sourceLineNo">2043</span>              .contains("org/apache/hadoop/hdfs/protocol/HdfsConstants$SafeModeAction")) {<a name="line.2043"></a>
-<span class="sourceLineNo">2044</span>            // improved error message for this special case<a name="line.2044"></a>
-<span class="sourceLineNo">2045</span>            abort("HBase is having a problem with its Hadoop jars.  You may need to "<a name="line.2045"></a>
-<span class="sourceLineNo">2046</span>              + "recompile HBase against Hadoop version "<a name="line.2046"></a>
-<span class="sourceLineNo">2047</span>              + org.apache.hadoop.util.VersionInfo.getVersion()<a name="line.2047"></a>
-<span class="sourceLineNo">2048</span>              + " or change your hadoop jars to start properly", t);<a name="line.2048"></a>
-<span class="sourceLineNo">2049</span>          } else {<a name="line.2049"></a>
-<span class="sourceLineNo">2050</span>            abort("Unhandled exception. Starting shutdown.", t);<a name="line.2050"></a>
-<span class="sourceLineNo">2051</span>          }<a name="line.2051"></a>
-<span class="sourceLineNo">2052</span>        } finally {<a name="line.2052"></a>
-<span class="sourceLineNo">2053</span>          status.cleanup();<a name="line.2053"></a>
-<span class="sourceLineNo">2054</span>        }<a name="line.2054"></a>
-<span class="sourceLineNo">2055</span>      }<a name="line.2055"></a>
-<span class="sourceLineNo">2056</span>    }, getServerName().toShortString() + ".masterManager"));<a name="line.2056"></a>
-<span class="sourceLineNo">2057</span>  }<a name="line.2057"></a>
-<span class="sourceLineNo">2058</span><a name="line.2058"></a>
-<span class="sourceLineNo">2059</span>  private void checkCompression(final TableDescriptor htd)<a name="line.2059"></a>
-<span class="sourceLineNo">2060</span>  throws IOException {<a name="line.2060"></a>
-<span class="sourceLineNo">2061</span>    if (!this.masterCheckCompression) return;<a name="line.2061"></a>
-<span class="sourceLineNo">2062</span>    for (ColumnFamilyDescriptor hcd : htd.getColumnFamilies()) {<a name="line.2062"></a>
-<span class="sourceLineNo">2063</span>      checkCompression(hcd);<a name="line.2063"></a>
-<span class="sourceLineNo">2064</span>    }<a name="line.2064"></a>
-<span class="sourceLineNo">2065</span>  }<a name="line.2065"></a>
-<span class="sourceLineNo">2066</span><a name="line.2066"></a>
-<span class="sourceLineNo">2067</span>  private void checkCompression(final ColumnFamilyDescriptor hcd)<a name="line.2067"></a>
-<span class="sourceLineNo">2068</span>  throws IOException {<a name="line.2068"></a>
-<span class="sourceLineNo">2069</span>    if (!this.masterCheckCompression) return;<a name="line.2069"></a>
-<span class="sourceLineNo">2070</span>    CompressionTest.testCompression(hcd.getCompressionType());<a name="line.2070"></a>
-<span class="sourceLineNo">2071</span>    CompressionTest.testCompression(hcd.getCompactionCompressionType());<a name="line.2071"></a>
-<span class="sourceLineNo">2072</span>  }<a name="line.2072"></a>
-<span class="sourceLineNo">2073</span><a name="line.2073"></a>
-<span class="sourceLineNo">2074</span>  private void checkEncryption(final Configuration conf, final TableDescriptor htd)<a name="line.2074"></a>
-<span class="sourceLineNo">2075</span>  throws IOException {<a name="line.2075"></a>
-<span class="sourceLineNo">2076</span>    if (!this.masterCheckEncryption) return;<a name="line.2076"></a>
-<span class="sourceLineNo">2077</span>    for (ColumnFamilyDescriptor hcd : htd.getColumnFamilies()) {<a name="line.2077"></a>
-<span class="sourceLineNo">2078</span>      checkEncryption(conf, hcd);<a name="line.2078"></a>
-<span class="sourceLineNo">2079</span>    }<a name="line.2079"></a>
-<span class="sourceLineNo">2080</span>  }<a name="line.2080"></a>
-<span class="sourceLineNo">2081</span><a name="line.2081"></a>
-<span class="sourceLineNo">2082</span>  private void checkEncryption(final Configuration conf, final ColumnFamilyDescriptor hcd)<a name="line.2082"></a>
-<span class="sourceLineNo">2083</span>  throws IOException {<a name="line.2083"></a>
-<span class="sourceLineNo">2084</span>    if (!this.masterCheckEncryption) return;<a name="line.2084"></a>
-<span class="sourceLineNo">2085</span>    EncryptionTest.testEncryption(conf, hcd.getEncryptionType(), hcd.getEncryptionKey());<a name="line.2085"></a>
-<span class="sourceLineNo">2086</span>  }<a name="line.2086"></a>
-<span class="sourceLineNo">2087</span><a name="line.2087"></a>
-<span class="sourceLineNo">2088</span>  private void checkClassLoading(final Configuration conf, final TableDescriptor htd)<a name="line.2088"></a>
-<span class="sourceLineNo">2089</span>  throws IOException {<a name="line.2089"></a>
-<span class="sourceLineNo">2090</span>    RegionSplitPolicy.getSplitPolicyClass(htd, conf);<a name="line.2090"></a>
-<span class="sourceLineNo">2091</span>    RegionCoprocessorHost.testTableCoprocessorAttrs(conf, htd);<a name="line.2091"></a>
-<span class="sourceLineNo">2092</span>  }<a name="line.2092"></a>
-<span class="sourceLineNo">2093</span><a name="line.2093"></a>
-<span class="sourceLineNo">2094</span>  private static boolean isCatalogTable(final TableName tableName) {<a name="line.2094"></a>
-<span class="sourceLineNo">2095</span>    return tableName.equals(TableName.META_TABLE_NAME);<a name="line.2095"></a>
-<span class="sourceLineNo">2096</span>  }<a name="line.2096"></a>
-<span class="sourceLineNo">2097</span><a name="line.2097"></a>
-<span class="sourceLineNo">2098</span>  @Override<a name="line.2098"></a>
-<span class="sourceLineNo">2099</span>  public long deleteTable(<a name="line.2099"></a>
-<span class="sourceLineNo">2100</span>      final TableName tableName,<a name="line.2100"></a>
-<span class="sourceLineNo">2101</span>      final long nonceGroup,<a name="line.2101"></a>
-<span class="sourceLineNo">2102</span>      final long nonce) throws IOException {<a name="line.2102"></a>
-<span class="sourceLineNo">2103</span>    checkInitialized();<a name="line.2103"></a>
-<span class="sourceLineNo">2104</span><a name="line.2104"></a>
-<span class="sourceLineNo">2105</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2105"></a>
-<span class="sourceLineNo">2106</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2106"></a>
-<span class="sourceLineNo">2107</span>      @Override<a name="line.2107"></a>
-<span class="sourceLineNo">2108</span>      protected void run() throws IOException {<a name="line.2108"></a>
-<span class="sourceLineNo">2109</span>        getMaster().getMasterCoprocessorHost().preDeleteTable(tableName);<a name="line.2109"></a>
-<span class="sourceLineNo">2110</span><a name="line.2110"></a>
-<span class="sourceLineNo">2111</span>        LOG.info(getClientIdAuditPrefix() + " delete " + tableName);<a name="line.2111"></a>
-<span class="sourceLineNo">2112</span><a name="line.2112"></a>
-<span class="sourceLineNo">2113</span>        // TODO: We can handle/merge duplicate request<a name="line.2113"></a>
-<span class="sourceLineNo">2114</span>        ProcedurePrepareLatch latch = ProcedurePrepareLatch.createLatch();<a name="line.2114"></a>
-<span class="sourceLineNo">2115</span>        submitProcedure(new DeleteTableProcedure(procedureExecutor.getEnvironment(),<a name="line.2115"></a>
-<span class="sourceLineNo">2116</span>            tableName, latch));<a name="line.2116"></a>
-<span class="sourceLineNo">2117</span>        latch.await();<a name="line.2117"></a>
-<span class="sourceLineNo">2118</span><a name="line.2118"></a>
-<span class="sourceLineNo">2119</span>        getMaster().getMasterCoprocessorHost().postDeleteTable(tableName);<a name="line.2119"></a>
-<span class="sourceLineNo">2120</span>      }<a name="line.2120"></a>
-<span class="sourceLineNo">2121</span><a name="line.2121"></a>
-<span class="sourceLineNo">2122</span>      @Override<a name="line.2122"></a>
-<span class="sourceLineNo">2123</span>      protected String getDescription() {<a name="line.2123"></a>
-<span class="sourceLineNo">2124</span>        return "DeleteTableProcedure";<a name="line.2124"></a>
-<span class="sourceLineNo">2125</span>      }<a name="line.2125"></a>
-<span class="sourceLineNo">2126</span>    });<a name="line.2126"></a>
-<span class="sourceLineNo">2127</span>  }<a name="line.2127"></a>
-<span class="sourceLineNo">2128</span><a name="line.2128"></a>
-<span class="sourceLineNo">2129</span>  @Override<a name="line.2129"></a>
-<span class="sourceLineNo">2130</span>  public long truncateTable(<a name="line.2130"></a>
-<span class="sourceLineNo">2131</span>      final TableName tableName,<a name="line.2131"></a>
-<span class="sourceLineNo">2132</span>      final boolean preserveSplits,<a name="line.2132"></a>
-<span class="sourceLineNo">2133</span>      final long nonceGroup,<a name="line.2133"></a>
-<span class="sourceLineNo">2134</span>      final long nonce) throws IOException {<a name="line.2134"></a>
-<span class="sourceLineNo">2135</span>    checkInitialized();<a name="line.2135"></a>
-<span class="sourceLineNo">2136</span><a name="line.2136"></a>
-<span class="sourceLineNo">2137</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2137"></a>
-<span class="sourceLineNo">2138</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2138"></a>
-<span class="sourceLineNo">2139</span>      @Override<a name="line.2139"></a>
-<span class="sourceLineNo">2140</span>      protected void run() throws IOException {<a name="line.2140"></a>
-<span class="sourceLineNo">2141</span>        getMaster().getMasterCoprocessorHost().preTruncateTable(tableName);<a name="line.2141"></a>
-<span class="sourceLineNo">2142</span><a name="line.2142"></a>
-<span class="sourceLineNo">2143</span>        LOG.info(getClientIdAuditPrefix() + " truncate " + tableName);<a name="line.2143"></a>
-<span class="sourceLineNo">2144</span>        ProcedurePrepareLatch latch = ProcedurePrepareLatch.createLatch(2, 0);<a name="line.2144"></a>
-<span class="sourceLineNo">2145</span>        submitProcedure(new TruncateTableProcedure(procedureExecutor.getEnvironment(),<a name="line.2145"></a>
-<span class="sourceLineNo">2146</span>            tableName, preserveSplits, latch));<a name="line.2146"></a>
-<span class="sourceLineNo">2147</span>        latch.await();<a name="line.2147"></a>
-<span class="sourceLineNo">2148</span><a name="line.2148"></a>
-<span class="sourceLineNo">2149</span>        getMaster().getMasterCoprocessorHost().postTruncateTable(tableName);<a name="line.2149"></a>
-<span class="sourceLineNo">2150</span>      }<a name="line.2150"></a>
-<span class="sourceLineNo">2151</span><a name="line.2151"></a>
-<span class="sourceLineNo">2152</span>      @Override<a name="line.2152"></a>
-<span class="sourceLineNo">2153</span>      protected String getDescription() {<a name="line.2153"></a>
-<span class="sourceLineNo">2154</span>        return "TruncateTableProcedure";<a name="line.2154"></a>
-<span class="sourceLineNo">2155</span>      }<a name="line.2155"></a>
-<span class="sourceLineNo">2156</span>    });<a name="line.2156"></a>
-<span class="sourceLineNo">2157</span>  }<a name="line.2157"></a>
-<span class="sourceLineNo">2158</span><a name="line.2158"></a>
-<span class="sourceLineNo">2159</span>  @Override<a name="line.2159"></a>
-<span class="sourceLineNo">2160</span>  public long addColumn(<a name="line.2160"></a>
-<span class="sourceLineNo">2161</span>      final TableName tableName,<a name="line.2161"></a>
-<span class="sourceLineNo">2162</span>      final ColumnFamilyDescriptor columnDescriptor,<a name="line.2162"></a>
-<span class="sourceLineNo">2163</span>      final long nonceGroup,<a name="line.2163"></a>
-<span class="sourceLineNo">2164</span>      final long nonce)<a name="line.2164"></a>
-<span class="sourceLineNo">2165</span>      throws IOException {<a name="line.2165"></a>
-<span class="sourceLineNo">2166</span>    checkInitialized();<a name="line.2166"></a>
-<span class="sourceLineNo">2167</span>    checkCompression(columnDescriptor);<a name="line.2167"></a>
-<span class="sourceLineNo">2168</span>    checkEncryption(conf, columnDescriptor);<a name="line.2168"></a>
-<span class="sourceLineNo">2169</span>    checkReplicationScope(columnDescriptor);<a name="line.2169"></a>
-<span class="sourceLineNo">2170</span><a name="line.2170"></a>
-<span class="sourceLineNo">2171</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2171"></a>
-<span class="sourceLineNo">2172</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2172"></a>
-<span class="sourceLineNo">2173</span>      @Override<a name="line.2173"></a>
-<span class="sourceLineNo">2174</span>      protected void run() throws IOException {<a name="line.2174"></a>
-<span class="sourceLineNo">2175</span>        if (getMaster().getMasterCoprocessorHost().preAddColumn(tableName, columnDescriptor)) {<a name="line.2175"></a>
-<span class="sourceLineNo">2176</span>          return;<a name="line.2176"></a>
-<span class="sourceLineNo">2177</span>        }<a name="line.2177"></a>
-<span class="sourceLineNo">2178</span><a name="line.2178"></a>
-<span class="sourceLineNo">2179</span>        // Execute the operation synchronously, wait for the operation to complete before continuing<a name="line.2179"></a>
-<span class="sourceLineNo">2180</span>        ProcedurePrepareLatch latch = ProcedurePrepareLatch.createLatch(2, 0);<a name="line.2180"></a>
-<span class="sourceLineNo">2181</span>        submitProcedure(new AddColumnFamilyProcedure(procedureExecutor.getEnvironment(),<a name="line.2181"></a>
-<span class="sourceLineNo">2182</span>            tableName, columnDescriptor, latch));<a name="line.2182"></a>
-<span class="sourceLineNo">2183</span>        latch.await();<a name="line.2183"></a>
-<span class="sourceLineNo">2184</span><a name="line.2184"></a>
-<span class="sourceLineNo">2185</span>        getMaster().getMasterCoprocessorHost().postAddColumn(tableName, columnDescriptor);<a name="line.2185"></a>
-<span class="sourceLineNo">2186</span>      }<a name="line.2186"></a>
-<span class="sourceLineNo">2187</span><a name="line.2187"></a>
-<span class="sourceLineNo">2188</span>      @Override<a name="line.2188"></a>
-<span class="sourceLineNo">2189</span>      protected String getDescription() {<a name="line.2189"></a>
-<span class="sourceLineNo">2190</span>        return "AddColumnFamilyProcedure";<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>  }<a name="line.2193"></a>
-<span class="sourceLineNo">2194</span><a name="line.2194"></a>
-<span class="sourceLineNo">2195</span>  @Override<a name="line.2195"></a>
-<span class="sourceLineNo">2196</span>  public long modifyColumn(<a name="line.2196"></a>
-<span class="sourceLineNo">2197</span>      final TableName tableName,<a name="line.2197"></a>
-<span class="sourceLineNo">2198</span>      final ColumnFamilyDescriptor descriptor,<a name="line.2198"></a>
-<span class="sourceLineNo">2199</span>      final long nonceGroup,<a name="line.2199"></a>
-<span class="sourceLineNo">2200</span>      final long nonce)<a name="line.2200"></a>
-<span class="sourceLineNo">2201</span>      throws IOException {<a name="line.2201"></a>
-<span class="sourceLineNo">2202</span>    checkInitialized();<a name="line.2202"></a>
-<span class="sourceLineNo">2203</span>    checkCompression(descriptor);<a name="line.2203"></a>
-<span class="sourceLineNo">2204</span>    checkEncryption(conf, descriptor);<a name="line.2204"></a>
-<span class="sourceLineNo">2205</span>    checkReplicationScope(descriptor);<a name="line.2205"></a>
-<span class="sourceLineNo">2206</span><a name="line.2206"></a>
-<span class="sourceLineNo">2207</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2207"></a>
-<span class="sourceLineNo">2208</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2208"></a>
-<span class="sourceLineNo">2209</span>      @Override<a name="line.2209"></a>
-<span class="sourceLineNo">2210</span>      protected void run() throws IOException {<a name="line.2210"></a>
-<span class="sourceLineNo">2211</span>        if (getMaster().getMasterCoprocessorHost().preModifyColumn(tableName, descriptor)) {<a name="line.2211"></a>
-<span class="sourceLineNo">2212</span>          return;<a name="line.2212"></a>
-<span class="sourceLineNo">2213</span>        }<a name="line.2213"></a>
-<span class="sourceLineNo">2214</span><a name="line.2214"></a>
-<span class="sourceLineNo">2215</span>        LOG.info(getClientIdAuditPrefix() + " modify " + descriptor);<a name="line.2215"></a>
-<span class="sourceLineNo">2216</span><a name="line.2216"></a>
-<span class="sourceLineNo">2217</span>        // Execute the operation synchronously - wait for the operation to complete before<a name="line.2217"></a>
-<span class="sourceLineNo">2218</span>        // continuing.<a name="line.2218"></a>
-<span class="sourceLineNo">2219</span>        ProcedurePrepareLatch latch = ProcedurePrepareLatch.createLatch(2, 0);<a name="line.2219"></a>
-<span class="sourceLineNo">2220</span>        submitProcedure(new ModifyColumnFamilyProcedure(procedureExecutor.getEnvironment(),<a name="line.2220"></a>
-<span class="sourceLineNo">2221</span>            tableName, descriptor, latch));<a name="line.2221"></a>
-<span class="sourceLineNo">2222</span>        latch.await();<a name="line.2222"></a>
-<span class="sourceLineNo">2223</span><a name="line.2223"></a>
-<span class="sourceLineNo">2224</span>        getMaster().getMasterCoprocessorHost().postModifyColumn(tableName, descriptor);<a name="line.2224"></a>
-<span class="sourceLineNo">2225</span>      }<a name="line.2225"></a>
-<span class="sourceLineNo">2226</span><a name="line.2226"></a>
-<span class="sourceLineNo">2227</span>      @Override<a name="line.2227"></a>
-<span class="sourceLineNo">2228</span>      protected String getDescription() {<a name="line.2228"></a>
-<span class="sourceLineNo">2229</span>        return "ModifyColumnFamilyProcedure";<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>  }<a name="line.2232"></a>
-<span class="sourceLineNo">2233</span><a name="line.2233"></a>
-<span class="sourceLineNo">2234</span>  @Override<a name="line.2234"></a>
-<span class="sourceLineNo">2235</span>  public long deleteColumn(<a name="line.2235"></a>
-<span class="sourceLineNo">2236</span>      final TableName tableName,<a name="line.2236"></a>
-<span class="sourceLineNo">2237</span>      final byte[] columnName,<a name="line.2237"></a>
-<span class="sourceLineNo">2238</span>      final long nonceGroup,<a name="line.2238"></a>
-<span class="sourceLineNo">2239</span>      final long nonce)<a name="line.2239"></a>
-<span class="sourceLineNo">2240</span>      throws IOException {<a name="line.2240"></a>
-<span class="sourceLineNo">2241</span>    checkInitialized();<a name="line.2241"></a>
-<span class="sourceLineNo">2242</span><a name="line.2242"></a>
-<span class="sourceLineNo">2243</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2243"></a>
-<span class="sourceLineNo">2244</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2244"></a>
-<span class="sourceLineNo">2245</span>      @Override<a name="line.2245"></a>
-<span class="sourceLineNo">2246</span>      protected void run() throws IOException {<a name="line.2246"></a>
-<span class="sourceLineNo">2247</span>        if (getMaster().getMasterCoprocessorHost().preDeleteColumn(tableName, columnName)) {<a name="line.2247"></a>
-<span class="sourceLineNo">2248</span>          return;<a name="line.2248"></a>
-<span class="sourceLineNo">2249</span>        }<a name="line.2249"></a>
-<span class="sourceLineNo">2250</span><a name="line.2250"></a>
-<span class="sourceLineNo">2251</span>        LOG.info(getClientIdAuditPrefix() + " delete " + Bytes.toString(columnName));<a name="line.2251"></a>
-<span class="sourceLineNo">2252</span><a name="line.2252"></a>
-<span class="sourceLineNo">2253</span>        // Execute the operation synchronously - wait for the operation to complete before continuing.<a name="line.2253"></a>
-<span class="sourceLineNo">2254</span>        ProcedurePrepareLatch latch = ProcedurePrepareLatch.createLatch(2, 0);<a name="line.2254"></a>
-<span class="sourceLineNo">2255</span>        submitProcedure(new DeleteColumnFamilyProcedure(procedureExecutor.getEnvironment(),<a name="line.2255"></a>
-<span class="sourceLineNo">2256</span>            tableName, columnName, latch));<a name="line.2256"></a>
-<span class="sourceLineNo">2257</span>        latch.await();<a name="line.2257"></a>
-<span class="sourceLineNo">2258</span><a name="line.2258"></a>
-<span class="sourceLineNo">2259</span>        getMaster().getMasterCoprocessorHost().postDeleteColumn(tableName, columnName);<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>      @Override<a name="line.2262"></a>
-<span class="sourceLineNo">2263</span>      protected String getDescription() {<a name="line.2263"></a>
-<span class="sourceLineNo">2264</span>        return "DeleteColumnFamilyProcedure";<a name="line.2264"></a>
-<span class="sourceLineNo">2265</span>      }<a name="line.2265"></a>
-<span class="sourceLineNo">2266</span>    });<a name="line.2266"></a>
-<span class="sourceLineNo">2267</span>  }<a name="line.2267"></a>
-<span class="sourceLineNo">2268</span><a name="line.2268"></a>
-<span class="sourceLineNo">2269</span>  @Override<a name="line.2269"></a>
-<span class="sourceLineNo">2270</span>  public long enableTable(final TableName tableName, final long nonceGroup, final long nonce)<a name="line.2270"></a>
-<span class="sourceLineNo">2271</span>      throws IOException {<a name="line.2271"></a>
-<span class="sourceLineNo">2272</span>    checkInitialized();<a name="line.2272"></a>
-<span class="sourceLineNo">2273</span><a name="line.2273"></a>
-<span class="sourceLineNo">2274</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2274"></a>
-<span class="sourceLineNo">2275</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2275"></a>
-<span class="sourceLineNo">2276</span>      @Override<a name="line.2276"></a>
-<span class="sourceLineNo">2277</span>      protected void run() throws IOException {<a name="line.2277"></a>
-<span class="sourceLineNo">2278</span>        getMaster().getMasterCoprocessorHost().preEnableTable(tableName);<a name="line.2278"></a>
-<span class="sourceLineNo">2279</span><a name="line.2279"></a>
-<span class="sourceLineNo">2280</span>        // Normally, it would make sense for this authorization check to exist inside<a name="line.2280"></a>
-<span class="sourceLineNo">2281</span>        // AccessController, but because the authorization check is done based on internal state<a name="line.2281"></a>
-<span class="sourceLineNo">2282</span>        // (rather than explicit permissions) we'll do the check here instead of in the<a name="line.2282"></a>
-<span class="sourceLineNo">2283</span>        // coprocessor.<a name="line.2283"></a>
-<span class="sourceLineNo">2284</span>        MasterQuotaManager quotaManager = getMasterQuotaManager();<a name="line.2284"></a>
-<span class="sourceLineNo">2285</span>        if (quotaManager != null) {<a name="line.2285"></a>
-<span class="sourceLineNo">2286</span>          if (quotaManager.isQuotaInitialized()) {<a name="line.2286"></a>
-<span class="sourceLineNo">2287</span>            Quotas quotaForTable = QuotaUtil.getTableQuota(getConnection(), tableName);<a name="line.2287"></a>
-<span class="sourceLineNo">2288</span>            if (quotaForTable != null &amp;&amp; quotaForTable.hasSpace()) {<a name="line.2288"></a>
-<span class="sourceLineNo">2289</span>              SpaceViolationPolicy policy = quotaForTable.getSpace().getViolationPolicy();<a name="line.2289"></a>
-<span class="sourceLineNo">2290</span>              if (SpaceViolationPolicy.DISABLE == policy) {<a name="line.2290"></a>
-<span class="sourceLineNo">2291</span>                throw new AccessDeniedException("Enabling the table '" + tableName<a name="line.2291"></a>
-<span class="sourceLineNo">2292</span>                    + "' is disallowed due to a violated space quota.");<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>          } else if (LOG.isTraceEnabled()) {<a name="line.2295"></a>
-<span class="sourceLineNo">2296</span>            LOG.trace("Unable to check for space quotas as the MasterQuotaManager is not enabled");<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>        LOG.info(getClientIdAuditPrefix() + " enable " + tableName);<a name="line.2300"></a>
-<span class="sourceLineNo">2301</span><a name="line.2301"></a>
-<span class="sourceLineNo">2302</span>        // Execute the operation asynchronously - client will check the progress of the operation<a name="line.2302"></a>
-<span class="sourceLineNo">2303</span>        // In case the request is from a &lt;1.1 client before returning,<a name="line.2303"></a>
-<span class="sourceLineNo">2304</span>        // we want to make sure that the table is prepared to be<a name="line.2304"></a>
-<span class="sourceLineNo">2305</span>        // enabled (the table is locked and the table state is set).<a name="line.2305"></a>
-<span class="sourceLineNo">2306</span>        // Note: if the procedure throws exception, we will catch it and rethrow.<a name="line.2306"></a>
-<span class="sourceLineNo">2307</span>        final ProcedurePrepareLatch prepareLatch = ProcedurePrepareLatch.createLatch();<a name="line.2307"></a>
-<span class="sourceLineNo">2308</span>        submitProcedure(new EnableTableProcedure(procedureExecutor.getEnvironment(),<a name="line.2308"></a>
-<span class="sourceLineNo">2309</span>            tableName, false, prepareLatch));<a name="line.2309"></a>
-<span class="sourceLineNo">2310</span>        prepareLatch.await();<a name="line.2310"></a>
-<span class="sourceLineNo">2311</span><a name="line.2311"></a>
-<span class="sourceLineNo">2312</span>        getMaster().getMasterCoprocessorHost().postEnableTable(tableName);<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>      @Override<a name="line.2315"></a>
-<span class="sourceLineNo">2316</span>      protected String getDescription() {<a name="line.2316"></a>
-<span class="sourceLineNo">2317</span>        return "EnableTableProcedure";<a name="line.2317"></a>
-<span class="sourceLineNo">2318</span>      }<a name="line.2318"></a>
-<span class="sourceLineNo">2319</span>    });<a name="line.2319"></a>
-<span class="sourceLineNo">2320</span>  }<a name="line.2320"></a>
-<span class="sourceLineNo">2321</span><a name="line.2321"></a>
-<span class="sourceLineNo">2322</span>  @Override<a name="line.2322"></a>
-<span class="sourceLineNo">2323</span>  public long disableTable(final TableName tableName, final long nonceGroup, final long nonce)<a name="line.2323"></a>
-<span class="sourceLineNo">2324</span>      throws IOException {<a name="line.2324"></a>
-<span class="sourceLineNo">2325</span>    checkInitialized();<a name="line.2325"></a>
-<span class="sourceLineNo">2326</span><a name="line.2326"></a>
-<span class="sourceLineNo">2327</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2327"></a>
-<span class="sourceLineNo">2328</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2328"></a>
-<span class="sourceLineNo">2329</span>      @Override<a name="line.2329"></a>
-<span class="sourceLineNo">2330</span>      protected void run() throws IOException {<a name="line.2330"></a>
-<span class="sourceLineNo">2331</span>        getMaster().getMasterCoprocessorHost().preDisableTable(tableName);<a name="line.2331"></a>
-<span class="sourceLineNo">2332</span><a name="line.2332"></a>
-<span class="sourceLineNo">2333</span>        LOG.info(getClientIdAuditPrefix() + " disable " + tableName);<a name="line.2333"></a>
-<span class="sourceLineNo">2334</span><a name="line.2334"></a>
-<span class="sourceLineNo">2335</span>        // Execute the operation asynchronously - client will check the progress of the operation<a name="line.2335"></a>
-<span class="sourceLineNo">2336</span>        // In case the request is from a &lt;1.1 client before returning,<a name="line.2336"></a>
-<span class="sourceLineNo">2337</span>        // we want to make sure that the table is prepared to be<a name="line.2337"></a>
-<span class="sourceLineNo">2338</span>        // enabled (the table is locked and the table state is set).<a name="line.2338"></a>
-<span class="sourceLineNo">2339</span>        // Note: if the procedure throws exception, we will catch it and rethrow.<a name="line.2339"></a>
-<span class="sourceLineNo">2340</span>        final ProcedurePrepareLatch prepareLatch = ProcedurePrepareLatch.createLatch();<a name="line.2340"></a>
-<span class="sourceLineNo">2341</span>        submitProcedure(new DisableTableProcedure(procedureExecutor.getEnvironment(),<a name="line.2341"></a>
-<span class="sourceLineNo">2342</span>            tableName, false, prepareLatch));<a name="line.2342"></a>
-<span class="sourceLineNo">2343</span>        prepareLatch.await();<a name="line.2343"></a>
-<span class="sourceLineNo">2344</span><a name="line.2344"></a>
-<span class="sourceLineNo">2345</span>        getMaster().getMasterCoprocessorHost().postDisableTable(tableName);<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>      @Override<a name="line.2348"></a>
-<span class="sourceLineNo">2349</span>      protected String getDescription() {<a name="line.2349"></a>
-<span class="sourceLineNo">2350</span>        return "DisableTableProcedure";<a name="line.2350"></a>
-<span class="sourceLineNo">2351</span>      }<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><a name="line.2354"></a>
-<span class="sourceLineNo">2355</span>  /**<a name="line.2355"></a>
-<span class="sourceLineNo">2356</span>   * Return the region and current deployment for the region containing<a name="line.2356"></a>
-<span class="sourceLineNo">2357</span>   * the given row. If the region cannot be found, returns null. If it<a name="line.2357"></a>
-<span class="sourceLineNo">2358</span>   * is found, but not currently deployed, the second element of the pair<a name="line.2358"></a>
-<span class="sourceLineNo">2359</span>   * may be null.<a name="line.2359"></a>
-<span class="sourceLineNo">2360</span>   */<a name="line.2360"></a>
-<span class="sourceLineNo">2361</span>  @VisibleForTesting // Used by TestMaster.<a name="line.2361"></a>
-<span class="sourceLineNo">2362</span>  Pair&lt;HRegionInfo, ServerName&gt; getTableRegionForRow(<a name="line.2362"></a>
-<span class="sourceLineNo">2363</span>      final TableName tableName, final byte [] rowKey)<a name="line.2363"></a>
-<span class="sourceLineNo">2364</span>  throws IOException {<a name="line.2364"></a>
-<span class="sourceLineNo">2365</span>    final AtomicReference&lt;Pair&lt;HRegionInfo, ServerName&gt;&gt; result = new AtomicReference&lt;&gt;(null);<a name="line.2365"></a>
-<span class="sourceLineNo">2366</span><a name="line.2366"></a>
-<span class="sourceLineNo">2367</span>    MetaTableAccessor.Visitor visitor = new MetaTableAccessor.Visitor() {<a name="line.2367"></a>
-<span class="sourceLineNo">2368</span>        @Override<a name="line.2368"></a>
-<span class="sourceLineNo">2369</span>        public boolean visit(Result data) throws IOException {<a name="line.2369"></a>
-<span class="sourceLineNo">2370</span>          if (data == null || data.size() &lt;= 0) {<a name="line.2370"></a>
-<span class="sourceLineNo">2371</span>            return true;<a name="line.2371"></a>
-<span class="sourceLineNo">2372</span>          }<a name="line.2372"></a>
-<span class="sourceLineNo">2373</span>          Pair&lt;HRegionInfo, ServerName&gt; pair =<a name="line.2373"></a>
-<span class="sourceLineNo">2374</span>              new Pair(MetaTableAccessor.getHRegionInfo(data),<a name="line.2374"></a>
-<span class="sourceLineNo">2375</span>                  MetaTableAccessor.getServerName(data,0));<a name="line.2375"></a>
-<span class="sourceLineNo">2376</span>          if (pair == null) {<a name="line.2376"></a>
-<span class="sourceLineNo">2377</span>            return false;<a name="line.2377"></a>
-<span class="sourceLineNo">2378</span>          }<a name="line.2378"></a>
-<span class="sourceLineNo">2379</span>          if (!pair.getFirst().getTable().equals(tableName)) {<a name="line.2379"></a>
-<span class="sourceLineNo">2380</span>            return false;<a name="line.2380"></a>
-<span class="sourceLineNo">2381</span>          }<a name="line.2381"></a>
-<span class="sourceLineNo">2382</span>          result.set(pair);<a name="line.2382"></a>
-<span class="sourceLineNo">2383</span>          return true;<a name="line.2383"></a>
-<span class="sourceLineNo">2384</span>        }<a name="line.2384"></a>
-<span class="sourceLineNo">2385</span>    };<a name="line.2385"></a>
-<span class="sourceLineNo">2386</span><a name="line.2386"></a>
-<span class="sourceLineNo">2387</span>    MetaTableAccessor.scanMeta(clusterConnection, visitor, tableName, rowKey, 1);<a name="line.2387"></a>
-<span class="sourceLineNo">2388</span>    return result.get();<a name="line.2388"></a>
-<span class="sourceLineNo">2389</span>  }<a name="line.2389"></a>
-<span class="sourceLineNo">2390</span><a name="line.2390"></a>
-<span class="sourceLineNo">2391</span>  @Override<a name="line.2391"></a>
-<span class="sourceLineNo">2392</span>  public long modifyTable(final TableName tableName, final TableDescriptor descriptor,<a name="line.2392"></a>
-<span class="sourceLineNo">2393</span>      final long nonceGroup, final long nonce) throws IOException {<a name="line.2393"></a>
-<span class="sourceLineNo">2394</span>    checkInitialized();<a name="line.2394"></a>
-<span class="sourceLineNo">2395</span>    sanityCheckTableDescriptor(descriptor);<a name="line.2395"></a>
-<span class="sourceLineNo">2396</span><a name="line.2396"></a>
-<span class="sourceLineNo">2397</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2397"></a>
-<span class="sourceLineNo">2398</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2398"></a>
-<span class="sourceLineNo">2399</span>      @Override<a name="line.2399"></a>
-<span class="sourceLineNo">2400</span>      protected void run() throws IOException {<a name="line.2400"></a>
-<span class="sourceLineNo">2401</span>        getMaster().getMasterCoprocessorHost().preModifyTable(tableName, descriptor);<a name="line.2401"></a>
-<span class="sourceLineNo">2402</span><a name="line.2402"></a>
-<span class="sourceLineNo">2403</span>        LOG.info(getClientIdAuditPrefix() + " modify " + tableName);<a name="line.2403"></a>
-<span class="sourceLineNo">2404</span><a name="line.2404"></a>
-<span class="sourceLineNo">2405</span>        // Execute the operation synchronously - wait for the operation completes before continuing.<a name="line.2405"></a>
-<span class="sourceLineNo">2406</span>        ProcedurePrepareLatch latch = ProcedurePrepareLatch.createLatch(2, 0);<a name="line.2406"></a>
-<span class="sourceLineNo">2407</span>        submitProcedure(new ModifyTableProcedure(procedureExecutor.getEnvironment(),<a name="line.2407"></a>
-<span class="sourceLineNo">2408</span>            descriptor, latch));<a name="line.2408"></a>
-<span class="sourceLineNo">2409</span>        latch.await();<a name="line.2409"></a>
-<span class="sourceLineNo">2410</span><a name="line.2410"></a>
-<span class="sourceLineNo">2411</span>        getMaster().getMasterCoprocessorHost().postModifyTable(tableName, descriptor);<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>      @Override<a name="line.2414"></a>
-<span class="sourceLineNo">2415</span>      protected String getDescription() {<a name="line.2415"></a>
-<span class="sourceLineNo">2416</span>        return "ModifyTableProcedure";<a name="line.2416"></a>
-<span class="sourceLineNo">2417</span>      }<a name="line.2417"></a>
-<span class="sourceLineNo">2418</span>    });<a name="line.2418"></a>
-<span class="sourceLineNo">2419</span>  }<a name="line.2419"></a>
-<span class="sourceLineNo">2420</span><a name="line.2420"></a>
-<span class="sourceLineNo">2421</span>  public long restoreSnapshot(final SnapshotDescription snapshotDesc,<a name="line.2421"></a>
-<span class="sourceLineNo">2422</span>      final long nonceGroup, final long nonce, final boolean restoreAcl) throws IOException {<a name="line.2422"></a>
-<span class="sourceLineNo">2423</span>    checkInitialized();<a name="line.2423"></a>
-<span class="sourceLineNo">2424</span>    getSnapshotManager().checkSnapshotSupport();<a name="line.2424"></a>
-<span class="sourceLineNo">2425</span><a name="line.2425"></a>
-<span class="sourceLineNo">2426</span>    // Ensure namespace exists. Will throw exception if non-known NS.<a name="line.2426"></a>
-<span class="sourceLineNo">2427</span>    final TableName dstTable = TableName.valueOf(snapshotDesc.getTable());<a name="line.2427"></a>
-<span class="sourceLineNo">2428</span>    getClusterSchema().getNamespace(dstTable.getNamespaceAsString());<a name="line.2428"></a>
-<span class="sourceLineNo">2429</span><a name="line.2429"></a>
-<span class="sourceLineNo">2430</span>    return MasterProcedureUtil.submitProcedure(<a name="line.2430"></a>
-<span class="sourceLineNo">2431</span>        new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) {<a name="line.2431"></a>
-<span class="sourceLineNo">2432</span>      @Override<a name="line.2432"></a>
-<span class="sourceLineNo">2433</span>      protected void run() throws IOException {<a name="line.2433"></a>
-<span class="sourceLineNo">2434</span>          setProcId(<a name="line.2434"></a>
-<span class="sourceLineNo">2435</span>            getSnapshotManager().restoreOrCloneSnapshot(snapshotDesc, getNonceKey(), restoreAcl));<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>      @Override<a name="line.2438"></a>
-<span class="sourceLineNo">2439</span>      protected String getDescription() {<a name="line.2439"></a>
-<span class="sourceLineNo">2440</span>        return "RestoreSnapshotProcedure";<a name="line.2440"></a>
-<span class="sourceLineNo">2441</span>      }<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>  @Override<a name="line.2445"></a>
-<span class="sourceLineNo">2446</span>  public void checkTableModifiable(final TableName tableName)<a name="line.2446"></a>
-<span class="sourceLineNo">2447</span>      throws IOException, TableNotFoundException, TableNotDisabledException {<a name="line.2447"></a>
-<span class="sourceLineNo">2448</span>    if (isCatalogTable(tableName)) {<a name="line.2448"></a>
-<span class="sourceLineNo">2449</span>      throw new IOException("Can't modify catalog tables");<a name="line.2449"></a>
-<span class="sourceLineNo">2450</span>    }<a name="line.2450"></a>
-<span class="sourceLineNo">2451</span>    if (!MetaTableAccessor.tableExists(getConnection(), tableName)) {<a name="line.2451"></a>
-<span class="sourceLineNo">2452</span>      throw new TableNotFoundException(tableName);<a name="line.2452"></a>
-<span class="sourceLineNo">2453</span>    }<a name="line.2453"></a>
-<span class="sourceLineNo">2454</span>    if (!getTableStateManager().isTableState(tableName, TableState.State.DISABLED)) {<a name="line.2454"></a>
-<span class="sourceLineNo">2455</span>      throw new TableNotDisabledException(tableName);<a name="line.2455"></a>
-<span class="sourceLineNo">2456</span>    }<a name="line.2456"></a>
-<span class="sourceLineNo">2457</span>  }<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>   * @return cluster status<a name="line.2460"></a>
-<span class="sourceLineNo">2461</span>   */<a name="line.2461"></a>
-<span class="sourceLineNo">2462</span>  public ClusterStatus getClusterStatus() throws InterruptedIOException {<a name="line.2462"></a>
-<span class="sourceLineNo">2463</span>    return getClusterStatus(Options.getDefaultOptions());<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>  /**<a name="line.2466"></a>
-<span class="sourceLineNo">2467</span>   * @return cluster status<a name="line.2467"></a>
-<span class="sourceLineNo">2468</span>   */<a name="line.2468"></a>
-<span class="sourceLineNo">2469</span>  public ClusterStatus getClusterStatus(Options options) throws InterruptedIOException {<a name="line.2469"></a>
-<span class="sourceLineNo">2470</span>    if (LOG.isDebugEnabled()) {<a name="line.2470"></a>
-<span class="sourceLineNo">2471</span>      LOG.debug("Retrieving cluster status info. " + options);<a name="line.2471"></a>
-<span class="sourceLineNo">2472</span>    }<a name="line.2472"></a>
-<span class="sourceLineNo">2473</span>    ClusterStatus.Builder builder = ClusterStatus.newBuilder();<a name="line.2473"></a>
-<span class="sourceLineNo">2474</span>    if (options.includeHBaseVersion()) {<a name="line.2474"></a>
-<span class="sourceLineNo">2475</span>      builder.setHBaseVersion(VersionInfo.getVersion());<a name="line.2475"></a>
-<span class="sourceLineNo">2476</span>    }<a name="line.2476"></a>
-<span class="sourceLineNo">2477</span>    if (options.includeClusterId()) {<a name="line.2477"></a>
-<span class="sourceLineNo">2478</span>      builder.setClusterId(getClusterId());<a name="line.2478"></a>
-<span class="sourceLineNo">2479</span>    }<a name="line.2479"></a>
-<span class="sourceLineNo">2480</span>    if (options.includeLiveServers() &amp;&amp; serverManager != null) {<a name="line.2480"></a>
-<span class="sourceLineNo">2481</span>      builder.setLiveServers(serverManager.getOnlineServers());<a name="line.2481"></a>
-<span class="sourceLineNo">2482</span>    }<a name="line.2482"></a>
-<span class="sourceLineNo">2483</span>    if (options.includeDeadServers() &amp;&amp; serverManager != null) {<a name="line.2483"></a>
-<span class="sourceLineNo">2484</span>      builder.setDeadServers(serverManager.getDeadServers().copyServerNames());<a name="line.2484"></a>
-<span class="sourceLineNo">2485</span>    }<a name="line.2485"></a>
-<span class="sourceLineNo">2486</span>    if (options.includeMaster()) {<a name="line.2486"></a>
-<span class="sourceLineNo">2487</span>      builder.setMaster(getServerName());<a name="line.2487"></a>
-<span class="sourceLineNo">2488</span>    }<a name="line.2488"></a>
-<span class="sourceLineNo">2489</span>    if (options.includeBackupMasters()) {<a name="line.2489"></a>
-<span class="sourceLineNo">2490</span>      builder.setBackupMasters(getBackupMasters());<a name="line.2490"></a>
-<span class="sourceLineNo">2491</span>    }<a name="line.2491"></a>
-<span class="sourceLineNo">2492</span>    if (options.includeRegionState() &amp;&amp; assignmentManager != null) {<a name="line.2492"></a>
-<span class="sourceLineNo">2493</span>      builder.setRegionState(assignmentManager.getRegionStates().getRegionsStateInTransition());<a name="line.2493"></a>
-<span class="sourceLineNo">2494</span>    }<a name="line.2494"></a>
-<span class="sourceLineNo">2495</span>    if (options.includeMasterCoprocessors() &amp;&amp; cpHost != null) {<a name="line.2495"></a>
-<span class="sourceLineNo">2496</span>      builder.setMasterCoprocessors(getMasterCoprocessors());<a name="line.2496"></a>
-<span class="sourceLineNo">2497</span>    }<a name="line.2497"></a>
-<span class="sourceLineNo">2498</span>    if (options.includeBalancerOn() &amp;&amp; loadBalancerTracker != null) {<a name="line.2498"></a>
-<span class="sourceLineNo">2499</span>      builder.setBalancerOn(loadBalancerTracker.isBalancerOn());<a name="line.2499"></a>
-<span class="sourceLineNo">2500</span>    }<a name="line.2500"></a>
-<span class="sourceLineNo">2501</span>    return builder.build();<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>  private List&lt;ServerName&gt; getBackupMasters() throws InterruptedIOException {<a name="line.2504"></a>
-<span class="sourceLineNo">2505</span>    // Build Set of backup masters from ZK nodes<a name="line.2505"></a>
-<span class="sourceLineNo">2506</span>    List&lt;String&gt; backupMasterStrings;<a name="line.2506"></a>
-<span class="sourceLineNo">2507</span>    try {<a name="line.2507"></a>
-<span class="sourceLineNo">2508</span>      backupMasterStrings = ZKUtil.listChildrenNoWatch(this.zooKeeper,<a name="line.2508"></a>
-<span class="sourceLineNo">2509</span>        this.zooKeeper.znodePaths.backupMasterAddressesZNode);<a name="line.2509"></a>
-<span class="sourceLineNo">2510</span>    } catch (KeeperException e) {<a name="line.2510"></a>
-<span class="sourceLineNo">2511</span>      LOG.warn(this.zooKeeper.prefix("Unable to list backup servers"), e);<a name="line.2511"></a>
-<span class="sourceLineNo">2512</span>      backupMasterStrings = null;<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>    List&lt;ServerName&gt; backupMasters = null;<a name="line.2515"></a>
-<span class="sourceLineNo">2516</span>    if (backupMasterStrings != null &amp;&amp; !backupMasterStrings.isEmpty()) {<a name="line.2516"></a>
-<span class="sourceLineNo">2517</span>      backupMasters = new ArrayList&lt;&gt;(backupMasterStrings.size());<a name="line.2517"></a>
-<span class="sourceLineNo">2518</span>      for (String s: backupMasterStrings) {<a name="line.2518"></a>
-<span class="sourceLineNo">2519</span>        try {<a name="line.2519"></a>
-<span class="sourceLineNo">2520</span>          byte [] bytes;<a name="line.2520"></a>
-<span class="sourceLineNo">2521</span>          try {<a name="line.2521"></a>
-<span class="sourceLineNo">2522</span>            bytes = ZKUtil.getData(this.zooKeeper, ZKUtil.joinZNode(<a name="line.2522"></a>
-<span class="sourceLineNo">2523</span>                this.zooKeeper.znodePaths.backupMasterAddressesZNode, s));<a name="line.2523"></a>
-<span class="sourceLineNo">2524</span>          } catch (InterruptedException e) {<a name="line.2524"></a>
-<span class="sourceLineNo">2525</span>            throw new InterruptedIOException();<a name="line.2525"></a>
-<span class="sourceLineNo">2526</span>          }<a name="line.2526"></a>
-<span class="sourceLineNo">2527</span>          if (bytes != null) {<a name="line.2527"></a>
-<span class="sourceLineNo">2528</span>            ServerName sn;<a name="line.2528"></a>
-<span class="sourceLineNo">2529</span>            try {<a name="line.2529"></a>
-<span class="sourceLineNo">2530</span>              sn = ProtobufUtil.parseServerNameFrom(bytes);<a name="line.2530"></a>
-<span class="sourceLineNo">2531</span>            } catch (DeserializationException e) {<a name="line.2531"></a>
-<span class="sourceLineNo">2532</span>              LOG.warn("Failed parse, skipping registering backup server", e);<a name="line.2532"></a>
-<span class="sourceLineNo">2533</span>              continue;<a name="line.2533"></a>
-<span class="sourceLineNo">2534</span>            }<a name="line.2534"></a>
-<span class="sourceLineNo">2535</span>            backupMasters.add(sn);<a name="line.2535"></a>
-<span class="sourceLineNo">2536</span>          }<a name="line.2536"></a>
-<span class="sourceLineNo">2537</span>        } catch (KeeperException e) {<a name="line.2537"></a>
-<span class="sourceLineNo">2538</span>          LOG.warn(this.zooKeeper.prefix("Unable to get information about " +<a name="line.2538"></a>
-<span class="sourceLineNo">2539</span>                   "backup servers"), e);<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>      Collections.sort(backupMasters, new Comparator&lt;ServerName&gt;() {<a name="line.2542"></a>
-<span class="sourceLineNo">2543</span>        @Override<a name="line.2543"></a>
-<span class="sourceLineNo">2544</span>        public int compare(ServerName s1, ServerName s2) {<a name="line.2544"></a>
-<span class="sourceLineNo">2545</span>          return s1.getServerName().compareTo(s2.getServerName());<a name="line.2545"></a>
-<span class="sourceLineNo">2546</span>        }});<a name="line.2546"></a>
-<span class="sourceLineNo">2547</span>    }<a name="line.2547"></a>
-<span class="sourceLineNo">2548</span>    return backupMasters;<a name="line.2548"></a>
-<span class="sourceLineNo">2549</span>  }<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>   * The set of loaded coprocessors is stored in a static set. Since it's<a name="line.2552"></a>
-<span class="sourceLineNo">2553</span>   * statically allocated, it does not require that HMaster's cpHost be<a name="line.2553"></a>
-<span class="sourceLineNo">2554</span>   * initialized prior to accessing it.<a name="line.2554"></a>
-<span class="sourceLineNo">2555</span>   * @return a String representation of the set of names of the loaded coprocessors.<a name="line.2555"></a>
-<span class="sourceLineNo">2556</span>   */<a name="line.2556"></a>
-<span class="sourceLineNo">2557</span>  public static String getLoadedCoprocessors() {<a name="line.2557"></a>
-<span class="sourceLineNo">2558</span>    return CoprocessorHost.getLoadedCoprocessors().toString();<a name="line.2558"></a>
-<span class="sourceLineNo">2559</span>  }<a name="line.2559"></a>
-<span class="sourceLineNo">2560</span><a name="line.2560"></a>
-<span class="sourceLineNo">2561</span>  /**<a name="line.2561"></a>
-<span class="sourceLineNo">2562</span>   * @return timestamp in millis when HMaster was started.<a name="line.2562"></a>
-<span class="sourceLineNo">2563</span>   */<a name="line.2563"></a>
-<span class="sourceLineNo">2564</span>  public long getMasterStartTime() {<a name="line.2564"></a>
-<span class="sourceLineNo">2565</span>    return startcode;<a name="line.2565"></a>
-<span class="sourceLineNo">2566</span>  }<a name="line.2566"></a>
-<span class="sourceLineNo">2567</span><a name="line.2567"></a>
-<span class="sourceLineNo">2568</span>  /**<a name="line.2568"></a>
-<span class="sourceLineNo">2569</span>   * @return timestamp in millis when HMaster became the active master.<a name="line.2569"></a>
-<span class="sourceLineNo">2570</span>   */<a name="line.2570"></a>
-<span class="sourceLineNo">2571</span>  public long getMasterActiveTime() {<a name="line.2571"></a>
-<span class="sourceLineNo">2572</span>    return masterActiveTime;<a name="line.2572"></a>
-<span class="sourceLineNo">2573</span>  }<a name="line.2573"></a>
-<span class="sourceLineNo">2574</span><a name="line.2574"></a>
-<span class="sourceLineNo">2575</span>  /**<a name="line.2575"></a>
-<span class="sourceLineNo">2576</span>   * @return timestamp in millis when HMaster finished becoming the active master<a name="line.2576"></a>
-<span class="sourceLineNo">2577</span>   */<a name="line.2577"></a>
-<span class="sourceLineNo">2578</span>  public long getMasterFinishedInitializationTime() {<a name="line.2578"></a>
-<span class="sourceLineNo">2579</span>    return masterFinishedInitializationTime;<a name="line.2579"></a>
-<span class="sourceLineNo">2580</span>  }<a name="line.2580"></a>
-<span class="sourceLineNo">2581</span><a name="line.2581"></a>
-<span class="sourceLineNo">2582</span>  public int getNumWALFiles() {<a name="line.2582"></a>
-<span class="sourceLineNo">2583</span>    return procedureStore != null ? procedureStore.getActiveLogs().size() : 0;<a name="line.2583"></a>
-<span class="sourceLineNo">2584</span>  }<a name="line.2584"></a>
-<span class="sourceLineNo">2585</span><a name="line.2585"></a>
-<span class="sourceLineNo">2586</span>  public WALProcedureStore getWalProcedureStore() {<a name="line.2586"></a>
-<span class="sourceLineNo">2587</span>    return procedureStore;<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>  public int getRegionServerInfoPort(final ServerName sn) {<a name="line.2590"></a>
-<span class="sourceLineNo">2591</span>    RegionServerInfo info = this.regionServerTracker.getRegionServerInfo(sn);<a name="line.2591"></a>
-<span class="sourceLineNo">2592</span>    if (info == null || info.getInfoPort() == 0) {<a name="line.2592"></a>
-<span class="sourceLineNo">2593</span>      return conf.getInt(HConstants.REGIONSERVER_INFO_PORT,<a name="line.2593"></a>
-<span class="sourceLineNo">2594</span>        HConstants.DEFAULT_REGIONSERVER_INFOPORT);<a name="line.2594"></a>
-<span class="sourceLineNo">2595</span>    }<a name="line.2595"></a>
-<span class="sourceLineNo">2596</span>    return info.getInfoPort();<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 String getRegionServerVersion(final ServerName sn) {<a name="line.2600"></a>
-<span class="sourceLineNo">2601</span>    RegionServerInfo info = this.regionServerTracker.getRegionServerInfo(sn);<a name="line.2601"></a>
-<span class="sourceLineNo">2602</span>    if (info != null &amp;&amp; info.hasVersionInfo()) {<a name="line.2602"></a>
-<span class="sourceLineNo">2603</span>      return info.getVersionInfo().getVersion();<a name="line.2603"></a>
-<span class="sourceLineNo">2604</span>    }<a name="line.2604"></a>
-<span class="sourceLineNo">2605</span>    return "0.0.0"; //Lowest version to prevent move system region to unknown version RS.<a name="line.2605"></a>
-<span class="sourceLineNo">2606</span>  }<a name="line.2606"></a>
-<span class="sourceLineNo">2607</span><a name="line.2607"></a>
-<span class="sourceLineNo">2608</span>  @Override<a name="line.2608"></a>
-<span class="sourceLineNo">2609</span>  public void checkIfShouldMoveSystemRegionAsync() {<a name="line.2609"></a>
-<span class="sourceLineNo">2610</span>    assignmentManager.checkIfShouldMoveSystemRegionAsync();<a name="line.2610"></a>
-<span class="sourceLineNo">2611</span>  }<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>   * @return array of coprocessor SimpleNames.<a name="line.2614"></a>
-<span class="sourceLineNo">2615</span>   */<a name="line.2615"></a>
-<span class="sourceLineNo">2616</span>  public String[] getMasterCoprocessors() {<a name="line.2616"></a>
-<span class="sourceLineNo">2617</span>    Set&lt;String&gt; masterCoprocessors = getMasterCoprocessorHost().getCoprocessors();<a name="line.2617"></a>
-<span class="sourceLineNo">2618</span>    return masterCoprocessors.toArray(new String[masterCoprocessors.size()]);<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>  @Override<a name="line.2621"></a>
-<span class="sourceLineNo">2622</span>  public void abort(final String msg, final Throwable t) {<a name="line.2622"></a>
-<span class="sourceLineNo">2623</span>    if (isAborted() || isStopped()) {<a name="line.2623"></a>
-<span class="sourceLineNo">2624</span>      return;<a name="line.2624"></a>
-<span class="sourceLineNo">2625</span>    }<a name="line.2625"></a>
-<span class="sourceLineNo">2626</span>    if (cpHost != null) {<a name="line.2626"></a>
-<span class="sourceLineNo">2627</span>      // HBASE-4014: dump a list of loaded coprocessors.<a name="line.2627"></a>
-<span class="sourceLineNo">2628</span>      LOG.fatal("Master server abort: loaded coprocessors are: " +<a name="line.2628"></a>
-<span class="sourceLineNo">2629</span>          getLoadedCoprocessors());<a name="line.2629"></a>
-<span class="sourceLineNo">2630</span>    }<a name="line.2630"></a>
-<span class="sourceLineNo">2631</span>    if (t != null) LOG.fatal(msg, t);<a name="line.2631"></a>
-<span class="sourceLineNo">2632</span>    try {<a name="line.2632"></a>
-<span class="sourceLineNo">2633</span>      stopMaster();<a name="line.2633"></a>
-<span class="sourceLineNo">2634</span>    } catch (IOException e) {<a name="line.2634"></a>
-<span class="sourceLineNo">2635</span>      LOG.error("Exception occurred while stopping master", e);<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>  @Override<a name="line.2639"></a>
-<span class="sourceLineNo">2640</span>  public ZooKeeperWatcher getZooKeeper() {<a name="line.2640"></a>
-<span class="sourceLineNo">2641</span>    return zooKeeper;<a name="line.2641"></a>
-<span class="sourceLineNo">2642</span>  }<a name="line.2642"></a>
-<span class="sourceLineNo">2643</span><a name="line.2643"></a>
-<span class="sourceLineNo">2644</span>  @Override<a name="line.2644"></a>
-<span class="sourceLineNo">2645</span>  public MasterCoprocessorHost getMasterCoprocessorHost() {<a name="line.2645"></a>
-<span class="sourceLineNo">2646</span>    return cpHost;<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>  @Override<a name="line.2649"></a>
-<span class="sourceLineNo">2650</span>  public MasterQuotaManager getMasterQuotaManager() {<a name="line.2650"></a>
-<span class="sourceLineNo">2651</span>    return quotaManager;<a name="line.2651"></a>
-<span class="sourceLineNo">2652</span>  }<a name="line.2652"></a>
-<span class="sourceLineNo">2653</span><a name="line.2653"></a>
-<span class="sourceLineNo">2654</span>  @Override<a name="line.2654"></a>
-<span class="sourceLineNo">2655</span>  public ProcedureExecutor&lt;MasterProcedureEnv&gt; getMasterProcedureExecutor() {<a name="line.2655"></a>
-<span class="sourceLineNo">2656</span>    return procedureExecutor;<a name="line.2656"></a>
-<span class="sourceLineNo">2657</span>  }<a name="line.2657"></a>
-<span class="sourceLineNo">2658</span><a name="line.2658"></a>
-<span class="sourceLineNo">2659</span>  @Override<a name="line.2659"></a>
-<span class="sourceLineNo">2660</span>  public ServerName getServerName() {<a name="line.2660"></a>
-<span class="sourceLineNo">2661</span>    return this.serverName;<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>  @Override<a name="line.2664"></a>
-<span class="sourceLineNo">2665</span>  public AssignmentManager getAssignmentManager() {<a name="line.2665"></a>
-<span class="sourceLineNo">2666</span>    return this.assignmentManager;<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>  @Override<a name="line.2669"></a>
-<span class="sourceLineNo">2670</span>  public CatalogJanitor getCatalogJanitor() {<a name="line.2670"></a>
-<span class="sourceLineNo">2671</span>    return this.catalogJanitorChore;<a name="line.2671"></a>
-<span class="sourceLineNo">2672</span>  }<a name="line.2672"></a>
-<span class="sourceLineNo">2673</span><a name="line.2673"></a>
-<span class="sourceLineNo">2674</span>  public MemoryBoundedLogMessageBuffer getRegionServerFatalLogBuffer() {<a name="line.2674"></a>
-<span class="sourceLineNo">2675</span>    return rsFatals;<a name="line.2675"></a>
-<span class="sourceLineNo">2676</span>  }<a name="line.2676"></a>
-<span class="sourceLineNo">2677</span><a name="line.2677"></a>
-<span class="sourceLineNo">2678</span>  public void shutdown() throws IOException {<a name="line.2678"></a>
-<span class="sourceLineNo">2679</span>    if (cpHost != null) {<a name="line.2679"></a>
-<span class="sourceLineNo">2680</span>      cpHost.preShutdown();<a name="line.2680"></a>
-<span class="sourceLineNo">2681</span>    }<a name="line.2681"></a>
-<span class="sourceLineNo">2682</span><a name="line.2682"></a>
-<span class="sourceLineNo">2683</span>    if (this.serverManager != null) {<a name="line.2683"></a>
-<span class="sourceLineNo">2684</span>      this.serverManager.shutdownCluster();<a name="line.2684"></a>
-<span class="sourceLineNo">2685</span>    }<a name="line.2685"></a>
-<span class="sourceLineNo">2686</span>    if (this.clusterStatusTracker != null){<a name="line.2686"></a>
-<span class="sourceLineNo">2687</span>      try {<a name="line.2687"></a>
-<span class="sourceLineNo">2688</span>        this.clusterStatusTracker.setClusterDown();<a name="line.2688"></a>
-<span class="sourceLineNo">2689</span>      } catch (KeeperException e) {<a name="line.2689"></a>
-<span class="sourceLineNo">2690</span>        LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);<a name="line.2690"></a>
-<span class="sourceLineNo">2691</span>      }<a name="line.2691"></a>
-<span class="sourceLineNo">2692</span>    }<a name="line.2692"></a>
-<span class="sourceLineNo">2693</span>  }<a name="line.2693"></a>
-<span class="sourceLineNo">2694</span><a name="line.2694"></a>
-<span class="sourceLineNo">2695</span>  public void stopMaster() throws IOException {<a name="line.2695"></a>
-<span class="sourceLineNo">2696</span>    if (cpHost != null) {<a name="line.2696"></a>
-<span class="sourceLineNo">2697</span>      cpHost.preStopMaster();<a name="line.2697"></a>
-<span class="sourceLineNo">2698</span>    }<a name="line.2698"></a>
-<span class="sourceLineNo">2699</span>    stop("Stopped by " + Thread.currentThread().getName());<a name="line.2699"></a>
-<span class="sourceLineNo">2700</span>  }<a name="line.2700"></a>
-<span class="sourceLineNo">2701</span><a name="line.2701"></a>
-<span class="sourceLineNo">2702</span>  void checkServiceStarted() throws ServerNotRunningYetException {<a name="line.2702"></a>
-<span class="sourceLineNo">2703</span>    if (!serviceStarted) {<a name="line.2703"></a>
-<span class="sourceLineNo">2704</span>      throw new ServerNotRunningYetException("Server is not running yet");<a name="line.2704"></a>
-<span class="sourceLineNo">2705</span>    }<a name="line.2705"></a>
-<span class="sourceLineNo">2706</span>  }<a name="line.2706"></a>
-<span class="sourceLineNo">2707</span><a name="line.2707"></a>
-<span class="sourceLineNo">2708</span>  void checkInitialized()<a name="line.2708"></a>
-<span class="sourceLineNo">2709</span>      throws PleaseHoldException, ServerNotRunningYetException, MasterNotRunningException {<a name="line.2709"></a>
-<span class="sourceLineNo">2710</span>    checkServiceStarted();<a name="line.2710"></a>
-<span class="sourceLineNo">2711</span>    if (!isInitialized()) throw new PleaseHoldException("Master is initializing");<a name="line.2711"></a>
-<span class="sourceLineNo">2712</span>    if (isStopped()) throw new MasterNotRunningException();<a name="line.2712"></a>
-<span class="sourceLineNo">2713</span>  }<a name="line.2713"></a>
-<span class="sourceLineNo">2714</span><a name="line.2714"></a>
-<span class="sourceLineNo">2715</span>  /**<a name="line.2715"></a>
-<span class="sourceLineNo">2716</span>   * Report whether this master is currently the active master or not.<a name="line.2716"></a>
-<span class="sourceLineNo">2717</span>   * If not active master, we are parked on ZK waiting to become active.<a name="line.2717"></a>
-<span class="sourceLineNo">2718</span>   *<a name="line.2718"></a>
-<span class="sourceLineNo">2719</span>   * This method is used for testing.<a name="line.2719"></a>
-<span class="sourceLineNo">2720</span>   *<a name="line.2720"></a>
-<span class="sourceLineNo">2721</span>   * @return true if active master, false if not.<a name="line.2721"></a>
-<span class="sourceLineNo">2722</span>   */<a name="line.2722"></a>
-<span class="sourceLineNo">2723</span>  @Override<a name="line.2723"></a>
-<span class="sourceLineNo">2724</span>  public boolean isActiveMaster() {<a name="line.2724"></a>
-<span class="sourceLineNo">2725</span>    return activeMaster;<a name="line.2725"></a>
-<span class="sourceLineNo">2726</span>  }<a name="line.2726"></a>
-<span class="sourceLineNo">2727</span><a name="line.2727"></a>
-<span class="sourceLineNo">2728</span>  /**<a name="line.2728"></a>
-<span class="sourceLineNo">2729</span>   * Report whether this master has completed with its initialization and is<a name="line.2729"></a>
-<span class="sourceLineNo">2730</span>   * ready.  If ready, the master is also the active master.  A standby master<a name="line.2730"></a>
-<span class="sourceLineNo">2731</span>   * is never ready.<a name="line.2731"></a>
-<span class="sourceLineNo">2732</span>   *<a name="line.2732"></a>
-<span class="sourceLineNo">2733</span>   * This method is used for testing.<a name="line.2733"></a>
-<span class="sourceLineNo">2734</span>   *<a name="line.2734"></a>
-<span class="sourceLineNo">2735</span>   * @return true if master is ready to go, false if not.<a name="line.2735"></a>
-<span class="sourceLineNo">2736</span>   */<a name="line.2736"></a>
-<span class="sourceLineNo">2737</span>  @Override<a name="line.2737"></a>
-<span class="sourceLineNo">2738</span>  public boolean isInitialized() {<a name="line.2738"></a>
-<span class="sourceLineNo">2739</span>    return initialized.isReady();<a name="line.2739"></a>
-<span class="sourceLineNo">2740</span>  }<a name="line.2740"></a>
-<span class="sourceLineNo">2741</span><a name="line.2741"></a>
-<span class="sourceLineNo">2742</span>  /**<a name="line.2742"></a>
-<span class="sourceLineNo">2743</span>   * Report whether this master is in maintenance mode.<a name="line.2743"></a>
-<span class="sourceLineNo">2744</span>   *<a name="line.2744"></a>
-<span class="sourceLineNo">2745</span>   * @return true if master is in maintenanceMode<a name="line.2745"></a>
-<span class="sourceLineNo">2746</span>   */<a name="line.2746"></a>
-<span class="sourceLineNo">2747</span>  @Override<a name="line.2747"></a>
-<span class="sourceLineNo">2748</span>  public boolean isInMaintenanceMode() {<a name="line.2748"></a>
-<span class="sourceLineNo">2749</span>    return maintenanceModeTracker.isInMaintenanceMode();<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>  @VisibleForTesting<a name="line.2752"></a>
-<span class="sourceLineNo">2753</span>  public void setInitialized(boolean isInitialized) {<a name="line.2753"></a>
-<span class="sourceLineNo">2754</span>    procedureExecutor.getEnvironment().setEventReady(initialized, isInitialized);<a name="line.2754"></a>
-<span class="sourceLineNo">2755</span>  }<a name="line.2755"></a>
-<span class="sourceLineNo">2756</span><a name="line.2756"></a>
-<span class="sourceLineNo">2757</span>  @Override<a name="line.2757"></a>
-<span class="sourceLineNo">2758</span>  public ProcedureEvent getInitializedEvent() {<a name="line.2758"></a>
-<span class="sourceLineNo">2759</span>    return initialized;<a name="line.2759"></a>
-<span class="sourceLineNo">2760</span>  }<a name="line.2760"></a>
-<span class="sourceLineNo">2761</span><a name="line.2761"></a>
-<span class="sourceLineNo">2762</span>  /**<a name="line.2762"></a>
-<span class="sourceLineNo">2763</span>   * ServerCrashProcessingEnabled is set false before completing assignMeta to prevent processing<a name="line.2763"></a>
-<span class="sourceLineNo">2764</span>   * of crashed servers.<a name="line.2764"></a>
-<span class="sourceLineNo">2765</span>   * @return true if assignMeta has completed;<a name="line.2765"></a>
-<span class="sourceLineNo">2766</span>   */<a name="line.2766"></a>
-<span class="sourceLineNo">2767</span>  @Override<a name="line.2767"></a>
-<span class="sourceLineNo">2768</span>  public boolean isServerCrashProcessingEnabled() {<a name="line.2768"></a>
-<span class="sourceLineNo">2769</span>    return serverCrashProcessingEnabled.isReady();<a name="line.2769"></a>
-<span class="sourceLineNo">2770</span>  }<a name="line.2770"></a>
-<span class="sourceLineNo">2771</span><a name="line.2771"></a>
-<span class="sourceLineNo">2772</span>  @VisibleForTesting<a name="line.2772"></a>
-<span class="sourceLineNo">2773</span>  public void setServerCrashProcessingEnabled(final boolean b) {<a name="line.2773"></a>
-<span class="sourceLineNo">2774</span>    procedureExecutor.getEnvironment().setEventReady(serverCrashProcessingEnabled, b);<a name="line.2774"></a>
-<span class="sourceLineNo">2775</span>  }<a name="line.2775"></a>
-<span class="sourceLineNo">2776</span><a name="line.2776"></a>
-<span class="sourceLineNo">2777</span>  public ProcedureEvent getServerCrashProcessingEnabledEvent() {<a name="line.2777"></a>
-<span class="sourceLineNo">2778</span>    return serverCrashProcessingEnabled;<a name="line.2778"></a>
-<span class="sourceLineNo">2779</span>  }<a name="line.2779"></a>
-<span class="sourceLineNo">2780</span><a name="line.2780"></a>
-<span class="sourceLineNo">2781</span>  /**<a name="line.2781"></a>
-<span class="sourceLineNo">2782</span>   * Compute the average load across all region servers.<a name="line.2782"></a>
-<span class="sourceLineNo">2783</span>   * Currently, this uses a very naive computation - just uses the number of<a name="line.2783"></a>
-<span class="sourceLineNo">2784</span>   * regions being served, ignoring stats about number of requests.<a name="line.2784"></a>
-<span class="sourceLineNo">2785</span>   * @return the average load<a name="line.2785"></a>
-<span class="sourceLineNo">2786</span>   */<a name="line.2786"></a>
-<span class="sourceLineNo">2787</span>  public double getAverageLoad() {<a name="line.2787"></a>
-<span class="sourceLineNo">2788</span>    if (this.assignmentManager == null) {<a name="line.2788"></a>
-<span class="sourceLineNo">2789</span>      return 0;<a name="line.2789"></a>
-<span class="sourceLineNo">2790</span>    }<a name="line.2790"></a>
-<span class="sourceLineNo">2791</span><a name="line.2791"></a>
-<span class="sourceLineNo">2792</span>    RegionStates regionStates = this.assignmentManager.getRegionStates();<a name="line.2792"></a>
-<span class="sourceLineNo">2793</span>    if (regionStates == null) {<a name="line.2793"></a>
-<span class="sourceLineNo">2794</span>      return 0;<a name="line.2794"></a>
-<span class="sourceLineNo">2795</span>    }<a name="line.2795"></a>
-<span class="sourceLineNo">2796</span>    return regionStates.getAverageLoad();<a name="line.2796"></a>
-<span class="sourceLineNo">2797</span>  }<a name="line.2797"></a>
-<span class="sourceLineNo">2798</span><a name="line.2798"></a>
-<span class="sourceLineNo">2799</span>  /*<a name="line.2799"></a>
-<span class="sourceLineNo">2800</span>   * @return the count of region split plans executed<a name="line.2800"></a>
-<span class="sourceLineNo">2801</span>   */<a name="line.2801"></a>
-<span class="sourceLineNo">2802</span>  public long getSplitPlanCount() {<a name="line.2802"></a>
-<span class="sourceLineNo">2803</span>    return splitPlanCount;<a name="line.2803"></a>
-<span class="sourceLineNo">2804</span>  }<a name="line.2804"></a>
-<span class="sourceLineNo">2805</span><a name="line.2805"></a>
-<span class="sourceLineNo">2806</span>  /*<a name="line.2806"></a>
-<span class="sourceLineNo">2807</span>   * @return the count of region merge plans executed<a name="line.2807"></a>
-<span class="sourceLineNo">2808</span>   */<a name="line.2808"></a>
-<span class="sourceLineNo">2809</span>  public long getMergePlanCount() {<a name="line.2809"></a>
-<span class="sourceLineNo">2810</span>    return mergePlanCount;<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>  public boolean registerService(Service instance) {<a name="line.2814"></a>
-<span class="sourceLineNo">2815</span>    /*<a name="line.2815"></a>
-<span class="sourceLineNo">2816</span>     * No stacking of instances is allowed for a single service name<a name="line.2816"></a>
-<span class="sourceLineNo">2817</span>     */<a name="line.2817"></a>
-<span class="sourceLineNo">2818</span>    Descriptors.ServiceDescriptor serviceDesc = instance.getDescriptorForType();<a name="line.2818"></a>
-<span class="sourceLineNo">2819</span>    String serviceName = CoprocessorRpcUtils.getServiceName(serviceDesc);<a name="line.2819"></a>
-<span class="sourceLineNo">2820</span>    if (coprocessorServiceHandlers.containsKey(serviceName)) {<a name="line.2820"></a>
-<span class="sourceLineNo">2821</span>      LOG.error("Coprocessor service "+serviceName+<a name="line.2821

<TRUNCATED>

Mime
View raw message