@InterfaceAudience.Private public final class LockProcedure extends Procedure<MasterProcedureEnv> implements TableProcedureInterface
Procedure.LockStateTableProcedureInterface.TableOperationType| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_LOCAL_MASTER_LOCKS_TIMEOUT_MS |
static int |
DEFAULT_REMOTE_LOCKS_TIMEOUT_MS |
static String |
LOCAL_MASTER_LOCKS_TIMEOUT_MS_CONF |
static String |
REMOTE_LOCKS_TIMEOUT_MS_CONF |
NO_PROC_ID, NO_TIMEOUT| 构造器和说明 |
|---|
LockProcedure() |
LockProcedure(org.apache.hadoop.conf.Configuration conf,
RegionInfo[] regionInfos,
LockType type,
String description,
CountDownLatch lockAcquireLatch)
Constructor for region lock(s).
|
LockProcedure(org.apache.hadoop.conf.Configuration conf,
String namespace,
LockType type,
String description,
CountDownLatch lockAcquireLatch)
Constructor for namespace lock.
|
LockProcedure(org.apache.hadoop.conf.Configuration conf,
TableName tableName,
LockType type,
String description,
CountDownLatch lockAcquireLatch)
Constructor for table lock.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
abort(MasterProcedureEnv env) |
protected Procedure.LockState |
acquireLock(MasterProcedureEnv env) |
protected void |
beforeReplay(MasterProcedureEnv env)
On recovery, re-execute from start to acquire the locks.
|
protected void |
deserializeStateData(ProcedureStateSerializer serializer) |
protected Procedure<MasterProcedureEnv>[] |
execute(MasterProcedureEnv env) |
String |
getDescription() |
TableName |
getTableName() |
TableProcedureInterface.TableOperationType |
getTableOperationType()
Given an operation type we can take decisions about what to do with pending operations.
|
LockType |
getType() |
boolean |
holdLock(MasterProcedureEnv env) |
boolean |
isLocked() |
protected void |
releaseLock(MasterProcedureEnv env) |
protected void |
rollback(MasterProcedureEnv env) |
protected void |
serializeStateData(ProcedureStateSerializer serializer) |
protected boolean |
setTimeoutFailure(MasterProcedureEnv env)
Re run the procedure after every timeout to write new WAL entries so we don't hold back old
WALs.
|
protected void |
toStringClassDetails(StringBuilder builder) |
void |
unlock(MasterProcedureEnv env) |
void |
updateHeartBeat()
Updates timeout deadline for the lock.
|
addStackIndex, afterReplay, bypass, compareTo, completionCleanup, doExecute, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcedureMetrics, 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, shouldWaitClientAck, skipPersistence, toString, toStringClass, toStringDetails, toStringSimpleSB, toStringState, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecutedpublic static final int DEFAULT_REMOTE_LOCKS_TIMEOUT_MS
public static final int DEFAULT_LOCAL_MASTER_LOCKS_TIMEOUT_MS
public LockProcedure()
public LockProcedure(org.apache.hadoop.conf.Configuration conf,
String namespace,
LockType type,
String description,
CountDownLatch lockAcquireLatch)
throws IllegalArgumentException
lockAcquireLatch - if not null, the latch is decreased when lock is acquired.IllegalArgumentExceptionpublic LockProcedure(org.apache.hadoop.conf.Configuration conf,
TableName tableName,
LockType type,
String description,
CountDownLatch lockAcquireLatch)
throws IllegalArgumentException
lockAcquireLatch - if not null, the latch is decreased when lock is acquired.IllegalArgumentExceptionpublic LockProcedure(org.apache.hadoop.conf.Configuration conf,
RegionInfo[] regionInfos,
LockType type,
String description,
CountDownLatch lockAcquireLatch)
throws IllegalArgumentException
lockAcquireLatch - if not null, the latch is decreased when lock is acquired.
Useful for locks acquired locally from master process.IllegalArgumentException - if all regions are not from same table.public TableName getTableName()
getTableName 在接口中 TableProcedureInterfacepublic TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterfacegetTableOperationType 在接口中 TableProcedureInterfacepublic void updateHeartBeat()
protected boolean setTimeoutFailure(MasterProcedureEnv env)
setTimeoutFailure 在类中 Procedure<MasterProcedureEnv>public void unlock(MasterProcedureEnv env)
protected Procedure<MasterProcedureEnv>[] execute(MasterProcedureEnv env) throws ProcedureSuspendedException
execute 在类中 Procedure<MasterProcedureEnv>ProcedureSuspendedExceptionprotected void rollback(MasterProcedureEnv env)
rollback 在类中 Procedure<MasterProcedureEnv>protected boolean abort(MasterProcedureEnv env)
abort 在类中 Procedure<MasterProcedureEnv>protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
serializeStateData 在类中 Procedure<MasterProcedureEnv>IOExceptionprotected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
deserializeStateData 在类中 Procedure<MasterProcedureEnv>IOExceptionprotected Procedure.LockState acquireLock(MasterProcedureEnv env)
acquireLock 在类中 Procedure<MasterProcedureEnv>protected void releaseLock(MasterProcedureEnv env)
releaseLock 在类中 Procedure<MasterProcedureEnv>protected void beforeReplay(MasterProcedureEnv env)
beforeReplay 在类中 Procedure<MasterProcedureEnv>protected void toStringClassDetails(StringBuilder builder)
public LockType getType()
public String getDescription()
public boolean isLocked()
public boolean holdLock(MasterProcedureEnv env)
holdLock 在类中 Procedure<MasterProcedureEnv>Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.