HBASE-22708 Remove the deprecated methods in Hbck interface (#3362)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
456c7f964a
commit
40a3d57628
|
@ -21,16 +21,12 @@ import java.io.Closeable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import org.apache.hadoop.hbase.Abortable;
|
import org.apache.hadoop.hbase.Abortable;
|
||||||
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
|
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
|
||||||
import org.apache.hadoop.hbase.ServerName;
|
import org.apache.hadoop.hbase.ServerName;
|
||||||
import org.apache.hadoop.hbase.master.RegionState;
|
import org.apache.hadoop.hbase.master.RegionState;
|
||||||
import org.apache.yetus.audience.InterfaceAudience;
|
import org.apache.yetus.audience.InterfaceAudience;
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
|
|
||||||
import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hbck fixup tool APIs. Obtain an instance from {@link Connection#getHbck()} and call
|
* Hbck fixup tool APIs. Obtain an instance from {@link Connection#getHbck()} and call
|
||||||
* {@link #close()} when done.
|
* {@link #close()} when done.
|
||||||
|
@ -116,17 +112,6 @@ public interface Hbck extends Abortable, Closeable {
|
||||||
List<Boolean> bypassProcedure(List<Long> pids, long waitTime, boolean override, boolean recursive)
|
List<Boolean> bypassProcedure(List<Long> pids, long waitTime, boolean override, boolean recursive)
|
||||||
throws IOException;
|
throws IOException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Use {@link #scheduleServerCrashProcedures(List)} instead.
|
|
||||||
* @deprecated since 2.2.1. Will removed in 3.0.0.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
default List<Long> scheduleServerCrashProcedure(List<HBaseProtos.ServerName> serverNames)
|
|
||||||
throws IOException {
|
|
||||||
return scheduleServerCrashProcedures(
|
|
||||||
serverNames.stream().map(ProtobufUtil::toServerName).collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Long> scheduleServerCrashProcedures(List<ServerName> serverNames) throws IOException;
|
List<Long> scheduleServerCrashProcedures(List<ServerName> serverNames) throws IOException;
|
||||||
|
|
||||||
List<Long> scheduleSCPsForUnknownServers() throws IOException;
|
List<Long> scheduleSCPsForUnknownServers() throws IOException;
|
||||||
|
|
|
@ -67,7 +67,6 @@ import org.junit.runners.Parameterized.Parameters;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.apache.hbase.thirdparty.com.google.common.io.Closeables;
|
import org.apache.hbase.thirdparty.com.google.common.io.Closeables;
|
||||||
import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to test HBaseHbck. Spins up the minicluster once at test start and then takes it down
|
* Class to test HBaseHbck. Spins up the minicluster once at test start and then takes it down
|
||||||
|
@ -285,12 +284,12 @@ public class TestHbck {
|
||||||
ServerName serverName = testRs.getServerName();
|
ServerName serverName = testRs.getServerName();
|
||||||
Hbck hbck = getHbck();
|
Hbck hbck = getHbck();
|
||||||
List<Long> pids =
|
List<Long> pids =
|
||||||
hbck.scheduleServerCrashProcedure(Arrays.asList(ProtobufUtil.toServerName(serverName)));
|
hbck.scheduleServerCrashProcedures(Arrays.asList(serverName));
|
||||||
assertTrue(pids.get(0) > 0);
|
assertTrue(pids.get(0) > 0);
|
||||||
LOG.info("pid is {}", pids.get(0));
|
LOG.info("pid is {}", pids.get(0));
|
||||||
|
|
||||||
List<Long> newPids =
|
List<Long> newPids =
|
||||||
hbck.scheduleServerCrashProcedure(Arrays.asList(ProtobufUtil.toServerName(serverName)));
|
hbck.scheduleServerCrashProcedures(Arrays.asList(serverName));
|
||||||
assertTrue(newPids.get(0) < 0);
|
assertTrue(newPids.get(0) < 0);
|
||||||
LOG.info("pid is {}", newPids.get(0));
|
LOG.info("pid is {}", newPids.get(0));
|
||||||
waitOnPids(pids);
|
waitOnPids(pids);
|
||||||
|
|
Loading…
Reference in New Issue