hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [24/49] hbase-site git commit: Published site at .
Date Sun, 24 Sep 2017 15:13:50 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e6bd0774/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.MasterEnvironment.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.MasterEnvironment.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.MasterEnvironment.html
index 2a29b1c..3b0b6dd 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.MasterEnvironment.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterCoprocessorHost.MasterEnvironment.html
@@ -60,9 +60,9 @@
 <span class="sourceLineNo">052</span>import org.apache.hadoop.hbase.procedure2.LockedResource;<a name="line.52"></a>
 <span class="sourceLineNo">053</span>import org.apache.hadoop.hbase.procedure2.Procedure;<a name="line.53"></a>
 <span class="sourceLineNo">054</span>import org.apache.hadoop.hbase.procedure2.ProcedureExecutor;<a name="line.54"></a>
-<span class="sourceLineNo">055</span>import org.apache.hadoop.hbase.replication.ReplicationPeerConfig;<a name="line.55"></a>
-<span class="sourceLineNo">056</span>import org.apache.hadoop.hbase.security.User;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas;<a name="line.57"></a>
+<span class="sourceLineNo">055</span>import org.apache.hadoop.hbase.quotas.GlobalQuotaSettings;<a name="line.55"></a>
+<span class="sourceLineNo">056</span>import org.apache.hadoop.hbase.replication.ReplicationPeerConfig;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>import org.apache.hadoop.hbase.security.User;<a name="line.57"></a>
 <span class="sourceLineNo">058</span>import org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription;<a name="line.58"></a>
 <span class="sourceLineNo">059</span>import org.apache.yetus.audience.InterfaceAudience;<a name="line.59"></a>
 <span class="sourceLineNo">060</span><a name="line.60"></a>
@@ -1307,598 +1307,608 @@
 <span class="sourceLineNo">1299</span>    });<a name="line.1299"></a>
 <span class="sourceLineNo">1300</span>  }<a name="line.1300"></a>
 <span class="sourceLineNo">1301</span><a name="line.1301"></a>
-<span class="sourceLineNo">1302</span>  public void preSetUserQuota(final String user, final Quotas quotas) throws IOException {<a name="line.1302"></a>
-<span class="sourceLineNo">1303</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1303"></a>
-<span class="sourceLineNo">1304</span>      @Override<a name="line.1304"></a>
-<span class="sourceLineNo">1305</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1305"></a>
-<span class="sourceLineNo">1306</span>          throws IOException {<a name="line.1306"></a>
-<span class="sourceLineNo">1307</span>        oserver.preSetUserQuota(ctx, user, quotas);<a name="line.1307"></a>
-<span class="sourceLineNo">1308</span>      }<a name="line.1308"></a>
-<span class="sourceLineNo">1309</span>    });<a name="line.1309"></a>
-<span class="sourceLineNo">1310</span>  }<a name="line.1310"></a>
-<span class="sourceLineNo">1311</span><a name="line.1311"></a>
-<span class="sourceLineNo">1312</span>  public void postSetUserQuota(final String user, final Quotas quotas) throws IOException {<a name="line.1312"></a>
-<span class="sourceLineNo">1313</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1313"></a>
-<span class="sourceLineNo">1314</span>      @Override<a name="line.1314"></a>
-<span class="sourceLineNo">1315</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1315"></a>
-<span class="sourceLineNo">1316</span>          throws IOException {<a name="line.1316"></a>
-<span class="sourceLineNo">1317</span>        oserver.postSetUserQuota(ctx, user, quotas);<a name="line.1317"></a>
-<span class="sourceLineNo">1318</span>      }<a name="line.1318"></a>
-<span class="sourceLineNo">1319</span>    });<a name="line.1319"></a>
-<span class="sourceLineNo">1320</span>  }<a name="line.1320"></a>
-<span class="sourceLineNo">1321</span><a name="line.1321"></a>
-<span class="sourceLineNo">1322</span>  public void preSetUserQuota(final String user, final TableName table, final Quotas quotas)<a name="line.1322"></a>
-<span class="sourceLineNo">1323</span>      throws IOException {<a name="line.1323"></a>
-<span class="sourceLineNo">1324</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1324"></a>
-<span class="sourceLineNo">1325</span>      @Override<a name="line.1325"></a>
-<span class="sourceLineNo">1326</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1326"></a>
-<span class="sourceLineNo">1327</span>          throws IOException {<a name="line.1327"></a>
-<span class="sourceLineNo">1328</span>        oserver.preSetUserQuota(ctx, user, table, quotas);<a name="line.1328"></a>
-<span class="sourceLineNo">1329</span>      }<a name="line.1329"></a>
-<span class="sourceLineNo">1330</span>    });<a name="line.1330"></a>
-<span class="sourceLineNo">1331</span>  }<a name="line.1331"></a>
-<span class="sourceLineNo">1332</span><a name="line.1332"></a>
-<span class="sourceLineNo">1333</span>  public void postSetUserQuota(final String user, final TableName table, final Quotas quotas)<a name="line.1333"></a>
-<span class="sourceLineNo">1334</span>      throws IOException {<a name="line.1334"></a>
-<span class="sourceLineNo">1335</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1335"></a>
-<span class="sourceLineNo">1336</span>      @Override<a name="line.1336"></a>
-<span class="sourceLineNo">1337</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1337"></a>
+<span class="sourceLineNo">1302</span>  public void preSetUserQuota(<a name="line.1302"></a>
+<span class="sourceLineNo">1303</span>      final String user, final GlobalQuotaSettings quotas) throws IOException {<a name="line.1303"></a>
+<span class="sourceLineNo">1304</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1304"></a>
+<span class="sourceLineNo">1305</span>      @Override<a name="line.1305"></a>
+<span class="sourceLineNo">1306</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1306"></a>
+<span class="sourceLineNo">1307</span>          throws IOException {<a name="line.1307"></a>
+<span class="sourceLineNo">1308</span>        oserver.preSetUserQuota(ctx, user, quotas);<a name="line.1308"></a>
+<span class="sourceLineNo">1309</span>      }<a name="line.1309"></a>
+<span class="sourceLineNo">1310</span>    });<a name="line.1310"></a>
+<span class="sourceLineNo">1311</span>  }<a name="line.1311"></a>
+<span class="sourceLineNo">1312</span><a name="line.1312"></a>
+<span class="sourceLineNo">1313</span>  public void postSetUserQuota(<a name="line.1313"></a>
+<span class="sourceLineNo">1314</span>      final String user, final GlobalQuotaSettings quotas) throws IOException {<a name="line.1314"></a>
+<span class="sourceLineNo">1315</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1315"></a>
+<span class="sourceLineNo">1316</span>      @Override<a name="line.1316"></a>
+<span class="sourceLineNo">1317</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1317"></a>
+<span class="sourceLineNo">1318</span>          throws IOException {<a name="line.1318"></a>
+<span class="sourceLineNo">1319</span>        oserver.postSetUserQuota(ctx, user, quotas);<a name="line.1319"></a>
+<span class="sourceLineNo">1320</span>      }<a name="line.1320"></a>
+<span class="sourceLineNo">1321</span>    });<a name="line.1321"></a>
+<span class="sourceLineNo">1322</span>  }<a name="line.1322"></a>
+<span class="sourceLineNo">1323</span><a name="line.1323"></a>
+<span class="sourceLineNo">1324</span>  public void preSetUserQuota(<a name="line.1324"></a>
+<span class="sourceLineNo">1325</span>      final String user, final TableName table, final GlobalQuotaSettings quotas)<a name="line.1325"></a>
+<span class="sourceLineNo">1326</span>          throws IOException {<a name="line.1326"></a>
+<span class="sourceLineNo">1327</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1327"></a>
+<span class="sourceLineNo">1328</span>      @Override<a name="line.1328"></a>
+<span class="sourceLineNo">1329</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1329"></a>
+<span class="sourceLineNo">1330</span>          throws IOException {<a name="line.1330"></a>
+<span class="sourceLineNo">1331</span>        oserver.preSetUserQuota(ctx, user, table, quotas);<a name="line.1331"></a>
+<span class="sourceLineNo">1332</span>      }<a name="line.1332"></a>
+<span class="sourceLineNo">1333</span>    });<a name="line.1333"></a>
+<span class="sourceLineNo">1334</span>  }<a name="line.1334"></a>
+<span class="sourceLineNo">1335</span><a name="line.1335"></a>
+<span class="sourceLineNo">1336</span>  public void postSetUserQuota(<a name="line.1336"></a>
+<span class="sourceLineNo">1337</span>      final String user, final TableName table, final GlobalQuotaSettings quotas)<a name="line.1337"></a>
 <span class="sourceLineNo">1338</span>          throws IOException {<a name="line.1338"></a>
-<span class="sourceLineNo">1339</span>        oserver.postSetUserQuota(ctx, user, table, quotas);<a name="line.1339"></a>
-<span class="sourceLineNo">1340</span>      }<a name="line.1340"></a>
-<span class="sourceLineNo">1341</span>    });<a name="line.1341"></a>
-<span class="sourceLineNo">1342</span>  }<a name="line.1342"></a>
-<span class="sourceLineNo">1343</span><a name="line.1343"></a>
-<span class="sourceLineNo">1344</span>  public void preSetUserQuota(final String user, final String namespace, final Quotas quotas)<a name="line.1344"></a>
-<span class="sourceLineNo">1345</span>      throws IOException {<a name="line.1345"></a>
-<span class="sourceLineNo">1346</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1346"></a>
-<span class="sourceLineNo">1347</span>      @Override<a name="line.1347"></a>
-<span class="sourceLineNo">1348</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1348"></a>
-<span class="sourceLineNo">1349</span>          throws IOException {<a name="line.1349"></a>
-<span class="sourceLineNo">1350</span>        oserver.preSetUserQuota(ctx, user, namespace, quotas);<a name="line.1350"></a>
-<span class="sourceLineNo">1351</span>      }<a name="line.1351"></a>
-<span class="sourceLineNo">1352</span>    });<a name="line.1352"></a>
-<span class="sourceLineNo">1353</span>  }<a name="line.1353"></a>
-<span class="sourceLineNo">1354</span><a name="line.1354"></a>
-<span class="sourceLineNo">1355</span>  public void postSetUserQuota(final String user, final String namespace, final Quotas quotas)<a name="line.1355"></a>
-<span class="sourceLineNo">1356</span>      throws IOException {<a name="line.1356"></a>
-<span class="sourceLineNo">1357</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1357"></a>
-<span class="sourceLineNo">1358</span>      @Override<a name="line.1358"></a>
-<span class="sourceLineNo">1359</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1359"></a>
-<span class="sourceLineNo">1360</span>          throws IOException {<a name="line.1360"></a>
-<span class="sourceLineNo">1361</span>        oserver.postSetUserQuota(ctx, user, namespace, quotas);<a name="line.1361"></a>
-<span class="sourceLineNo">1362</span>      }<a name="line.1362"></a>
-<span class="sourceLineNo">1363</span>    });<a name="line.1363"></a>
-<span class="sourceLineNo">1364</span>  }<a name="line.1364"></a>
-<span class="sourceLineNo">1365</span><a name="line.1365"></a>
-<span class="sourceLineNo">1366</span>  public void preSetTableQuota(final TableName table, final Quotas quotas) throws IOException {<a name="line.1366"></a>
-<span class="sourceLineNo">1367</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1367"></a>
-<span class="sourceLineNo">1368</span>      @Override<a name="line.1368"></a>
-<span class="sourceLineNo">1369</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1369"></a>
-<span class="sourceLineNo">1370</span>          throws IOException {<a name="line.1370"></a>
-<span class="sourceLineNo">1371</span>        oserver.preSetTableQuota(ctx, table, quotas);<a name="line.1371"></a>
-<span class="sourceLineNo">1372</span>      }<a name="line.1372"></a>
-<span class="sourceLineNo">1373</span>    });<a name="line.1373"></a>
-<span class="sourceLineNo">1374</span>  }<a name="line.1374"></a>
-<span class="sourceLineNo">1375</span><a name="line.1375"></a>
-<span class="sourceLineNo">1376</span>  public void postSetTableQuota(final TableName table, final Quotas quotas) throws IOException {<a name="line.1376"></a>
-<span class="sourceLineNo">1377</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1377"></a>
-<span class="sourceLineNo">1378</span>      @Override<a name="line.1378"></a>
-<span class="sourceLineNo">1379</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1379"></a>
-<span class="sourceLineNo">1380</span>          throws IOException {<a name="line.1380"></a>
-<span class="sourceLineNo">1381</span>        oserver.postSetTableQuota(ctx, table, quotas);<a name="line.1381"></a>
-<span class="sourceLineNo">1382</span>      }<a name="line.1382"></a>
-<span class="sourceLineNo">1383</span>    });<a name="line.1383"></a>
-<span class="sourceLineNo">1384</span>  }<a name="line.1384"></a>
-<span class="sourceLineNo">1385</span><a name="line.1385"></a>
-<span class="sourceLineNo">1386</span>  public void preSetNamespaceQuota(final String namespace, final Quotas quotas) throws IOException {<a name="line.1386"></a>
-<span class="sourceLineNo">1387</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1387"></a>
-<span class="sourceLineNo">1388</span>      @Override<a name="line.1388"></a>
-<span class="sourceLineNo">1389</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1389"></a>
-<span class="sourceLineNo">1390</span>          throws IOException {<a name="line.1390"></a>
-<span class="sourceLineNo">1391</span>        oserver.preSetNamespaceQuota(ctx, namespace, quotas);<a name="line.1391"></a>
-<span class="sourceLineNo">1392</span>      }<a name="line.1392"></a>
-<span class="sourceLineNo">1393</span>    });<a name="line.1393"></a>
-<span class="sourceLineNo">1394</span>  }<a name="line.1394"></a>
-<span class="sourceLineNo">1395</span><a name="line.1395"></a>
-<span class="sourceLineNo">1396</span>  public void postSetNamespaceQuota(final String namespace, final Quotas quotas) throws IOException{<a name="line.1396"></a>
-<span class="sourceLineNo">1397</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1397"></a>
-<span class="sourceLineNo">1398</span>      @Override<a name="line.1398"></a>
-<span class="sourceLineNo">1399</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1399"></a>
-<span class="sourceLineNo">1400</span>          throws IOException {<a name="line.1400"></a>
-<span class="sourceLineNo">1401</span>        oserver.postSetNamespaceQuota(ctx, namespace, quotas);<a name="line.1401"></a>
-<span class="sourceLineNo">1402</span>      }<a name="line.1402"></a>
-<span class="sourceLineNo">1403</span>    });<a name="line.1403"></a>
-<span class="sourceLineNo">1404</span>  }<a name="line.1404"></a>
-<span class="sourceLineNo">1405</span><a name="line.1405"></a>
-<span class="sourceLineNo">1406</span>  private static abstract class CoprocessorOperation<a name="line.1406"></a>
-<span class="sourceLineNo">1407</span>      extends ObserverContext&lt;MasterCoprocessorEnvironment&gt; {<a name="line.1407"></a>
-<span class="sourceLineNo">1408</span>    public CoprocessorOperation() {<a name="line.1408"></a>
-<span class="sourceLineNo">1409</span>      this(RpcServer.getRequestUser());<a name="line.1409"></a>
-<span class="sourceLineNo">1410</span>    }<a name="line.1410"></a>
-<span class="sourceLineNo">1411</span><a name="line.1411"></a>
-<span class="sourceLineNo">1412</span>    public CoprocessorOperation(User user) {<a name="line.1412"></a>
-<span class="sourceLineNo">1413</span>      super(user);<a name="line.1413"></a>
-<span class="sourceLineNo">1414</span>    }<a name="line.1414"></a>
+<span class="sourceLineNo">1339</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1339"></a>
+<span class="sourceLineNo">1340</span>      @Override<a name="line.1340"></a>
+<span class="sourceLineNo">1341</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1341"></a>
+<span class="sourceLineNo">1342</span>          throws IOException {<a name="line.1342"></a>
+<span class="sourceLineNo">1343</span>        oserver.postSetUserQuota(ctx, user, table, quotas);<a name="line.1343"></a>
+<span class="sourceLineNo">1344</span>      }<a name="line.1344"></a>
+<span class="sourceLineNo">1345</span>    });<a name="line.1345"></a>
+<span class="sourceLineNo">1346</span>  }<a name="line.1346"></a>
+<span class="sourceLineNo">1347</span><a name="line.1347"></a>
+<span class="sourceLineNo">1348</span>  public void preSetUserQuota(<a name="line.1348"></a>
+<span class="sourceLineNo">1349</span>      final String user, final String namespace, final GlobalQuotaSettings quotas)<a name="line.1349"></a>
+<span class="sourceLineNo">1350</span>          throws IOException {<a name="line.1350"></a>
+<span class="sourceLineNo">1351</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1351"></a>
+<span class="sourceLineNo">1352</span>      @Override<a name="line.1352"></a>
+<span class="sourceLineNo">1353</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1353"></a>
+<span class="sourceLineNo">1354</span>          throws IOException {<a name="line.1354"></a>
+<span class="sourceLineNo">1355</span>        oserver.preSetUserQuota(ctx, user, namespace, quotas);<a name="line.1355"></a>
+<span class="sourceLineNo">1356</span>      }<a name="line.1356"></a>
+<span class="sourceLineNo">1357</span>    });<a name="line.1357"></a>
+<span class="sourceLineNo">1358</span>  }<a name="line.1358"></a>
+<span class="sourceLineNo">1359</span><a name="line.1359"></a>
+<span class="sourceLineNo">1360</span>  public void postSetUserQuota(<a name="line.1360"></a>
+<span class="sourceLineNo">1361</span>      final String user, final String namespace, final GlobalQuotaSettings quotas)<a name="line.1361"></a>
+<span class="sourceLineNo">1362</span>          throws IOException {<a name="line.1362"></a>
+<span class="sourceLineNo">1363</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1363"></a>
+<span class="sourceLineNo">1364</span>      @Override<a name="line.1364"></a>
+<span class="sourceLineNo">1365</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1365"></a>
+<span class="sourceLineNo">1366</span>          throws IOException {<a name="line.1366"></a>
+<span class="sourceLineNo">1367</span>        oserver.postSetUserQuota(ctx, user, namespace, quotas);<a name="line.1367"></a>
+<span class="sourceLineNo">1368</span>      }<a name="line.1368"></a>
+<span class="sourceLineNo">1369</span>    });<a name="line.1369"></a>
+<span class="sourceLineNo">1370</span>  }<a name="line.1370"></a>
+<span class="sourceLineNo">1371</span><a name="line.1371"></a>
+<span class="sourceLineNo">1372</span>  public void preSetTableQuota(<a name="line.1372"></a>
+<span class="sourceLineNo">1373</span>      final TableName table, final GlobalQuotaSettings quotas) throws IOException {<a name="line.1373"></a>
+<span class="sourceLineNo">1374</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1374"></a>
+<span class="sourceLineNo">1375</span>      @Override<a name="line.1375"></a>
+<span class="sourceLineNo">1376</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1376"></a>
+<span class="sourceLineNo">1377</span>          throws IOException {<a name="line.1377"></a>
+<span class="sourceLineNo">1378</span>        oserver.preSetTableQuota(ctx, table, quotas);<a name="line.1378"></a>
+<span class="sourceLineNo">1379</span>      }<a name="line.1379"></a>
+<span class="sourceLineNo">1380</span>    });<a name="line.1380"></a>
+<span class="sourceLineNo">1381</span>  }<a name="line.1381"></a>
+<span class="sourceLineNo">1382</span><a name="line.1382"></a>
+<span class="sourceLineNo">1383</span>  public void postSetTableQuota(<a name="line.1383"></a>
+<span class="sourceLineNo">1384</span>      final TableName table, final GlobalQuotaSettings quotas) throws IOException {<a name="line.1384"></a>
+<span class="sourceLineNo">1385</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1385"></a>
+<span class="sourceLineNo">1386</span>      @Override<a name="line.1386"></a>
+<span class="sourceLineNo">1387</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1387"></a>
+<span class="sourceLineNo">1388</span>          throws IOException {<a name="line.1388"></a>
+<span class="sourceLineNo">1389</span>        oserver.postSetTableQuota(ctx, table, quotas);<a name="line.1389"></a>
+<span class="sourceLineNo">1390</span>      }<a name="line.1390"></a>
+<span class="sourceLineNo">1391</span>    });<a name="line.1391"></a>
+<span class="sourceLineNo">1392</span>  }<a name="line.1392"></a>
+<span class="sourceLineNo">1393</span><a name="line.1393"></a>
+<span class="sourceLineNo">1394</span>  public void preSetNamespaceQuota(<a name="line.1394"></a>
+<span class="sourceLineNo">1395</span>      final String namespace, final GlobalQuotaSettings quotas) throws IOException {<a name="line.1395"></a>
+<span class="sourceLineNo">1396</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1396"></a>
+<span class="sourceLineNo">1397</span>      @Override<a name="line.1397"></a>
+<span class="sourceLineNo">1398</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1398"></a>
+<span class="sourceLineNo">1399</span>          throws IOException {<a name="line.1399"></a>
+<span class="sourceLineNo">1400</span>        oserver.preSetNamespaceQuota(ctx, namespace, quotas);<a name="line.1400"></a>
+<span class="sourceLineNo">1401</span>      }<a name="line.1401"></a>
+<span class="sourceLineNo">1402</span>    });<a name="line.1402"></a>
+<span class="sourceLineNo">1403</span>  }<a name="line.1403"></a>
+<span class="sourceLineNo">1404</span><a name="line.1404"></a>
+<span class="sourceLineNo">1405</span>  public void postSetNamespaceQuota(<a name="line.1405"></a>
+<span class="sourceLineNo">1406</span>      final String namespace, final GlobalQuotaSettings quotas) throws IOException{<a name="line.1406"></a>
+<span class="sourceLineNo">1407</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1407"></a>
+<span class="sourceLineNo">1408</span>      @Override<a name="line.1408"></a>
+<span class="sourceLineNo">1409</span>      public void call(MasterObserver oserver, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1409"></a>
+<span class="sourceLineNo">1410</span>          throws IOException {<a name="line.1410"></a>
+<span class="sourceLineNo">1411</span>        oserver.postSetNamespaceQuota(ctx, namespace, quotas);<a name="line.1411"></a>
+<span class="sourceLineNo">1412</span>      }<a name="line.1412"></a>
+<span class="sourceLineNo">1413</span>    });<a name="line.1413"></a>
+<span class="sourceLineNo">1414</span>  }<a name="line.1414"></a>
 <span class="sourceLineNo">1415</span><a name="line.1415"></a>
-<span class="sourceLineNo">1416</span>    public abstract void call(MasterObserver oserver,<a name="line.1416"></a>
-<span class="sourceLineNo">1417</span>        ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException;<a name="line.1417"></a>
-<span class="sourceLineNo">1418</span><a name="line.1418"></a>
-<span class="sourceLineNo">1419</span>    public void postEnvCall(MasterEnvironment env) {<a name="line.1419"></a>
+<span class="sourceLineNo">1416</span>  private static abstract class CoprocessorOperation<a name="line.1416"></a>
+<span class="sourceLineNo">1417</span>      extends ObserverContext&lt;MasterCoprocessorEnvironment&gt; {<a name="line.1417"></a>
+<span class="sourceLineNo">1418</span>    public CoprocessorOperation() {<a name="line.1418"></a>
+<span class="sourceLineNo">1419</span>      this(RpcServer.getRequestUser());<a name="line.1419"></a>
 <span class="sourceLineNo">1420</span>    }<a name="line.1420"></a>
-<span class="sourceLineNo">1421</span>  }<a name="line.1421"></a>
-<span class="sourceLineNo">1422</span><a name="line.1422"></a>
-<span class="sourceLineNo">1423</span>  private static abstract class CoprocessorOperationWithResult&lt;T&gt; extends CoprocessorOperation {<a name="line.1423"></a>
-<span class="sourceLineNo">1424</span>    private T result = null;<a name="line.1424"></a>
-<span class="sourceLineNo">1425</span>    public void setResult(final T result) { this.result = result; }<a name="line.1425"></a>
-<span class="sourceLineNo">1426</span>    public T getResult() { return this.result; }<a name="line.1426"></a>
-<span class="sourceLineNo">1427</span>  }<a name="line.1427"></a>
+<span class="sourceLineNo">1421</span><a name="line.1421"></a>
+<span class="sourceLineNo">1422</span>    public CoprocessorOperation(User user) {<a name="line.1422"></a>
+<span class="sourceLineNo">1423</span>      super(user);<a name="line.1423"></a>
+<span class="sourceLineNo">1424</span>    }<a name="line.1424"></a>
+<span class="sourceLineNo">1425</span><a name="line.1425"></a>
+<span class="sourceLineNo">1426</span>    public abstract void call(MasterObserver oserver,<a name="line.1426"></a>
+<span class="sourceLineNo">1427</span>        ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException;<a name="line.1427"></a>
 <span class="sourceLineNo">1428</span><a name="line.1428"></a>
-<span class="sourceLineNo">1429</span>  private &lt;T&gt; T execOperationWithResult(final T defaultValue,<a name="line.1429"></a>
-<span class="sourceLineNo">1430</span>      final CoprocessorOperationWithResult&lt;T&gt; ctx) throws IOException {<a name="line.1430"></a>
-<span class="sourceLineNo">1431</span>    if (ctx == null) return defaultValue;<a name="line.1431"></a>
-<span class="sourceLineNo">1432</span>    ctx.setResult(defaultValue);<a name="line.1432"></a>
-<span class="sourceLineNo">1433</span>    execOperation(ctx);<a name="line.1433"></a>
-<span class="sourceLineNo">1434</span>    return ctx.getResult();<a name="line.1434"></a>
-<span class="sourceLineNo">1435</span>  }<a name="line.1435"></a>
-<span class="sourceLineNo">1436</span><a name="line.1436"></a>
-<span class="sourceLineNo">1437</span>  private boolean execOperation(final CoprocessorOperation ctx) throws IOException {<a name="line.1437"></a>
-<span class="sourceLineNo">1438</span>    if (ctx == null) return false;<a name="line.1438"></a>
-<span class="sourceLineNo">1439</span>    boolean bypass = false;<a name="line.1439"></a>
-<span class="sourceLineNo">1440</span>    List&lt;MasterEnvironment&gt; envs = coprocessors.get();<a name="line.1440"></a>
-<span class="sourceLineNo">1441</span>    for (int i = 0; i &lt; envs.size(); i++) {<a name="line.1441"></a>
-<span class="sourceLineNo">1442</span>      MasterEnvironment env = envs.get(i);<a name="line.1442"></a>
-<span class="sourceLineNo">1443</span>      if (env.getInstance() instanceof MasterObserver) {<a name="line.1443"></a>
-<span class="sourceLineNo">1444</span>        ctx.prepare(env);<a name="line.1444"></a>
-<span class="sourceLineNo">1445</span>        Thread currentThread = Thread.currentThread();<a name="line.1445"></a>
-<span class="sourceLineNo">1446</span>        ClassLoader cl = currentThread.getContextClassLoader();<a name="line.1446"></a>
-<span class="sourceLineNo">1447</span>        try {<a name="line.1447"></a>
-<span class="sourceLineNo">1448</span>          currentThread.setContextClassLoader(env.getClassLoader());<a name="line.1448"></a>
-<span class="sourceLineNo">1449</span>          ctx.call((MasterObserver)env.getInstance(), ctx);<a name="line.1449"></a>
-<span class="sourceLineNo">1450</span>        } catch (Throwable e) {<a name="line.1450"></a>
-<span class="sourceLineNo">1451</span>          handleCoprocessorThrowable(env, e);<a name="line.1451"></a>
-<span class="sourceLineNo">1452</span>        } finally {<a name="line.1452"></a>
-<span class="sourceLineNo">1453</span>          currentThread.setContextClassLoader(cl);<a name="line.1453"></a>
-<span class="sourceLineNo">1454</span>        }<a name="line.1454"></a>
-<span class="sourceLineNo">1455</span>        bypass |= ctx.shouldBypass();<a name="line.1455"></a>
-<span class="sourceLineNo">1456</span>        if (ctx.shouldComplete()) {<a name="line.1456"></a>
-<span class="sourceLineNo">1457</span>          break;<a name="line.1457"></a>
-<span class="sourceLineNo">1458</span>        }<a name="line.1458"></a>
-<span class="sourceLineNo">1459</span>      }<a name="line.1459"></a>
-<span class="sourceLineNo">1460</span>      ctx.postEnvCall(env);<a name="line.1460"></a>
-<span class="sourceLineNo">1461</span>    }<a name="line.1461"></a>
-<span class="sourceLineNo">1462</span>    return bypass;<a name="line.1462"></a>
-<span class="sourceLineNo">1463</span>  }<a name="line.1463"></a>
-<span class="sourceLineNo">1464</span><a name="line.1464"></a>
-<span class="sourceLineNo">1465</span>  /**<a name="line.1465"></a>
-<span class="sourceLineNo">1466</span>   * Master coprocessor classes can be configured in any order, based on that priority is set and<a name="line.1466"></a>
-<span class="sourceLineNo">1467</span>   * chained in a sorted order. For preStopMaster()/preShutdown(), coprocessor methods are invoked<a name="line.1467"></a>
-<span class="sourceLineNo">1468</span>   * in call() and environment is shutdown in postEnvCall(). &lt;br&gt;<a name="line.1468"></a>
-<span class="sourceLineNo">1469</span>   * Need to execute all coprocessor methods first then postEnvCall(), otherwise some coprocessors<a name="line.1469"></a>
-<span class="sourceLineNo">1470</span>   * may remain shutdown if any exception occurs during next coprocessor execution which prevent<a name="line.1470"></a>
-<span class="sourceLineNo">1471</span>   * Master stop or cluster shutdown. (Refer:<a name="line.1471"></a>
-<span class="sourceLineNo">1472</span>   * &lt;a href="https://issues.apache.org/jira/browse/HBASE-16663"&gt;HBASE-16663&lt;/a&gt;<a name="line.1472"></a>
-<span class="sourceLineNo">1473</span>   * @param ctx CoprocessorOperation<a name="line.1473"></a>
-<span class="sourceLineNo">1474</span>   * @return true if bypaas coprocessor execution, false if not.<a name="line.1474"></a>
-<span class="sourceLineNo">1475</span>   * @throws IOException<a name="line.1475"></a>
-<span class="sourceLineNo">1476</span>   */<a name="line.1476"></a>
-<span class="sourceLineNo">1477</span>  private boolean execShutdown(final CoprocessorOperation ctx) throws IOException {<a name="line.1477"></a>
-<span class="sourceLineNo">1478</span>    if (ctx == null) return false;<a name="line.1478"></a>
-<span class="sourceLineNo">1479</span>    boolean bypass = false;<a name="line.1479"></a>
-<span class="sourceLineNo">1480</span>    List&lt;MasterEnvironment&gt; envs = coprocessors.get();<a name="line.1480"></a>
-<span class="sourceLineNo">1481</span>    int envsSize = envs.size();<a name="line.1481"></a>
-<span class="sourceLineNo">1482</span>    // Iterate the coprocessors and execute CoprocessorOperation's call()<a name="line.1482"></a>
-<span class="sourceLineNo">1483</span>    for (int i = 0; i &lt; envsSize; i++) {<a name="line.1483"></a>
-<span class="sourceLineNo">1484</span>      MasterEnvironment env = envs.get(i);<a name="line.1484"></a>
-<span class="sourceLineNo">1485</span>      if (env.getInstance() instanceof MasterObserver) {<a name="line.1485"></a>
-<span class="sourceLineNo">1486</span>        ctx.prepare(env);<a name="line.1486"></a>
-<span class="sourceLineNo">1487</span>        Thread currentThread = Thread.currentThread();<a name="line.1487"></a>
-<span class="sourceLineNo">1488</span>        ClassLoader cl = currentThread.getContextClassLoader();<a name="line.1488"></a>
-<span class="sourceLineNo">1489</span>        try {<a name="line.1489"></a>
-<span class="sourceLineNo">1490</span>          currentThread.setContextClassLoader(env.getClassLoader());<a name="line.1490"></a>
-<span class="sourceLineNo">1491</span>          ctx.call((MasterObserver) env.getInstance(), ctx);<a name="line.1491"></a>
-<span class="sourceLineNo">1492</span>        } catch (Throwable e) {<a name="line.1492"></a>
-<span class="sourceLineNo">1493</span>          handleCoprocessorThrowable(env, e);<a name="line.1493"></a>
-<span class="sourceLineNo">1494</span>        } finally {<a name="line.1494"></a>
-<span class="sourceLineNo">1495</span>          currentThread.setContextClassLoader(cl);<a name="line.1495"></a>
-<span class="sourceLineNo">1496</span>        }<a name="line.1496"></a>
-<span class="sourceLineNo">1497</span>        bypass |= ctx.shouldBypass();<a name="line.1497"></a>
-<span class="sourceLineNo">1498</span>        if (ctx.shouldComplete()) {<a name="line.1498"></a>
-<span class="sourceLineNo">1499</span>          break;<a name="line.1499"></a>
-<span class="sourceLineNo">1500</span>        }<a name="line.1500"></a>
-<span class="sourceLineNo">1501</span>      }<a name="line.1501"></a>
-<span class="sourceLineNo">1502</span>    }<a name="line.1502"></a>
-<span class="sourceLineNo">1503</span><a name="line.1503"></a>
-<span class="sourceLineNo">1504</span>    // Iterate the coprocessors and execute CoprocessorOperation's postEnvCall()<a name="line.1504"></a>
-<span class="sourceLineNo">1505</span>    for (int i = 0; i &lt; envsSize; i++) {<a name="line.1505"></a>
-<span class="sourceLineNo">1506</span>      MasterEnvironment env = envs.get(i);<a name="line.1506"></a>
-<span class="sourceLineNo">1507</span>      ctx.postEnvCall(env);<a name="line.1507"></a>
-<span class="sourceLineNo">1508</span>    }<a name="line.1508"></a>
-<span class="sourceLineNo">1509</span>    return bypass;<a name="line.1509"></a>
-<span class="sourceLineNo">1510</span>  }<a name="line.1510"></a>
-<span class="sourceLineNo">1511</span><a name="line.1511"></a>
-<span class="sourceLineNo">1512</span>  public void preMoveServersAndTables(final Set&lt;Address&gt; servers, final Set&lt;TableName&gt; tables, final String targetGroup)<a name="line.1512"></a>
-<span class="sourceLineNo">1513</span>          throws IOException {<a name="line.1513"></a>
-<span class="sourceLineNo">1514</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1514"></a>
-<span class="sourceLineNo">1515</span>      @Override<a name="line.1515"></a>
-<span class="sourceLineNo">1516</span>      public void call(MasterObserver oserver,<a name="line.1516"></a>
-<span class="sourceLineNo">1517</span>                       ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1517"></a>
-<span class="sourceLineNo">1518</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1518"></a>
-<span class="sourceLineNo">1519</span>          oserver.preMoveServersAndTables(ctx, servers, tables, targetGroup);<a name="line.1519"></a>
-<span class="sourceLineNo">1520</span>        }<a name="line.1520"></a>
-<span class="sourceLineNo">1521</span>      }<a name="line.1521"></a>
-<span class="sourceLineNo">1522</span>    });<a name="line.1522"></a>
-<span class="sourceLineNo">1523</span>  }<a name="line.1523"></a>
-<span class="sourceLineNo">1524</span><a name="line.1524"></a>
-<span class="sourceLineNo">1525</span>  public void postMoveServersAndTables(final Set&lt;Address&gt; servers, final Set&lt;TableName&gt; tables, final String targetGroup)<a name="line.1525"></a>
-<span class="sourceLineNo">1526</span>          throws IOException {<a name="line.1526"></a>
-<span class="sourceLineNo">1527</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1527"></a>
-<span class="sourceLineNo">1528</span>      @Override<a name="line.1528"></a>
-<span class="sourceLineNo">1529</span>      public void call(MasterObserver oserver,<a name="line.1529"></a>
-<span class="sourceLineNo">1530</span>                       ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1530"></a>
-<span class="sourceLineNo">1531</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1531"></a>
-<span class="sourceLineNo">1532</span>          oserver.postMoveServersAndTables(ctx, servers, tables, targetGroup);<a name="line.1532"></a>
-<span class="sourceLineNo">1533</span>        }<a name="line.1533"></a>
-<span class="sourceLineNo">1534</span>      }<a name="line.1534"></a>
-<span class="sourceLineNo">1535</span>    });<a name="line.1535"></a>
-<span class="sourceLineNo">1536</span>  }<a name="line.1536"></a>
-<span class="sourceLineNo">1537</span><a name="line.1537"></a>
-<span class="sourceLineNo">1538</span>  public void preMoveServers(final Set&lt;Address&gt; servers, final String targetGroup)<a name="line.1538"></a>
-<span class="sourceLineNo">1539</span>      throws IOException {<a name="line.1539"></a>
-<span class="sourceLineNo">1540</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1540"></a>
-<span class="sourceLineNo">1541</span>      @Override<a name="line.1541"></a>
-<span class="sourceLineNo">1542</span>      public void call(MasterObserver oserver,<a name="line.1542"></a>
-<span class="sourceLineNo">1543</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1543"></a>
-<span class="sourceLineNo">1544</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1544"></a>
-<span class="sourceLineNo">1545</span>          oserver.preMoveServers(ctx, servers, targetGroup);<a name="line.1545"></a>
-<span class="sourceLineNo">1546</span>        }<a name="line.1546"></a>
-<span class="sourceLineNo">1547</span>      }<a name="line.1547"></a>
-<span class="sourceLineNo">1548</span>    });<a name="line.1548"></a>
-<span class="sourceLineNo">1549</span>  }<a name="line.1549"></a>
-<span class="sourceLineNo">1550</span><a name="line.1550"></a>
-<span class="sourceLineNo">1551</span>  public void postMoveServers(final Set&lt;Address&gt; servers, final String targetGroup)<a name="line.1551"></a>
-<span class="sourceLineNo">1552</span>      throws IOException {<a name="line.1552"></a>
-<span class="sourceLineNo">1553</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1553"></a>
-<span class="sourceLineNo">1554</span>      @Override<a name="line.1554"></a>
-<span class="sourceLineNo">1555</span>      public void call(MasterObserver oserver,<a name="line.1555"></a>
-<span class="sourceLineNo">1556</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1556"></a>
-<span class="sourceLineNo">1557</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1557"></a>
-<span class="sourceLineNo">1558</span>          oserver.postMoveServers(ctx, servers, targetGroup);<a name="line.1558"></a>
-<span class="sourceLineNo">1559</span>        }<a name="line.1559"></a>
-<span class="sourceLineNo">1560</span>      }<a name="line.1560"></a>
-<span class="sourceLineNo">1561</span>    });<a name="line.1561"></a>
-<span class="sourceLineNo">1562</span>  }<a name="line.1562"></a>
-<span class="sourceLineNo">1563</span><a name="line.1563"></a>
-<span class="sourceLineNo">1564</span>  public void preMoveTables(final Set&lt;TableName&gt; tables, final String targetGroup)<a name="line.1564"></a>
-<span class="sourceLineNo">1565</span>      throws IOException {<a name="line.1565"></a>
-<span class="sourceLineNo">1566</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1566"></a>
-<span class="sourceLineNo">1567</span>      @Override<a name="line.1567"></a>
-<span class="sourceLineNo">1568</span>      public void call(MasterObserver oserver,<a name="line.1568"></a>
-<span class="sourceLineNo">1569</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1569"></a>
-<span class="sourceLineNo">1570</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1570"></a>
-<span class="sourceLineNo">1571</span>          oserver.preMoveTables(ctx, tables, targetGroup);<a name="line.1571"></a>
-<span class="sourceLineNo">1572</span>        }<a name="line.1572"></a>
-<span class="sourceLineNo">1573</span>      }<a name="line.1573"></a>
-<span class="sourceLineNo">1574</span>    });<a name="line.1574"></a>
-<span class="sourceLineNo">1575</span>  }<a name="line.1575"></a>
-<span class="sourceLineNo">1576</span><a name="line.1576"></a>
-<span class="sourceLineNo">1577</span>  public void postMoveTables(final Set&lt;TableName&gt; tables, final String targetGroup)<a name="line.1577"></a>
-<span class="sourceLineNo">1578</span>      throws IOException {<a name="line.1578"></a>
-<span class="sourceLineNo">1579</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1579"></a>
-<span class="sourceLineNo">1580</span>      @Override<a name="line.1580"></a>
-<span class="sourceLineNo">1581</span>      public void call(MasterObserver oserver,<a name="line.1581"></a>
-<span class="sourceLineNo">1582</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1582"></a>
-<span class="sourceLineNo">1583</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1583"></a>
-<span class="sourceLineNo">1584</span>          oserver.postMoveTables(ctx, tables, targetGroup);<a name="line.1584"></a>
-<span class="sourceLineNo">1585</span>        }<a name="line.1585"></a>
-<span class="sourceLineNo">1586</span>      }<a name="line.1586"></a>
-<span class="sourceLineNo">1587</span>    });<a name="line.1587"></a>
-<span class="sourceLineNo">1588</span>  }<a name="line.1588"></a>
-<span class="sourceLineNo">1589</span><a name="line.1589"></a>
-<span class="sourceLineNo">1590</span>  public void preAddRSGroup(final String name)<a name="line.1590"></a>
-<span class="sourceLineNo">1591</span>      throws IOException {<a name="line.1591"></a>
-<span class="sourceLineNo">1592</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1592"></a>
-<span class="sourceLineNo">1593</span>      @Override<a name="line.1593"></a>
-<span class="sourceLineNo">1594</span>      public void call(MasterObserver oserver,<a name="line.1594"></a>
-<span class="sourceLineNo">1595</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1595"></a>
-<span class="sourceLineNo">1596</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1596"></a>
-<span class="sourceLineNo">1597</span>          oserver.preAddRSGroup(ctx, name);<a name="line.1597"></a>
-<span class="sourceLineNo">1598</span>        }<a name="line.1598"></a>
-<span class="sourceLineNo">1599</span>      }<a name="line.1599"></a>
-<span class="sourceLineNo">1600</span>    });<a name="line.1600"></a>
-<span class="sourceLineNo">1601</span>  }<a name="line.1601"></a>
-<span class="sourceLineNo">1602</span><a name="line.1602"></a>
-<span class="sourceLineNo">1603</span>  public void postAddRSGroup(final String name)<a name="line.1603"></a>
-<span class="sourceLineNo">1604</span>      throws IOException {<a name="line.1604"></a>
-<span class="sourceLineNo">1605</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1605"></a>
-<span class="sourceLineNo">1606</span>      @Override<a name="line.1606"></a>
-<span class="sourceLineNo">1607</span>      public void call(MasterObserver oserver,<a name="line.1607"></a>
-<span class="sourceLineNo">1608</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1608"></a>
-<span class="sourceLineNo">1609</span>        if (((MasterEnvironment) ctx.getEnvironment()).supportGroupCPs) {<a name="line.1609"></a>
-<span class="sourceLineNo">1610</span>          oserver.postAddRSGroup(ctx, name);<a name="line.1610"></a>
-<span class="sourceLineNo">1611</span>        }<a name="line.1611"></a>
-<span class="sourceLineNo">1612</span>      }<a name="line.1612"></a>
-<span class="sourceLineNo">1613</span>    });<a name="line.1613"></a>
-<span class="sourceLineNo">1614</span>  }<a name="line.1614"></a>
-<span class="sourceLineNo">1615</span><a name="line.1615"></a>
-<span class="sourceLineNo">1616</span>  public void preRemoveRSGroup(final String name)<a name="line.1616"></a>
-<span class="sourceLineNo">1617</span>      throws IOException {<a name="line.1617"></a>
-<span class="sourceLineNo">1618</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1618"></a>
-<span class="sourceLineNo">1619</span>      @Override<a name="line.1619"></a>
-<span class="sourceLineNo">1620</span>      public void call(MasterObserver oserver,<a name="line.1620"></a>
-<span class="sourceLineNo">1621</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1621"></a>
-<span class="sourceLineNo">1622</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1622"></a>
-<span class="sourceLineNo">1623</span>          oserver.preRemoveRSGroup(ctx, name);<a name="line.1623"></a>
-<span class="sourceLineNo">1624</span>        }<a name="line.1624"></a>
-<span class="sourceLineNo">1625</span>      }<a name="line.1625"></a>
-<span class="sourceLineNo">1626</span>    });<a name="line.1626"></a>
-<span class="sourceLineNo">1627</span>  }<a name="line.1627"></a>
-<span class="sourceLineNo">1628</span><a name="line.1628"></a>
-<span class="sourceLineNo">1629</span>  public void postRemoveRSGroup(final String name)<a name="line.1629"></a>
-<span class="sourceLineNo">1630</span>      throws IOException {<a name="line.1630"></a>
-<span class="sourceLineNo">1631</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1631"></a>
-<span class="sourceLineNo">1632</span>      @Override<a name="line.1632"></a>
-<span class="sourceLineNo">1633</span>      public void call(MasterObserver oserver,<a name="line.1633"></a>
-<span class="sourceLineNo">1634</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1634"></a>
-<span class="sourceLineNo">1635</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1635"></a>
-<span class="sourceLineNo">1636</span>          oserver.postRemoveRSGroup(ctx, name);<a name="line.1636"></a>
-<span class="sourceLineNo">1637</span>        }<a name="line.1637"></a>
-<span class="sourceLineNo">1638</span>      }<a name="line.1638"></a>
-<span class="sourceLineNo">1639</span>    });<a name="line.1639"></a>
-<span class="sourceLineNo">1640</span>  }<a name="line.1640"></a>
-<span class="sourceLineNo">1641</span><a name="line.1641"></a>
-<span class="sourceLineNo">1642</span>  public void preBalanceRSGroup(final String name)<a name="line.1642"></a>
-<span class="sourceLineNo">1643</span>      throws IOException {<a name="line.1643"></a>
-<span class="sourceLineNo">1644</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1644"></a>
-<span class="sourceLineNo">1645</span>      @Override<a name="line.1645"></a>
-<span class="sourceLineNo">1646</span>      public void call(MasterObserver oserver,<a name="line.1646"></a>
-<span class="sourceLineNo">1647</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1647"></a>
-<span class="sourceLineNo">1648</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1648"></a>
-<span class="sourceLineNo">1649</span>          oserver.preBalanceRSGroup(ctx, name);<a name="line.1649"></a>
-<span class="sourceLineNo">1650</span>        }<a name="line.1650"></a>
-<span class="sourceLineNo">1651</span>      }<a name="line.1651"></a>
-<span class="sourceLineNo">1652</span>    });<a name="line.1652"></a>
-<span class="sourceLineNo">1653</span>  }<a name="line.1653"></a>
-<span class="sourceLineNo">1654</span><a name="line.1654"></a>
-<span class="sourceLineNo">1655</span>  public void postBalanceRSGroup(final String name, final boolean balanceRan)<a name="line.1655"></a>
-<span class="sourceLineNo">1656</span>      throws IOException {<a name="line.1656"></a>
-<span class="sourceLineNo">1657</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1657"></a>
-<span class="sourceLineNo">1658</span>      @Override<a name="line.1658"></a>
-<span class="sourceLineNo">1659</span>      public void call(MasterObserver oserver,<a name="line.1659"></a>
-<span class="sourceLineNo">1660</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1660"></a>
-<span class="sourceLineNo">1661</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1661"></a>
-<span class="sourceLineNo">1662</span>          oserver.postBalanceRSGroup(ctx, name, balanceRan);<a name="line.1662"></a>
-<span class="sourceLineNo">1663</span>        }<a name="line.1663"></a>
-<span class="sourceLineNo">1664</span>      }<a name="line.1664"></a>
-<span class="sourceLineNo">1665</span>    });<a name="line.1665"></a>
-<span class="sourceLineNo">1666</span>  }<a name="line.1666"></a>
-<span class="sourceLineNo">1667</span><a name="line.1667"></a>
-<span class="sourceLineNo">1668</span>  public void preAddReplicationPeer(final String peerId, final ReplicationPeerConfig peerConfig)<a name="line.1668"></a>
-<span class="sourceLineNo">1669</span>      throws IOException {<a name="line.1669"></a>
-<span class="sourceLineNo">1670</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1670"></a>
-<span class="sourceLineNo">1671</span>      @Override<a name="line.1671"></a>
-<span class="sourceLineNo">1672</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1672"></a>
-<span class="sourceLineNo">1673</span>          throws IOException {<a name="line.1673"></a>
-<span class="sourceLineNo">1674</span>        observer.preAddReplicationPeer(ctx, peerId, peerConfig);<a name="line.1674"></a>
-<span class="sourceLineNo">1675</span>      }<a name="line.1675"></a>
-<span class="sourceLineNo">1676</span>    });<a name="line.1676"></a>
-<span class="sourceLineNo">1677</span>  }<a name="line.1677"></a>
-<span class="sourceLineNo">1678</span><a name="line.1678"></a>
-<span class="sourceLineNo">1679</span>  public void postAddReplicationPeer(final String peerId, final ReplicationPeerConfig peerConfig)<a name="line.1679"></a>
-<span class="sourceLineNo">1680</span>      throws IOException {<a name="line.1680"></a>
-<span class="sourceLineNo">1681</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1681"></a>
-<span class="sourceLineNo">1682</span>      @Override<a name="line.1682"></a>
-<span class="sourceLineNo">1683</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1683"></a>
-<span class="sourceLineNo">1684</span>          throws IOException {<a name="line.1684"></a>
-<span class="sourceLineNo">1685</span>        observer.postAddReplicationPeer(ctx, peerId, peerConfig);<a name="line.1685"></a>
-<span class="sourceLineNo">1686</span>      }<a name="line.1686"></a>
-<span class="sourceLineNo">1687</span>    });<a name="line.1687"></a>
-<span class="sourceLineNo">1688</span>  }<a name="line.1688"></a>
-<span class="sourceLineNo">1689</span><a name="line.1689"></a>
-<span class="sourceLineNo">1690</span>  public void preRemoveReplicationPeer(final String peerId) throws IOException {<a name="line.1690"></a>
+<span class="sourceLineNo">1429</span>    public void postEnvCall(MasterEnvironment env) {<a name="line.1429"></a>
+<span class="sourceLineNo">1430</span>    }<a name="line.1430"></a>
+<span class="sourceLineNo">1431</span>  }<a name="line.1431"></a>
+<span class="sourceLineNo">1432</span><a name="line.1432"></a>
+<span class="sourceLineNo">1433</span>  private static abstract class CoprocessorOperationWithResult&lt;T&gt; extends CoprocessorOperation {<a name="line.1433"></a>
+<span class="sourceLineNo">1434</span>    private T result = null;<a name="line.1434"></a>
+<span class="sourceLineNo">1435</span>    public void setResult(final T result) { this.result = result; }<a name="line.1435"></a>
+<span class="sourceLineNo">1436</span>    public T getResult() { return this.result; }<a name="line.1436"></a>
+<span class="sourceLineNo">1437</span>  }<a name="line.1437"></a>
+<span class="sourceLineNo">1438</span><a name="line.1438"></a>
+<span class="sourceLineNo">1439</span>  private &lt;T&gt; T execOperationWithResult(final T defaultValue,<a name="line.1439"></a>
+<span class="sourceLineNo">1440</span>      final CoprocessorOperationWithResult&lt;T&gt; ctx) throws IOException {<a name="line.1440"></a>
+<span class="sourceLineNo">1441</span>    if (ctx == null) return defaultValue;<a name="line.1441"></a>
+<span class="sourceLineNo">1442</span>    ctx.setResult(defaultValue);<a name="line.1442"></a>
+<span class="sourceLineNo">1443</span>    execOperation(ctx);<a name="line.1443"></a>
+<span class="sourceLineNo">1444</span>    return ctx.getResult();<a name="line.1444"></a>
+<span class="sourceLineNo">1445</span>  }<a name="line.1445"></a>
+<span class="sourceLineNo">1446</span><a name="line.1446"></a>
+<span class="sourceLineNo">1447</span>  private boolean execOperation(final CoprocessorOperation ctx) throws IOException {<a name="line.1447"></a>
+<span class="sourceLineNo">1448</span>    if (ctx == null) return false;<a name="line.1448"></a>
+<span class="sourceLineNo">1449</span>    boolean bypass = false;<a name="line.1449"></a>
+<span class="sourceLineNo">1450</span>    List&lt;MasterEnvironment&gt; envs = coprocessors.get();<a name="line.1450"></a>
+<span class="sourceLineNo">1451</span>    for (int i = 0; i &lt; envs.size(); i++) {<a name="line.1451"></a>
+<span class="sourceLineNo">1452</span>      MasterEnvironment env = envs.get(i);<a name="line.1452"></a>
+<span class="sourceLineNo">1453</span>      if (env.getInstance() instanceof MasterObserver) {<a name="line.1453"></a>
+<span class="sourceLineNo">1454</span>        ctx.prepare(env);<a name="line.1454"></a>
+<span class="sourceLineNo">1455</span>        Thread currentThread = Thread.currentThread();<a name="line.1455"></a>
+<span class="sourceLineNo">1456</span>        ClassLoader cl = currentThread.getContextClassLoader();<a name="line.1456"></a>
+<span class="sourceLineNo">1457</span>        try {<a name="line.1457"></a>
+<span class="sourceLineNo">1458</span>          currentThread.setContextClassLoader(env.getClassLoader());<a name="line.1458"></a>
+<span class="sourceLineNo">1459</span>          ctx.call((MasterObserver)env.getInstance(), ctx);<a name="line.1459"></a>
+<span class="sourceLineNo">1460</span>        } catch (Throwable e) {<a name="line.1460"></a>
+<span class="sourceLineNo">1461</span>          handleCoprocessorThrowable(env, e);<a name="line.1461"></a>
+<span class="sourceLineNo">1462</span>        } finally {<a name="line.1462"></a>
+<span class="sourceLineNo">1463</span>          currentThread.setContextClassLoader(cl);<a name="line.1463"></a>
+<span class="sourceLineNo">1464</span>        }<a name="line.1464"></a>
+<span class="sourceLineNo">1465</span>        bypass |= ctx.shouldBypass();<a name="line.1465"></a>
+<span class="sourceLineNo">1466</span>        if (ctx.shouldComplete()) {<a name="line.1466"></a>
+<span class="sourceLineNo">1467</span>          break;<a name="line.1467"></a>
+<span class="sourceLineNo">1468</span>        }<a name="line.1468"></a>
+<span class="sourceLineNo">1469</span>      }<a name="line.1469"></a>
+<span class="sourceLineNo">1470</span>      ctx.postEnvCall(env);<a name="line.1470"></a>
+<span class="sourceLineNo">1471</span>    }<a name="line.1471"></a>
+<span class="sourceLineNo">1472</span>    return bypass;<a name="line.1472"></a>
+<span class="sourceLineNo">1473</span>  }<a name="line.1473"></a>
+<span class="sourceLineNo">1474</span><a name="line.1474"></a>
+<span class="sourceLineNo">1475</span>  /**<a name="line.1475"></a>
+<span class="sourceLineNo">1476</span>   * Master coprocessor classes can be configured in any order, based on that priority is set and<a name="line.1476"></a>
+<span class="sourceLineNo">1477</span>   * chained in a sorted order. For preStopMaster()/preShutdown(), coprocessor methods are invoked<a name="line.1477"></a>
+<span class="sourceLineNo">1478</span>   * in call() and environment is shutdown in postEnvCall(). &lt;br&gt;<a name="line.1478"></a>
+<span class="sourceLineNo">1479</span>   * Need to execute all coprocessor methods first then postEnvCall(), otherwise some coprocessors<a name="line.1479"></a>
+<span class="sourceLineNo">1480</span>   * may remain shutdown if any exception occurs during next coprocessor execution which prevent<a name="line.1480"></a>
+<span class="sourceLineNo">1481</span>   * Master stop or cluster shutdown. (Refer:<a name="line.1481"></a>
+<span class="sourceLineNo">1482</span>   * &lt;a href="https://issues.apache.org/jira/browse/HBASE-16663"&gt;HBASE-16663&lt;/a&gt;<a name="line.1482"></a>
+<span class="sourceLineNo">1483</span>   * @param ctx CoprocessorOperation<a name="line.1483"></a>
+<span class="sourceLineNo">1484</span>   * @return true if bypaas coprocessor execution, false if not.<a name="line.1484"></a>
+<span class="sourceLineNo">1485</span>   * @throws IOException<a name="line.1485"></a>
+<span class="sourceLineNo">1486</span>   */<a name="line.1486"></a>
+<span class="sourceLineNo">1487</span>  private boolean execShutdown(final CoprocessorOperation ctx) throws IOException {<a name="line.1487"></a>
+<span class="sourceLineNo">1488</span>    if (ctx == null) return false;<a name="line.1488"></a>
+<span class="sourceLineNo">1489</span>    boolean bypass = false;<a name="line.1489"></a>
+<span class="sourceLineNo">1490</span>    List&lt;MasterEnvironment&gt; envs = coprocessors.get();<a name="line.1490"></a>
+<span class="sourceLineNo">1491</span>    int envsSize = envs.size();<a name="line.1491"></a>
+<span class="sourceLineNo">1492</span>    // Iterate the coprocessors and execute CoprocessorOperation's call()<a name="line.1492"></a>
+<span class="sourceLineNo">1493</span>    for (int i = 0; i &lt; envsSize; i++) {<a name="line.1493"></a>
+<span class="sourceLineNo">1494</span>      MasterEnvironment env = envs.get(i);<a name="line.1494"></a>
+<span class="sourceLineNo">1495</span>      if (env.getInstance() instanceof MasterObserver) {<a name="line.1495"></a>
+<span class="sourceLineNo">1496</span>        ctx.prepare(env);<a name="line.1496"></a>
+<span class="sourceLineNo">1497</span>        Thread currentThread = Thread.currentThread();<a name="line.1497"></a>
+<span class="sourceLineNo">1498</span>        ClassLoader cl = currentThread.getContextClassLoader();<a name="line.1498"></a>
+<span class="sourceLineNo">1499</span>        try {<a name="line.1499"></a>
+<span class="sourceLineNo">1500</span>          currentThread.setContextClassLoader(env.getClassLoader());<a name="line.1500"></a>
+<span class="sourceLineNo">1501</span>          ctx.call((MasterObserver) env.getInstance(), ctx);<a name="line.1501"></a>
+<span class="sourceLineNo">1502</span>        } catch (Throwable e) {<a name="line.1502"></a>
+<span class="sourceLineNo">1503</span>          handleCoprocessorThrowable(env, e);<a name="line.1503"></a>
+<span class="sourceLineNo">1504</span>        } finally {<a name="line.1504"></a>
+<span class="sourceLineNo">1505</span>          currentThread.setContextClassLoader(cl);<a name="line.1505"></a>
+<span class="sourceLineNo">1506</span>        }<a name="line.1506"></a>
+<span class="sourceLineNo">1507</span>        bypass |= ctx.shouldBypass();<a name="line.1507"></a>
+<span class="sourceLineNo">1508</span>        if (ctx.shouldComplete()) {<a name="line.1508"></a>
+<span class="sourceLineNo">1509</span>          break;<a name="line.1509"></a>
+<span class="sourceLineNo">1510</span>        }<a name="line.1510"></a>
+<span class="sourceLineNo">1511</span>      }<a name="line.1511"></a>
+<span class="sourceLineNo">1512</span>    }<a name="line.1512"></a>
+<span class="sourceLineNo">1513</span><a name="line.1513"></a>
+<span class="sourceLineNo">1514</span>    // Iterate the coprocessors and execute CoprocessorOperation's postEnvCall()<a name="line.1514"></a>
+<span class="sourceLineNo">1515</span>    for (int i = 0; i &lt; envsSize; i++) {<a name="line.1515"></a>
+<span class="sourceLineNo">1516</span>      MasterEnvironment env = envs.get(i);<a name="line.1516"></a>
+<span class="sourceLineNo">1517</span>      ctx.postEnvCall(env);<a name="line.1517"></a>
+<span class="sourceLineNo">1518</span>    }<a name="line.1518"></a>
+<span class="sourceLineNo">1519</span>    return bypass;<a name="line.1519"></a>
+<span class="sourceLineNo">1520</span>  }<a name="line.1520"></a>
+<span class="sourceLineNo">1521</span><a name="line.1521"></a>
+<span class="sourceLineNo">1522</span>  public void preMoveServersAndTables(final Set&lt;Address&gt; servers, final Set&lt;TableName&gt; tables, final String targetGroup)<a name="line.1522"></a>
+<span class="sourceLineNo">1523</span>          throws IOException {<a name="line.1523"></a>
+<span class="sourceLineNo">1524</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1524"></a>
+<span class="sourceLineNo">1525</span>      @Override<a name="line.1525"></a>
+<span class="sourceLineNo">1526</span>      public void call(MasterObserver oserver,<a name="line.1526"></a>
+<span class="sourceLineNo">1527</span>                       ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1527"></a>
+<span class="sourceLineNo">1528</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1528"></a>
+<span class="sourceLineNo">1529</span>          oserver.preMoveServersAndTables(ctx, servers, tables, targetGroup);<a name="line.1529"></a>
+<span class="sourceLineNo">1530</span>        }<a name="line.1530"></a>
+<span class="sourceLineNo">1531</span>      }<a name="line.1531"></a>
+<span class="sourceLineNo">1532</span>    });<a name="line.1532"></a>
+<span class="sourceLineNo">1533</span>  }<a name="line.1533"></a>
+<span class="sourceLineNo">1534</span><a name="line.1534"></a>
+<span class="sourceLineNo">1535</span>  public void postMoveServersAndTables(final Set&lt;Address&gt; servers, final Set&lt;TableName&gt; tables, final String targetGroup)<a name="line.1535"></a>
+<span class="sourceLineNo">1536</span>          throws IOException {<a name="line.1536"></a>
+<span class="sourceLineNo">1537</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1537"></a>
+<span class="sourceLineNo">1538</span>      @Override<a name="line.1538"></a>
+<span class="sourceLineNo">1539</span>      public void call(MasterObserver oserver,<a name="line.1539"></a>
+<span class="sourceLineNo">1540</span>                       ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1540"></a>
+<span class="sourceLineNo">1541</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1541"></a>
+<span class="sourceLineNo">1542</span>          oserver.postMoveServersAndTables(ctx, servers, tables, targetGroup);<a name="line.1542"></a>
+<span class="sourceLineNo">1543</span>        }<a name="line.1543"></a>
+<span class="sourceLineNo">1544</span>      }<a name="line.1544"></a>
+<span class="sourceLineNo">1545</span>    });<a name="line.1545"></a>
+<span class="sourceLineNo">1546</span>  }<a name="line.1546"></a>
+<span class="sourceLineNo">1547</span><a name="line.1547"></a>
+<span class="sourceLineNo">1548</span>  public void preMoveServers(final Set&lt;Address&gt; servers, final String targetGroup)<a name="line.1548"></a>
+<span class="sourceLineNo">1549</span>      throws IOException {<a name="line.1549"></a>
+<span class="sourceLineNo">1550</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1550"></a>
+<span class="sourceLineNo">1551</span>      @Override<a name="line.1551"></a>
+<span class="sourceLineNo">1552</span>      public void call(MasterObserver oserver,<a name="line.1552"></a>
+<span class="sourceLineNo">1553</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1553"></a>
+<span class="sourceLineNo">1554</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1554"></a>
+<span class="sourceLineNo">1555</span>          oserver.preMoveServers(ctx, servers, targetGroup);<a name="line.1555"></a>
+<span class="sourceLineNo">1556</span>        }<a name="line.1556"></a>
+<span class="sourceLineNo">1557</span>      }<a name="line.1557"></a>
+<span class="sourceLineNo">1558</span>    });<a name="line.1558"></a>
+<span class="sourceLineNo">1559</span>  }<a name="line.1559"></a>
+<span class="sourceLineNo">1560</span><a name="line.1560"></a>
+<span class="sourceLineNo">1561</span>  public void postMoveServers(final Set&lt;Address&gt; servers, final String targetGroup)<a name="line.1561"></a>
+<span class="sourceLineNo">1562</span>      throws IOException {<a name="line.1562"></a>
+<span class="sourceLineNo">1563</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1563"></a>
+<span class="sourceLineNo">1564</span>      @Override<a name="line.1564"></a>
+<span class="sourceLineNo">1565</span>      public void call(MasterObserver oserver,<a name="line.1565"></a>
+<span class="sourceLineNo">1566</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1566"></a>
+<span class="sourceLineNo">1567</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1567"></a>
+<span class="sourceLineNo">1568</span>          oserver.postMoveServers(ctx, servers, targetGroup);<a name="line.1568"></a>
+<span class="sourceLineNo">1569</span>        }<a name="line.1569"></a>
+<span class="sourceLineNo">1570</span>      }<a name="line.1570"></a>
+<span class="sourceLineNo">1571</span>    });<a name="line.1571"></a>
+<span class="sourceLineNo">1572</span>  }<a name="line.1572"></a>
+<span class="sourceLineNo">1573</span><a name="line.1573"></a>
+<span class="sourceLineNo">1574</span>  public void preMoveTables(final Set&lt;TableName&gt; tables, final String targetGroup)<a name="line.1574"></a>
+<span class="sourceLineNo">1575</span>      throws IOException {<a name="line.1575"></a>
+<span class="sourceLineNo">1576</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1576"></a>
+<span class="sourceLineNo">1577</span>      @Override<a name="line.1577"></a>
+<span class="sourceLineNo">1578</span>      public void call(MasterObserver oserver,<a name="line.1578"></a>
+<span class="sourceLineNo">1579</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1579"></a>
+<span class="sourceLineNo">1580</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1580"></a>
+<span class="sourceLineNo">1581</span>          oserver.preMoveTables(ctx, tables, targetGroup);<a name="line.1581"></a>
+<span class="sourceLineNo">1582</span>        }<a name="line.1582"></a>
+<span class="sourceLineNo">1583</span>      }<a name="line.1583"></a>
+<span class="sourceLineNo">1584</span>    });<a name="line.1584"></a>
+<span class="sourceLineNo">1585</span>  }<a name="line.1585"></a>
+<span class="sourceLineNo">1586</span><a name="line.1586"></a>
+<span class="sourceLineNo">1587</span>  public void postMoveTables(final Set&lt;TableName&gt; tables, final String targetGroup)<a name="line.1587"></a>
+<span class="sourceLineNo">1588</span>      throws IOException {<a name="line.1588"></a>
+<span class="sourceLineNo">1589</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1589"></a>
+<span class="sourceLineNo">1590</span>      @Override<a name="line.1590"></a>
+<span class="sourceLineNo">1591</span>      public void call(MasterObserver oserver,<a name="line.1591"></a>
+<span class="sourceLineNo">1592</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1592"></a>
+<span class="sourceLineNo">1593</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1593"></a>
+<span class="sourceLineNo">1594</span>          oserver.postMoveTables(ctx, tables, targetGroup);<a name="line.1594"></a>
+<span class="sourceLineNo">1595</span>        }<a name="line.1595"></a>
+<span class="sourceLineNo">1596</span>      }<a name="line.1596"></a>
+<span class="sourceLineNo">1597</span>    });<a name="line.1597"></a>
+<span class="sourceLineNo">1598</span>  }<a name="line.1598"></a>
+<span class="sourceLineNo">1599</span><a name="line.1599"></a>
+<span class="sourceLineNo">1600</span>  public void preAddRSGroup(final String name)<a name="line.1600"></a>
+<span class="sourceLineNo">1601</span>      throws IOException {<a name="line.1601"></a>
+<span class="sourceLineNo">1602</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1602"></a>
+<span class="sourceLineNo">1603</span>      @Override<a name="line.1603"></a>
+<span class="sourceLineNo">1604</span>      public void call(MasterObserver oserver,<a name="line.1604"></a>
+<span class="sourceLineNo">1605</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1605"></a>
+<span class="sourceLineNo">1606</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1606"></a>
+<span class="sourceLineNo">1607</span>          oserver.preAddRSGroup(ctx, name);<a name="line.1607"></a>
+<span class="sourceLineNo">1608</span>        }<a name="line.1608"></a>
+<span class="sourceLineNo">1609</span>      }<a name="line.1609"></a>
+<span class="sourceLineNo">1610</span>    });<a name="line.1610"></a>
+<span class="sourceLineNo">1611</span>  }<a name="line.1611"></a>
+<span class="sourceLineNo">1612</span><a name="line.1612"></a>
+<span class="sourceLineNo">1613</span>  public void postAddRSGroup(final String name)<a name="line.1613"></a>
+<span class="sourceLineNo">1614</span>      throws IOException {<a name="line.1614"></a>
+<span class="sourceLineNo">1615</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1615"></a>
+<span class="sourceLineNo">1616</span>      @Override<a name="line.1616"></a>
+<span class="sourceLineNo">1617</span>      public void call(MasterObserver oserver,<a name="line.1617"></a>
+<span class="sourceLineNo">1618</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1618"></a>
+<span class="sourceLineNo">1619</span>        if (((MasterEnvironment) ctx.getEnvironment()).supportGroupCPs) {<a name="line.1619"></a>
+<span class="sourceLineNo">1620</span>          oserver.postAddRSGroup(ctx, name);<a name="line.1620"></a>
+<span class="sourceLineNo">1621</span>        }<a name="line.1621"></a>
+<span class="sourceLineNo">1622</span>      }<a name="line.1622"></a>
+<span class="sourceLineNo">1623</span>    });<a name="line.1623"></a>
+<span class="sourceLineNo">1624</span>  }<a name="line.1624"></a>
+<span class="sourceLineNo">1625</span><a name="line.1625"></a>
+<span class="sourceLineNo">1626</span>  public void preRemoveRSGroup(final String name)<a name="line.1626"></a>
+<span class="sourceLineNo">1627</span>      throws IOException {<a name="line.1627"></a>
+<span class="sourceLineNo">1628</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1628"></a>
+<span class="sourceLineNo">1629</span>      @Override<a name="line.1629"></a>
+<span class="sourceLineNo">1630</span>      public void call(MasterObserver oserver,<a name="line.1630"></a>
+<span class="sourceLineNo">1631</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1631"></a>
+<span class="sourceLineNo">1632</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1632"></a>
+<span class="sourceLineNo">1633</span>          oserver.preRemoveRSGroup(ctx, name);<a name="line.1633"></a>
+<span class="sourceLineNo">1634</span>        }<a name="line.1634"></a>
+<span class="sourceLineNo">1635</span>      }<a name="line.1635"></a>
+<span class="sourceLineNo">1636</span>    });<a name="line.1636"></a>
+<span class="sourceLineNo">1637</span>  }<a name="line.1637"></a>
+<span class="sourceLineNo">1638</span><a name="line.1638"></a>
+<span class="sourceLineNo">1639</span>  public void postRemoveRSGroup(final String name)<a name="line.1639"></a>
+<span class="sourceLineNo">1640</span>      throws IOException {<a name="line.1640"></a>
+<span class="sourceLineNo">1641</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1641"></a>
+<span class="sourceLineNo">1642</span>      @Override<a name="line.1642"></a>
+<span class="sourceLineNo">1643</span>      public void call(MasterObserver oserver,<a name="line.1643"></a>
+<span class="sourceLineNo">1644</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1644"></a>
+<span class="sourceLineNo">1645</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1645"></a>
+<span class="sourceLineNo">1646</span>          oserver.postRemoveRSGroup(ctx, name);<a name="line.1646"></a>
+<span class="sourceLineNo">1647</span>        }<a name="line.1647"></a>
+<span class="sourceLineNo">1648</span>      }<a name="line.1648"></a>
+<span class="sourceLineNo">1649</span>    });<a name="line.1649"></a>
+<span class="sourceLineNo">1650</span>  }<a name="line.1650"></a>
+<span class="sourceLineNo">1651</span><a name="line.1651"></a>
+<span class="sourceLineNo">1652</span>  public void preBalanceRSGroup(final String name)<a name="line.1652"></a>
+<span class="sourceLineNo">1653</span>      throws IOException {<a name="line.1653"></a>
+<span class="sourceLineNo">1654</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1654"></a>
+<span class="sourceLineNo">1655</span>      @Override<a name="line.1655"></a>
+<span class="sourceLineNo">1656</span>      public void call(MasterObserver oserver,<a name="line.1656"></a>
+<span class="sourceLineNo">1657</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1657"></a>
+<span class="sourceLineNo">1658</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1658"></a>
+<span class="sourceLineNo">1659</span>          oserver.preBalanceRSGroup(ctx, name);<a name="line.1659"></a>
+<span class="sourceLineNo">1660</span>        }<a name="line.1660"></a>
+<span class="sourceLineNo">1661</span>      }<a name="line.1661"></a>
+<span class="sourceLineNo">1662</span>    });<a name="line.1662"></a>
+<span class="sourceLineNo">1663</span>  }<a name="line.1663"></a>
+<span class="sourceLineNo">1664</span><a name="line.1664"></a>
+<span class="sourceLineNo">1665</span>  public void postBalanceRSGroup(final String name, final boolean balanceRan)<a name="line.1665"></a>
+<span class="sourceLineNo">1666</span>      throws IOException {<a name="line.1666"></a>
+<span class="sourceLineNo">1667</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1667"></a>
+<span class="sourceLineNo">1668</span>      @Override<a name="line.1668"></a>
+<span class="sourceLineNo">1669</span>      public void call(MasterObserver oserver,<a name="line.1669"></a>
+<span class="sourceLineNo">1670</span>          ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx) throws IOException {<a name="line.1670"></a>
+<span class="sourceLineNo">1671</span>        if(((MasterEnvironment)ctx.getEnvironment()).supportGroupCPs) {<a name="line.1671"></a>
+<span class="sourceLineNo">1672</span>          oserver.postBalanceRSGroup(ctx, name, balanceRan);<a name="line.1672"></a>
+<span class="sourceLineNo">1673</span>        }<a name="line.1673"></a>
+<span class="sourceLineNo">1674</span>      }<a name="line.1674"></a>
+<span class="sourceLineNo">1675</span>    });<a name="line.1675"></a>
+<span class="sourceLineNo">1676</span>  }<a name="line.1676"></a>
+<span class="sourceLineNo">1677</span><a name="line.1677"></a>
+<span class="sourceLineNo">1678</span>  public void preAddReplicationPeer(final String peerId, final ReplicationPeerConfig peerConfig)<a name="line.1678"></a>
+<span class="sourceLineNo">1679</span>      throws IOException {<a name="line.1679"></a>
+<span class="sourceLineNo">1680</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1680"></a>
+<span class="sourceLineNo">1681</span>      @Override<a name="line.1681"></a>
+<span class="sourceLineNo">1682</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1682"></a>
+<span class="sourceLineNo">1683</span>          throws IOException {<a name="line.1683"></a>
+<span class="sourceLineNo">1684</span>        observer.preAddReplicationPeer(ctx, peerId, peerConfig);<a name="line.1684"></a>
+<span class="sourceLineNo">1685</span>      }<a name="line.1685"></a>
+<span class="sourceLineNo">1686</span>    });<a name="line.1686"></a>
+<span class="sourceLineNo">1687</span>  }<a name="line.1687"></a>
+<span class="sourceLineNo">1688</span><a name="line.1688"></a>
+<span class="sourceLineNo">1689</span>  public void postAddReplicationPeer(final String peerId, final ReplicationPeerConfig peerConfig)<a name="line.1689"></a>
+<span class="sourceLineNo">1690</span>      throws IOException {<a name="line.1690"></a>
 <span class="sourceLineNo">1691</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1691"></a>
 <span class="sourceLineNo">1692</span>      @Override<a name="line.1692"></a>
 <span class="sourceLineNo">1693</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1693"></a>
 <span class="sourceLineNo">1694</span>          throws IOException {<a name="line.1694"></a>
-<span class="sourceLineNo">1695</span>        observer.preRemoveReplicationPeer(ctx, peerId);<a name="line.1695"></a>
+<span class="sourceLineNo">1695</span>        observer.postAddReplicationPeer(ctx, peerId, peerConfig);<a name="line.1695"></a>
 <span class="sourceLineNo">1696</span>      }<a name="line.1696"></a>
 <span class="sourceLineNo">1697</span>    });<a name="line.1697"></a>
 <span class="sourceLineNo">1698</span>  }<a name="line.1698"></a>
 <span class="sourceLineNo">1699</span><a name="line.1699"></a>
-<span class="sourceLineNo">1700</span>  public void postRemoveReplicationPeer(final String peerId) throws IOException {<a name="line.1700"></a>
+<span class="sourceLineNo">1700</span>  public void preRemoveReplicationPeer(final String peerId) throws IOException {<a name="line.1700"></a>
 <span class="sourceLineNo">1701</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1701"></a>
 <span class="sourceLineNo">1702</span>      @Override<a name="line.1702"></a>
 <span class="sourceLineNo">1703</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1703"></a>
 <span class="sourceLineNo">1704</span>          throws IOException {<a name="line.1704"></a>
-<span class="sourceLineNo">1705</span>        observer.postRemoveReplicationPeer(ctx, peerId);<a name="line.1705"></a>
+<span class="sourceLineNo">1705</span>        observer.preRemoveReplicationPeer(ctx, peerId);<a name="line.1705"></a>
 <span class="sourceLineNo">1706</span>      }<a name="line.1706"></a>
 <span class="sourceLineNo">1707</span>    });<a name="line.1707"></a>
 <span class="sourceLineNo">1708</span>  }<a name="line.1708"></a>
 <span class="sourceLineNo">1709</span><a name="line.1709"></a>
-<span class="sourceLineNo">1710</span>  public void preEnableReplicationPeer(final String peerId) throws IOException {<a name="line.1710"></a>
+<span class="sourceLineNo">1710</span>  public void postRemoveReplicationPeer(final String peerId) throws IOException {<a name="line.1710"></a>
 <span class="sourceLineNo">1711</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1711"></a>
 <span class="sourceLineNo">1712</span>      @Override<a name="line.1712"></a>
 <span class="sourceLineNo">1713</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1713"></a>
 <span class="sourceLineNo">1714</span>          throws IOException {<a name="line.1714"></a>
-<span class="sourceLineNo">1715</span>        observer.preEnableReplicationPeer(ctx, peerId);<a name="line.1715"></a>
+<span class="sourceLineNo">1715</span>        observer.postRemoveReplicationPeer(ctx, peerId);<a name="line.1715"></a>
 <span class="sourceLineNo">1716</span>      }<a name="line.1716"></a>
 <span class="sourceLineNo">1717</span>    });<a name="line.1717"></a>
 <span class="sourceLineNo">1718</span>  }<a name="line.1718"></a>
 <span class="sourceLineNo">1719</span><a name="line.1719"></a>
-<span class="sourceLineNo">1720</span>  public void postEnableReplicationPeer(final String peerId) throws IOException {<a name="line.1720"></a>
+<span class="sourceLineNo">1720</span>  public void preEnableReplicationPeer(final String peerId) throws IOException {<a name="line.1720"></a>
 <span class="sourceLineNo">1721</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1721"></a>
 <span class="sourceLineNo">1722</span>      @Override<a name="line.1722"></a>
 <span class="sourceLineNo">1723</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1723"></a>
 <span class="sourceLineNo">1724</span>          throws IOException {<a name="line.1724"></a>
-<span class="sourceLineNo">1725</span>        observer.postEnableReplicationPeer(ctx, peerId);<a name="line.1725"></a>
+<span class="sourceLineNo">1725</span>        observer.preEnableReplicationPeer(ctx, peerId);<a name="line.1725"></a>
 <span class="sourceLineNo">1726</span>      }<a name="line.1726"></a>
 <span class="sourceLineNo">1727</span>    });<a name="line.1727"></a>
 <span class="sourceLineNo">1728</span>  }<a name="line.1728"></a>
 <span class="sourceLineNo">1729</span><a name="line.1729"></a>
-<span class="sourceLineNo">1730</span>  public void preDisableReplicationPeer(final String peerId) throws IOException {<a name="line.1730"></a>
+<span class="sourceLineNo">1730</span>  public void postEnableReplicationPeer(final String peerId) throws IOException {<a name="line.1730"></a>
 <span class="sourceLineNo">1731</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1731"></a>
 <span class="sourceLineNo">1732</span>      @Override<a name="line.1732"></a>
 <span class="sourceLineNo">1733</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1733"></a>
 <span class="sourceLineNo">1734</span>          throws IOException {<a name="line.1734"></a>
-<span class="sourceLineNo">1735</span>        observer.preDisableReplicationPeer(ctx, peerId);<a name="line.1735"></a>
+<span class="sourceLineNo">1735</span>        observer.postEnableReplicationPeer(ctx, peerId);<a name="line.1735"></a>
 <span class="sourceLineNo">1736</span>      }<a name="line.1736"></a>
 <span class="sourceLineNo">1737</span>    });<a name="line.1737"></a>
 <span class="sourceLineNo">1738</span>  }<a name="line.1738"></a>
 <span class="sourceLineNo">1739</span><a name="line.1739"></a>
-<span class="sourceLineNo">1740</span>  public void postDisableReplicationPeer(final String peerId) throws IOException {<a name="line.1740"></a>
+<span class="sourceLineNo">1740</span>  public void preDisableReplicationPeer(final String peerId) throws IOException {<a name="line.1740"></a>
 <span class="sourceLineNo">1741</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1741"></a>
 <span class="sourceLineNo">1742</span>      @Override<a name="line.1742"></a>
 <span class="sourceLineNo">1743</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1743"></a>
 <span class="sourceLineNo">1744</span>          throws IOException {<a name="line.1744"></a>
-<span class="sourceLineNo">1745</span>        observer.postDisableReplicationPeer(ctx, peerId);<a name="line.1745"></a>
+<span class="sourceLineNo">1745</span>        observer.preDisableReplicationPeer(ctx, peerId);<a name="line.1745"></a>
 <span class="sourceLineNo">1746</span>      }<a name="line.1746"></a>
 <span class="sourceLineNo">1747</span>    });<a name="line.1747"></a>
 <span class="sourceLineNo">1748</span>  }<a name="line.1748"></a>
 <span class="sourceLineNo">1749</span><a name="line.1749"></a>
-<span class="sourceLineNo">1750</span>  public void preGetReplicationPeerConfig(final String peerId) throws IOException {<a name="line.1750"></a>
+<span class="sourceLineNo">1750</span>  public void postDisableReplicationPeer(final String peerId) throws IOException {<a name="line.1750"></a>
 <span class="sourceLineNo">1751</span>    execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {<a name="line.1751"></a>
 <span class="sourceLineNo">1752</span>      @Override<a name="line.1752"></a>
 <span class="sourceLineNo">1753</span>      public void call(MasterObserver observer, ObserverContext&lt;MasterCoprocessorEnvironment&gt; ctx)<a name="line.1753"></a>
 <span class="sourceLineNo">1754</span>          throws IOException {<a name="line.1754"></a>
-<span class="sourceLineNo">1755</span>        observer.preGetReplicationPeerConfig(ctx, peerId);<a name="line.1755"></a>
+<span class="sourceLineNo">1755</span>        observer.postDisableReplicationPeer(ctx, peerId);<a name="line.1755"></a>

<TRUNCATED>

Mime
View raw message