@InterfaceAudience.Private public final class LockProcedure extends org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv> implements TableProcedureInterface
org.apache.hadoop.hbase.procedure2.Procedure.LockStateTableProcedureInterface.TableOperationType| Modifier and Type | Field and Description |
|---|---|
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 |
| Constructor and Description |
|---|
LockProcedure() |
LockProcedure(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.client.RegionInfo[] regionInfos,
org.apache.hadoop.hbase.procedure2.LockType type,
String description,
CountDownLatch lockAcquireLatch)
Constructor for region lock(s).
|
LockProcedure(org.apache.hadoop.conf.Configuration conf,
String namespace,
org.apache.hadoop.hbase.procedure2.LockType type,
String description,
CountDownLatch lockAcquireLatch)
Constructor for namespace lock.
|
LockProcedure(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.TableName tableName,
org.apache.hadoop.hbase.procedure2.LockType type,
String description,
CountDownLatch lockAcquireLatch)
Constructor for table lock.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
abort(MasterProcedureEnv env) |
protected org.apache.hadoop.hbase.procedure2.Procedure.LockState |
acquireLock(MasterProcedureEnv env) |
protected void |
beforeReplay(MasterProcedureEnv env)
On recovery, re-execute from start to acquire the locks.
|
protected void |
deserializeStateData(org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer serializer) |
protected org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>[] |
execute(MasterProcedureEnv env) |
String |
getDescription() |
org.apache.hadoop.hbase.TableName |
getTableName() |
TableProcedureInterface.TableOperationType |
getTableOperationType()
Given an operation type we can take decisions about what to do with pending operations.
|
org.apache.hadoop.hbase.procedure2.LockType |
getType() |
boolean |
holdLock(MasterProcedureEnv env) |
boolean |
isLocked() |
protected void |
releaseLock(MasterProcedureEnv env) |
protected void |
rollback(MasterProcedureEnv env) |
protected void |
serializeStateData(org.apache.hadoop.hbase.procedure2.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 String REMOTE_LOCKS_TIMEOUT_MS_CONF
public static final int DEFAULT_LOCAL_MASTER_LOCKS_TIMEOUT_MS
public static final String LOCAL_MASTER_LOCKS_TIMEOUT_MS_CONF
public LockProcedure()
public LockProcedure(org.apache.hadoop.conf.Configuration conf,
String namespace,
org.apache.hadoop.hbase.procedure2.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,
org.apache.hadoop.hbase.TableName tableName,
org.apache.hadoop.hbase.procedure2.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,
org.apache.hadoop.hbase.client.RegionInfo[] regionInfos,
org.apache.hadoop.hbase.procedure2.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 org.apache.hadoop.hbase.TableName getTableName()
getTableName in interface TableProcedureInterfacepublic TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterfacegetTableOperationType in interface TableProcedureInterfacepublic void updateHeartBeat()
protected boolean setTimeoutFailure(MasterProcedureEnv env)
setTimeoutFailure in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>public void unlock(MasterProcedureEnv env)
protected org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>[] execute(MasterProcedureEnv env) throws org.apache.hadoop.hbase.procedure2.ProcedureSuspendedException
execute in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>org.apache.hadoop.hbase.procedure2.ProcedureSuspendedExceptionprotected void rollback(MasterProcedureEnv env)
rollback in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>protected boolean abort(MasterProcedureEnv env)
abort in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>protected void serializeStateData(org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer serializer)
throws IOException
serializeStateData in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>IOExceptionprotected void deserializeStateData(org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer serializer)
throws IOException
deserializeStateData in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>IOExceptionprotected org.apache.hadoop.hbase.procedure2.Procedure.LockState acquireLock(MasterProcedureEnv env)
acquireLock in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>protected void releaseLock(MasterProcedureEnv env)
releaseLock in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>protected void beforeReplay(MasterProcedureEnv env)
beforeReplay in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>protected void toStringClassDetails(StringBuilder builder)
toStringClassDetails in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>public org.apache.hadoop.hbase.procedure2.LockType getType()
public String getDescription()
public boolean isLocked()
public boolean holdLock(MasterProcedureEnv env)
holdLock in class org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.