@InterfaceAudience.Private public class AssignProcedure extends RegionTransitionProcedure
The Assign starts by pushing the "assign" operation to the AssignmentManager and then will go in a "waiting" state. The AM will batch the "assign" requests and ask the Balancer where to put the region (the various policies will be respected: retain, round-robin, random). Once the AM and the balancer have found a place for the region the procedure will be resumed and an "open region" request will be placed in the Remote Dispatcher queue, and the procedure once again will go in a "waiting state". The Remote Dispatcher will batch the various requests for that server and they will be sent to the RS for execution. The RS will complete the open operation by calling master.reportRegionStateTransition(). The AM will intercept the transition report, and notify the procedure. The procedure will finish the assignment by publishing to new state on meta or it will retry the assignment.
This procedure does not rollback when beyond the first REGION_TRANSITION_QUEUE step; it will press on trying to assign in the face of failure. Should we ignore rollback calls to Assign/Unassign then? Or just remove rollback here?
| 限定符和类型 | 类和说明 |
|---|---|
static class |
AssignProcedure.CompareAssignProcedure
Sort AssignProcedures such that meta and system assigns come first before user-space assigns.
|
Procedure.LockStateTableProcedureInterface.TableOperationType| 限定符和类型 | 字段和说明 |
|---|---|
static AssignProcedure.CompareAssignProcedure |
COMPARATOR
Comparator that will sort AssignProcedures so meta assigns come first, then system table
assigns and finally user space assigns.
|
protected ServerName |
targetServer
Gets set as desired target on move, merge, etc., when we want to go to a particular server.
|
abortedNO_PROC_ID, NO_TIMEOUT| 构造器和说明 |
|---|
AssignProcedure() |
AssignProcedure(RegionInfo regionInfo) |
AssignProcedure(RegionInfo regionInfo,
ServerName destinationServer) |
AssignProcedure(RegionInfo regionInfo,
ServerName destinationServer,
boolean override) |
abort, acquireLock, addToRemoteDispatcher, bypass, execute, getAttempt, getRegionInfo, getRegionState, getTableName, getTransitionState, holdLock, isMeta, isServerOnline, isServerOnline, releaseLock, remoteCallFailed, remoteOperationCompleted, remoteOperationFailed, reportTransition, rollback, setAttempt, setOverride, setRegionInfo, setTimeoutFailure, shouldWaitClientAck, toStringState, waitInitializedaddStackIndex, afterReplay, beforeReplay, compareTo, completionCleanup, doExecute, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcId, getProcIdHashCode, getProcName, getResult, getRootProcedureId, getRootProcId, getStackIndexes, getState, getSubmittedTime, getTimeout, getTimeoutTimestamp, hasChildren, hasException, hasLock, hasOwner, hasParent, hasTimeout, haveSameParent, incChildrenLatch, isBypass, isFailed, isFinished, isInitializing, isLockedWhenLoading, isRunnable, isSuccess, isWaiting, isYieldAfterExecutionStep, removeStackIndex, setAbortFailure, setChildrenLatch, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, skipPersistence, toString, toStringClass, toStringDetails, toStringSimpleSB, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, wasExecutedprotected volatile ServerName targetServer
public static final AssignProcedure.CompareAssignProcedure COMPARATOR
public AssignProcedure()
public AssignProcedure(RegionInfo regionInfo)
public AssignProcedure(RegionInfo regionInfo, ServerName destinationServer)
public AssignProcedure(RegionInfo regionInfo, ServerName destinationServer, boolean override)
public TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterfaceprotected boolean isRollbackSupported(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.RegionTransitionState state)
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
serializeStateData 在类中 Procedure<MasterProcedureEnv>IOExceptionprotected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
deserializeStateData 在类中 Procedure<MasterProcedureEnv>IOExceptionpublic static boolean assign(MasterServices masterServices, RegionInfo ri)
protected static boolean assign(MasterServices masterServices, RegionStates.RegionStateNode regionNode) throws IOException
IOExceptionprotected boolean startTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode) throws IOException
startTransition 在类中 RegionTransitionProcedureIOExceptionprotected boolean updateTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode) throws IOException, ProcedureSuspendedException
RegionTransitionProcedureprotected void finishTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode) throws IOException
finishTransition 在类中 RegionTransitionProcedureIOExceptionprotected void reportTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode, org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode code, long openSeqNum) throws UnexpectedStateException
public RemoteProcedureDispatcher.RemoteOperation remoteCallBuild(MasterProcedureEnv env, ServerName serverName)
protected boolean remoteCallFailed(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode, IOException exception)
remoteCallFailed 在类中 RegionTransitionProcedurepublic void toStringClassDetails(StringBuilder sb)
public ServerName getServer(MasterProcedureEnv env)
RegionTransitionProceduregetServer 在类中 RegionTransitionProcedureprotected ProcedureMetrics getProcedureMetrics(MasterProcedureEnv env)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.