Package org.apache.hadoop.hbase.util
Class MoveWithAck
java.lang.Object
org.apache.hadoop.hbase.util.MoveWithAck
Move Regions and make sure that they are up on the target server.If a region movement fails we
exit as failure
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Adminprivate final Connectionprivate static final org.slf4j.Loggerprivate final List<RegionInfo>private final RegionInfoprivate final ServerNameprivate final ServerName -
Constructor Summary
ConstructorsConstructorDescriptionMoveWithAck(Connection conn, RegionInfo regionInfo, ServerName sourceServer, ServerName targetServer, List<RegionInfo> movedRegions) -
Method Summary
Modifier and TypeMethodDescriptioncall()(package private) static ServerNamegetServerNameForRegion(RegionInfo region, Admin admin, Connection conn) Get servername that is up in hbase:meta hosting the given region.private static StringgetTimeDiffInSec(long startTime) private booleanisSameServer(RegionInfo region, ServerName serverName) Returns true if passed region is still on serverName when we look at hbase:meta.private voidisSuccessfulScan(RegionInfo region) Tries to scan a row from passed region
-
Field Details
-
LOG
-
region
-
targetServer
-
movedRegions
-
sourceServer
-
conn
-
admin
-
-
Constructor Details
-
MoveWithAck
MoveWithAck(Connection conn, RegionInfo regionInfo, ServerName sourceServer, ServerName targetServer, List<RegionInfo> movedRegions) throws IOException - Throws:
IOException
-
-
Method Details
-
call
- Specified by:
callin interfaceCallable<Boolean>- Throws:
IOExceptionInterruptedException
-
getTimeDiffInSec
-
isSuccessfulScan
Tries to scan a row from passed region- Throws:
IOException
-
isSameServer
Returns true if passed region is still on serverName when we look at hbase:meta.- Returns:
- true if region is hosted on serverName otherwise false
- Throws:
IOException
-
getServerNameForRegion
static ServerName getServerNameForRegion(RegionInfo region, Admin admin, Connection conn) throws IOException Get servername that is up in hbase:meta hosting the given region. this is hostname + port + startcode comma-delimited. Can return null- Returns:
- regionServer hosting the given region
- Throws:
IOException
-