Class AssignmentManagerUtil
java.lang.Object
org.apache.hadoop.hbase.master.assignment.AssignmentManagerUtil
Utility for this assignment package only.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidcheckClosedRegion(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) private static booleandropStaleEditsUnder(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path regionDir, long durableSeqId, RegionInfo regionInfo) (package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponsegetRegionInfoResponse(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.GetRegionInfoResponsegetRegionInfoResponse(MasterProcedureEnv env, ServerName regionLocation, RegionInfo hri, boolean includeBestSplitRow) (package private) static booleanisSplitOrMerged(RegionStateNode regionStateNode) For splitting, need to test both region info and state, and will return true if either of the test returns true.private static voidlock(List<RegionStateNode> regionNodes) (package private) static voidremoveNonDefaultReplicas(MasterProcedureEnv env, Stream<RegionInfo> regions, int regionReplication) (package private) static voidreopenRegionsForRollback(MasterProcedureEnv env, List<RegionInfo> regions, int regionReplication, ServerName targetServer) private static booleantryDropStaleRecoveredEdits(MasterProcedureEnv env, RegionInfo regionInfo) Try to remove recovered.edits files that are provably below the region's last flushed seqid.private static voidunlock(List<RegionStateNode> regionNodes)
-
Field Details
-
LOG
-
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
-
tryDropStaleRecoveredEdits
Try to remove recovered.edits files that are provably below the region's last flushed seqid.- Returns:
- true if, after cleanup, no recovered.edits remain for the region
-
dropStaleEditsUnder
private static boolean dropStaleEditsUnder(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path regionDir, long durableSeqId, RegionInfo regionInfo) throws IOException - Throws:
IOException
-
isSplitOrMerged
For splitting, need to test both region info and state, and will return true if either of the test returns true. Please see the comments inAssignmentManager.markRegionAsSplit(RegionInfo, ServerName, RegionInfo, RegionInfo)for more details on why we need to test two conditions.
-