@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?
Procedure.LockState
TableProcedureInterface.TableOperationType
Modifier and Type | Field and Description |
---|---|
protected ServerName |
targetServer
Gets set as desired target on move, merge, etc., when we want to go to a particular server.
|
aborted
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
AssignProcedure() |
AssignProcedure(HRegionInfo regionInfo) |
AssignProcedure(HRegionInfo regionInfo,
boolean forceNewPlan) |
AssignProcedure(HRegionInfo regionInfo,
ServerName destinationServer) |
abort, acquireLock, addToRemoteDispatcher, execute, getRegionInfo, getRegionState, getTableName, getTransitionState, hasLock, holdLock, isMeta, isServerOnline, isServerOnline, releaseLock, remoteCallCompleted, remoteCallFailed, reportTransition, rollback, setRegionInfo, setTransitionState, shouldWaitClientAck, toStringState
addStackIndex, afterReplay, beforeReplay, compareTo, completionCleanup, doAcquireLock, doExecute, doReleaseLock, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcId, getProcIdHashCode, getProcName, getResult, getRootProcedureId, getRootProcId, getStackIndexes, getState, getSubmittedTime, getTimeout, getTimeoutTimestamp, hasChildren, hasException, hasOwner, hasParent, hasTimeout, haveSameParent, incChildrenLatch, isFailed, isFinished, isInitializing, isRunnable, isSuccess, isWaiting, isYieldAfterExecutionStep, removeStackIndex, setAbortFailure, setChildrenLatch, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, toString, toStringClass, toStringDetails, toStringSimpleSB, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, wasExecuted
protected volatile ServerName targetServer
public AssignProcedure()
public AssignProcedure(HRegionInfo regionInfo)
public AssignProcedure(HRegionInfo regionInfo, boolean forceNewPlan)
public AssignProcedure(HRegionInfo regionInfo, ServerName destinationServer)
public TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterface
protected boolean isRollbackSupported(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.RegionTransitionState state)
isRollbackSupported
in class RegionTransitionProcedure
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
serializeStateData
in class Procedure<MasterProcedureEnv>
IOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
deserializeStateData
in class Procedure<MasterProcedureEnv>
IOException
protected boolean startTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode) throws IOException
startTransition
in class RegionTransitionProcedure
IOException
protected boolean updateTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode) throws IOException, ProcedureSuspendedException
RegionTransitionProcedure
updateTransition
in class RegionTransitionProcedure
IOException
ProcedureSuspendedException
protected void finishTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode) throws IOException
finishTransition
in class RegionTransitionProcedure
IOException
protected void reportTransition(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode, org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode code, long openSeqNum) throws UnexpectedStateException
reportTransition
in class RegionTransitionProcedure
UnexpectedStateException
public RemoteProcedureDispatcher.RemoteOperation remoteCallBuild(MasterProcedureEnv env, ServerName serverName)
remoteCallBuild
in interface RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>
remoteCallBuild
in class RegionTransitionProcedure
protected boolean remoteCallFailed(MasterProcedureEnv env, RegionStates.RegionStateNode regionNode, IOException exception)
remoteCallFailed
in class RegionTransitionProcedure
public void toStringClassDetails(StringBuilder sb)
toStringClassDetails
in class RegionTransitionProcedure
public ServerName getServer(MasterProcedureEnv env)
RegionTransitionProcedure
getServer
in class RegionTransitionProcedure
protected ProcedureMetrics getProcedureMetrics(MasterProcedureEnv env)
getProcedureMetrics
in class Procedure<MasterProcedureEnv>
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.