hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r1711891 [25/50] - in /hbase/hbase.apache.org/trunk: ./ apidocs/ apidocs/org/apache/hadoop/hbase/ apidocs/org/apache/hadoop/hbase/class-use/ apidocs/org/apache/hadoop/hbase/client/ apidocs/org/apache/hadoop/hbase/client/class-use/ apidocs/o...
Date Mon, 02 Nov 2015 03:51:05 GMT
Modified: hbase/hbase.apache.org/trunk/devapidocs/src-html/org/apache/hadoop/hbase/client/HBaseAdmin.TableFuture.TableWaitForStateCallable.html
URL: http://svn.apache.org/viewvc/hbase/hbase.apache.org/trunk/devapidocs/src-html/org/apache/hadoop/hbase/client/HBaseAdmin.TableFuture.TableWaitForStateCallable.html?rev=1711891&r1=1711890&r2=1711891&view=diff
==============================================================================
--- hbase/hbase.apache.org/trunk/devapidocs/src-html/org/apache/hadoop/hbase/client/HBaseAdmin.TableFuture.TableWaitForStateCallable.html (original)
+++ hbase/hbase.apache.org/trunk/devapidocs/src-html/org/apache/hadoop/hbase/client/HBaseAdmin.TableFuture.TableWaitForStateCallable.html Mon Nov  2 03:51:02 2015
@@ -2099,2804 +2099,2806 @@
 <span class="sourceLineNo">2091</span>        compact(master, getMobRegionInfo(tableName), major, columnFamily);<a name="line.2091"></a>
 <span class="sourceLineNo">2092</span>        break;<a name="line.2092"></a>
 <span class="sourceLineNo">2093</span>      case NORMAL:<a name="line.2093"></a>
-<span class="sourceLineNo">2094</span>        ZooKeeperWatcher zookeeper = null;<a name="line.2094"></a>
-<span class="sourceLineNo">2095</span>        try {<a name="line.2095"></a>
-<span class="sourceLineNo">2096</span>          checkTableExists(tableName);<a name="line.2096"></a>
-<span class="sourceLineNo">2097</span>          zookeeper = new ZooKeeperWatcher(conf, ZK_IDENTIFIER_PREFIX + connection.toString(),<a name="line.2097"></a>
-<span class="sourceLineNo">2098</span>                  new ThrowableAbortable());<a name="line.2098"></a>
-<span class="sourceLineNo">2099</span>          List&lt;Pair&lt;HRegionInfo, ServerName&gt;&gt; pairs;<a name="line.2099"></a>
-<span class="sourceLineNo">2100</span>          if (TableName.META_TABLE_NAME.equals(tableName)) {<a name="line.2100"></a>
-<span class="sourceLineNo">2101</span>            pairs = new MetaTableLocator().getMetaRegionsAndLocations(zookeeper);<a name="line.2101"></a>
-<span class="sourceLineNo">2102</span>          } else {<a name="line.2102"></a>
-<span class="sourceLineNo">2103</span>            pairs = MetaTableAccessor.getTableRegionsAndLocations(connection, tableName);<a name="line.2103"></a>
-<span class="sourceLineNo">2104</span>          }<a name="line.2104"></a>
-<span class="sourceLineNo">2105</span>          for (Pair&lt;HRegionInfo, ServerName&gt; pair: pairs) {<a name="line.2105"></a>
-<span class="sourceLineNo">2106</span>            if (pair.getFirst().isOffline()) continue;<a name="line.2106"></a>
-<span class="sourceLineNo">2107</span>            if (pair.getSecond() == null) continue;<a name="line.2107"></a>
-<span class="sourceLineNo">2108</span>            try {<a name="line.2108"></a>
-<span class="sourceLineNo">2109</span>              compact(pair.getSecond(), pair.getFirst(), major, columnFamily);<a name="line.2109"></a>
-<span class="sourceLineNo">2110</span>            } catch (NotServingRegionException e) {<a name="line.2110"></a>
-<span class="sourceLineNo">2111</span>              if (LOG.isDebugEnabled()) {<a name="line.2111"></a>
-<span class="sourceLineNo">2112</span>                LOG.debug("Trying to" + (major ? " major" : "") + " compact " +<a name="line.2112"></a>
-<span class="sourceLineNo">2113</span>                        pair.getFirst() + ": " +<a name="line.2113"></a>
-<span class="sourceLineNo">2114</span>                        StringUtils.stringifyException(e));<a name="line.2114"></a>
-<span class="sourceLineNo">2115</span>              }<a name="line.2115"></a>
-<span class="sourceLineNo">2116</span>            }<a name="line.2116"></a>
-<span class="sourceLineNo">2117</span>          }<a name="line.2117"></a>
-<span class="sourceLineNo">2118</span>        } finally {<a name="line.2118"></a>
-<span class="sourceLineNo">2119</span>          if (zookeeper != null) {<a name="line.2119"></a>
-<span class="sourceLineNo">2120</span>            zookeeper.close();<a name="line.2120"></a>
-<span class="sourceLineNo">2121</span>          }<a name="line.2121"></a>
-<span class="sourceLineNo">2122</span>        }<a name="line.2122"></a>
-<span class="sourceLineNo">2123</span>        break;<a name="line.2123"></a>
-<span class="sourceLineNo">2124</span>    }<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>   * Compact an individual region.<a name="line.2128"></a>
-<span class="sourceLineNo">2129</span>   * Asynchronous operation.<a name="line.2129"></a>
-<span class="sourceLineNo">2130</span>   *<a name="line.2130"></a>
-<span class="sourceLineNo">2131</span>   * @param regionName region to compact<a name="line.2131"></a>
-<span class="sourceLineNo">2132</span>   * @param columnFamily column family within a table or region<a name="line.2132"></a>
-<span class="sourceLineNo">2133</span>   * @param major True if we are to do a major compaction.<a name="line.2133"></a>
-<span class="sourceLineNo">2134</span>   * @throws IOException if a remote or network exception occurs<a name="line.2134"></a>
-<span class="sourceLineNo">2135</span>   * @throws InterruptedException<a name="line.2135"></a>
-<span class="sourceLineNo">2136</span>   */<a name="line.2136"></a>
-<span class="sourceLineNo">2137</span>  private void compactRegion(final byte[] regionName, final byte[] columnFamily,final boolean major)<a name="line.2137"></a>
-<span class="sourceLineNo">2138</span>  throws IOException {<a name="line.2138"></a>
-<span class="sourceLineNo">2139</span>    Pair&lt;HRegionInfo, ServerName&gt; regionServerPair = getRegion(regionName);<a name="line.2139"></a>
-<span class="sourceLineNo">2140</span>    if (regionServerPair == null) {<a name="line.2140"></a>
-<span class="sourceLineNo">2141</span>      throw new IllegalArgumentException("Invalid region: " + Bytes.toStringBinary(regionName));<a name="line.2141"></a>
-<span class="sourceLineNo">2142</span>    }<a name="line.2142"></a>
-<span class="sourceLineNo">2143</span>    if (regionServerPair.getSecond() == null) {<a name="line.2143"></a>
-<span class="sourceLineNo">2144</span>      throw new NoServerForRegionException(Bytes.toStringBinary(regionName));<a name="line.2144"></a>
-<span class="sourceLineNo">2145</span>    }<a name="line.2145"></a>
-<span class="sourceLineNo">2146</span>    compact(regionServerPair.getSecond(), regionServerPair.getFirst(), major, columnFamily);<a name="line.2146"></a>
-<span class="sourceLineNo">2147</span>  }<a name="line.2147"></a>
-<span class="sourceLineNo">2148</span><a name="line.2148"></a>
-<span class="sourceLineNo">2149</span>  private void compact(final ServerName sn, final HRegionInfo hri,<a name="line.2149"></a>
-<span class="sourceLineNo">2150</span>      final boolean major, final byte [] family)<a name="line.2150"></a>
-<span class="sourceLineNo">2151</span>  throws IOException {<a name="line.2151"></a>
-<span class="sourceLineNo">2152</span>    AdminService.BlockingInterface admin = this.connection.getAdmin(sn);<a name="line.2152"></a>
-<span class="sourceLineNo">2153</span>    CompactRegionRequest request =<a name="line.2153"></a>
-<span class="sourceLineNo">2154</span>      RequestConverter.buildCompactRegionRequest(hri.getRegionName(), major, family);<a name="line.2154"></a>
-<span class="sourceLineNo">2155</span>    try {<a name="line.2155"></a>
-<span class="sourceLineNo">2156</span>      admin.compactRegion(null, request);<a name="line.2156"></a>
-<span class="sourceLineNo">2157</span>    } catch (ServiceException se) {<a name="line.2157"></a>
-<span class="sourceLineNo">2158</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2158"></a>
-<span class="sourceLineNo">2159</span>    }<a name="line.2159"></a>
-<span class="sourceLineNo">2160</span>  }<a name="line.2160"></a>
-<span class="sourceLineNo">2161</span><a name="line.2161"></a>
-<span class="sourceLineNo">2162</span>  /**<a name="line.2162"></a>
-<span class="sourceLineNo">2163</span>   * Move the region &lt;code&gt;r&lt;/code&gt; to &lt;code&gt;dest&lt;/code&gt;.<a name="line.2163"></a>
-<span class="sourceLineNo">2164</span>   * @param encodedRegionName The encoded region name; i.e. the hash that makes<a name="line.2164"></a>
-<span class="sourceLineNo">2165</span>   * up the region name suffix: e.g. if regionname is<a name="line.2165"></a>
-<span class="sourceLineNo">2166</span>   * &lt;code&gt;TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.&lt;/code&gt;,<a name="line.2166"></a>
-<span class="sourceLineNo">2167</span>   * then the encoded region name is: &lt;code&gt;527db22f95c8a9e0116f0cc13c680396&lt;/code&gt;.<a name="line.2167"></a>
-<span class="sourceLineNo">2168</span>   * @param destServerName The servername of the destination regionserver.  If<a name="line.2168"></a>
-<span class="sourceLineNo">2169</span>   * passed the empty byte array we'll assign to a random server.  A server name<a name="line.2169"></a>
-<span class="sourceLineNo">2170</span>   * is made of host, port and startcode.  Here is an example:<a name="line.2170"></a>
-<span class="sourceLineNo">2171</span>   * &lt;code&gt; host187.example.com,60020,1289493121758&lt;/code&gt;<a name="line.2171"></a>
-<span class="sourceLineNo">2172</span>   * @throws UnknownRegionException Thrown if we can't find a region named<a name="line.2172"></a>
-<span class="sourceLineNo">2173</span>   * &lt;code&gt;encodedRegionName&lt;/code&gt;<a name="line.2173"></a>
-<span class="sourceLineNo">2174</span>   */<a name="line.2174"></a>
-<span class="sourceLineNo">2175</span>  @Override<a name="line.2175"></a>
-<span class="sourceLineNo">2176</span>  public void move(final byte [] encodedRegionName, final byte [] destServerName)<a name="line.2176"></a>
-<span class="sourceLineNo">2177</span>      throws IOException {<a name="line.2177"></a>
-<span class="sourceLineNo">2178</span><a name="line.2178"></a>
-<span class="sourceLineNo">2179</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2179"></a>
-<span class="sourceLineNo">2180</span>      @Override<a name="line.2180"></a>
-<span class="sourceLineNo">2181</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2181"></a>
-<span class="sourceLineNo">2182</span>        try {<a name="line.2182"></a>
-<span class="sourceLineNo">2183</span>          MoveRegionRequest request =<a name="line.2183"></a>
-<span class="sourceLineNo">2184</span>              RequestConverter.buildMoveRegionRequest(encodedRegionName, destServerName);<a name="line.2184"></a>
-<span class="sourceLineNo">2185</span>            master.moveRegion(null, request);<a name="line.2185"></a>
-<span class="sourceLineNo">2186</span>        } catch (DeserializationException de) {<a name="line.2186"></a>
-<span class="sourceLineNo">2187</span>          LOG.error("Could not parse destination server name: " + de);<a name="line.2187"></a>
-<span class="sourceLineNo">2188</span>          throw new ServiceException(new DoNotRetryIOException(de));<a name="line.2188"></a>
-<span class="sourceLineNo">2189</span>        }<a name="line.2189"></a>
-<span class="sourceLineNo">2190</span>        return null;<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>  /**<a name="line.2195"></a>
-<span class="sourceLineNo">2196</span>   * @param regionName<a name="line.2196"></a>
-<span class="sourceLineNo">2197</span>   *          Region name to assign.<a name="line.2197"></a>
-<span class="sourceLineNo">2198</span>   * @throws MasterNotRunningException<a name="line.2198"></a>
-<span class="sourceLineNo">2199</span>   * @throws ZooKeeperConnectionException<a name="line.2199"></a>
-<span class="sourceLineNo">2200</span>   * @throws IOException<a name="line.2200"></a>
-<span class="sourceLineNo">2201</span>   */<a name="line.2201"></a>
-<span class="sourceLineNo">2202</span>  @Override<a name="line.2202"></a>
-<span class="sourceLineNo">2203</span>  public void assign(final byte[] regionName) throws MasterNotRunningException,<a name="line.2203"></a>
-<span class="sourceLineNo">2204</span>      ZooKeeperConnectionException, IOException {<a name="line.2204"></a>
-<span class="sourceLineNo">2205</span>    final byte[] toBeAssigned = getRegionName(regionName);<a name="line.2205"></a>
-<span class="sourceLineNo">2206</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2206"></a>
-<span class="sourceLineNo">2207</span>      @Override<a name="line.2207"></a>
-<span class="sourceLineNo">2208</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2208"></a>
-<span class="sourceLineNo">2209</span>        AssignRegionRequest request =<a name="line.2209"></a>
-<span class="sourceLineNo">2210</span>          RequestConverter.buildAssignRegionRequest(toBeAssigned);<a name="line.2210"></a>
-<span class="sourceLineNo">2211</span>        master.assignRegion(null,request);<a name="line.2211"></a>
-<span class="sourceLineNo">2212</span>        return null;<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>  }<a name="line.2215"></a>
-<span class="sourceLineNo">2216</span><a name="line.2216"></a>
-<span class="sourceLineNo">2217</span>  /**<a name="line.2217"></a>
-<span class="sourceLineNo">2218</span>   * Unassign a region from current hosting regionserver.  Region will then be<a name="line.2218"></a>
-<span class="sourceLineNo">2219</span>   * assigned to a regionserver chosen at random.  Region could be reassigned<a name="line.2219"></a>
-<span class="sourceLineNo">2220</span>   * back to the same server.  Use {@link #move(byte[], byte[])} if you want<a name="line.2220"></a>
-<span class="sourceLineNo">2221</span>   * to control the region movement.<a name="line.2221"></a>
-<span class="sourceLineNo">2222</span>   * @param regionName Region to unassign. Will clear any existing RegionPlan<a name="line.2222"></a>
-<span class="sourceLineNo">2223</span>   * if one found.<a name="line.2223"></a>
-<span class="sourceLineNo">2224</span>   * @param force If true, force unassign (Will remove region from<a name="line.2224"></a>
-<span class="sourceLineNo">2225</span>   * regions-in-transition too if present. If results in double assignment<a name="line.2225"></a>
-<span class="sourceLineNo">2226</span>   * use hbck -fix to resolve. To be used by experts).<a name="line.2226"></a>
-<span class="sourceLineNo">2227</span>   * @throws MasterNotRunningException<a name="line.2227"></a>
-<span class="sourceLineNo">2228</span>   * @throws ZooKeeperConnectionException<a name="line.2228"></a>
-<span class="sourceLineNo">2229</span>   * @throws IOException<a name="line.2229"></a>
-<span class="sourceLineNo">2230</span>   */<a name="line.2230"></a>
-<span class="sourceLineNo">2231</span>  @Override<a name="line.2231"></a>
-<span class="sourceLineNo">2232</span>  public void unassign(final byte [] regionName, final boolean force)<a name="line.2232"></a>
-<span class="sourceLineNo">2233</span>  throws MasterNotRunningException, ZooKeeperConnectionException, IOException {<a name="line.2233"></a>
-<span class="sourceLineNo">2234</span>    final byte[] toBeUnassigned = getRegionName(regionName);<a name="line.2234"></a>
-<span class="sourceLineNo">2235</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2235"></a>
-<span class="sourceLineNo">2236</span>      @Override<a name="line.2236"></a>
-<span class="sourceLineNo">2237</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2237"></a>
-<span class="sourceLineNo">2238</span>        UnassignRegionRequest request =<a name="line.2238"></a>
-<span class="sourceLineNo">2239</span>          RequestConverter.buildUnassignRegionRequest(toBeUnassigned, force);<a name="line.2239"></a>
-<span class="sourceLineNo">2240</span>        master.unassignRegion(null, request);<a name="line.2240"></a>
-<span class="sourceLineNo">2241</span>        return null;<a name="line.2241"></a>
-<span class="sourceLineNo">2242</span>      }<a name="line.2242"></a>
-<span class="sourceLineNo">2243</span>    });<a name="line.2243"></a>
-<span class="sourceLineNo">2244</span>  }<a name="line.2244"></a>
-<span class="sourceLineNo">2245</span><a name="line.2245"></a>
-<span class="sourceLineNo">2246</span>  /**<a name="line.2246"></a>
-<span class="sourceLineNo">2247</span>   * Offline specified region from master's in-memory state. It will not attempt to reassign the<a name="line.2247"></a>
-<span class="sourceLineNo">2248</span>   * region as in unassign. This API can be used when a region not served by any region server and<a name="line.2248"></a>
-<span class="sourceLineNo">2249</span>   * still online as per Master's in memory state. If this API is incorrectly used on active region<a name="line.2249"></a>
-<span class="sourceLineNo">2250</span>   * then master will loose track of that region.<a name="line.2250"></a>
-<span class="sourceLineNo">2251</span>   *<a name="line.2251"></a>
-<span class="sourceLineNo">2252</span>   * This is a special method that should be used by experts or hbck.<a name="line.2252"></a>
-<span class="sourceLineNo">2253</span>   *<a name="line.2253"></a>
-<span class="sourceLineNo">2254</span>   * @param regionName<a name="line.2254"></a>
-<span class="sourceLineNo">2255</span>   *          Region to offline.<a name="line.2255"></a>
-<span class="sourceLineNo">2256</span>   * @throws IOException<a name="line.2256"></a>
-<span class="sourceLineNo">2257</span>   */<a name="line.2257"></a>
-<span class="sourceLineNo">2258</span>  @Override<a name="line.2258"></a>
-<span class="sourceLineNo">2259</span>  public void offline(final byte [] regionName)<a name="line.2259"></a>
-<span class="sourceLineNo">2260</span>  throws IOException {<a name="line.2260"></a>
-<span class="sourceLineNo">2261</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2261"></a>
-<span class="sourceLineNo">2262</span>      @Override<a name="line.2262"></a>
-<span class="sourceLineNo">2263</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2263"></a>
-<span class="sourceLineNo">2264</span>        master.offlineRegion(null,RequestConverter.buildOfflineRegionRequest(regionName));<a name="line.2264"></a>
-<span class="sourceLineNo">2265</span>        return null;<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><a name="line.2269"></a>
-<span class="sourceLineNo">2270</span>  /**<a name="line.2270"></a>
-<span class="sourceLineNo">2271</span>   * Turn the load balancer on or off.<a name="line.2271"></a>
-<span class="sourceLineNo">2272</span>   * @param on If true, enable balancer. If false, disable balancer.<a name="line.2272"></a>
-<span class="sourceLineNo">2273</span>   * @param synchronous If true, it waits until current balance() call, if outstanding, to return.<a name="line.2273"></a>
-<span class="sourceLineNo">2274</span>   * @return Previous balancer value<a name="line.2274"></a>
-<span class="sourceLineNo">2275</span>   */<a name="line.2275"></a>
-<span class="sourceLineNo">2276</span>  @Override<a name="line.2276"></a>
-<span class="sourceLineNo">2277</span>  public boolean setBalancerRunning(final boolean on, final boolean synchronous)<a name="line.2277"></a>
-<span class="sourceLineNo">2278</span>  throws IOException {<a name="line.2278"></a>
-<span class="sourceLineNo">2279</span>    return executeCallable(new MasterCallable&lt;Boolean&gt;(getConnection()) {<a name="line.2279"></a>
-<span class="sourceLineNo">2280</span>      @Override<a name="line.2280"></a>
-<span class="sourceLineNo">2281</span>      public Boolean call(int callTimeout) throws ServiceException {<a name="line.2281"></a>
-<span class="sourceLineNo">2282</span>        SetBalancerRunningRequest req =<a name="line.2282"></a>
-<span class="sourceLineNo">2283</span>            RequestConverter.buildSetBalancerRunningRequest(on, synchronous);<a name="line.2283"></a>
-<span class="sourceLineNo">2284</span>        return master.setBalancerRunning(null, req).getPrevBalanceValue();<a name="line.2284"></a>
-<span class="sourceLineNo">2285</span>      }<a name="line.2285"></a>
-<span class="sourceLineNo">2286</span>    });<a name="line.2286"></a>
-<span class="sourceLineNo">2287</span>  }<a name="line.2287"></a>
-<span class="sourceLineNo">2288</span><a name="line.2288"></a>
-<span class="sourceLineNo">2289</span>  /**<a name="line.2289"></a>
-<span class="sourceLineNo">2290</span>   * Invoke the balancer.  Will run the balancer and if regions to move, it will<a name="line.2290"></a>
-<span class="sourceLineNo">2291</span>   * go ahead and do the reassignments.  Can NOT run for various reasons.  Check<a name="line.2291"></a>
-<span class="sourceLineNo">2292</span>   * logs.<a name="line.2292"></a>
-<span class="sourceLineNo">2293</span>   * @return True if balancer ran, false otherwise.<a name="line.2293"></a>
-<span class="sourceLineNo">2294</span>   */<a name="line.2294"></a>
-<span class="sourceLineNo">2295</span>  @Override<a name="line.2295"></a>
-<span class="sourceLineNo">2296</span>  public boolean balancer() throws IOException {<a name="line.2296"></a>
-<span class="sourceLineNo">2297</span>    return executeCallable(new MasterCallable&lt;Boolean&gt;(getConnection()) {<a name="line.2297"></a>
-<span class="sourceLineNo">2298</span>      @Override<a name="line.2298"></a>
-<span class="sourceLineNo">2299</span>      public Boolean call(int callTimeout) throws ServiceException {<a name="line.2299"></a>
-<span class="sourceLineNo">2300</span>        return master.balance(null, RequestConverter.buildBalanceRequest(false)).getBalancerRan();<a name="line.2300"></a>
-<span class="sourceLineNo">2301</span>      }<a name="line.2301"></a>
-<span class="sourceLineNo">2302</span>    });<a name="line.2302"></a>
-<span class="sourceLineNo">2303</span>  }<a name="line.2303"></a>
-<span class="sourceLineNo">2304</span><a name="line.2304"></a>
-<span class="sourceLineNo">2305</span>  @Override<a name="line.2305"></a>
-<span class="sourceLineNo">2306</span>  public boolean balancer(final boolean force) throws IOException {<a name="line.2306"></a>
-<span class="sourceLineNo">2307</span>    return executeCallable(new MasterCallable&lt;Boolean&gt;(getConnection()) {<a name="line.2307"></a>
-<span class="sourceLineNo">2308</span>      @Override<a name="line.2308"></a>
-<span class="sourceLineNo">2309</span>      public Boolean call(int callTimeout) throws ServiceException {<a name="line.2309"></a>
-<span class="sourceLineNo">2310</span>        return master.balance(null, RequestConverter.buildBalanceRequest(force)).getBalancerRan();<a name="line.2310"></a>
-<span class="sourceLineNo">2311</span>      }<a name="line.2311"></a>
-<span class="sourceLineNo">2312</span>    });<a name="line.2312"></a>
-<span class="sourceLineNo">2313</span>  }<a name="line.2313"></a>
-<span class="sourceLineNo">2314</span><a name="line.2314"></a>
-<span class="sourceLineNo">2315</span>  /**<a name="line.2315"></a>
-<span class="sourceLineNo">2316</span>   * Query the state of the balancer from the Master. It's not a guarantee that the balancer is<a name="line.2316"></a>
-<span class="sourceLineNo">2317</span>   * actually running this very moment, but that it will run.<a name="line.2317"></a>
-<span class="sourceLineNo">2318</span>   *<a name="line.2318"></a>
-<span class="sourceLineNo">2319</span>   * @return True if the balancer is enabled, false otherwise.<a name="line.2319"></a>
-<span class="sourceLineNo">2320</span>   */<a name="line.2320"></a>
-<span class="sourceLineNo">2321</span>  @Override<a name="line.2321"></a>
-<span class="sourceLineNo">2322</span>  public boolean isBalancerEnabled() throws IOException {<a name="line.2322"></a>
-<span class="sourceLineNo">2323</span>    return executeCallable(new MasterCallable&lt;Boolean&gt;(getConnection()) {<a name="line.2323"></a>
-<span class="sourceLineNo">2324</span>      @Override<a name="line.2324"></a>
-<span class="sourceLineNo">2325</span>      public Boolean call(int callTimeout) throws ServiceException {<a name="line.2325"></a>
-<span class="sourceLineNo">2326</span>        return master.isBalancerEnabled(null, RequestConverter.buildIsBalancerEnabledRequest())<a name="line.2326"></a>
-<span class="sourceLineNo">2327</span>            .getEnabled();<a name="line.2327"></a>
-<span class="sourceLineNo">2328</span>      }<a name="line.2328"></a>
-<span class="sourceLineNo">2329</span>    });<a name="line.2329"></a>
-<span class="sourceLineNo">2330</span>  }<a name="line.2330"></a>
-<span class="sourceLineNo">2331</span><a name="line.2331"></a>
-<span class="sourceLineNo">2332</span>  /**<a name="line.2332"></a>
-<span class="sourceLineNo">2333</span>   * Invoke region normalizer. Can NOT run for various reasons.  Check logs.<a name="line.2333"></a>
-<span class="sourceLineNo">2334</span>   *<a name="line.2334"></a>
-<span class="sourceLineNo">2335</span>   * @return True if region normalizer ran, false otherwise.<a name="line.2335"></a>
-<span class="sourceLineNo">2336</span>   */<a name="line.2336"></a>
-<span class="sourceLineNo">2337</span>  @Override<a name="line.2337"></a>
-<span class="sourceLineNo">2338</span>  public boolean normalize() throws IOException {<a name="line.2338"></a>
-<span class="sourceLineNo">2339</span>    return executeCallable(new MasterCallable&lt;Boolean&gt;(getConnection()) {<a name="line.2339"></a>
-<span class="sourceLineNo">2340</span>      @Override<a name="line.2340"></a>
-<span class="sourceLineNo">2341</span>      public Boolean call(int callTimeout) throws ServiceException {<a name="line.2341"></a>
-<span class="sourceLineNo">2342</span>        return master.normalize(null,<a name="line.2342"></a>
-<span class="sourceLineNo">2343</span>          RequestConverter.buildNormalizeRequest()).getNormalizerRan();<a name="line.2343"></a>
-<span class="sourceLineNo">2344</span>      }<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>   * Query the current state of the region normalizer<a name="line.2349"></a>
-<span class="sourceLineNo">2350</span>   *<a name="line.2350"></a>
-<span class="sourceLineNo">2351</span>   * @return true if region normalizer is enabled, false otherwise.<a name="line.2351"></a>
-<span class="sourceLineNo">2352</span>   */<a name="line.2352"></a>
-<span class="sourceLineNo">2353</span>  public boolean isNormalizerEnabled() throws IOException {<a name="line.2353"></a>
-<span class="sourceLineNo">2354</span>    return executeCallable(new MasterCallable&lt;Boolean&gt;(getConnection()) {<a name="line.2354"></a>
-<span class="sourceLineNo">2355</span>      @Override<a name="line.2355"></a>
-<span class="sourceLineNo">2356</span>      public Boolean call(int callTimeout) throws ServiceException {<a name="line.2356"></a>
-<span class="sourceLineNo">2357</span>        return master.isNormalizerEnabled(null,<a name="line.2357"></a>
-<span class="sourceLineNo">2358</span>          RequestConverter.buildIsNormalizerEnabledRequest()).getEnabled();<a name="line.2358"></a>
-<span class="sourceLineNo">2359</span>      }<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><a name="line.2362"></a>
-<span class="sourceLineNo">2363</span>  /**<a name="line.2363"></a>
-<span class="sourceLineNo">2364</span>   * Turn region normalizer on or off.<a name="line.2364"></a>
-<span class="sourceLineNo">2365</span>   *<a name="line.2365"></a>
-<span class="sourceLineNo">2366</span>   * @return Previous normalizer value<a name="line.2366"></a>
-<span class="sourceLineNo">2367</span>   */<a name="line.2367"></a>
-<span class="sourceLineNo">2368</span>  public boolean setNormalizerRunning(final boolean on) throws IOException {<a name="line.2368"></a>
-<span class="sourceLineNo">2369</span>    return executeCallable(new MasterCallable&lt;Boolean&gt;(getConnection()) {<a name="line.2369"></a>
-<span class="sourceLineNo">2370</span>      @Override<a name="line.2370"></a>
-<span class="sourceLineNo">2371</span>      public Boolean call(int callTimeout) throws ServiceException {<a name="line.2371"></a>
-<span class="sourceLineNo">2372</span>        SetNormalizerRunningRequest req =<a name="line.2372"></a>
-<span class="sourceLineNo">2373</span>          RequestConverter.buildSetNormalizerRunningRequest(on);<a name="line.2373"></a>
-<span class="sourceLineNo">2374</span>        return master.setNormalizerRunning(null, req).getPrevNormalizerValue();<a name="line.2374"></a>
-<span class="sourceLineNo">2375</span>      }<a name="line.2375"></a>
-<span class="sourceLineNo">2376</span>    });<a name="line.2376"></a>
-<span class="sourceLineNo">2377</span>  }<a name="line.2377"></a>
-<span class="sourceLineNo">2378</span><a name="line.2378"></a>
-<span class="sourceLineNo">2379</span>  /**<a name="line.2379"></a>
-<span class="sourceLineNo">2380</span>   * Enable/Disable the catalog janitor<a name="line.2380"></a>
-<span class="sourceLineNo">2381</span>   * @param enable if true enables the catalog janitor<a name="line.2381"></a>
-<span class="sourceLineNo">2382</span>   * @return the previous state<a name="line.2382"></a>
-<span class="sourceLineNo">2383</span>   * @throws MasterNotRunningException<a name="line.2383"></a>
-<span class="sourceLineNo">2384</span>   */<a name="line.2384"></a>
-<span class="sourceLineNo">2385</span>  @Override<a name="line.2385"></a>
-<span class="sourceLineNo">2386</span>  public boolean enableCatalogJanitor(final boolean enable)<a name="line.2386"></a>
-<span class="sourceLineNo">2387</span>      throws IOException {<a name="line.2387"></a>
-<span class="sourceLineNo">2388</span>    return executeCallable(new MasterCallable&lt;Boolean&gt;(getConnection()) {<a name="line.2388"></a>
-<span class="sourceLineNo">2389</span>      @Override<a name="line.2389"></a>
-<span class="sourceLineNo">2390</span>      public Boolean call(int callTimeout) throws ServiceException {<a name="line.2390"></a>
-<span class="sourceLineNo">2391</span>        return master.enableCatalogJanitor(null,<a name="line.2391"></a>
-<span class="sourceLineNo">2392</span>          RequestConverter.buildEnableCatalogJanitorRequest(enable)).getPrevValue();<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><a name="line.2396"></a>
-<span class="sourceLineNo">2397</span>  /**<a name="line.2397"></a>
-<span class="sourceLineNo">2398</span>   * Ask for a scan of the catalog table<a name="line.2398"></a>
-<span class="sourceLineNo">2399</span>   * @return the number of entries cleaned<a name="line.2399"></a>
-<span class="sourceLineNo">2400</span>   * @throws MasterNotRunningException<a name="line.2400"></a>
-<span class="sourceLineNo">2401</span>   */<a name="line.2401"></a>
-<span class="sourceLineNo">2402</span>  @Override<a name="line.2402"></a>
-<span class="sourceLineNo">2403</span>  public int runCatalogScan() throws IOException {<a name="line.2403"></a>
-<span class="sourceLineNo">2404</span>    return executeCallable(new MasterCallable&lt;Integer&gt;(getConnection()) {<a name="line.2404"></a>
-<span class="sourceLineNo">2405</span>      @Override<a name="line.2405"></a>
-<span class="sourceLineNo">2406</span>      public Integer call(int callTimeout) throws ServiceException {<a name="line.2406"></a>
-<span class="sourceLineNo">2407</span>        return master.runCatalogScan(null,<a name="line.2407"></a>
-<span class="sourceLineNo">2408</span>          RequestConverter.buildCatalogScanRequest()).getScanResult();<a name="line.2408"></a>
-<span class="sourceLineNo">2409</span>      }<a name="line.2409"></a>
-<span class="sourceLineNo">2410</span>    });<a name="line.2410"></a>
-<span class="sourceLineNo">2411</span>  }<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>   * Query on the catalog janitor state (Enabled/Disabled?)<a name="line.2414"></a>
-<span class="sourceLineNo">2415</span>   * @throws org.apache.hadoop.hbase.MasterNotRunningException<a name="line.2415"></a>
-<span class="sourceLineNo">2416</span>   */<a name="line.2416"></a>
-<span class="sourceLineNo">2417</span>  @Override<a name="line.2417"></a>
-<span class="sourceLineNo">2418</span>  public boolean isCatalogJanitorEnabled() throws IOException {<a name="line.2418"></a>
-<span class="sourceLineNo">2419</span>    return executeCallable(new MasterCallable&lt;Boolean&gt;(getConnection()) {<a name="line.2419"></a>
-<span class="sourceLineNo">2420</span>      @Override<a name="line.2420"></a>
-<span class="sourceLineNo">2421</span>      public Boolean call(int callTimeout) throws ServiceException {<a name="line.2421"></a>
-<span class="sourceLineNo">2422</span>        return master.isCatalogJanitorEnabled(null,<a name="line.2422"></a>
-<span class="sourceLineNo">2423</span>          RequestConverter.buildIsCatalogJanitorEnabledRequest()).getValue();<a name="line.2423"></a>
-<span class="sourceLineNo">2424</span>      }<a name="line.2424"></a>
-<span class="sourceLineNo">2425</span>    });<a name="line.2425"></a>
-<span class="sourceLineNo">2426</span>  }<a name="line.2426"></a>
-<span class="sourceLineNo">2427</span><a name="line.2427"></a>
-<span class="sourceLineNo">2428</span>  /**<a name="line.2428"></a>
-<span class="sourceLineNo">2429</span>   * Merge two regions. Asynchronous operation.<a name="line.2429"></a>
-<span class="sourceLineNo">2430</span>   * @param encodedNameOfRegionA encoded name of region a<a name="line.2430"></a>
-<span class="sourceLineNo">2431</span>   * @param encodedNameOfRegionB encoded name of region b<a name="line.2431"></a>
-<span class="sourceLineNo">2432</span>   * @param forcible true if do a compulsory merge, otherwise we will only merge<a name="line.2432"></a>
-<span class="sourceLineNo">2433</span>   *          two adjacent regions<a name="line.2433"></a>
-<span class="sourceLineNo">2434</span>   * @throws IOException<a name="line.2434"></a>
-<span class="sourceLineNo">2435</span>   */<a name="line.2435"></a>
-<span class="sourceLineNo">2436</span>  @Override<a name="line.2436"></a>
-<span class="sourceLineNo">2437</span>  public void mergeRegions(final byte[] encodedNameOfRegionA,<a name="line.2437"></a>
-<span class="sourceLineNo">2438</span>      final byte[] encodedNameOfRegionB, final boolean forcible)<a name="line.2438"></a>
-<span class="sourceLineNo">2439</span>      throws IOException {<a name="line.2439"></a>
-<span class="sourceLineNo">2440</span>    Pair&lt;HRegionInfo, ServerName&gt; pair = getRegion(encodedNameOfRegionA);<a name="line.2440"></a>
-<span class="sourceLineNo">2441</span>    if (pair != null &amp;&amp; pair.getFirst().getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID)<a name="line.2441"></a>
-<span class="sourceLineNo">2442</span>      throw new IllegalArgumentException("Can't invoke merge on non-default regions directly");<a name="line.2442"></a>
-<span class="sourceLineNo">2443</span>    pair = getRegion(encodedNameOfRegionB);<a name="line.2443"></a>
-<span class="sourceLineNo">2444</span>    if (pair != null &amp;&amp; pair.getFirst().getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID)<a name="line.2444"></a>
-<span class="sourceLineNo">2445</span>      throw new IllegalArgumentException("Can't invoke merge on non-default regions directly");<a name="line.2445"></a>
-<span class="sourceLineNo">2446</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2446"></a>
-<span class="sourceLineNo">2447</span>      @Override<a name="line.2447"></a>
-<span class="sourceLineNo">2448</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2448"></a>
-<span class="sourceLineNo">2449</span>        try {<a name="line.2449"></a>
-<span class="sourceLineNo">2450</span>          DispatchMergingRegionsRequest request = RequestConverter<a name="line.2450"></a>
-<span class="sourceLineNo">2451</span>              .buildDispatchMergingRegionsRequest(encodedNameOfRegionA,<a name="line.2451"></a>
-<span class="sourceLineNo">2452</span>                encodedNameOfRegionB, forcible);<a name="line.2452"></a>
-<span class="sourceLineNo">2453</span>          master.dispatchMergingRegions(null, request);<a name="line.2453"></a>
-<span class="sourceLineNo">2454</span>        } catch (DeserializationException de) {<a name="line.2454"></a>
-<span class="sourceLineNo">2455</span>          LOG.error("Could not parse destination server name: " + de);<a name="line.2455"></a>
-<span class="sourceLineNo">2456</span>        }<a name="line.2456"></a>
-<span class="sourceLineNo">2457</span>        return null;<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>  }<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>   * {@inheritDoc}<a name="line.2463"></a>
-<span class="sourceLineNo">2464</span>   */<a name="line.2464"></a>
-<span class="sourceLineNo">2465</span>  @Override<a name="line.2465"></a>
-<span class="sourceLineNo">2466</span>  public void split(final TableName tableName)<a name="line.2466"></a>
-<span class="sourceLineNo">2467</span>    throws IOException {<a name="line.2467"></a>
-<span class="sourceLineNo">2468</span>    split(tableName, null);<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>  /**<a name="line.2471"></a>
-<span class="sourceLineNo">2472</span>   * {@inheritDoc}<a name="line.2472"></a>
-<span class="sourceLineNo">2473</span>   */<a name="line.2473"></a>
-<span class="sourceLineNo">2474</span>  @Override<a name="line.2474"></a>
-<span class="sourceLineNo">2475</span>  public void splitRegion(final byte[] regionName)<a name="line.2475"></a>
-<span class="sourceLineNo">2476</span>    throws IOException {<a name="line.2476"></a>
-<span class="sourceLineNo">2477</span>    splitRegion(regionName, null);<a name="line.2477"></a>
-<span class="sourceLineNo">2478</span>  }<a name="line.2478"></a>
-<span class="sourceLineNo">2479</span><a name="line.2479"></a>
-<span class="sourceLineNo">2480</span>  /**<a name="line.2480"></a>
-<span class="sourceLineNo">2481</span>   * @deprecated Use {@link #split(org.apache.hadoop.hbase.TableName)} or {@link #splitRegion<a name="line.2481"></a>
-<span class="sourceLineNo">2482</span>   * (byte[])} instead.<a name="line.2482"></a>
-<span class="sourceLineNo">2483</span>   */<a name="line.2483"></a>
-<span class="sourceLineNo">2484</span>  @Deprecated<a name="line.2484"></a>
-<span class="sourceLineNo">2485</span>  public void split(final String tableNameOrRegionName)<a name="line.2485"></a>
-<span class="sourceLineNo">2486</span>  throws IOException, InterruptedException {<a name="line.2486"></a>
-<span class="sourceLineNo">2487</span>    split(Bytes.toBytes(tableNameOrRegionName));<a name="line.2487"></a>
-<span class="sourceLineNo">2488</span>  }<a name="line.2488"></a>
-<span class="sourceLineNo">2489</span><a name="line.2489"></a>
-<span class="sourceLineNo">2490</span>  /**<a name="line.2490"></a>
-<span class="sourceLineNo">2491</span>   * @deprecated Use {@link #split(org.apache.hadoop.hbase.TableName)} or {@link #splitRegion<a name="line.2491"></a>
-<span class="sourceLineNo">2492</span>   * (byte[])} instead.<a name="line.2492"></a>
-<span class="sourceLineNo">2493</span>   */<a name="line.2493"></a>
-<span class="sourceLineNo">2494</span>  @Deprecated<a name="line.2494"></a>
-<span class="sourceLineNo">2495</span>  public void split(final byte[] tableNameOrRegionName)<a name="line.2495"></a>
-<span class="sourceLineNo">2496</span>  throws IOException, InterruptedException {<a name="line.2496"></a>
-<span class="sourceLineNo">2497</span>    split(tableNameOrRegionName, null);<a name="line.2497"></a>
-<span class="sourceLineNo">2498</span>  }<a name="line.2498"></a>
-<span class="sourceLineNo">2499</span><a name="line.2499"></a>
-<span class="sourceLineNo">2500</span>  /**<a name="line.2500"></a>
-<span class="sourceLineNo">2501</span>   * {@inheritDoc}<a name="line.2501"></a>
-<span class="sourceLineNo">2502</span>   */<a name="line.2502"></a>
-<span class="sourceLineNo">2503</span>  @Override<a name="line.2503"></a>
-<span class="sourceLineNo">2504</span>  public void split(final TableName tableName, final byte [] splitPoint)<a name="line.2504"></a>
-<span class="sourceLineNo">2505</span>  throws IOException {<a name="line.2505"></a>
-<span class="sourceLineNo">2506</span>    ZooKeeperWatcher zookeeper = null;<a name="line.2506"></a>
-<span class="sourceLineNo">2507</span>    try {<a name="line.2507"></a>
-<span class="sourceLineNo">2508</span>      checkTableExists(tableName);<a name="line.2508"></a>
-<span class="sourceLineNo">2509</span>      zookeeper = new ZooKeeperWatcher(conf, ZK_IDENTIFIER_PREFIX + connection.toString(),<a name="line.2509"></a>
-<span class="sourceLineNo">2510</span>        new ThrowableAbortable());<a name="line.2510"></a>
-<span class="sourceLineNo">2511</span>      List&lt;Pair&lt;HRegionInfo, ServerName&gt;&gt; pairs;<a name="line.2511"></a>
-<span class="sourceLineNo">2512</span>      if (TableName.META_TABLE_NAME.equals(tableName)) {<a name="line.2512"></a>
-<span class="sourceLineNo">2513</span>        pairs = new MetaTableLocator().getMetaRegionsAndLocations(zookeeper);<a name="line.2513"></a>
-<span class="sourceLineNo">2514</span>      } else {<a name="line.2514"></a>
-<span class="sourceLineNo">2515</span>        pairs = MetaTableAccessor.getTableRegionsAndLocations(connection, tableName);<a name="line.2515"></a>
-<span class="sourceLineNo">2516</span>      }<a name="line.2516"></a>
-<span class="sourceLineNo">2517</span>      for (Pair&lt;HRegionInfo, ServerName&gt; pair: pairs) {<a name="line.2517"></a>
-<span class="sourceLineNo">2518</span>        // May not be a server for a particular row<a name="line.2518"></a>
-<span class="sourceLineNo">2519</span>        if (pair.getSecond() == null) continue;<a name="line.2519"></a>
-<span class="sourceLineNo">2520</span>        HRegionInfo r = pair.getFirst();<a name="line.2520"></a>
-<span class="sourceLineNo">2521</span>        // check for parents<a name="line.2521"></a>
-<span class="sourceLineNo">2522</span>        if (r.isSplitParent()) continue;<a name="line.2522"></a>
-<span class="sourceLineNo">2523</span>        // if a split point given, only split that particular region<a name="line.2523"></a>
-<span class="sourceLineNo">2524</span>        if (r.getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID ||<a name="line.2524"></a>
-<span class="sourceLineNo">2525</span>           (splitPoint != null &amp;&amp; !r.containsRow(splitPoint))) continue;<a name="line.2525"></a>
-<span class="sourceLineNo">2526</span>        // call out to region server to do split now<a name="line.2526"></a>
-<span class="sourceLineNo">2527</span>        split(pair.getSecond(), pair.getFirst(), splitPoint);<a name="line.2527"></a>
-<span class="sourceLineNo">2528</span>      }<a name="line.2528"></a>
-<span class="sourceLineNo">2529</span>    } finally {<a name="line.2529"></a>
-<span class="sourceLineNo">2530</span>      if (zookeeper != null) {<a name="line.2530"></a>
-<span class="sourceLineNo">2531</span>        zookeeper.close();<a name="line.2531"></a>
-<span class="sourceLineNo">2532</span>      }<a name="line.2532"></a>
-<span class="sourceLineNo">2533</span>    }<a name="line.2533"></a>
-<span class="sourceLineNo">2534</span>  }<a name="line.2534"></a>
-<span class="sourceLineNo">2535</span><a name="line.2535"></a>
-<span class="sourceLineNo">2536</span>  /**<a name="line.2536"></a>
-<span class="sourceLineNo">2537</span>   * {@inheritDoc}<a name="line.2537"></a>
-<span class="sourceLineNo">2538</span>   */<a name="line.2538"></a>
-<span class="sourceLineNo">2539</span>  @Override<a name="line.2539"></a>
-<span class="sourceLineNo">2540</span>  public void splitRegion(final byte[] regionName, final byte [] splitPoint)<a name="line.2540"></a>
-<span class="sourceLineNo">2541</span>  throws IOException {<a name="line.2541"></a>
-<span class="sourceLineNo">2542</span>    Pair&lt;HRegionInfo, ServerName&gt; regionServerPair = getRegion(regionName);<a name="line.2542"></a>
-<span class="sourceLineNo">2543</span>    if (regionServerPair == null) {<a name="line.2543"></a>
-<span class="sourceLineNo">2544</span>      throw new IllegalArgumentException("Invalid region: " + Bytes.toStringBinary(regionName));<a name="line.2544"></a>
-<span class="sourceLineNo">2545</span>    }<a name="line.2545"></a>
-<span class="sourceLineNo">2546</span>    if (regionServerPair.getFirst() != null &amp;&amp;<a name="line.2546"></a>
-<span class="sourceLineNo">2547</span>        regionServerPair.getFirst().getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID) {<a name="line.2547"></a>
-<span class="sourceLineNo">2548</span>      throw new IllegalArgumentException("Can't split replicas directly. "<a name="line.2548"></a>
-<span class="sourceLineNo">2549</span>          + "Replicas are auto-split when their primary is split.");<a name="line.2549"></a>
-<span class="sourceLineNo">2550</span>    }<a name="line.2550"></a>
-<span class="sourceLineNo">2551</span>    if (regionServerPair.getSecond() == null) {<a name="line.2551"></a>
-<span class="sourceLineNo">2552</span>      throw new NoServerForRegionException(Bytes.toStringBinary(regionName));<a name="line.2552"></a>
-<span class="sourceLineNo">2553</span>    }<a name="line.2553"></a>
-<span class="sourceLineNo">2554</span>    split(regionServerPair.getSecond(), regionServerPair.getFirst(), splitPoint);<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>   * @deprecated Use {@link #split(org.apache.hadoop.hbase.TableName,<a name="line.2558"></a>
-<span class="sourceLineNo">2559</span>   * byte[])} or {@link #splitRegion(byte[], byte[])} instead.<a name="line.2559"></a>
-<span class="sourceLineNo">2560</span>   */<a name="line.2560"></a>
-<span class="sourceLineNo">2561</span>  @Deprecated<a name="line.2561"></a>
-<span class="sourceLineNo">2562</span>  public void split(final String tableNameOrRegionName,<a name="line.2562"></a>
-<span class="sourceLineNo">2563</span>    final String splitPoint) throws IOException {<a name="line.2563"></a>
-<span class="sourceLineNo">2564</span>    split(Bytes.toBytes(tableNameOrRegionName), Bytes.toBytes(splitPoint));<a name="line.2564"></a>
-<span class="sourceLineNo">2565</span>  }<a name="line.2565"></a>
-<span class="sourceLineNo">2566</span><a name="line.2566"></a>
-<span class="sourceLineNo">2567</span>  /**<a name="line.2567"></a>
-<span class="sourceLineNo">2568</span>   * @deprecated Use {@link #split(org.apache.hadoop.hbase.TableName,<a name="line.2568"></a>
-<span class="sourceLineNo">2569</span>   * byte[])} or {@link #splitRegion(byte[], byte[])} instead.<a name="line.2569"></a>
-<span class="sourceLineNo">2570</span>   */<a name="line.2570"></a>
-<span class="sourceLineNo">2571</span>  @Deprecated<a name="line.2571"></a>
-<span class="sourceLineNo">2572</span>  public void split(final byte[] tableNameOrRegionName,<a name="line.2572"></a>
-<span class="sourceLineNo">2573</span>      final byte [] splitPoint) throws IOException {<a name="line.2573"></a>
-<span class="sourceLineNo">2574</span>    try {<a name="line.2574"></a>
-<span class="sourceLineNo">2575</span>      splitRegion(tableNameOrRegionName, splitPoint);<a name="line.2575"></a>
-<span class="sourceLineNo">2576</span>    } catch (IllegalArgumentException e) {<a name="line.2576"></a>
-<span class="sourceLineNo">2577</span>      // Bad region, try table<a name="line.2577"></a>
-<span class="sourceLineNo">2578</span>      split(TableName.valueOf(tableNameOrRegionName), splitPoint);<a name="line.2578"></a>
-<span class="sourceLineNo">2579</span>    }<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>  @VisibleForTesting<a name="line.2582"></a>
-<span class="sourceLineNo">2583</span>  public void split(final ServerName sn, final HRegionInfo hri,<a name="line.2583"></a>
-<span class="sourceLineNo">2584</span>      byte[] splitPoint) throws IOException {<a name="line.2584"></a>
-<span class="sourceLineNo">2585</span>    if (hri.getStartKey() != null &amp;&amp; splitPoint != null &amp;&amp;<a name="line.2585"></a>
-<span class="sourceLineNo">2586</span>         Bytes.compareTo(hri.getStartKey(), splitPoint) == 0) {<a name="line.2586"></a>
-<span class="sourceLineNo">2587</span>       throw new IOException("should not give a splitkey which equals to startkey!");<a name="line.2587"></a>
-<span class="sourceLineNo">2588</span>    }<a name="line.2588"></a>
-<span class="sourceLineNo">2589</span>    // TODO: This is not executed via retries<a name="line.2589"></a>
-<span class="sourceLineNo">2590</span>    AdminService.BlockingInterface admin = this.connection.getAdmin(sn);<a name="line.2590"></a>
-<span class="sourceLineNo">2591</span>    ProtobufUtil.split(admin, hri, splitPoint);<a name="line.2591"></a>
-<span class="sourceLineNo">2592</span>  }<a name="line.2592"></a>
-<span class="sourceLineNo">2593</span><a name="line.2593"></a>
-<span class="sourceLineNo">2594</span>  /**<a name="line.2594"></a>
-<span class="sourceLineNo">2595</span>   * Modify an existing table, more IRB friendly version. Asynchronous operation.<a name="line.2595"></a>
-<span class="sourceLineNo">2596</span>   * This means that it may be a while before your schema change is updated across all of the<a name="line.2596"></a>
-<span class="sourceLineNo">2597</span>   * table. You can use Future.get(long, TimeUnit) to wait on the operation to complete.<a name="line.2597"></a>
-<span class="sourceLineNo">2598</span>   * It may throw ExecutionException if there was an error while executing the operation<a name="line.2598"></a>
-<span class="sourceLineNo">2599</span>   * or TimeoutException in case the wait timeout was not long enough to allow the<a name="line.2599"></a>
-<span class="sourceLineNo">2600</span>   * operation to complete.<a name="line.2600"></a>
-<span class="sourceLineNo">2601</span>   *<a name="line.2601"></a>
-<span class="sourceLineNo">2602</span>   * @param tableName name of table.<a name="line.2602"></a>
-<span class="sourceLineNo">2603</span>   * @param htd modified description of the table<a name="line.2603"></a>
-<span class="sourceLineNo">2604</span>   * @throws IOException if a remote or network exception occurs<a name="line.2604"></a>
-<span class="sourceLineNo">2605</span>   * @return the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the<a name="line.2605"></a>
-<span class="sourceLineNo">2606</span>   *     operation to complete.<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 Future&lt;Void&gt; modifyTable(final TableName tableName, final HTableDescriptor htd)<a name="line.2609"></a>
-<span class="sourceLineNo">2610</span>  throws IOException {<a name="line.2610"></a>
-<span class="sourceLineNo">2611</span>    if (!tableName.equals(htd.getTableName())) {<a name="line.2611"></a>
-<span class="sourceLineNo">2612</span>      throw new IllegalArgumentException("the specified table name '" + tableName +<a name="line.2612"></a>
-<span class="sourceLineNo">2613</span>        "' doesn't match with the HTD one: " + htd.getTableName());<a name="line.2613"></a>
-<span class="sourceLineNo">2614</span>    }<a name="line.2614"></a>
-<span class="sourceLineNo">2615</span><a name="line.2615"></a>
-<span class="sourceLineNo">2616</span>    ModifyTableResponse response = executeCallable(<a name="line.2616"></a>
-<span class="sourceLineNo">2617</span>        new MasterCallable&lt;ModifyTableResponse&gt;(getConnection()) {<a name="line.2617"></a>
-<span class="sourceLineNo">2618</span>      @Override<a name="line.2618"></a>
-<span class="sourceLineNo">2619</span>      public ModifyTableResponse call(int callTimeout) throws ServiceException {<a name="line.2619"></a>
-<span class="sourceLineNo">2620</span>        ModifyTableRequest request = RequestConverter.buildModifyTableRequest(<a name="line.2620"></a>
-<span class="sourceLineNo">2621</span>          tableName, htd, ng.getNonceGroup(), ng.newNonce());<a name="line.2621"></a>
-<span class="sourceLineNo">2622</span>        return master.modifyTable(null, request);<a name="line.2622"></a>
-<span class="sourceLineNo">2623</span>      }<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>    return new ModifyTableFuture(this, tableName, response);<a name="line.2626"></a>
-<span class="sourceLineNo">2627</span>  }<a name="line.2627"></a>
-<span class="sourceLineNo">2628</span><a name="line.2628"></a>
-<span class="sourceLineNo">2629</span>  private static class ModifyTableFuture extends TableFuture&lt;Void&gt; {<a name="line.2629"></a>
-<span class="sourceLineNo">2630</span>    public ModifyTableFuture(final HBaseAdmin admin, final TableName tableName,<a name="line.2630"></a>
-<span class="sourceLineNo">2631</span>        final ModifyTableResponse response) {<a name="line.2631"></a>
-<span class="sourceLineNo">2632</span>      super(admin, tableName,<a name="line.2632"></a>
-<span class="sourceLineNo">2633</span>          (response != null &amp;&amp; response.hasProcId()) ? response.getProcId() : null);<a name="line.2633"></a>
-<span class="sourceLineNo">2634</span>    }<a name="line.2634"></a>
-<span class="sourceLineNo">2635</span><a name="line.2635"></a>
-<span class="sourceLineNo">2636</span>    public ModifyTableFuture(final HBaseAdmin admin, final TableName tableName, final Long procId) {<a name="line.2636"></a>
-<span class="sourceLineNo">2637</span>      super(admin, tableName, procId);<a name="line.2637"></a>
-<span class="sourceLineNo">2638</span>    }<a name="line.2638"></a>
-<span class="sourceLineNo">2639</span><a name="line.2639"></a>
-<span class="sourceLineNo">2640</span>    @Override<a name="line.2640"></a>
-<span class="sourceLineNo">2641</span>    public String getOperationType() {<a name="line.2641"></a>
-<span class="sourceLineNo">2642</span>      return "MODIFY";<a name="line.2642"></a>
-<span class="sourceLineNo">2643</span>    }<a name="line.2643"></a>
-<span class="sourceLineNo">2644</span><a name="line.2644"></a>
-<span class="sourceLineNo">2645</span>    @Override<a name="line.2645"></a>
-<span class="sourceLineNo">2646</span>    protected Void postOperationResult(final Void result, final long deadlineTs)<a name="line.2646"></a>
-<span class="sourceLineNo">2647</span>        throws IOException, TimeoutException {<a name="line.2647"></a>
-<span class="sourceLineNo">2648</span>      // The modify operation on the table is asynchronous on the server side irrespective<a name="line.2648"></a>
-<span class="sourceLineNo">2649</span>      // of whether Procedure V2 is supported or not. So, we wait in the client till<a name="line.2649"></a>
-<span class="sourceLineNo">2650</span>      // all regions get updated.<a name="line.2650"></a>
-<span class="sourceLineNo">2651</span>      waitForSchemaUpdate(deadlineTs);<a name="line.2651"></a>
-<span class="sourceLineNo">2652</span>      return result;<a name="line.2652"></a>
-<span class="sourceLineNo">2653</span>    }<a name="line.2653"></a>
-<span class="sourceLineNo">2654</span>  }<a name="line.2654"></a>
-<span class="sourceLineNo">2655</span><a name="line.2655"></a>
-<span class="sourceLineNo">2656</span>  public void modifyTable(final byte[] tableName, final HTableDescriptor htd)<a name="line.2656"></a>
-<span class="sourceLineNo">2657</span>  throws IOException {<a name="line.2657"></a>
-<span class="sourceLineNo">2658</span>    modifyTable(TableName.valueOf(tableName), htd);<a name="line.2658"></a>
-<span class="sourceLineNo">2659</span>  }<a name="line.2659"></a>
-<span class="sourceLineNo">2660</span><a name="line.2660"></a>
-<span class="sourceLineNo">2661</span>  public void modifyTable(final String tableName, final HTableDescriptor htd)<a name="line.2661"></a>
-<span class="sourceLineNo">2662</span>  throws IOException {<a name="line.2662"></a>
-<span class="sourceLineNo">2663</span>    modifyTable(TableName.valueOf(tableName), htd);<a name="line.2663"></a>
-<span class="sourceLineNo">2664</span>  }<a name="line.2664"></a>
-<span class="sourceLineNo">2665</span><a name="line.2665"></a>
-<span class="sourceLineNo">2666</span>  /**<a name="line.2666"></a>
-<span class="sourceLineNo">2667</span>   * @param regionName Name of a region.<a name="line.2667"></a>
-<span class="sourceLineNo">2668</span>   * @return a pair of HRegionInfo and ServerName if &lt;code&gt;regionName&lt;/code&gt; is<a name="line.2668"></a>
-<span class="sourceLineNo">2669</span>   *  a verified region name (we call {@link<a name="line.2669"></a>
-<span class="sourceLineNo">2670</span>   *  MetaTableAccessor#getRegion(HConnection, byte[])}<a name="line.2670"></a>
-<span class="sourceLineNo">2671</span>   *  else null.<a name="line.2671"></a>
-<span class="sourceLineNo">2672</span>   * Throw IllegalArgumentException if &lt;code&gt;regionName&lt;/code&gt; is null.<a name="line.2672"></a>
-<span class="sourceLineNo">2673</span>   * @throws IOException<a name="line.2673"></a>
-<span class="sourceLineNo">2674</span>   */<a name="line.2674"></a>
-<span class="sourceLineNo">2675</span>  Pair&lt;HRegionInfo, ServerName&gt; getRegion(final byte[] regionName) throws IOException {<a name="line.2675"></a>
-<span class="sourceLineNo">2676</span>    if (regionName == null) {<a name="line.2676"></a>
-<span class="sourceLineNo">2677</span>      throw new IllegalArgumentException("Pass a table name or region name");<a name="line.2677"></a>
-<span class="sourceLineNo">2678</span>    }<a name="line.2678"></a>
-<span class="sourceLineNo">2679</span>    Pair&lt;HRegionInfo, ServerName&gt; pair =<a name="line.2679"></a>
-<span class="sourceLineNo">2680</span>      MetaTableAccessor.getRegion(connection, regionName);<a name="line.2680"></a>
-<span class="sourceLineNo">2681</span>    if (pair == null) {<a name="line.2681"></a>
-<span class="sourceLineNo">2682</span>      final AtomicReference&lt;Pair&lt;HRegionInfo, ServerName&gt;&gt; result =<a name="line.2682"></a>
-<span class="sourceLineNo">2683</span>        new AtomicReference&lt;Pair&lt;HRegionInfo, ServerName&gt;&gt;(null);<a name="line.2683"></a>
-<span class="sourceLineNo">2684</span>      final String encodedName = Bytes.toString(regionName);<a name="line.2684"></a>
-<span class="sourceLineNo">2685</span>      MetaTableAccessor.Visitor visitor = new MetaTableAccessor.Visitor() {<a name="line.2685"></a>
-<span class="sourceLineNo">2686</span>        @Override<a name="line.2686"></a>
-<span class="sourceLineNo">2687</span>        public boolean visit(Result data) throws IOException {<a name="line.2687"></a>
-<span class="sourceLineNo">2688</span>          HRegionInfo info = HRegionInfo.getHRegionInfo(data);<a name="line.2688"></a>
-<span class="sourceLineNo">2689</span>          if (info == null) {<a name="line.2689"></a>
-<span class="sourceLineNo">2690</span>            LOG.warn("No serialized HRegionInfo in " + data);<a name="line.2690"></a>
-<span class="sourceLineNo">2691</span>            return true;<a name="line.2691"></a>
-<span class="sourceLineNo">2692</span>          }<a name="line.2692"></a>
-<span class="sourceLineNo">2693</span>          RegionLocations rl = MetaTableAccessor.getRegionLocations(data);<a name="line.2693"></a>
-<span class="sourceLineNo">2694</span>          boolean matched = false;<a name="line.2694"></a>
-<span class="sourceLineNo">2695</span>          ServerName sn = null;<a name="line.2695"></a>
-<span class="sourceLineNo">2696</span>          if (rl != null) {<a name="line.2696"></a>
-<span class="sourceLineNo">2697</span>            for (HRegionLocation h : rl.getRegionLocations()) {<a name="line.2697"></a>
-<span class="sourceLineNo">2698</span>              if (h != null &amp;&amp; encodedName.equals(h.getRegionInfo().getEncodedName())) {<a name="line.2698"></a>
-<span class="sourceLineNo">2699</span>                sn = h.getServerName();<a name="line.2699"></a>
-<span class="sourceLineNo">2700</span>                info = h.getRegionInfo();<a name="line.2700"></a>
-<span class="sourceLineNo">2701</span>                matched = true;<a name="line.2701"></a>
-<span class="sourceLineNo">2702</span>              }<a name="line.2702"></a>
-<span class="sourceLineNo">2703</span>            }<a name="line.2703"></a>
-<span class="sourceLineNo">2704</span>          }<a name="line.2704"></a>
-<span class="sourceLineNo">2705</span>          if (!matched) return true;<a name="line.2705"></a>
-<span class="sourceLineNo">2706</span>          result.set(new Pair&lt;HRegionInfo, ServerName&gt;(info, sn));<a name="line.2706"></a>
-<span class="sourceLineNo">2707</span>          return false; // found the region, stop<a name="line.2707"></a>
-<span class="sourceLineNo">2708</span>        }<a name="line.2708"></a>
-<span class="sourceLineNo">2709</span>      };<a name="line.2709"></a>
-<span class="sourceLineNo">2710</span><a name="line.2710"></a>
-<span class="sourceLineNo">2711</span>      MetaTableAccessor.fullScanRegions(connection, visitor);<a name="line.2711"></a>
-<span class="sourceLineNo">2712</span>      pair = result.get();<a name="line.2712"></a>
-<span class="sourceLineNo">2713</span>    }<a name="line.2713"></a>
-<span class="sourceLineNo">2714</span>    return pair;<a name="line.2714"></a>
-<span class="sourceLineNo">2715</span>  }<a name="line.2715"></a>
-<span class="sourceLineNo">2716</span><a name="line.2716"></a>
-<span class="sourceLineNo">2717</span>  /**<a name="line.2717"></a>
-<span class="sourceLineNo">2718</span>   * If the input is a region name, it is returned as is. If it's an<a name="line.2718"></a>
-<span class="sourceLineNo">2719</span>   * encoded region name, the corresponding region is found from meta<a name="line.2719"></a>
-<span class="sourceLineNo">2720</span>   * and its region name is returned. If we can't find any region in<a name="line.2720"></a>
-<span class="sourceLineNo">2721</span>   * meta matching the input as either region name or encoded region<a name="line.2721"></a>
-<span class="sourceLineNo">2722</span>   * name, the input is returned as is. We don't throw unknown<a name="line.2722"></a>
-<span class="sourceLineNo">2723</span>   * region exception.<a name="line.2723"></a>
-<span class="sourceLineNo">2724</span>   */<a name="line.2724"></a>
-<span class="sourceLineNo">2725</span>  private byte[] getRegionName(<a name="line.2725"></a>
-<span class="sourceLineNo">2726</span>      final byte[] regionNameOrEncodedRegionName) throws IOException {<a name="line.2726"></a>
-<span class="sourceLineNo">2727</span>    if (Bytes.equals(regionNameOrEncodedRegionName,<a name="line.2727"></a>
-<span class="sourceLineNo">2728</span>        HRegionInfo.FIRST_META_REGIONINFO.getRegionName())<a name="line.2728"></a>
-<span class="sourceLineNo">2729</span>          || Bytes.equals(regionNameOrEncodedRegionName,<a name="line.2729"></a>
-<span class="sourceLineNo">2730</span>            HRegionInfo.FIRST_META_REGIONINFO.getEncodedNameAsBytes())) {<a name="line.2730"></a>
-<span class="sourceLineNo">2731</span>      return HRegionInfo.FIRST_META_REGIONINFO.getRegionName();<a name="line.2731"></a>
-<span class="sourceLineNo">2732</span>    }<a name="line.2732"></a>
-<span class="sourceLineNo">2733</span>    byte[] tmp = regionNameOrEncodedRegionName;<a name="line.2733"></a>
-<span class="sourceLineNo">2734</span>    Pair&lt;HRegionInfo, ServerName&gt; regionServerPair = getRegion(regionNameOrEncodedRegionName);<a name="line.2734"></a>
-<span class="sourceLineNo">2735</span>    if (regionServerPair != null &amp;&amp; regionServerPair.getFirst() != null) {<a name="line.2735"></a>
-<span class="sourceLineNo">2736</span>      tmp = regionServerPair.getFirst().getRegionName();<a name="line.2736"></a>
-<span class="sourceLineNo">2737</span>    }<a name="line.2737"></a>
-<span class="sourceLineNo">2738</span>    return tmp;<a name="line.2738"></a>
-<span class="sourceLineNo">2739</span>  }<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>   * Check if table exists or not<a name="line.2742"></a>
-<span class="sourceLineNo">2743</span>   * @param tableName Name of a table.<a name="line.2743"></a>
-<span class="sourceLineNo">2744</span>   * @return tableName instance<a name="line.2744"></a>
-<span class="sourceLineNo">2745</span>   * @throws IOException if a remote or network exception occurs.<a name="line.2745"></a>
-<span class="sourceLineNo">2746</span>   * @throws TableNotFoundException if table does not exist.<a name="line.2746"></a>
-<span class="sourceLineNo">2747</span>   */<a name="line.2747"></a>
-<span class="sourceLineNo">2748</span>  private TableName checkTableExists(final TableName tableName)<a name="line.2748"></a>
-<span class="sourceLineNo">2749</span>      throws IOException {<a name="line.2749"></a>
-<span class="sourceLineNo">2750</span>    return executeCallable(new ConnectionCallable&lt;TableName&gt;(getConnection()) {<a name="line.2750"></a>
-<span class="sourceLineNo">2751</span>      @Override<a name="line.2751"></a>
-<span class="sourceLineNo">2752</span>      public TableName call(int callTimeout) throws ServiceException, IOException {<a name="line.2752"></a>
-<span class="sourceLineNo">2753</span>        if (!MetaTableAccessor.tableExists(connection, tableName)) {<a name="line.2753"></a>
-<span class="sourceLineNo">2754</span>          throw new TableNotFoundException(tableName);<a name="line.2754"></a>
-<span class="sourceLineNo">2755</span>        }<a name="line.2755"></a>
-<span class="sourceLineNo">2756</span>        return tableName;<a name="line.2756"></a>
-<span class="sourceLineNo">2757</span>      }<a name="line.2757"></a>
-<span class="sourceLineNo">2758</span>    });<a name="line.2758"></a>
-<span class="sourceLineNo">2759</span>  }<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>   * Shuts down the HBase cluster<a name="line.2762"></a>
-<span class="sourceLineNo">2763</span>   * @throws IOException if a remote or network exception occurs<a name="line.2763"></a>
-<span class="sourceLineNo">2764</span>   */<a name="line.2764"></a>
-<span class="sourceLineNo">2765</span>  @Override<a name="line.2765"></a>
-<span class="sourceLineNo">2766</span>  public synchronized void shutdown() throws IOException {<a name="line.2766"></a>
-<span class="sourceLineNo">2767</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2767"></a>
-<span class="sourceLineNo">2768</span>      @Override<a name="line.2768"></a>
-<span class="sourceLineNo">2769</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2769"></a>
-<span class="sourceLineNo">2770</span>        master.shutdown(null,ShutdownRequest.newBuilder().build());<a name="line.2770"></a>
-<span class="sourceLineNo">2771</span>        return null;<a name="line.2771"></a>
-<span class="sourceLineNo">2772</span>      }<a name="line.2772"></a>
-<span class="sourceLineNo">2773</span>    });<a name="line.2773"></a>
-<span class="sourceLineNo">2774</span>  }<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>   * Shuts down the current HBase master only.<a name="line.2777"></a>
-<span class="sourceLineNo">2778</span>   * Does not shutdown the cluster.<a name="line.2778"></a>
-<span class="sourceLineNo">2779</span>   * @see #shutdown()<a name="line.2779"></a>
-<span class="sourceLineNo">2780</span>   * @throws IOException if a remote or network exception occurs<a name="line.2780"></a>
-<span class="sourceLineNo">2781</span>   */<a name="line.2781"></a>
-<span class="sourceLineNo">2782</span>  @Override<a name="line.2782"></a>
-<span class="sourceLineNo">2783</span>  public synchronized void stopMaster() throws IOException {<a name="line.2783"></a>
-<span class="sourceLineNo">2784</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2784"></a>
-<span class="sourceLineNo">2785</span>      @Override<a name="line.2785"></a>
-<span class="sourceLineNo">2786</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2786"></a>
-<span class="sourceLineNo">2787</span>        master.stopMaster(null, StopMasterRequest.newBuilder().build());<a name="line.2787"></a>
-<span class="sourceLineNo">2788</span>        return null;<a name="line.2788"></a>
-<span class="sourceLineNo">2789</span>      }<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><a name="line.2792"></a>
-<span class="sourceLineNo">2793</span>  /**<a name="line.2793"></a>
-<span class="sourceLineNo">2794</span>   * Stop the designated regionserver<a name="line.2794"></a>
-<span class="sourceLineNo">2795</span>   * @param hostnamePort Hostname and port delimited by a &lt;code&gt;:&lt;/code&gt; as in<a name="line.2795"></a>
-<span class="sourceLineNo">2796</span>   * &lt;code&gt;example.org:1234&lt;/code&gt;<a name="line.2796"></a>
-<span class="sourceLineNo">2797</span>   * @throws IOException if a remote or network exception occurs<a name="line.2797"></a>
-<span class="sourceLineNo">2798</span>   */<a name="line.2798"></a>
-<span class="sourceLineNo">2799</span>  @Override<a name="line.2799"></a>
-<span class="sourceLineNo">2800</span>  public synchronized void stopRegionServer(final String hostnamePort)<a name="line.2800"></a>
-<span class="sourceLineNo">2801</span>  throws IOException {<a name="line.2801"></a>
-<span class="sourceLineNo">2802</span>    String hostname = Addressing.parseHostname(hostnamePort);<a name="line.2802"></a>
-<span class="sourceLineNo">2803</span>    int port = Addressing.parsePort(hostnamePort);<a name="line.2803"></a>
-<span class="sourceLineNo">2804</span>    AdminService.BlockingInterface admin =<a name="line.2804"></a>
-<span class="sourceLineNo">2805</span>      this.connection.getAdmin(ServerName.valueOf(hostname, port, 0));<a name="line.2805"></a>
-<span class="sourceLineNo">2806</span>    StopServerRequest request = RequestConverter.buildStopServerRequest(<a name="line.2806"></a>
-<span class="sourceLineNo">2807</span>      "Called by admin client " + this.connection.toString());<a name="line.2807"></a>
-<span class="sourceLineNo">2808</span>    try {<a name="line.2808"></a>
-<span class="sourceLineNo">2809</span>      admin.stopServer(null, request);<a name="line.2809"></a>
-<span class="sourceLineNo">2810</span>    } catch (ServiceException se) {<a name="line.2810"></a>
-<span class="sourceLineNo">2811</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2811"></a>
-<span class="sourceLineNo">2812</span>    }<a name="line.2812"></a>
-<span class="sourceLineNo">2813</span>  }<a name="line.2813"></a>
-<span class="sourceLineNo">2814</span><a name="line.2814"></a>
+<span class="sourceLineNo">2094</span>      default:<a name="line.2094"></a>
+<span class="sourceLineNo">2095</span>        ZooKeeperWatcher zookeeper = null;<a name="line.2095"></a>
+<span class="sourceLineNo">2096</span>        try {<a name="line.2096"></a>
+<span class="sourceLineNo">2097</span>          checkTableExists(tableName);<a name="line.2097"></a>
+<span class="sourceLineNo">2098</span>          zookeeper = new ZooKeeperWatcher(conf, ZK_IDENTIFIER_PREFIX + connection.toString(),<a name="line.2098"></a>
+<span class="sourceLineNo">2099</span>                  new ThrowableAbortable());<a name="line.2099"></a>
+<span class="sourceLineNo">2100</span>          List&lt;Pair&lt;HRegionInfo, ServerName&gt;&gt; pairs;<a name="line.2100"></a>
+<span class="sourceLineNo">2101</span>          if (TableName.META_TABLE_NAME.equals(tableName)) {<a name="line.2101"></a>
+<span class="sourceLineNo">2102</span>            pairs = new MetaTableLocator().getMetaRegionsAndLocations(zookeeper);<a name="line.2102"></a>
+<span class="sourceLineNo">2103</span>          } else {<a name="line.2103"></a>
+<span class="sourceLineNo">2104</span>            pairs = MetaTableAccessor.getTableRegionsAndLocations(connection, tableName);<a name="line.2104"></a>
+<span class="sourceLineNo">2105</span>          }<a name="line.2105"></a>
+<span class="sourceLineNo">2106</span>          for (Pair&lt;HRegionInfo, ServerName&gt; pair: pairs) {<a name="line.2106"></a>
+<span class="sourceLineNo">2107</span>            if (pair.getFirst().isOffline()) continue;<a name="line.2107"></a>
+<span class="sourceLineNo">2108</span>            if (pair.getSecond() == null) continue;<a name="line.2108"></a>
+<span class="sourceLineNo">2109</span>            try {<a name="line.2109"></a>
+<span class="sourceLineNo">2110</span>              compact(pair.getSecond(), pair.getFirst(), major, columnFamily);<a name="line.2110"></a>
+<span class="sourceLineNo">2111</span>            } catch (NotServingRegionException e) {<a name="line.2111"></a>
+<span class="sourceLineNo">2112</span>              if (LOG.isDebugEnabled()) {<a name="line.2112"></a>
+<span class="sourceLineNo">2113</span>                LOG.debug("Trying to" + (major ? " major" : "") + " compact " +<a name="line.2113"></a>
+<span class="sourceLineNo">2114</span>                        pair.getFirst() + ": " +<a name="line.2114"></a>
+<span class="sourceLineNo">2115</span>                        StringUtils.stringifyException(e));<a name="line.2115"></a>
+<span class="sourceLineNo">2116</span>              }<a name="line.2116"></a>
+<span class="sourceLineNo">2117</span>            }<a name="line.2117"></a>
+<span class="sourceLineNo">2118</span>          }<a name="line.2118"></a>
+<span class="sourceLineNo">2119</span>        } finally {<a name="line.2119"></a>
+<span class="sourceLineNo">2120</span>          if (zookeeper != null) {<a name="line.2120"></a>
+<span class="sourceLineNo">2121</span>            zookeeper.close();<a name="line.2121"></a>
+<span class="sourceLineNo">2122</span>          }<a name="line.2122"></a>
+<span class="sourceLineNo">2123</span>        }<a name="line.2123"></a>
+<span class="sourceLineNo">2124</span>        break;<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>   * Compact an individual region.<a name="line.2129"></a>
+<span class="sourceLineNo">2130</span>   * Asynchronous operation.<a name="line.2130"></a>
+<span class="sourceLineNo">2131</span>   *<a name="line.2131"></a>
+<span class="sourceLineNo">2132</span>   * @param regionName region to compact<a name="line.2132"></a>
+<span class="sourceLineNo">2133</span>   * @param columnFamily column family within a table or region<a name="line.2133"></a>
+<span class="sourceLineNo">2134</span>   * @param major True if we are to do a major compaction.<a name="line.2134"></a>
+<span class="sourceLineNo">2135</span>   * @throws IOException if a remote or network exception occurs<a name="line.2135"></a>
+<span class="sourceLineNo">2136</span>   * @throws InterruptedException<a name="line.2136"></a>
+<span class="sourceLineNo">2137</span>   */<a name="line.2137"></a>
+<span class="sourceLineNo">2138</span>  private void compactRegion(final byte[] regionName, final byte[] columnFamily,final boolean major)<a name="line.2138"></a>
+<span class="sourceLineNo">2139</span>  throws IOException {<a name="line.2139"></a>
+<span class="sourceLineNo">2140</span>    Pair&lt;HRegionInfo, ServerName&gt; regionServerPair = getRegion(regionName);<a name="line.2140"></a>
+<span class="sourceLineNo">2141</span>    if (regionServerPair == null) {<a name="line.2141"></a>
+<span class="sourceLineNo">2142</span>      throw new IllegalArgumentException("Invalid region: " + Bytes.toStringBinary(regionName));<a name="line.2142"></a>
+<span class="sourceLineNo">2143</span>    }<a name="line.2143"></a>
+<span class="sourceLineNo">2144</span>    if (regionServerPair.getSecond() == null) {<a name="line.2144"></a>
+<span class="sourceLineNo">2145</span>      throw new NoServerForRegionException(Bytes.toStringBinary(regionName));<a name="line.2145"></a>
+<span class="sourceLineNo">2146</span>    }<a name="line.2146"></a>
+<span class="sourceLineNo">2147</span>    compact(regionServerPair.getSecond(), regionServerPair.getFirst(), major, columnFamily);<a name="line.2147"></a>
+<span class="sourceLineNo">2148</span>  }<a name="line.2148"></a>
+<span class="sourceLineNo">2149</span><a name="line.2149"></a>
+<span class="sourceLineNo">2150</span>  private void compact(final ServerName sn, final HRegionInfo hri,<a name="line.2150"></a>
+<span class="sourceLineNo">2151</span>      final boolean major, final byte [] family)<a name="line.2151"></a>
+<span class="sourceLineNo">2152</span>  throws IOException {<a name="line.2152"></a>
+<span class="sourceLineNo">2153</span>    AdminService.BlockingInterface admin = this.connection.getAdmin(sn);<a name="line.2153"></a>
+<span class="sourceLineNo">2154</span>    CompactRegionRequest request =<a name="line.2154"></a>
+<span class="sourceLineNo">2155</span>      RequestConverter.buildCompactRegionRequest(hri.getRegionName(), major, family);<a name="line.2155"></a>
+<span class="sourceLineNo">2156</span>    try {<a name="line.2156"></a>
+<span class="sourceLineNo">2157</span>      admin.compactRegion(null, request);<a name="line.2157"></a>
+<span class="sourceLineNo">2158</span>    } catch (ServiceException se) {<a name="line.2158"></a>
+<span class="sourceLineNo">2159</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2159"></a>
+<span class="sourceLineNo">2160</span>    }<a name="line.2160"></a>
+<span class="sourceLineNo">2161</span>  }<a name="line.2161"></a>
+<span class="sourceLineNo">2162</span><a name="line.2162"></a>
+<span class="sourceLineNo">2163</span>  /**<a name="line.2163"></a>
+<span class="sourceLineNo">2164</span>   * Move the region &lt;code&gt;r&lt;/code&gt; to &lt;code&gt;dest&lt;/code&gt;.<a name="line.2164"></a>
+<span class="sourceLineNo">2165</span>   * @param encodedRegionName The encoded region name; i.e. the hash that makes<a name="line.2165"></a>
+<span class="sourceLineNo">2166</span>   * up the region name suffix: e.g. if regionname is<a name="line.2166"></a>
+<span class="sourceLineNo">2167</span>   * &lt;code&gt;TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396.&lt;/code&gt;,<a name="line.2167"></a>
+<span class="sourceLineNo">2168</span>   * then the encoded region name is: &lt;code&gt;527db22f95c8a9e0116f0cc13c680396&lt;/code&gt;.<a name="line.2168"></a>
+<span class="sourceLineNo">2169</span>   * @param destServerName The servername of the destination regionserver.  If<a name="line.2169"></a>
+<span class="sourceLineNo">2170</span>   * passed the empty byte array we'll assign to a random server.  A server name<a name="line.2170"></a>
+<span class="sourceLineNo">2171</span>   * is made of host, port and startcode.  Here is an example:<a name="line.2171"></a>
+<span class="sourceLineNo">2172</span>   * &lt;code&gt; host187.example.com,60020,1289493121758&lt;/code&gt;<a name="line.2172"></a>
+<span class="sourceLineNo">2173</span>   * @throws UnknownRegionException Thrown if we can't find a region named<a name="line.2173"></a>
+<span class="sourceLineNo">2174</span>   * &lt;code&gt;encodedRegionName&lt;/code&gt;<a name="line.2174"></a>
+<span class="sourceLineNo">2175</span>   */<a name="line.2175"></a>
+<span class="sourceLineNo">2176</span>  @Override<a name="line.2176"></a>
+<span class="sourceLineNo">2177</span>  public void move(final byte [] encodedRegionName, final byte [] destServerName)<a name="line.2177"></a>
+<span class="sourceLineNo">2178</span>      throws IOException {<a name="line.2178"></a>
+<span class="sourceLineNo">2179</span><a name="line.2179"></a>
+<span class="sourceLineNo">2180</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2180"></a>
+<span class="sourceLineNo">2181</span>      @Override<a name="line.2181"></a>
+<span class="sourceLineNo">2182</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2182"></a>
+<span class="sourceLineNo">2183</span>        try {<a name="line.2183"></a>
+<span class="sourceLineNo">2184</span>          MoveRegionRequest request =<a name="line.2184"></a>
+<span class="sourceLineNo">2185</span>              RequestConverter.buildMoveRegionRequest(encodedRegionName, destServerName);<a name="line.2185"></a>
+<span class="sourceLineNo">2186</span>            master.moveRegion(null, request);<a name="line.2186"></a>
+<span class="sourceLineNo">2187</span>        } catch (DeserializationException de) {<a name="line.2187"></a>
+<span class="sourceLineNo">2188</span>          LOG.error("Could not parse destination server name: " + de);<a name="line.2188"></a>
+<span class="sourceLineNo">2189</span>          throw new ServiceException(new DoNotRetryIOException(de));<a name="line.2189"></a>
+<span class="sourceLineNo">2190</span>        }<a name="line.2190"></a>
+<span class="sourceLineNo">2191</span>        return null;<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><a name="line.2195"></a>
+<span class="sourceLineNo">2196</span>  /**<a name="line.2196"></a>
+<span class="sourceLineNo">2197</span>   * @param regionName<a name="line.2197"></a>
+<span class="sourceLineNo">2198</span>   *          Region name to assign.<a name="line.2198"></a>
+<span class="sourceLineNo">2199</span>   * @throws MasterNotRunningException<a name="line.2199"></a>
+<span class="sourceLineNo">2200</span>   * @throws ZooKeeperConnectionException<a name="line.2200"></a>
+<span class="sourceLineNo">2201</span>   * @throws IOException<a name="line.2201"></a>
+<span class="sourceLineNo">2202</span>   */<a name="line.2202"></a>
+<span class="sourceLineNo">2203</span>  @Override<a name="line.2203"></a>
+<span class="sourceLineNo">2204</span>  public void assign(final byte[] regionName) throws MasterNotRunningException,<a name="line.2204"></a>
+<span class="sourceLineNo">2205</span>      ZooKeeperConnectionException, IOException {<a name="line.2205"></a>
+<span class="sourceLineNo">2206</span>    final byte[] toBeAssigned = getRegionName(regionName);<a name="line.2206"></a>
+<span class="sourceLineNo">2207</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2207"></a>
+<span class="sourceLineNo">2208</span>      @Override<a name="line.2208"></a>
+<span class="sourceLineNo">2209</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2209"></a>
+<span class="sourceLineNo">2210</span>        AssignRegionRequest request =<a name="line.2210"></a>
+<span class="sourceLineNo">2211</span>          RequestConverter.buildAssignRegionRequest(toBeAssigned);<a name="line.2211"></a>
+<span class="sourceLineNo">2212</span>        master.assignRegion(null,request);<a name="line.2212"></a>
+<span class="sourceLineNo">2213</span>        return null;<a name="line.2213"></a>
+<span class="sourceLineNo">2214</span>      }<a name="line.2214"></a>
+<span class="sourceLineNo">2215</span>    });<a name="line.2215"></a>
+<span class="sourceLineNo">2216</span>  }<a name="line.2216"></a>
+<span class="sourceLineNo">2217</span><a name="line.2217"></a>
+<span class="sourceLineNo">2218</span>  /**<a name="line.2218"></a>
+<span class="sourceLineNo">2219</span>   * Unassign a region from current hosting regionserver.  Region will then be<a name="line.2219"></a>
+<span class="sourceLineNo">2220</span>   * assigned to a regionserver chosen at random.  Region could be reassigned<a name="line.2220"></a>
+<span class="sourceLineNo">2221</span>   * back to the same server.  Use {@link #move(byte[], byte[])} if you want<a name="line.2221"></a>
+<span class="sourceLineNo">2222</span>   * to control the region movement.<a name="line.2222"></a>
+<span class="sourceLineNo">2223</span>   * @param regionName Region to unassign. Will clear any existing RegionPlan<a name="line.2223"></a>
+<span class="sourceLineNo">2224</span>   * if one found.<a name="line.2224"></a>
+<span class="sourceLineNo">2225</span>   * @param force If true, force unassign (Will remove region from<a name="line.2225"></a>
+<span class="sourceLineNo">2226</span>   * regions-in-transition too if present. If results in double assignment<a name="line.2226"></a>
+<span class="sourceLineNo">2227</span>   * use hbck -fix to resolve. To be used by experts).<a name="line.2227"></a>
+<span class="sourceLineNo">2228</span>   * @throws MasterNotRunningException<a name="line.2228"></a>
+<span class="sourceLineNo">2229</span>   * @throws ZooKeeperConnectionException<a name="line.2229"></a>
+<span class="sourceLineNo">2230</span>   * @throws IOException<a name="line.2230"></a>
+<span class="sourceLineNo">2231</span>   */<a name="line.2231"></a>
+<span class="sourceLineNo">2232</span>  @Override<a name="line.2232"></a>
+<span class="sourceLineNo">2233</span>  public void unassign(final byte [] regionName, final boolean force)<a name="line.2233"></a>
+<span class="sourceLineNo">2234</span>  throws MasterNotRunningException, ZooKeeperConnectionException, IOException {<a name="line.2234"></a>
+<span class="sourceLineNo">2235</span>    final byte[] toBeUnassigned = getRegionName(regionName);<a name="line.2235"></a>
+<span class="sourceLineNo">2236</span>    executeCallable(new MasterCallable&lt;Void&gt;(getConnection()) {<a name="line.2236"></a>
+<span class="sourceLineNo">2237</span>      @Override<a name="line.2237"></a>
+<span class="sourceLineNo">2238</span>      public Void call(int callTimeout) throws ServiceException {<a name="line.2238"></a>
+<span class="sourceLineNo">2239</span>        UnassignRegionRequest request =<a name="line.2239"></a>
+<span class="sourceLineNo">2240</span>          RequestConverter.buildUnassignRegionRequest(toBeUnassigned, force);<a name="line.2240"></a>
+<span class="sourceLineNo">2241</span>        master.unassignRegion(null, request);<a name="line.2241"></a>
+<span class="sourceLineNo">2242</span>        return null;<a name="line.2242"></a>
+<span class="sourceLineNo">2243</span>      }<a name="line.2243"></a>
+<span class="sourceLineNo">2244</span>    });<a name="line.2244"></a>
+<span class="sourceLineNo">2245</span>  }<a name="line.2245"></a>
+<span class="sourceLineNo">2246</span><a name="line.2246"></a>
+<span class="sourceLineNo">2247</span>  /**<a name="line.2247"></a>
+<span class="sourceLineNo">2248</span>   * Offline specified region from master's in-memory state. It will not attempt to reassign the<a name="line.2248"></a>

[... 4722 lines stripped ...]



Mime
View raw message