HBASE-19325 Pass a list of server name to postClearDeadServers

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Guangxu Cheng 2017-11-22 17:40:08 +08:00 committed by Chia-Ping Tsai
parent f521000d78
commit 5a0881a98b
3 changed files with 8 additions and 4 deletions

View File

@ -1263,7 +1263,8 @@ public interface MasterObserver {
/**
* Called after clear dead region servers.
*/
default void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx)
default void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<ServerName> servers, List<ServerName> notClearedServers)
throws IOException {}
/**

View File

@ -1596,11 +1596,12 @@ public class MasterCoprocessorHost
});
}
public void postClearDeadServers() throws IOException {
public void postClearDeadServers(List<ServerName> servers,
List<ServerName> notClearedServers) throws IOException {
execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() {
@Override
public void call(MasterObserver observer) throws IOException {
observer.postClearDeadServers(this);
observer.postClearDeadServers(this, servers, notClearedServers);
}
});
}

View File

@ -2163,7 +2163,9 @@ public class MasterRpcServices extends RSRpcServices
}
if (master.cpHost != null) {
master.cpHost.postClearDeadServers();
master.cpHost.postClearDeadServers(
ProtobufUtil.toServerNameList(request.getServerNameList()),
ProtobufUtil.toServerNameList(response.getServerNameList()));
}
} catch (IOException io) {
throw new ServiceException(io);