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 0406d06533
commit 44bd94721c
3 changed files with 8 additions and 4 deletions

View File

@ -1263,7 +1263,8 @@ public interface MasterObserver {
/** /**
* Called after clear dead region servers. * 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 {} 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() { execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() {
@Override @Override
public void call(MasterObserver observer) throws IOException { 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) { if (master.cpHost != null) {
master.cpHost.postClearDeadServers(); master.cpHost.postClearDeadServers(
ProtobufUtil.toServerNameList(request.getServerNameList()),
ProtobufUtil.toServerNameList(response.getServerNameList()));
} }
} catch (IOException io) { } catch (IOException io) {
throw new ServiceException(io); throw new ServiceException(io);