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-23 11:12:30 +08:00 committed by Chia-Ping Tsai
parent 20d811121f
commit de16690b7a
8 changed files with 18 additions and 14 deletions

View File

@ -970,8 +970,8 @@ public class RSGroupAdminEndpoint extends RSGroupAdminService
}
@Override
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException {
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<ServerName> servers, List<ServerName> notClearedServers) throws IOException {
}

View File

@ -84,8 +84,8 @@ public class BaseMasterAndRegionObserver extends BaseRegionObserver
}
@Override
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException {
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<ServerName> servers, List<ServerName> notClearedServers) throws IOException {
}
@Override

View File

@ -95,8 +95,8 @@ public class BaseMasterObserver implements MasterObserver {
}
@Override
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException {
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<ServerName> servers, List<ServerName> notClearedServers) throws IOException {
}
@Override

View File

@ -1067,7 +1067,8 @@ public interface MasterObserver extends Coprocessor {
/**
* Called after clear dead region servers.
*/
void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException;
void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<ServerName> servers, List<ServerName> notClearedServers) throws IOException;
/**
* Called before servers are moved to target region server group

View File

@ -1208,12 +1208,13 @@ public class MasterCoprocessorHost
});
}
public void postClearDeadServers() throws IOException {
public void postClearDeadServers(final List<ServerName> servers,
final List<ServerName> notClearedServers) throws IOException {
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override
public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException {
oserver.postClearDeadServers(ctx);
oserver.postClearDeadServers(ctx, servers, notClearedServers);
}
});
}

View File

@ -1162,7 +1162,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);

View File

@ -2613,8 +2613,8 @@ public class AccessController extends BaseMasterAndRegionObserver
}
@Override
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException { }
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<ServerName> servers, List<ServerName> notClearedServers) throws IOException { }
@Override
public void preMerge(ObserverContext<RegionServerCoprocessorEnvironment> ctx, Region regionA,

View File

@ -288,8 +288,8 @@ public class TestMasterObserver {
}
@Override
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException {
public void postClearDeadServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
List<ServerName> servers, List<ServerName> notClearedServers) throws IOException {
}
public boolean wasDispatchMergeCalled() {