Package org.apache.hadoop.hbase.master
Class RegionPlan
java.lang.Object
org.apache.hadoop.hbase.master.RegionPlan
- All Implemented Interfaces:
Comparable<RegionPlan>
@LimitedPrivate("Coprocessors")
@Evolving
public class RegionPlan
extends Object
implements Comparable<RegionPlan>
Stores the plan for the move of an individual region. Contains info for the region being moved,
info for the server the region should be moved from, and info for the server the region should be
moved to. The comparable implementation of this class compares only the region information and
not the source/dest server info.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate ServerName
private final RegionInfo
private final ServerName
-
Constructor Summary
ConstructorDescriptionRegionPlan
(RegionInfo hri, ServerName source, ServerName dest) Instantiate a plan for a region move, moving the specified region from the specified source server to the specified destination server. -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
compareServerName
(ServerName left, ServerName right) int
compareTo
(RegionPlan other) Compare the region info.private static int
compareTo
(RegionPlan left, RegionPlan right) boolean
Get the destination server for the plan for this region.Get the encoded region name for the region this plan is for.Get the source server for the plan for this region.int
hashCode()
void
setDestination
(ServerName dest) Set the destination server for the plan for this region.toString()
-
Field Details
-
hri
-
source
-
dest
-
-
Constructor Details
-
RegionPlan
Instantiate a plan for a region move, moving the specified region from the specified source server to the specified destination server. Destination server can be instantiated as null and later set withsetDestination(ServerName)
.- Parameters:
hri
- region to be movedsource
- regionserver region should be moved fromdest
- regionserver region should be moved to
-
-
Method Details
-
setDestination
Set the destination server for the plan for this region. -
getSource
Get the source server for the plan for this region.- Returns:
- server info for source
-
getDestination
Get the destination server for the plan for this region.- Returns:
- server info for destination
-
getRegionName
Get the encoded region name for the region this plan is for.- Returns:
- Encoded region name
-
getRegionInfo
-
compareTo
Compare the region info.- Specified by:
compareTo
in interfaceComparable<RegionPlan>
- Parameters:
other
- region plan you are comparing against
-
compareTo
-
compareServerName
-
hashCode
-
equals
-
toString
-