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
Modifier and TypeFieldDescriptionprivate final Admin
private final Connection
private static final org.slf4j.Logger
private final List<RegionInfo>
private final RegionInfo
private final ServerName
private final ServerName
-
Constructor Summary
ConstructorDescriptionMoveWithAck
(Connection conn, RegionInfo regionInfo, ServerName sourceServer, ServerName targetServer, List<RegionInfo> movedRegions) -
Method Summary
Modifier and TypeMethodDescriptioncall()
(package private) static ServerName
getServerNameForRegion
(RegionInfo region, Admin admin, Connection conn) Get servername that is up in hbase:meta hosting the given region.private static String
getTimeDiffInSec
(long startTime) private boolean
isSameServer
(RegionInfo region, ServerName serverName) Returns true if passed region is still on serverName when we look at hbase:meta.private void
isSuccessfulScan
(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:
call
in interfaceCallable<Boolean>
- Throws:
IOException
InterruptedException
-
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
-