HBASE-21303 [shell] clear_deadservers with no args fails

This commit is contained in:
Michael Stack 2018-10-12 10:34:59 -07:00
parent 714127b4a5
commit fecaf4737c
1 changed files with 4 additions and 5 deletions

View File

@ -25,6 +25,7 @@ import java.io.IOException;
import java.io.InterruptedIOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
@ -4233,15 +4234,13 @@ public class HBaseAdmin implements Admin {
}
@Override
public List<ServerName> clearDeadServers(final List<ServerName> servers) throws IOException {
if (servers == null || servers.size() == 0) {
throw new IllegalArgumentException("servers cannot be null or empty");
}
public List<ServerName> clearDeadServers(List<ServerName> servers) throws IOException {
return executeCallable(new MasterCallable<List<ServerName>>(getConnection(),
getRpcControllerFactory()) {
@Override
protected List<ServerName> rpcCall() throws Exception {
ClearDeadServersRequest req = RequestConverter.buildClearDeadServersRequest(servers);
ClearDeadServersRequest req = RequestConverter.
buildClearDeadServersRequest(servers == null? Collections.EMPTY_LIST: servers);
return ProtobufUtil.toServerNameList(
master.clearDeadServers(getRpcController(), req).getServerNameList());
}