hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [08/29] hbase-site git commit: Published site at 40a73a5ca73c9e9e2ff9be1bf823056b108686af.
Date Thu, 31 May 2018 14:48:10 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/46d8bc28/devapidocs/src-html/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.html b/devapidocs/src-html/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.html
index 67da347..19ce3aa 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.html
@@ -169,381 +169,405 @@
 <span class="sourceLineNo">161</span>      LOG.info(master.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, group="<a name="line.161"></a>
 <span class="sourceLineNo">162</span>              + groupName);<a name="line.162"></a>
 <span class="sourceLineNo">163</span>      try {<a name="line.163"></a>
-<span class="sourceLineNo">164</span>        checkPermission("getRSGroupInfo");<a name="line.164"></a>
-<span class="sourceLineNo">165</span>        RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName);<a name="line.165"></a>
-<span class="sourceLineNo">166</span>        if (rsGroupInfo != null) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>          builder.setRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(rsGroupInfo));<a name="line.167"></a>
-<span class="sourceLineNo">168</span>        }<a name="line.168"></a>
-<span class="sourceLineNo">169</span>      } catch (IOException e) {<a name="line.169"></a>
-<span class="sourceLineNo">170</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      }<a name="line.171"></a>
-<span class="sourceLineNo">172</span>      done.run(builder.build());<a name="line.172"></a>
-<span class="sourceLineNo">173</span>    }<a name="line.173"></a>
-<span class="sourceLineNo">174</span><a name="line.174"></a>
-<span class="sourceLineNo">175</span>    @Override<a name="line.175"></a>
-<span class="sourceLineNo">176</span>    public void getRSGroupInfoOfTable(RpcController controller,<a name="line.176"></a>
-<span class="sourceLineNo">177</span>        GetRSGroupInfoOfTableRequest request, RpcCallback&lt;GetRSGroupInfoOfTableResponse&gt; done) {<a name="line.177"></a>
-<span class="sourceLineNo">178</span>      GetRSGroupInfoOfTableResponse.Builder builder = GetRSGroupInfoOfTableResponse.newBuilder();<a name="line.178"></a>
-<span class="sourceLineNo">179</span>      TableName tableName = ProtobufUtil.toTableName(request.getTableName());<a name="line.179"></a>
-<span class="sourceLineNo">180</span>      LOG.info(master.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, table="<a name="line.180"></a>
-<span class="sourceLineNo">181</span>          + tableName);<a name="line.181"></a>
-<span class="sourceLineNo">182</span>      try {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>        checkPermission("getRSGroupInfoOfTable");<a name="line.183"></a>
-<span class="sourceLineNo">184</span>        RSGroupInfo RSGroupInfo = groupAdminServer.getRSGroupInfoOfTable(tableName);<a name="line.184"></a>
-<span class="sourceLineNo">185</span>        if (RSGroupInfo != null) {<a name="line.185"></a>
-<span class="sourceLineNo">186</span>          builder.setRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo));<a name="line.186"></a>
-<span class="sourceLineNo">187</span>        }<a name="line.187"></a>
-<span class="sourceLineNo">188</span>      } catch (IOException e) {<a name="line.188"></a>
-<span class="sourceLineNo">189</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.189"></a>
-<span class="sourceLineNo">190</span>      }<a name="line.190"></a>
-<span class="sourceLineNo">191</span>      done.run(builder.build());<a name="line.191"></a>
-<span class="sourceLineNo">192</span>    }<a name="line.192"></a>
-<span class="sourceLineNo">193</span><a name="line.193"></a>
-<span class="sourceLineNo">194</span>    @Override<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    public void moveServers(RpcController controller, MoveServersRequest request,<a name="line.195"></a>
-<span class="sourceLineNo">196</span>        RpcCallback&lt;MoveServersResponse&gt; done) {<a name="line.196"></a>
-<span class="sourceLineNo">197</span>      MoveServersResponse.Builder builder = MoveServersResponse.newBuilder();<a name="line.197"></a>
-<span class="sourceLineNo">198</span>      Set&lt;Address&gt; hostPorts = Sets.newHashSet();<a name="line.198"></a>
-<span class="sourceLineNo">199</span>      for (HBaseProtos.ServerName el : request.getServersList()) {<a name="line.199"></a>
-<span class="sourceLineNo">200</span>        hostPorts.add(Address.fromParts(el.getHostName(), el.getPort()));<a name="line.200"></a>
-<span class="sourceLineNo">201</span>      }<a name="line.201"></a>
-<span class="sourceLineNo">202</span>      LOG.info(master.getClientIdAuditPrefix() + " move servers " + hostPorts +" to rsgroup "<a name="line.202"></a>
-<span class="sourceLineNo">203</span>          + request.getTargetGroup());<a name="line.203"></a>
-<span class="sourceLineNo">204</span>      try {<a name="line.204"></a>
-<span class="sourceLineNo">205</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.205"></a>
-<span class="sourceLineNo">206</span>          master.getMasterCoprocessorHost().preMoveServers(hostPorts, request.getTargetGroup());<a name="line.206"></a>
-<span class="sourceLineNo">207</span>        }<a name="line.207"></a>
-<span class="sourceLineNo">208</span>        checkPermission("moveServers");<a name="line.208"></a>
-<span class="sourceLineNo">209</span>        groupAdminServer.moveServers(hostPorts, request.getTargetGroup());<a name="line.209"></a>
-<span class="sourceLineNo">210</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.210"></a>
-<span class="sourceLineNo">211</span>          master.getMasterCoprocessorHost().postMoveServers(hostPorts, request.getTargetGroup());<a name="line.211"></a>
-<span class="sourceLineNo">212</span>        }<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      } catch (IOException e) {<a name="line.213"></a>
-<span class="sourceLineNo">214</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.214"></a>
-<span class="sourceLineNo">215</span>      }<a name="line.215"></a>
-<span class="sourceLineNo">216</span>      done.run(builder.build());<a name="line.216"></a>
-<span class="sourceLineNo">217</span>    }<a name="line.217"></a>
-<span class="sourceLineNo">218</span><a name="line.218"></a>
-<span class="sourceLineNo">219</span>    @Override<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    public void moveTables(RpcController controller, MoveTablesRequest request,<a name="line.220"></a>
-<span class="sourceLineNo">221</span>        RpcCallback&lt;MoveTablesResponse&gt; done) {<a name="line.221"></a>
-<span class="sourceLineNo">222</span>      MoveTablesResponse.Builder builder = MoveTablesResponse.newBuilder();<a name="line.222"></a>
-<span class="sourceLineNo">223</span>      Set&lt;TableName&gt; tables = new HashSet&lt;&gt;(request.getTableNameList().size());<a name="line.223"></a>
-<span class="sourceLineNo">224</span>      for (HBaseProtos.TableName tableName : request.getTableNameList()) {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>        tables.add(ProtobufUtil.toTableName(tableName));<a name="line.225"></a>
-<span class="sourceLineNo">226</span>      }<a name="line.226"></a>
-<span class="sourceLineNo">227</span>      LOG.info(master.getClientIdAuditPrefix() + " move tables " + tables +" to rsgroup "<a name="line.227"></a>
-<span class="sourceLineNo">228</span>          + request.getTargetGroup());<a name="line.228"></a>
-<span class="sourceLineNo">229</span>      try {<a name="line.229"></a>
-<span class="sourceLineNo">230</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.230"></a>
-<span class="sourceLineNo">231</span>          master.getMasterCoprocessorHost().preMoveTables(tables, request.getTargetGroup());<a name="line.231"></a>
-<span class="sourceLineNo">232</span>        }<a name="line.232"></a>
-<span class="sourceLineNo">233</span>        checkPermission("moveTables");<a name="line.233"></a>
-<span class="sourceLineNo">234</span>        groupAdminServer.moveTables(tables, request.getTargetGroup());<a name="line.234"></a>
-<span class="sourceLineNo">235</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.235"></a>
-<span class="sourceLineNo">236</span>          master.getMasterCoprocessorHost().postMoveTables(tables, request.getTargetGroup());<a name="line.236"></a>
-<span class="sourceLineNo">237</span>        }<a name="line.237"></a>
-<span class="sourceLineNo">238</span>      } catch (IOException e) {<a name="line.238"></a>
-<span class="sourceLineNo">239</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.239"></a>
-<span class="sourceLineNo">240</span>      }<a name="line.240"></a>
-<span class="sourceLineNo">241</span>      done.run(builder.build());<a name="line.241"></a>
-<span class="sourceLineNo">242</span>    }<a name="line.242"></a>
-<span class="sourceLineNo">243</span><a name="line.243"></a>
-<span class="sourceLineNo">244</span>    @Override<a name="line.244"></a>
-<span class="sourceLineNo">245</span>    public void addRSGroup(RpcController controller, AddRSGroupRequest request,<a name="line.245"></a>
-<span class="sourceLineNo">246</span>        RpcCallback&lt;AddRSGroupResponse&gt; done) {<a name="line.246"></a>
-<span class="sourceLineNo">247</span>      AddRSGroupResponse.Builder builder = AddRSGroupResponse.newBuilder();<a name="line.247"></a>
-<span class="sourceLineNo">248</span>      LOG.info(master.getClientIdAuditPrefix() + " add rsgroup " + request.getRSGroupName());<a name="line.248"></a>
-<span class="sourceLineNo">249</span>      try {<a name="line.249"></a>
-<span class="sourceLineNo">250</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.250"></a>
-<span class="sourceLineNo">251</span>          master.getMasterCoprocessorHost().preAddRSGroup(request.getRSGroupName());<a name="line.251"></a>
-<span class="sourceLineNo">252</span>        }<a name="line.252"></a>
-<span class="sourceLineNo">253</span>        checkPermission("addRSGroup");<a name="line.253"></a>
-<span class="sourceLineNo">254</span>        groupAdminServer.addRSGroup(request.getRSGroupName());<a name="line.254"></a>
-<span class="sourceLineNo">255</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.255"></a>
-<span class="sourceLineNo">256</span>          master.getMasterCoprocessorHost().postAddRSGroup(request.getRSGroupName());<a name="line.256"></a>
-<span class="sourceLineNo">257</span>        }<a name="line.257"></a>
-<span class="sourceLineNo">258</span>      } catch (IOException e) {<a name="line.258"></a>
-<span class="sourceLineNo">259</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.259"></a>
-<span class="sourceLineNo">260</span>      }<a name="line.260"></a>
-<span class="sourceLineNo">261</span>      done.run(builder.build());<a name="line.261"></a>
-<span class="sourceLineNo">262</span>    }<a name="line.262"></a>
-<span class="sourceLineNo">263</span><a name="line.263"></a>
-<span class="sourceLineNo">264</span>    @Override<a name="line.264"></a>
-<span class="sourceLineNo">265</span>    public void removeRSGroup(RpcController controller,<a name="line.265"></a>
-<span class="sourceLineNo">266</span>        RemoveRSGroupRequest request, RpcCallback&lt;RemoveRSGroupResponse&gt; done) {<a name="line.266"></a>
-<span class="sourceLineNo">267</span>      RemoveRSGroupResponse.Builder builder =<a name="line.267"></a>
-<span class="sourceLineNo">268</span>          RemoveRSGroupResponse.newBuilder();<a name="line.268"></a>
-<span class="sourceLineNo">269</span>      LOG.info(master.getClientIdAuditPrefix() + " remove rsgroup " + request.getRSGroupName());<a name="line.269"></a>
-<span class="sourceLineNo">270</span>      try {<a name="line.270"></a>
-<span class="sourceLineNo">271</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.271"></a>
-<span class="sourceLineNo">272</span>          master.getMasterCoprocessorHost().preRemoveRSGroup(request.getRSGroupName());<a name="line.272"></a>
-<span class="sourceLineNo">273</span>        }<a name="line.273"></a>
-<span class="sourceLineNo">274</span>        checkPermission("removeRSGroup");<a name="line.274"></a>
-<span class="sourceLineNo">275</span>        groupAdminServer.removeRSGroup(request.getRSGroupName());<a name="line.275"></a>
-<span class="sourceLineNo">276</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.276"></a>
-<span class="sourceLineNo">277</span>          master.getMasterCoprocessorHost().postRemoveRSGroup(request.getRSGroupName());<a name="line.277"></a>
-<span class="sourceLineNo">278</span>        }<a name="line.278"></a>
-<span class="sourceLineNo">279</span>      } catch (IOException e) {<a name="line.279"></a>
-<span class="sourceLineNo">280</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.280"></a>
-<span class="sourceLineNo">281</span>      }<a name="line.281"></a>
-<span class="sourceLineNo">282</span>      done.run(builder.build());<a name="line.282"></a>
-<span class="sourceLineNo">283</span>    }<a name="line.283"></a>
-<span class="sourceLineNo">284</span><a name="line.284"></a>
-<span class="sourceLineNo">285</span>    @Override<a name="line.285"></a>
-<span class="sourceLineNo">286</span>    public void balanceRSGroup(RpcController controller,<a name="line.286"></a>
-<span class="sourceLineNo">287</span>        BalanceRSGroupRequest request, RpcCallback&lt;BalanceRSGroupResponse&gt; done) {<a name="line.287"></a>
-<span class="sourceLineNo">288</span>      BalanceRSGroupResponse.Builder builder = BalanceRSGroupResponse.newBuilder();<a name="line.288"></a>
-<span class="sourceLineNo">289</span>      LOG.info(master.getClientIdAuditPrefix() + " balance rsgroup, group=" +<a name="line.289"></a>
-<span class="sourceLineNo">290</span>              request.getRSGroupName());<a name="line.290"></a>
-<span class="sourceLineNo">291</span>      try {<a name="line.291"></a>
-<span class="sourceLineNo">292</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.292"></a>
-<span class="sourceLineNo">293</span>          master.getMasterCoprocessorHost().preBalanceRSGroup(request.getRSGroupName());<a name="line.293"></a>
-<span class="sourceLineNo">294</span>        }<a name="line.294"></a>
-<span class="sourceLineNo">295</span>        checkPermission("balanceRSGroup");<a name="line.295"></a>
-<span class="sourceLineNo">296</span>        boolean balancerRan = groupAdminServer.balanceRSGroup(request.getRSGroupName());<a name="line.296"></a>
-<span class="sourceLineNo">297</span>        builder.setBalanceRan(balancerRan);<a name="line.297"></a>
-<span class="sourceLineNo">298</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.298"></a>
-<span class="sourceLineNo">299</span>          master.getMasterCoprocessorHost().postBalanceRSGroup(request.getRSGroupName(),<a name="line.299"></a>
-<span class="sourceLineNo">300</span>              balancerRan);<a name="line.300"></a>
-<span class="sourceLineNo">301</span>        }<a name="line.301"></a>
-<span class="sourceLineNo">302</span>      } catch (IOException e) {<a name="line.302"></a>
-<span class="sourceLineNo">303</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.303"></a>
-<span class="sourceLineNo">304</span>        builder.setBalanceRan(false);<a name="line.304"></a>
-<span class="sourceLineNo">305</span>      }<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      done.run(builder.build());<a name="line.306"></a>
-<span class="sourceLineNo">307</span>    }<a name="line.307"></a>
-<span class="sourceLineNo">308</span><a name="line.308"></a>
-<span class="sourceLineNo">309</span>    @Override<a name="line.309"></a>
-<span class="sourceLineNo">310</span>    public void listRSGroupInfos(RpcController controller,<a name="line.310"></a>
-<span class="sourceLineNo">311</span>        ListRSGroupInfosRequest request, RpcCallback&lt;ListRSGroupInfosResponse&gt; done) {<a name="line.311"></a>
-<span class="sourceLineNo">312</span>      ListRSGroupInfosResponse.Builder builder = ListRSGroupInfosResponse.newBuilder();<a name="line.312"></a>
-<span class="sourceLineNo">313</span>      LOG.info(master.getClientIdAuditPrefix() + " list rsgroup");<a name="line.313"></a>
-<span class="sourceLineNo">314</span>      try {<a name="line.314"></a>
-<span class="sourceLineNo">315</span>        checkPermission("listRSGroup");<a name="line.315"></a>
-<span class="sourceLineNo">316</span>        for (RSGroupInfo RSGroupInfo : groupAdminServer.listRSGroups()) {<a name="line.316"></a>
-<span class="sourceLineNo">317</span>          builder.addRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo));<a name="line.317"></a>
-<span class="sourceLineNo">318</span>        }<a name="line.318"></a>
-<span class="sourceLineNo">319</span>      } catch (IOException e) {<a name="line.319"></a>
-<span class="sourceLineNo">320</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.320"></a>
-<span class="sourceLineNo">321</span>      }<a name="line.321"></a>
-<span class="sourceLineNo">322</span>      done.run(builder.build());<a name="line.322"></a>
-<span class="sourceLineNo">323</span>    }<a name="line.323"></a>
-<span class="sourceLineNo">324</span><a name="line.324"></a>
-<span class="sourceLineNo">325</span>    @Override<a name="line.325"></a>
-<span class="sourceLineNo">326</span>    public void getRSGroupInfoOfServer(RpcController controller,<a name="line.326"></a>
-<span class="sourceLineNo">327</span>        GetRSGroupInfoOfServerRequest request, RpcCallback&lt;GetRSGroupInfoOfServerResponse&gt; done) {<a name="line.327"></a>
-<span class="sourceLineNo">328</span>      GetRSGroupInfoOfServerResponse.Builder builder = GetRSGroupInfoOfServerResponse.newBuilder();<a name="line.328"></a>
-<span class="sourceLineNo">329</span>      Address hp = Address.fromParts(request.getServer().getHostName(),<a name="line.329"></a>
-<span class="sourceLineNo">330</span>          request.getServer().getPort());<a name="line.330"></a>
-<span class="sourceLineNo">331</span>      LOG.info(master.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, server="<a name="line.331"></a>
-<span class="sourceLineNo">332</span>          + hp);<a name="line.332"></a>
-<span class="sourceLineNo">333</span>      try {<a name="line.333"></a>
-<span class="sourceLineNo">334</span>        checkPermission("getRSGroupInfoOfServer");<a name="line.334"></a>
-<span class="sourceLineNo">335</span>        RSGroupInfo info = groupAdminServer.getRSGroupOfServer(hp);<a name="line.335"></a>
-<span class="sourceLineNo">336</span>        if (info != null) {<a name="line.336"></a>
-<span class="sourceLineNo">337</span>          builder.setRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(info));<a name="line.337"></a>
-<span class="sourceLineNo">338</span>        }<a name="line.338"></a>
-<span class="sourceLineNo">339</span>      } catch (IOException e) {<a name="line.339"></a>
-<span class="sourceLineNo">340</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.340"></a>
-<span class="sourceLineNo">341</span>      }<a name="line.341"></a>
-<span class="sourceLineNo">342</span>      done.run(builder.build());<a name="line.342"></a>
-<span class="sourceLineNo">343</span>    }<a name="line.343"></a>
-<span class="sourceLineNo">344</span><a name="line.344"></a>
-<span class="sourceLineNo">345</span>    @Override<a name="line.345"></a>
-<span class="sourceLineNo">346</span>    public void moveServersAndTables(RpcController controller,<a name="line.346"></a>
-<span class="sourceLineNo">347</span>        MoveServersAndTablesRequest request, RpcCallback&lt;MoveServersAndTablesResponse&gt; done) {<a name="line.347"></a>
-<span class="sourceLineNo">348</span>      MoveServersAndTablesResponse.Builder builder = MoveServersAndTablesResponse.newBuilder();<a name="line.348"></a>
-<span class="sourceLineNo">349</span>      Set&lt;Address&gt; hostPorts = Sets.newHashSet();<a name="line.349"></a>
-<span class="sourceLineNo">350</span>      for (HBaseProtos.ServerName el : request.getServersList()) {<a name="line.350"></a>
-<span class="sourceLineNo">351</span>        hostPorts.add(Address.fromParts(el.getHostName(), el.getPort()));<a name="line.351"></a>
-<span class="sourceLineNo">352</span>      }<a name="line.352"></a>
-<span class="sourceLineNo">353</span>      Set&lt;TableName&gt; tables = new HashSet&lt;&gt;(request.getTableNameList().size());<a name="line.353"></a>
-<span class="sourceLineNo">354</span>      for (HBaseProtos.TableName tableName : request.getTableNameList()) {<a name="line.354"></a>
-<span class="sourceLineNo">355</span>        tables.add(ProtobufUtil.toTableName(tableName));<a name="line.355"></a>
-<span class="sourceLineNo">356</span>      }<a name="line.356"></a>
-<span class="sourceLineNo">357</span>      LOG.info(master.getClientIdAuditPrefix() + " move servers " + hostPorts<a name="line.357"></a>
-<span class="sourceLineNo">358</span>          + " and tables " + tables + " to rsgroup" + request.getTargetGroup());<a name="line.358"></a>
-<span class="sourceLineNo">359</span>      try {<a name="line.359"></a>
+<span class="sourceLineNo">164</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.164"></a>
+<span class="sourceLineNo">165</span>          master.getMasterCoprocessorHost().preGetRSGroupInfo(groupName);<a name="line.165"></a>
+<span class="sourceLineNo">166</span>        }<a name="line.166"></a>
+<span class="sourceLineNo">167</span>        checkPermission("getRSGroupInfo");<a name="line.167"></a>
+<span class="sourceLineNo">168</span>        RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName);<a name="line.168"></a>
+<span class="sourceLineNo">169</span>        if (rsGroupInfo != null) {<a name="line.169"></a>
+<span class="sourceLineNo">170</span>          builder.setRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(rsGroupInfo));<a name="line.170"></a>
+<span class="sourceLineNo">171</span>        }<a name="line.171"></a>
+<span class="sourceLineNo">172</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>          master.getMasterCoprocessorHost().postGetRSGroupInfo(groupName);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>        }<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      } catch (IOException e) {<a name="line.175"></a>
+<span class="sourceLineNo">176</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.176"></a>
+<span class="sourceLineNo">177</span>      }<a name="line.177"></a>
+<span class="sourceLineNo">178</span>      done.run(builder.build());<a name="line.178"></a>
+<span class="sourceLineNo">179</span>    }<a name="line.179"></a>
+<span class="sourceLineNo">180</span><a name="line.180"></a>
+<span class="sourceLineNo">181</span>    @Override<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    public void getRSGroupInfoOfTable(RpcController controller,<a name="line.182"></a>
+<span class="sourceLineNo">183</span>        GetRSGroupInfoOfTableRequest request, RpcCallback&lt;GetRSGroupInfoOfTableResponse&gt; done) {<a name="line.183"></a>
+<span class="sourceLineNo">184</span>      GetRSGroupInfoOfTableResponse.Builder builder = GetRSGroupInfoOfTableResponse.newBuilder();<a name="line.184"></a>
+<span class="sourceLineNo">185</span>      TableName tableName = ProtobufUtil.toTableName(request.getTableName());<a name="line.185"></a>
+<span class="sourceLineNo">186</span>      LOG.info(master.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, table="<a name="line.186"></a>
+<span class="sourceLineNo">187</span>          + tableName);<a name="line.187"></a>
+<span class="sourceLineNo">188</span>      try {<a name="line.188"></a>
+<span class="sourceLineNo">189</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.189"></a>
+<span class="sourceLineNo">190</span>          master.getMasterCoprocessorHost().preGetRSGroupInfoOfTable(tableName);<a name="line.190"></a>
+<span class="sourceLineNo">191</span>        }<a name="line.191"></a>
+<span class="sourceLineNo">192</span>        checkPermission("getRSGroupInfoOfTable");<a name="line.192"></a>
+<span class="sourceLineNo">193</span>        RSGroupInfo RSGroupInfo = groupAdminServer.getRSGroupInfoOfTable(tableName);<a name="line.193"></a>
+<span class="sourceLineNo">194</span>        if (RSGroupInfo != null) {<a name="line.194"></a>
+<span class="sourceLineNo">195</span>          builder.setRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo));<a name="line.195"></a>
+<span class="sourceLineNo">196</span>        }<a name="line.196"></a>
+<span class="sourceLineNo">197</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.197"></a>
+<span class="sourceLineNo">198</span>          master.getMasterCoprocessorHost().postGetRSGroupInfoOfTable(tableName);<a name="line.198"></a>
+<span class="sourceLineNo">199</span>        }<a name="line.199"></a>
+<span class="sourceLineNo">200</span>      } catch (IOException e) {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.201"></a>
+<span class="sourceLineNo">202</span>      }<a name="line.202"></a>
+<span class="sourceLineNo">203</span>      done.run(builder.build());<a name="line.203"></a>
+<span class="sourceLineNo">204</span>    }<a name="line.204"></a>
+<span class="sourceLineNo">205</span><a name="line.205"></a>
+<span class="sourceLineNo">206</span>    @Override<a name="line.206"></a>
+<span class="sourceLineNo">207</span>    public void moveServers(RpcController controller, MoveServersRequest request,<a name="line.207"></a>
+<span class="sourceLineNo">208</span>        RpcCallback&lt;MoveServersResponse&gt; done) {<a name="line.208"></a>
+<span class="sourceLineNo">209</span>      MoveServersResponse.Builder builder = MoveServersResponse.newBuilder();<a name="line.209"></a>
+<span class="sourceLineNo">210</span>      Set&lt;Address&gt; hostPorts = Sets.newHashSet();<a name="line.210"></a>
+<span class="sourceLineNo">211</span>      for (HBaseProtos.ServerName el : request.getServersList()) {<a name="line.211"></a>
+<span class="sourceLineNo">212</span>        hostPorts.add(Address.fromParts(el.getHostName(), el.getPort()));<a name="line.212"></a>
+<span class="sourceLineNo">213</span>      }<a name="line.213"></a>
+<span class="sourceLineNo">214</span>      LOG.info(master.getClientIdAuditPrefix() + " move servers " + hostPorts +" to rsgroup "<a name="line.214"></a>
+<span class="sourceLineNo">215</span>          + request.getTargetGroup());<a name="line.215"></a>
+<span class="sourceLineNo">216</span>      try {<a name="line.216"></a>
+<span class="sourceLineNo">217</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.217"></a>
+<span class="sourceLineNo">218</span>          master.getMasterCoprocessorHost().preMoveServers(hostPorts, request.getTargetGroup());<a name="line.218"></a>
+<span class="sourceLineNo">219</span>        }<a name="line.219"></a>
+<span class="sourceLineNo">220</span>        checkPermission("moveServers");<a name="line.220"></a>
+<span class="sourceLineNo">221</span>        groupAdminServer.moveServers(hostPorts, request.getTargetGroup());<a name="line.221"></a>
+<span class="sourceLineNo">222</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.222"></a>
+<span class="sourceLineNo">223</span>          master.getMasterCoprocessorHost().postMoveServers(hostPorts, request.getTargetGroup());<a name="line.223"></a>
+<span class="sourceLineNo">224</span>        }<a name="line.224"></a>
+<span class="sourceLineNo">225</span>      } catch (IOException e) {<a name="line.225"></a>
+<span class="sourceLineNo">226</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.226"></a>
+<span class="sourceLineNo">227</span>      }<a name="line.227"></a>
+<span class="sourceLineNo">228</span>      done.run(builder.build());<a name="line.228"></a>
+<span class="sourceLineNo">229</span>    }<a name="line.229"></a>
+<span class="sourceLineNo">230</span><a name="line.230"></a>
+<span class="sourceLineNo">231</span>    @Override<a name="line.231"></a>
+<span class="sourceLineNo">232</span>    public void moveTables(RpcController controller, MoveTablesRequest request,<a name="line.232"></a>
+<span class="sourceLineNo">233</span>        RpcCallback&lt;MoveTablesResponse&gt; done) {<a name="line.233"></a>
+<span class="sourceLineNo">234</span>      MoveTablesResponse.Builder builder = MoveTablesResponse.newBuilder();<a name="line.234"></a>
+<span class="sourceLineNo">235</span>      Set&lt;TableName&gt; tables = new HashSet&lt;&gt;(request.getTableNameList().size());<a name="line.235"></a>
+<span class="sourceLineNo">236</span>      for (HBaseProtos.TableName tableName : request.getTableNameList()) {<a name="line.236"></a>
+<span class="sourceLineNo">237</span>        tables.add(ProtobufUtil.toTableName(tableName));<a name="line.237"></a>
+<span class="sourceLineNo">238</span>      }<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      LOG.info(master.getClientIdAuditPrefix() + " move tables " + tables +" to rsgroup "<a name="line.239"></a>
+<span class="sourceLineNo">240</span>          + request.getTargetGroup());<a name="line.240"></a>
+<span class="sourceLineNo">241</span>      try {<a name="line.241"></a>
+<span class="sourceLineNo">242</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.242"></a>
+<span class="sourceLineNo">243</span>          master.getMasterCoprocessorHost().preMoveTables(tables, request.getTargetGroup());<a name="line.243"></a>
+<span class="sourceLineNo">244</span>        }<a name="line.244"></a>
+<span class="sourceLineNo">245</span>        checkPermission("moveTables");<a name="line.245"></a>
+<span class="sourceLineNo">246</span>        groupAdminServer.moveTables(tables, request.getTargetGroup());<a name="line.246"></a>
+<span class="sourceLineNo">247</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.247"></a>
+<span class="sourceLineNo">248</span>          master.getMasterCoprocessorHost().postMoveTables(tables, request.getTargetGroup());<a name="line.248"></a>
+<span class="sourceLineNo">249</span>        }<a name="line.249"></a>
+<span class="sourceLineNo">250</span>      } catch (IOException e) {<a name="line.250"></a>
+<span class="sourceLineNo">251</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.251"></a>
+<span class="sourceLineNo">252</span>      }<a name="line.252"></a>
+<span class="sourceLineNo">253</span>      done.run(builder.build());<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    }<a name="line.254"></a>
+<span class="sourceLineNo">255</span><a name="line.255"></a>
+<span class="sourceLineNo">256</span>    @Override<a name="line.256"></a>
+<span class="sourceLineNo">257</span>    public void addRSGroup(RpcController controller, AddRSGroupRequest request,<a name="line.257"></a>
+<span class="sourceLineNo">258</span>        RpcCallback&lt;AddRSGroupResponse&gt; done) {<a name="line.258"></a>
+<span class="sourceLineNo">259</span>      AddRSGroupResponse.Builder builder = AddRSGroupResponse.newBuilder();<a name="line.259"></a>
+<span class="sourceLineNo">260</span>      LOG.info(master.getClientIdAuditPrefix() + " add rsgroup " + request.getRSGroupName());<a name="line.260"></a>
+<span class="sourceLineNo">261</span>      try {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.262"></a>
+<span class="sourceLineNo">263</span>          master.getMasterCoprocessorHost().preAddRSGroup(request.getRSGroupName());<a name="line.263"></a>
+<span class="sourceLineNo">264</span>        }<a name="line.264"></a>
+<span class="sourceLineNo">265</span>        checkPermission("addRSGroup");<a name="line.265"></a>
+<span class="sourceLineNo">266</span>        groupAdminServer.addRSGroup(request.getRSGroupName());<a name="line.266"></a>
+<span class="sourceLineNo">267</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.267"></a>
+<span class="sourceLineNo">268</span>          master.getMasterCoprocessorHost().postAddRSGroup(request.getRSGroupName());<a name="line.268"></a>
+<span class="sourceLineNo">269</span>        }<a name="line.269"></a>
+<span class="sourceLineNo">270</span>      } catch (IOException e) {<a name="line.270"></a>
+<span class="sourceLineNo">271</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.271"></a>
+<span class="sourceLineNo">272</span>      }<a name="line.272"></a>
+<span class="sourceLineNo">273</span>      done.run(builder.build());<a name="line.273"></a>
+<span class="sourceLineNo">274</span>    }<a name="line.274"></a>
+<span class="sourceLineNo">275</span><a name="line.275"></a>
+<span class="sourceLineNo">276</span>    @Override<a name="line.276"></a>
+<span class="sourceLineNo">277</span>    public void removeRSGroup(RpcController controller,<a name="line.277"></a>
+<span class="sourceLineNo">278</span>        RemoveRSGroupRequest request, RpcCallback&lt;RemoveRSGroupResponse&gt; done) {<a name="line.278"></a>
+<span class="sourceLineNo">279</span>      RemoveRSGroupResponse.Builder builder =<a name="line.279"></a>
+<span class="sourceLineNo">280</span>          RemoveRSGroupResponse.newBuilder();<a name="line.280"></a>
+<span class="sourceLineNo">281</span>      LOG.info(master.getClientIdAuditPrefix() + " remove rsgroup " + request.getRSGroupName());<a name="line.281"></a>
+<span class="sourceLineNo">282</span>      try {<a name="line.282"></a>
+<span class="sourceLineNo">283</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.283"></a>
+<span class="sourceLineNo">284</span>          master.getMasterCoprocessorHost().preRemoveRSGroup(request.getRSGroupName());<a name="line.284"></a>
+<span class="sourceLineNo">285</span>        }<a name="line.285"></a>
+<span class="sourceLineNo">286</span>        checkPermission("removeRSGroup");<a name="line.286"></a>
+<span class="sourceLineNo">287</span>        groupAdminServer.removeRSGroup(request.getRSGroupName());<a name="line.287"></a>
+<span class="sourceLineNo">288</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.288"></a>
+<span class="sourceLineNo">289</span>          master.getMasterCoprocessorHost().postRemoveRSGroup(request.getRSGroupName());<a name="line.289"></a>
+<span class="sourceLineNo">290</span>        }<a name="line.290"></a>
+<span class="sourceLineNo">291</span>      } catch (IOException e) {<a name="line.291"></a>
+<span class="sourceLineNo">292</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.292"></a>
+<span class="sourceLineNo">293</span>      }<a name="line.293"></a>
+<span class="sourceLineNo">294</span>      done.run(builder.build());<a name="line.294"></a>
+<span class="sourceLineNo">295</span>    }<a name="line.295"></a>
+<span class="sourceLineNo">296</span><a name="line.296"></a>
+<span class="sourceLineNo">297</span>    @Override<a name="line.297"></a>
+<span class="sourceLineNo">298</span>    public void balanceRSGroup(RpcController controller,<a name="line.298"></a>
+<span class="sourceLineNo">299</span>        BalanceRSGroupRequest request, RpcCallback&lt;BalanceRSGroupResponse&gt; done) {<a name="line.299"></a>
+<span class="sourceLineNo">300</span>      BalanceRSGroupResponse.Builder builder = BalanceRSGroupResponse.newBuilder();<a name="line.300"></a>
+<span class="sourceLineNo">301</span>      LOG.info(master.getClientIdAuditPrefix() + " balance rsgroup, group=" +<a name="line.301"></a>
+<span class="sourceLineNo">302</span>              request.getRSGroupName());<a name="line.302"></a>
+<span class="sourceLineNo">303</span>      try {<a name="line.303"></a>
+<span class="sourceLineNo">304</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.304"></a>
+<span class="sourceLineNo">305</span>          master.getMasterCoprocessorHost().preBalanceRSGroup(request.getRSGroupName());<a name="line.305"></a>
+<span class="sourceLineNo">306</span>        }<a name="line.306"></a>
+<span class="sourceLineNo">307</span>        checkPermission("balanceRSGroup");<a name="line.307"></a>
+<span class="sourceLineNo">308</span>        boolean balancerRan = groupAdminServer.balanceRSGroup(request.getRSGroupName());<a name="line.308"></a>
+<span class="sourceLineNo">309</span>        builder.setBalanceRan(balancerRan);<a name="line.309"></a>
+<span class="sourceLineNo">310</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.310"></a>
+<span class="sourceLineNo">311</span>          master.getMasterCoprocessorHost().postBalanceRSGroup(request.getRSGroupName(),<a name="line.311"></a>
+<span class="sourceLineNo">312</span>              balancerRan);<a name="line.312"></a>
+<span class="sourceLineNo">313</span>        }<a name="line.313"></a>
+<span class="sourceLineNo">314</span>      } catch (IOException e) {<a name="line.314"></a>
+<span class="sourceLineNo">315</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.315"></a>
+<span class="sourceLineNo">316</span>        builder.setBalanceRan(false);<a name="line.316"></a>
+<span class="sourceLineNo">317</span>      }<a name="line.317"></a>
+<span class="sourceLineNo">318</span>      done.run(builder.build());<a name="line.318"></a>
+<span class="sourceLineNo">319</span>    }<a name="line.319"></a>
+<span class="sourceLineNo">320</span><a name="line.320"></a>
+<span class="sourceLineNo">321</span>    @Override<a name="line.321"></a>
+<span class="sourceLineNo">322</span>    public void listRSGroupInfos(RpcController controller,<a name="line.322"></a>
+<span class="sourceLineNo">323</span>        ListRSGroupInfosRequest request, RpcCallback&lt;ListRSGroupInfosResponse&gt; done) {<a name="line.323"></a>
+<span class="sourceLineNo">324</span>      ListRSGroupInfosResponse.Builder builder = ListRSGroupInfosResponse.newBuilder();<a name="line.324"></a>
+<span class="sourceLineNo">325</span>      LOG.info(master.getClientIdAuditPrefix() + " list rsgroup");<a name="line.325"></a>
+<span class="sourceLineNo">326</span>      try {<a name="line.326"></a>
+<span class="sourceLineNo">327</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.327"></a>
+<span class="sourceLineNo">328</span>          master.getMasterCoprocessorHost().preListRSGroups();<a name="line.328"></a>
+<span class="sourceLineNo">329</span>        }<a name="line.329"></a>
+<span class="sourceLineNo">330</span>        checkPermission("listRSGroup");<a name="line.330"></a>
+<span class="sourceLineNo">331</span>        for (RSGroupInfo RSGroupInfo : groupAdminServer.listRSGroups()) {<a name="line.331"></a>
+<span class="sourceLineNo">332</span>          builder.addRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo));<a name="line.332"></a>
+<span class="sourceLineNo">333</span>        }<a name="line.333"></a>
+<span class="sourceLineNo">334</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.334"></a>
+<span class="sourceLineNo">335</span>          master.getMasterCoprocessorHost().postListRSGroups();<a name="line.335"></a>
+<span class="sourceLineNo">336</span>        }<a name="line.336"></a>
+<span class="sourceLineNo">337</span>      } catch (IOException e) {<a name="line.337"></a>
+<span class="sourceLineNo">338</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.338"></a>
+<span class="sourceLineNo">339</span>      }<a name="line.339"></a>
+<span class="sourceLineNo">340</span>      done.run(builder.build());<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    }<a name="line.341"></a>
+<span class="sourceLineNo">342</span><a name="line.342"></a>
+<span class="sourceLineNo">343</span>    @Override<a name="line.343"></a>
+<span class="sourceLineNo">344</span>    public void getRSGroupInfoOfServer(RpcController controller,<a name="line.344"></a>
+<span class="sourceLineNo">345</span>        GetRSGroupInfoOfServerRequest request, RpcCallback&lt;GetRSGroupInfoOfServerResponse&gt; done) {<a name="line.345"></a>
+<span class="sourceLineNo">346</span>      GetRSGroupInfoOfServerResponse.Builder builder = GetRSGroupInfoOfServerResponse.newBuilder();<a name="line.346"></a>
+<span class="sourceLineNo">347</span>      Address hp = Address.fromParts(request.getServer().getHostName(),<a name="line.347"></a>
+<span class="sourceLineNo">348</span>          request.getServer().getPort());<a name="line.348"></a>
+<span class="sourceLineNo">349</span>      LOG.info(master.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, server="<a name="line.349"></a>
+<span class="sourceLineNo">350</span>          + hp);<a name="line.350"></a>
+<span class="sourceLineNo">351</span>      try {<a name="line.351"></a>
+<span class="sourceLineNo">352</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.352"></a>
+<span class="sourceLineNo">353</span>          master.getMasterCoprocessorHost().preGetRSGroupInfoOfServer(hp);<a name="line.353"></a>
+<span class="sourceLineNo">354</span>        }<a name="line.354"></a>
+<span class="sourceLineNo">355</span>        checkPermission("getRSGroupInfoOfServer");<a name="line.355"></a>
+<span class="sourceLineNo">356</span>        RSGroupInfo info = groupAdminServer.getRSGroupOfServer(hp);<a name="line.356"></a>
+<span class="sourceLineNo">357</span>        if (info != null) {<a name="line.357"></a>
+<span class="sourceLineNo">358</span>          builder.setRSGroupInfo(RSGroupProtobufUtil.toProtoGroupInfo(info));<a name="line.358"></a>
+<span class="sourceLineNo">359</span>        }<a name="line.359"></a>
 <span class="sourceLineNo">360</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.360"></a>
-<span class="sourceLineNo">361</span>          master.getMasterCoprocessorHost().preMoveServersAndTables(hostPorts, tables,<a name="line.361"></a>
-<span class="sourceLineNo">362</span>              request.getTargetGroup());<a name="line.362"></a>
-<span class="sourceLineNo">363</span>        }<a name="line.363"></a>
-<span class="sourceLineNo">364</span>        checkPermission("moveServersAndTables");<a name="line.364"></a>
-<span class="sourceLineNo">365</span>        groupAdminServer.moveServersAndTables(hostPorts, tables, request.getTargetGroup());<a name="line.365"></a>
-<span class="sourceLineNo">366</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.366"></a>
-<span class="sourceLineNo">367</span>          master.getMasterCoprocessorHost().postMoveServersAndTables(hostPorts, tables,<a name="line.367"></a>
-<span class="sourceLineNo">368</span>              request.getTargetGroup());<a name="line.368"></a>
-<span class="sourceLineNo">369</span>        }<a name="line.369"></a>
-<span class="sourceLineNo">370</span>      } catch (IOException e) {<a name="line.370"></a>
-<span class="sourceLineNo">371</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.371"></a>
-<span class="sourceLineNo">372</span>      }<a name="line.372"></a>
-<span class="sourceLineNo">373</span>      done.run(builder.build());<a name="line.373"></a>
-<span class="sourceLineNo">374</span>    }<a name="line.374"></a>
-<span class="sourceLineNo">375</span><a name="line.375"></a>
-<span class="sourceLineNo">376</span>    @Override<a name="line.376"></a>
-<span class="sourceLineNo">377</span>    public void removeServers(RpcController controller,<a name="line.377"></a>
-<span class="sourceLineNo">378</span>        RemoveServersRequest request,<a name="line.378"></a>
-<span class="sourceLineNo">379</span>        RpcCallback&lt;RemoveServersResponse&gt; done) {<a name="line.379"></a>
-<span class="sourceLineNo">380</span>      RemoveServersResponse.Builder builder =<a name="line.380"></a>
-<span class="sourceLineNo">381</span>          RemoveServersResponse.newBuilder();<a name="line.381"></a>
-<span class="sourceLineNo">382</span>      Set&lt;Address&gt; servers = Sets.newHashSet();<a name="line.382"></a>
-<span class="sourceLineNo">383</span>      for (HBaseProtos.ServerName el : request.getServersList()) {<a name="line.383"></a>
-<span class="sourceLineNo">384</span>        servers.add(Address.fromParts(el.getHostName(), el.getPort()));<a name="line.384"></a>
-<span class="sourceLineNo">385</span>      }<a name="line.385"></a>
-<span class="sourceLineNo">386</span>      LOG.info(master.getClientIdAuditPrefix()<a name="line.386"></a>
-<span class="sourceLineNo">387</span>          + " remove decommissioned servers from rsgroup: " + servers);<a name="line.387"></a>
-<span class="sourceLineNo">388</span>      try {<a name="line.388"></a>
-<span class="sourceLineNo">389</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.389"></a>
-<span class="sourceLineNo">390</span>          master.getMasterCoprocessorHost().preRemoveServers(servers);<a name="line.390"></a>
-<span class="sourceLineNo">391</span>        }<a name="line.391"></a>
-<span class="sourceLineNo">392</span>        checkPermission("removeServers");<a name="line.392"></a>
-<span class="sourceLineNo">393</span>        groupAdminServer.removeServers(servers);<a name="line.393"></a>
-<span class="sourceLineNo">394</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.394"></a>
-<span class="sourceLineNo">395</span>          master.getMasterCoprocessorHost().postRemoveServers(servers);<a name="line.395"></a>
-<span class="sourceLineNo">396</span>        }<a name="line.396"></a>
-<span class="sourceLineNo">397</span>      } catch (IOException e) {<a name="line.397"></a>
-<span class="sourceLineNo">398</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.398"></a>
-<span class="sourceLineNo">399</span>      }<a name="line.399"></a>
-<span class="sourceLineNo">400</span>      done.run(builder.build());<a name="line.400"></a>
-<span class="sourceLineNo">401</span>    }<a name="line.401"></a>
-<span class="sourceLineNo">402</span>  }<a name="line.402"></a>
-<span class="sourceLineNo">403</span><a name="line.403"></a>
-<span class="sourceLineNo">404</span>  boolean rsgroupHasServersOnline(TableDescriptor desc) throws IOException {<a name="line.404"></a>
-<span class="sourceLineNo">405</span>    String groupName;<a name="line.405"></a>
-<span class="sourceLineNo">406</span>    try {<a name="line.406"></a>
-<span class="sourceLineNo">407</span>      groupName =<a name="line.407"></a>
-<span class="sourceLineNo">408</span>        master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString())<a name="line.408"></a>
-<span class="sourceLineNo">409</span>        .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP);<a name="line.409"></a>
-<span class="sourceLineNo">410</span>      if (groupName == null) {<a name="line.410"></a>
-<span class="sourceLineNo">411</span>        groupName = RSGroupInfo.DEFAULT_GROUP;<a name="line.411"></a>
-<span class="sourceLineNo">412</span>      }<a name="line.412"></a>
-<span class="sourceLineNo">413</span>    } catch (MasterNotRunningException | PleaseHoldException e) {<a name="line.413"></a>
-<span class="sourceLineNo">414</span>      LOG.info("Master has not initialized yet; temporarily using default RSGroup '" +<a name="line.414"></a>
-<span class="sourceLineNo">415</span>          RSGroupInfo.DEFAULT_GROUP + "' for deploy of system table");<a name="line.415"></a>
-<span class="sourceLineNo">416</span>      groupName = RSGroupInfo.DEFAULT_GROUP;<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    }<a name="line.417"></a>
-<span class="sourceLineNo">418</span><a name="line.418"></a>
-<span class="sourceLineNo">419</span>    RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName);<a name="line.419"></a>
-<span class="sourceLineNo">420</span>    if (rsGroupInfo == null) {<a name="line.420"></a>
-<span class="sourceLineNo">421</span>      throw new ConstraintException(<a name="line.421"></a>
-<span class="sourceLineNo">422</span>          "Default RSGroup (" + groupName + ") for this table's " + "namespace does not exist.");<a name="line.422"></a>
-<span class="sourceLineNo">423</span>    }<a name="line.423"></a>
-<span class="sourceLineNo">424</span><a name="line.424"></a>
-<span class="sourceLineNo">425</span>    for (ServerName onlineServer : master.getServerManager().createDestinationServersList()) {<a name="line.425"></a>
-<span class="sourceLineNo">426</span>      if (rsGroupInfo.getServers().contains(onlineServer.getAddress())) {<a name="line.426"></a>
-<span class="sourceLineNo">427</span>        return true;<a name="line.427"></a>
-<span class="sourceLineNo">428</span>      }<a name="line.428"></a>
-<span class="sourceLineNo">429</span>    }<a name="line.429"></a>
-<span class="sourceLineNo">430</span>    return false;<a name="line.430"></a>
-<span class="sourceLineNo">431</span>  }<a name="line.431"></a>
-<span class="sourceLineNo">432</span><a name="line.432"></a>
-<span class="sourceLineNo">433</span>  void assignTableToGroup(TableDescriptor desc) throws IOException {<a name="line.433"></a>
-<span class="sourceLineNo">434</span>    String groupName =<a name="line.434"></a>
-<span class="sourceLineNo">435</span>        master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString())<a name="line.435"></a>
-<span class="sourceLineNo">436</span>                .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP);<a name="line.436"></a>
-<span class="sourceLineNo">437</span>    if (groupName == null) {<a name="line.437"></a>
-<span class="sourceLineNo">438</span>      groupName = RSGroupInfo.DEFAULT_GROUP;<a name="line.438"></a>
-<span class="sourceLineNo">439</span>    }<a name="line.439"></a>
-<span class="sourceLineNo">440</span>    RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName);<a name="line.440"></a>
-<span class="sourceLineNo">441</span>    if (rsGroupInfo == null) {<a name="line.441"></a>
-<span class="sourceLineNo">442</span>      throw new ConstraintException("Default RSGroup (" + groupName + ") for this table's "<a name="line.442"></a>
-<span class="sourceLineNo">443</span>          + "namespace does not exist.");<a name="line.443"></a>
-<span class="sourceLineNo">444</span>    }<a name="line.444"></a>
-<span class="sourceLineNo">445</span>    if (!rsGroupInfo.containsTable(desc.getTableName())) {<a name="line.445"></a>
-<span class="sourceLineNo">446</span>      LOG.debug("Pre-moving table " + desc.getTableName() + " to RSGroup " + groupName);<a name="line.446"></a>
-<span class="sourceLineNo">447</span>      groupAdminServer.moveTables(Sets.newHashSet(desc.getTableName()), groupName);<a name="line.447"></a>
-<span class="sourceLineNo">448</span>    }<a name="line.448"></a>
-<span class="sourceLineNo">449</span>  }<a name="line.449"></a>
-<span class="sourceLineNo">450</span><a name="line.450"></a>
-<span class="sourceLineNo">451</span>  /////////////////////////////////////////////////////////////////////////////<a name="line.451"></a>
-<span class="sourceLineNo">452</span>  // MasterObserver overrides<a name="line.452"></a>
-<span class="sourceLineNo">453</span>  /////////////////////////////////////////////////////////////////////////////<a name="line.453"></a>
-<span class="sourceLineNo">454</span><a name="line.454"></a>
-<span class="sourceLineNo">455</span>  @Override<a name="line.455"></a>
-<span class="sourceLineNo">456</span>  public void preCreateTableAction(<a name="line.456"></a>
-<span class="sourceLineNo">457</span>      final ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.457"></a>
-<span class="sourceLineNo">458</span>      final TableDescriptor desc,<a name="line.458"></a>
-<span class="sourceLineNo">459</span>      final RegionInfo[] regions) throws IOException {<a name="line.459"></a>
-<span class="sourceLineNo">460</span>    if (!desc.getTableName().isSystemTable() &amp;&amp; !rsgroupHasServersOnline(desc)) {<a name="line.460"></a>
-<span class="sourceLineNo">461</span>      throw new HBaseIOException("No online servers in the rsgroup, which table " +<a name="line.461"></a>
-<span class="sourceLineNo">462</span>          desc.getTableName().getNameAsString() + " belongs to");<a name="line.462"></a>
+<span class="sourceLineNo">361</span>          master.getMasterCoprocessorHost().postGetRSGroupInfoOfServer(hp);<a name="line.361"></a>
+<span class="sourceLineNo">362</span>        }<a name="line.362"></a>
+<span class="sourceLineNo">363</span>      } catch (IOException e) {<a name="line.363"></a>
+<span class="sourceLineNo">364</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.364"></a>
+<span class="sourceLineNo">365</span>      }<a name="line.365"></a>
+<span class="sourceLineNo">366</span>      done.run(builder.build());<a name="line.366"></a>
+<span class="sourceLineNo">367</span>    }<a name="line.367"></a>
+<span class="sourceLineNo">368</span><a name="line.368"></a>
+<span class="sourceLineNo">369</span>    @Override<a name="line.369"></a>
+<span class="sourceLineNo">370</span>    public void moveServersAndTables(RpcController controller,<a name="line.370"></a>
+<span class="sourceLineNo">371</span>        MoveServersAndTablesRequest request, RpcCallback&lt;MoveServersAndTablesResponse&gt; done) {<a name="line.371"></a>
+<span class="sourceLineNo">372</span>      MoveServersAndTablesResponse.Builder builder = MoveServersAndTablesResponse.newBuilder();<a name="line.372"></a>
+<span class="sourceLineNo">373</span>      Set&lt;Address&gt; hostPorts = Sets.newHashSet();<a name="line.373"></a>
+<span class="sourceLineNo">374</span>      for (HBaseProtos.ServerName el : request.getServersList()) {<a name="line.374"></a>
+<span class="sourceLineNo">375</span>        hostPorts.add(Address.fromParts(el.getHostName(), el.getPort()));<a name="line.375"></a>
+<span class="sourceLineNo">376</span>      }<a name="line.376"></a>
+<span class="sourceLineNo">377</span>      Set&lt;TableName&gt; tables = new HashSet&lt;&gt;(request.getTableNameList().size());<a name="line.377"></a>
+<span class="sourceLineNo">378</span>      for (HBaseProtos.TableName tableName : request.getTableNameList()) {<a name="line.378"></a>
+<span class="sourceLineNo">379</span>        tables.add(ProtobufUtil.toTableName(tableName));<a name="line.379"></a>
+<span class="sourceLineNo">380</span>      }<a name="line.380"></a>
+<span class="sourceLineNo">381</span>      LOG.info(master.getClientIdAuditPrefix() + " move servers " + hostPorts<a name="line.381"></a>
+<span class="sourceLineNo">382</span>          + " and tables " + tables + " to rsgroup" + request.getTargetGroup());<a name="line.382"></a>
+<span class="sourceLineNo">383</span>      try {<a name="line.383"></a>
+<span class="sourceLineNo">384</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.384"></a>
+<span class="sourceLineNo">385</span>          master.getMasterCoprocessorHost().preMoveServersAndTables(hostPorts, tables,<a name="line.385"></a>
+<span class="sourceLineNo">386</span>              request.getTargetGroup());<a name="line.386"></a>
+<span class="sourceLineNo">387</span>        }<a name="line.387"></a>
+<span class="sourceLineNo">388</span>        checkPermission("moveServersAndTables");<a name="line.388"></a>
+<span class="sourceLineNo">389</span>        groupAdminServer.moveServersAndTables(hostPorts, tables, request.getTargetGroup());<a name="line.389"></a>
+<span class="sourceLineNo">390</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.390"></a>
+<span class="sourceLineNo">391</span>          master.getMasterCoprocessorHost().postMoveServersAndTables(hostPorts, tables,<a name="line.391"></a>
+<span class="sourceLineNo">392</span>              request.getTargetGroup());<a name="line.392"></a>
+<span class="sourceLineNo">393</span>        }<a name="line.393"></a>
+<span class="sourceLineNo">394</span>      } catch (IOException e) {<a name="line.394"></a>
+<span class="sourceLineNo">395</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.395"></a>
+<span class="sourceLineNo">396</span>      }<a name="line.396"></a>
+<span class="sourceLineNo">397</span>      done.run(builder.build());<a name="line.397"></a>
+<span class="sourceLineNo">398</span>    }<a name="line.398"></a>
+<span class="sourceLineNo">399</span><a name="line.399"></a>
+<span class="sourceLineNo">400</span>    @Override<a name="line.400"></a>
+<span class="sourceLineNo">401</span>    public void removeServers(RpcController controller,<a name="line.401"></a>
+<span class="sourceLineNo">402</span>        RemoveServersRequest request,<a name="line.402"></a>
+<span class="sourceLineNo">403</span>        RpcCallback&lt;RemoveServersResponse&gt; done) {<a name="line.403"></a>
+<span class="sourceLineNo">404</span>      RemoveServersResponse.Builder builder =<a name="line.404"></a>
+<span class="sourceLineNo">405</span>          RemoveServersResponse.newBuilder();<a name="line.405"></a>
+<span class="sourceLineNo">406</span>      Set&lt;Address&gt; servers = Sets.newHashSet();<a name="line.406"></a>
+<span class="sourceLineNo">407</span>      for (HBaseProtos.ServerName el : request.getServersList()) {<a name="line.407"></a>
+<span class="sourceLineNo">408</span>        servers.add(Address.fromParts(el.getHostName(), el.getPort()));<a name="line.408"></a>
+<span class="sourceLineNo">409</span>      }<a name="line.409"></a>
+<span class="sourceLineNo">410</span>      LOG.info(master.getClientIdAuditPrefix()<a name="line.410"></a>
+<span class="sourceLineNo">411</span>          + " remove decommissioned servers from rsgroup: " + servers);<a name="line.411"></a>
+<span class="sourceLineNo">412</span>      try {<a name="line.412"></a>
+<span class="sourceLineNo">413</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.413"></a>
+<span class="sourceLineNo">414</span>          master.getMasterCoprocessorHost().preRemoveServers(servers);<a name="line.414"></a>
+<span class="sourceLineNo">415</span>        }<a name="line.415"></a>
+<span class="sourceLineNo">416</span>        checkPermission("removeServers");<a name="line.416"></a>
+<span class="sourceLineNo">417</span>        groupAdminServer.removeServers(servers);<a name="line.417"></a>
+<span class="sourceLineNo">418</span>        if (master.getMasterCoprocessorHost() != null) {<a name="line.418"></a>
+<span class="sourceLineNo">419</span>          master.getMasterCoprocessorHost().postRemoveServers(servers);<a name="line.419"></a>
+<span class="sourceLineNo">420</span>        }<a name="line.420"></a>
+<span class="sourceLineNo">421</span>      } catch (IOException e) {<a name="line.421"></a>
+<span class="sourceLineNo">422</span>        CoprocessorRpcUtils.setControllerException(controller, e);<a name="line.422"></a>
+<span class="sourceLineNo">423</span>      }<a name="line.423"></a>
+<span class="sourceLineNo">424</span>      done.run(builder.build());<a name="line.424"></a>
+<span class="sourceLineNo">425</span>    }<a name="line.425"></a>
+<span class="sourceLineNo">426</span>  }<a name="line.426"></a>
+<span class="sourceLineNo">427</span><a name="line.427"></a>
+<span class="sourceLineNo">428</span>  boolean rsgroupHasServersOnline(TableDescriptor desc) throws IOException {<a name="line.428"></a>
+<span class="sourceLineNo">429</span>    String groupName;<a name="line.429"></a>
+<span class="sourceLineNo">430</span>    try {<a name="line.430"></a>
+<span class="sourceLineNo">431</span>      groupName =<a name="line.431"></a>
+<span class="sourceLineNo">432</span>        master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString())<a name="line.432"></a>
+<span class="sourceLineNo">433</span>        .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP);<a name="line.433"></a>
+<span class="sourceLineNo">434</span>      if (groupName == null) {<a name="line.434"></a>
+<span class="sourceLineNo">435</span>        groupName = RSGroupInfo.DEFAULT_GROUP;<a name="line.435"></a>
+<span class="sourceLineNo">436</span>      }<a name="line.436"></a>
+<span class="sourceLineNo">437</span>    } catch (MasterNotRunningException | PleaseHoldException e) {<a name="line.437"></a>
+<span class="sourceLineNo">438</span>      LOG.info("Master has not initialized yet; temporarily using default RSGroup '" +<a name="line.438"></a>
+<span class="sourceLineNo">439</span>          RSGroupInfo.DEFAULT_GROUP + "' for deploy of system table");<a name="line.439"></a>
+<span class="sourceLineNo">440</span>      groupName = RSGroupInfo.DEFAULT_GROUP;<a name="line.440"></a>
+<span class="sourceLineNo">441</span>    }<a name="line.441"></a>
+<span class="sourceLineNo">442</span><a name="line.442"></a>
+<span class="sourceLineNo">443</span>    RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName);<a name="line.443"></a>
+<span class="sourceLineNo">444</span>    if (rsGroupInfo == null) {<a name="line.444"></a>
+<span class="sourceLineNo">445</span>      throw new ConstraintException(<a name="line.445"></a>
+<span class="sourceLineNo">446</span>          "Default RSGroup (" + groupName + ") for this table's " + "namespace does not exist.");<a name="line.446"></a>
+<span class="sourceLineNo">447</span>    }<a name="line.447"></a>
+<span class="sourceLineNo">448</span><a name="line.448"></a>
+<span class="sourceLineNo">449</span>    for (ServerName onlineServer : master.getServerManager().createDestinationServersList()) {<a name="line.449"></a>
+<span class="sourceLineNo">450</span>      if (rsGroupInfo.getServers().contains(onlineServer.getAddress())) {<a name="line.450"></a>
+<span class="sourceLineNo">451</span>        return true;<a name="line.451"></a>
+<span class="sourceLineNo">452</span>      }<a name="line.452"></a>
+<span class="sourceLineNo">453</span>    }<a name="line.453"></a>
+<span class="sourceLineNo">454</span>    return false;<a name="line.454"></a>
+<span class="sourceLineNo">455</span>  }<a name="line.455"></a>
+<span class="sourceLineNo">456</span><a name="line.456"></a>
+<span class="sourceLineNo">457</span>  void assignTableToGroup(TableDescriptor desc) throws IOException {<a name="line.457"></a>
+<span class="sourceLineNo">458</span>    String groupName =<a name="line.458"></a>
+<span class="sourceLineNo">459</span>        master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString())<a name="line.459"></a>
+<span class="sourceLineNo">460</span>                .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP);<a name="line.460"></a>
+<span class="sourceLineNo">461</span>    if (groupName == null) {<a name="line.461"></a>
+<span class="sourceLineNo">462</span>      groupName = RSGroupInfo.DEFAULT_GROUP;<a name="line.462"></a>
 <span class="sourceLineNo">463</span>    }<a name="line.463"></a>
-<span class="sourceLineNo">464</span>  }<a name="line.464"></a>
-<span class="sourceLineNo">465</span><a name="line.465"></a>
-<span class="sourceLineNo">466</span>  // Assign table to default RSGroup.<a name="line.466"></a>
-<span class="sourceLineNo">467</span>  @Override<a name="line.467"></a>
-<span class="sourceLineNo">468</span>  public void postCreateTable(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.468"></a>
-<span class="sourceLineNo">469</span>      TableDescriptor desc, RegionInfo[] regions) throws IOException {<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    assignTableToGroup(desc);<a name="line.470"></a>
-<span class="sourceLineNo">471</span>  }<a name="line.471"></a>
-<span class="sourceLineNo">472</span><a name="line.472"></a>
-<span class="sourceLineNo">473</span>  // Remove table from its RSGroup.<a name="line.473"></a>
-<span class="sourceLineNo">474</span>  @Override<a name="line.474"></a>
-<span class="sourceLineNo">475</span>  public void postDeleteTable(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.475"></a>
-<span class="sourceLineNo">476</span>                              TableName tableName) throws IOException {<a name="line.476"></a>
-<span class="sourceLineNo">477</span>    try {<a name="line.477"></a>
-<span class="sourceLineNo">478</span>      RSGroupInfo group = groupAdminServer.getRSGroupInfoOfTable(tableName);<a name="line.478"></a>
-<span class="sourceLineNo">479</span>      if (group != null) {<a name="line.479"></a>
-<span class="sourceLineNo">480</span>        LOG.debug(String.format("Removing deleted table '%s' from rsgroup '%s'", tableName,<a name="line.480"></a>
-<span class="sourceLineNo">481</span>            group.getName()));<a name="line.481"></a>
-<span class="sourceLineNo">482</span>        groupAdminServer.moveTables(Sets.newHashSet(tableName), null);<a name="line.482"></a>
-<span class="sourceLineNo">483</span>      }<a name="line.483"></a>
-<span class="sourceLineNo">484</span>    } catch (IOException ex) {<a name="line.484"></a>
-<span class="sourceLineNo">485</span>      LOG.debug("Failed to perform RSGroup information cleanup for table: " + tableName, ex);<a name="line.485"></a>
-<span class="sourceLineNo">486</span>    }<a name="line.486"></a>
-<span class="sourceLineNo">487</span>  }<a name="line.487"></a>
-<span class="sourceLineNo">488</span><a name="line.488"></a>
-<span class="sourceLineNo">489</span>  @Override<a name="line.489"></a>
-<span class="sourceLineNo">490</span>  public void preCreateNamespace(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.490"></a>
-<span class="sourceLineNo">491</span>                                 NamespaceDescriptor ns) throws IOException {<a name="line.491"></a>
-<span class="sourceLineNo">492</span>    String group = ns.getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP);<a name="line.492"></a>
-<span class="sourceLineNo">493</span>    if(group != null &amp;&amp; groupAdminServer.getRSGroupInfo(group) == null) {<a name="line.493"></a>
-<span class="sourceLineNo">494</span>      throw new ConstraintException("Region server group "+group+" does not exit");<a name="line.494"></a>
-<span class="sourceLineNo">495</span>    }<a name="line.495"></a>
-<span class="sourceLineNo">496</span>  }<a name="line.496"></a>
-<span class="sourceLineNo">497</span><a name="line.497"></a>
+<span class="sourceLineNo">464</span>    RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName);<a name="line.464"></a>
+<span class="sourceLineNo">465</span>    if (rsGroupInfo == null) {<a name="line.465"></a>
+<span class="sourceLineNo">466</span>      throw new ConstraintException("Default RSGroup (" + groupName + ") for this table's "<a name="line.466"></a>
+<span class="sourceLineNo">467</span>          + "namespace does not exist.");<a name="line.467"></a>
+<span class="sourceLineNo">468</span>    }<a name="line.468"></a>
+<span class="sourceLineNo">469</span>    if (!rsGroupInfo.containsTable(desc.getTableName())) {<a name="line.469"></a>
+<span class="sourceLineNo">470</span>      LOG.debug("Pre-moving table " + desc.getTableName() + " to RSGroup " + groupName);<a name="line.470"></a>
+<span class="sourceLineNo">471</span>      groupAdminServer.moveTables(Sets.newHashSet(desc.getTableName()), groupName);<a name="line.471"></a>
+<span class="sourceLineNo">472</span>    }<a name="line.472"></a>
+<span class="sourceLineNo">473</span>  }<a name="line.473"></a>
+<span class="sourceLineNo">474</span><a name="line.474"></a>
+<span class="sourceLineNo">475</span>  /////////////////////////////////////////////////////////////////////////////<a name="line.475"></a>
+<span class="sourceLineNo">476</span>  // MasterObserver overrides<a name="line.476"></a>
+<span class="sourceLineNo">477</span>  /////////////////////////////////////////////////////////////////////////////<a name="line.477"></a>
+<span class="sourceLineNo">478</span><a name="line.478"></a>
+<span class="sourceLineNo">479</span>  @Override<a name="line.479"></a>
+<span class="sourceLineNo">480</span>  public void preCreateTableAction(<a name="line.480"></a>
+<span class="sourceLineNo">481</span>      final ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.481"></a>
+<span class="sourceLineNo">482</span>      final TableDescriptor desc,<a name="line.482"></a>
+<span class="sourceLineNo">483</span>      final RegionInfo[] regions) throws IOException {<a name="line.483"></a>
+<span class="sourceLineNo">484</span>    if (!desc.getTableName().isSystemTable() &amp;&amp; !rsgroupHasServersOnline(desc)) {<a name="line.484"></a>
+<span class="sourceLineNo">485</span>      throw new HBaseIOException("No online servers in the rsgroup, which table " +<a name="line.485"></a>
+<span class="sourceLineNo">486</span>          desc.getTableName().getNameAsString() + " belongs to");<a name="line.486"></a>
+<span class="sourceLineNo">487</span>    }<a name="line.487"></a>
+<span class="sourceLineNo">488</span>  }<a name="line.488"></a>
+<span class="sourceLineNo">489</span><a name="line.489"></a>
+<span class="sourceLineNo">490</span>  // Assign table to default RSGroup.<a name="line.490"></a>
+<span class="sourceLineNo">491</span>  @Override<a name="line.491"></a>
+<span class="sourceLineNo">492</span>  public void postCreateTable(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.492"></a>
+<span class="sourceLineNo">493</span>      TableDescriptor desc, RegionInfo[] regions) throws IOException {<a name="line.493"></a>
+<span class="sourceLineNo">494</span>    assignTableToGroup(desc);<a name="line.494"></a>
+<span class="sourceLineNo">495</span>  }<a name="line.495"></a>
+<span class="sourceLineNo">496</span><a name="line.496"></a>
+<span class="sourceLineNo">497</span>  // Remove table from its RSGroup.<a name="line.497"></a>
 <span class="sourceLineNo">498</span>  @Override<a name="line.498"></a>
-<span class="sourceLineNo">499</span>  public void preModifyNamespace(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.499"></a>
-<span class="sourceLineNo">500</span>      NamespaceDescriptor currentNsDesc, NamespaceDescriptor newNsDesc) throws IOException {<a name="line.500"></a>
-<span class="sourceLineNo">501</span>    preCreateNamespace(ctx, newNsDesc);<a name="line.501"></a>
-<span class="sourceLineNo">502</span>  }<a name="line.502"></a>
-<span class="sourceLineNo">503</span><a name="line.503"></a>
-<span class="sourceLineNo">504</span>  @Override<a name="line.504"></a>
-<span class="sourceLineNo">505</span>  public void preCloneSnapshot(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.505"></a>
-<span class="sourceLineNo">506</span>      SnapshotDescription snapshot, TableDescriptor desc) throws IOException {<a name="line.506"></a>
-<span class="sourceLineNo">507</span>    assignTableToGroup(desc);<a name="line.507"></a>
-<span class="sourceLineNo">508</span>  }<a name="line.508"></a>
-<span class="sourceLineNo">509</span><a name="line.509"></a>
-<span class="sourceLineNo">510</span>  @Override<a name="line.510"></a>
-<span class="sourceLineNo">511</span>  public void postClearDeadServers(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.511"></a>
-<span class="sourceLineNo">512</span>      List&lt;ServerName&gt; servers, List&lt;ServerName&gt; notClearedServers)<a name="line.512"></a>
-<span class="sourceLineNo">513</span>      throws IOException {<a name="line.513"></a>
-<span class="sourceLineNo">514</span>    Set&lt;Address&gt; clearedServer = servers.stream().<a name="line.514"></a>
-<span class="sourceLineNo">515</span>        filter(server -&gt; !notClearedServers.contains(server)).<a name="line.515"></a>
-<span class="sourceLineNo">516</span>        map(ServerName::getAddress).<a name="line.516"></a>
-<span class="sourceLineNo">517</span>        collect(Collectors.toSet());<a name="line.517"></a>
-<span class="sourceLineNo">518</span>    groupAdminServer.removeServers(clearedServer);<a name="line.518"></a>
-<span class="sourceLineNo">519</span>  }<a name="line.519"></a>
-<span class="sourceLineNo">520</span><a name="line.520"></a>
-<span class="sourceLineNo">521</span>  public void checkPermission(String request) throws IOException {<a name="line.521"></a>
-<span class="sourceLineNo">522</span>    accessChecker.requirePermission(getActiveUser(), request, Action.ADMIN);<a name="line.522"></a>
-<span class="sourceLineNo">523</span>  }<a name="line.523"></a>
-<span class="sourceLineNo">524</span><a name="line.524"></a>
-<span class="sourceLineNo">525</span>  /**<a name="line.525"></a>
-<span class="sourceLineNo">526</span>   * Returns the active user to which authorization checks should be applied.<a name="line.526"></a>
-<span class="sourceLineNo">527</span>   * If we are in the context of an RPC call, the remote user is used,<a name="line.527"></a>
-<span class="sourceLineNo">528</span>   * otherwise the currently logged in user is used.<a name="line.528"></a>
-<span class="sourceLineNo">529</span>   */<a name="line.529"></a>
-<span class="sourceLineNo">530</span>  private User getActiveUser() throws IOException {<a name="line.530"></a>
-<span class="sourceLineNo">531</span>    // for non-rpc handling, fallback to system user<a name="line.531"></a>
-<span class="sourceLineNo">532</span>    Optional&lt;User&gt; optionalUser = RpcServer.getRequestUser();<a name="line.532"></a>
-<span class="sourceLineNo">533</span>    if (optionalUser.isPresent()) {<a name="line.533"></a>
-<span class="sourceLineNo">534</span>      return optionalUser.get();<a name="line.534"></a>
-<span class="sourceLineNo">535</span>    }<a name="line.535"></a>
-<span class="sourceLineNo">536</span>    return userProvider.getCurrent();<a name="line.536"></a>
-<span class="sourceLineNo">537</span>  }<a name="line.537"></a>
-<span class="sourceLineNo">538</span>}<a name="line.538"></a>
+<span class="sourceLineNo">499</span>  public void postDeleteTable(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.499"></a>
+<span class="sourceLineNo">500</span>                              TableName tableName) throws IOException {<a name="line.500"></a>
+<span class="sourceLineNo">501</span>    try {<a name="line.501"></a>
+<span class="sourceLineNo">502</span>      RSGroupInfo group = groupAdminServer.getRSGroupInfoOfTable(tableName);<a name="line.502"></a>
+<span class="sourceLineNo">503</span>      if (group != null) {<a name="line.503"></a>
+<span class="sourceLineNo">504</span>        LOG.debug(String.format("Removing deleted table '%s' from rsgroup '%s'", tableName,<a name="line.504"></a>
+<span class="sourceLineNo">505</span>            group.getName()));<a name="line.505"></a>
+<span class="sourceLineNo">506</span>        groupAdminServer.moveTables(Sets.newHashSet(tableName), null);<a name="line.506"></a>
+<span class="sourceLineNo">507</span>      }<a name="line.507"></a>
+<span class="sourceLineNo">508</span>    } catch (IOException ex) {<a name="line.508"></a>
+<span class="sourceLineNo">509</span>      LOG.debug("Failed to perform RSGroup information cleanup for table: " + tableName, ex);<a name="line.509"></a>
+<span class="sourceLineNo">510</span>    }<a name="line.510"></a>
+<span class="sourceLineNo">511</span>  }<a name="line.511"></a>
+<span class="sourceLineNo">512</span><a name="line.512"></a>
+<span class="sourceLineNo">513</span>  @Override<a name="line.513"></a>
+<span class="sourceLineNo">514</span>  public void preCreateNamespace(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.514"></a>
+<span class="sourceLineNo">515</span>                                 NamespaceDescriptor ns) throws IOException {<a name="line.515"></a>
+<span class="sourceLineNo">516</span>    String group = ns.getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP);<a name="line.516"></a>
+<span class="sourceLineNo">517</span>    if(group != null &amp;&amp; groupAdminServer.getRSGroupInfo(group) == null) {<a name="line.517"></a>
+<span class="sourceLineNo">518</span>      throw new ConstraintException("Region server group "+group+" does not exit");<a name="line.518"></a>
+<span class="sourceLineNo">519</span>    }<a name="line.519"></a>
+<span class="sourceLineNo">520</span>  }<a name="line.520"></a>
+<span class="sourceLineNo">521</span><a name="line.521"></a>
+<span class="sourceLineNo">522</span>  @Override<a name="line.522"></a>
+<span class="sourceLineNo">523</span>  public void preModifyNamespace(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.523"></a>
+<span class="sourceLineNo">524</span>      NamespaceDescriptor currentNsDesc, NamespaceDescriptor newNsDesc) throws IOException {<a name="line.524"></a>
+<span class="sourceLineNo">525</span>    preCreateNamespace(ctx, newNsDesc);<a name="line.525"></a>
+<span class="sourceLineNo">526</span>  }<a name="line.526"></a>
+<span class="sourceLineNo">527</span><a name="line.527"></a>
+<span class="sourceLineNo">528</span>  @Override<a name="line.528"></a>
+<span class="sourceLineNo">529</span>  public void preCloneSnapshot(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.529"></a>
+<span class="sourceLineNo">530</span>      SnapshotDescription snapshot, TableDescriptor desc) throws IOException {<a name="line.530"></a>
+<span class="sourceLineNo">531</span>    assignTableToGroup(desc);<a name="line.531"></a>
+<span class="sourceLineNo">532</span>  }<a name="line.532"></a>
+<span class="sourceLineNo">533</span><a name="line.533"></a>
+<span class="sourceLineNo">534</span>  @Override<a name="line.534"></a>
+<span class="sourceLineNo">535</span>  public void postClearDeadServers(ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx,<a name="line.535"></a>
+<span class="sourceLineNo">536</span>      List&lt;ServerName&gt; servers, List&lt;ServerName&gt; notClearedServers)<a name="line.536"></a>
+<span class="sourceLineNo">537</span>      throws IOException {<a name="line.537"></a>
+<span class="sourceLineNo">538</span>    Set&lt;Address&gt; clearedServer = servers.stream().<a name="line.538"></a>
+<span class="sourceLineNo">539</span>        filter(server -&gt; !notClearedServers.contains(server)).<a name="line.539"></a>
+<span class="sourceLineNo">540</span>        map(ServerName::getAddress).<a name="line.540"></a>
+<span class="sourceLineNo">541</span>        collect(Collectors.toSet());<a name="line.541"></a>
+<span class="sourceLineNo">542</span>    groupAdminServer.removeServers(clearedServer);<a name="line.542"></a>
+<span class="sourceLineNo">543</span>  }<a name="line.543"></a>
+<span class="sourceLineNo">544</span><a name="line.544"></a>
+<span class="sourceLineNo">545</span>  public void checkPermission(String request) throws IOException {<a name="line.545"></a>
+<span class="sourceLineNo">546</span>    accessChecker.requirePermission(getActiveUser(), request, Action.ADMIN);<a name="line.546"></a>
+<span class="sourceLineNo">547</span>  }<a name="line.547"></a>
+<span class="sourceLineNo">548</span><a name="line.548"></a>
+<span class="sourceLineNo">549</span>  /**<a name="line.549"></a>
+<span class="sourceLineNo">550</span>   * Returns the active user to which authorization checks should be applied.<a name="line.550"></a>
+<span class="sourceLineNo">551</span>   * If we are in the context of an RPC call, the remote user is used,<a name="line.551"></a>
+<span class="sourceLineNo">552</span>   * otherwise the currently logged in user is used.<a name="line.552"></a>
+<span class="sourceLineNo">553</span>   */<a name="line.553"></a>
+<span class="sourceLineNo">554</span>  private User getActiveUser() throws IOException {<a name="line.554"></a>
+<span class="sourceLineNo">555</span>    // for non-rpc handling, fallback to system user<a name="line.555"></a>
+<span class="sourceLineNo">556</span>    Optional&lt;User&gt; optionalUser = RpcServer.getRequestUser();<a name="line.556"></a>
+<span class="sourceLineNo">557</span>    if (optionalUser.isPresent()) {<a name="line.557"></a>
+<span class="sourceLineNo">558</span>      return optionalUser.get();<a name="line.558"></a>
+<span class="sourceLineNo">559</span>    }<a name="line.559"></a>
+<span class="sourceLineNo">560</span>    return userProvider.getCurrent();<a name="line.560"></a>
+<span class="sourceLineNo">561</span>  }<a name="line.561"></a>
+<span class="sourceLineNo">562</span>}<a name="line.562"></a>
 
 
 


Mime
View raw message