Class AssignmentManagerUtil
java.lang.Object
org.apache.hadoop.hbase.master.assignment.AssignmentManagerUtil
Utility for this assignment package only.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static void
checkClosedRegion
(MasterProcedureEnv env, RegionInfo regionInfo) private static TransitRegionStateProcedure[]
createAssignProcedures
(MasterProcedureEnv env, List<RegionInfo> regions, int regionReplication, ServerName targetServer, boolean ignoreIfInTransition) Create assign procedures for the give regions, according to theregionReplication
.(package private) static TransitRegionStateProcedure[]
createAssignProceduresForOpeningNewRegions
(MasterProcedureEnv env, List<RegionInfo> regions, int regionReplication, ServerName targetServer) (package private) static TransitRegionStateProcedure[]
createAssignProceduresForSplitDaughters
(MasterProcedureEnv env, List<RegionInfo> daughters, int regionReplication, ServerName parentServer) private static TransitRegionStateProcedure[]
createRoundRobinAssignProcedures
(MasterProcedureEnv env, List<RegionInfo> regions, int regionReplication, List<ServerName> serversToExclude, boolean ignoreIfInTransition) Create round robin assign procedures for the given regions, according to theregionReplication
.(package private) static TransitRegionStateProcedure[]
createUnassignProceduresForSplitOrMerge
(MasterProcedureEnv env, Stream<RegionInfo> regions, int regionReplication) (package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse
getRegionInfoResponse
(MasterProcedureEnv env, ServerName regionLocation, RegionInfo hri) Raw call to remote regionserver to get info on a particular region.(package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse
getRegionInfoResponse
(MasterProcedureEnv env, ServerName regionLocation, RegionInfo hri, boolean includeBestSplitRow) private static void
lock
(List<RegionStateNode> regionNodes) (package private) static void
removeNonDefaultReplicas
(MasterProcedureEnv env, Stream<RegionInfo> regions, int regionReplication) (package private) static void
reopenRegionsForRollback
(MasterProcedureEnv env, List<RegionInfo> regions, int regionReplication, ServerName targetServer) private static void
unlock
(List<RegionStateNode> regionNodes)
-
Field Details
-
DEFAULT_REGION_REPLICA
- See Also:
-
-
Constructor Details
-
AssignmentManagerUtil
private AssignmentManagerUtil()
-
-
Method Details
-
getRegionInfoResponse
static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse getRegionInfoResponse(MasterProcedureEnv env, ServerName regionLocation, RegionInfo hri) throws IOException Raw call to remote regionserver to get info on a particular region.- Throws:
IOException
- Let it out so can report this IOE as reason for failure
-
getRegionInfoResponse
static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse getRegionInfoResponse(MasterProcedureEnv env, ServerName regionLocation, RegionInfo hri, boolean includeBestSplitRow) throws IOException - Throws:
IOException
-
lock
-
unlock
-
createUnassignProceduresForSplitOrMerge
static TransitRegionStateProcedure[] createUnassignProceduresForSplitOrMerge(MasterProcedureEnv env, Stream<RegionInfo> regions, int regionReplication) throws IOException - Throws:
IOException
-
createAssignProcedures
private static TransitRegionStateProcedure[] createAssignProcedures(MasterProcedureEnv env, List<RegionInfo> regions, int regionReplication, ServerName targetServer, boolean ignoreIfInTransition) Create assign procedures for the give regions, according to theregionReplication
. For rolling back, we will submit procedures directly to theProcedureExecutor
, so it is possible that we persist the newly scheduled procedures, and then crash before persisting the rollback state, so when we arrive here the second time, it is possible that some regions have already been associated with a TRSP.- Parameters:
ignoreIfInTransition
- if true, will skip creating TRSP for the given region if it is already in transition, otherwise we will add an assert that it should not in transition.
-
createRoundRobinAssignProcedures
private static TransitRegionStateProcedure[] createRoundRobinAssignProcedures(MasterProcedureEnv env, List<RegionInfo> regions, int regionReplication, List<ServerName> serversToExclude, boolean ignoreIfInTransition) Create round robin assign procedures for the given regions, according to theregionReplication
. For rolling back, we will submit procedures directly to theProcedureExecutor
, so it is possible that we persist the newly scheduled procedures, and then crash before persisting the rollback state, so when we arrive here the second time, it is possible that some regions have already been associated with a TRSP.- Parameters:
ignoreIfInTransition
- if true, will skip creating TRSP for the given region if it is already in transition, otherwise we will add an assert that it should not in transition.
-
createAssignProceduresForSplitDaughters
static TransitRegionStateProcedure[] createAssignProceduresForSplitDaughters(MasterProcedureEnv env, List<RegionInfo> daughters, int regionReplication, ServerName parentServer) -
createAssignProceduresForOpeningNewRegions
static TransitRegionStateProcedure[] createAssignProceduresForOpeningNewRegions(MasterProcedureEnv env, List<RegionInfo> regions, int regionReplication, ServerName targetServer) -
reopenRegionsForRollback
static void reopenRegionsForRollback(MasterProcedureEnv env, List<RegionInfo> regions, int regionReplication, ServerName targetServer) -
removeNonDefaultReplicas
static void removeNonDefaultReplicas(MasterProcedureEnv env, Stream<RegionInfo> regions, int regionReplication) -
checkClosedRegion
- Throws:
IOException
-