Class TestLockProcedure
java.lang.Object
org.apache.hadoop.hbase.master.locking.TestLockProcedure
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
final org.junit.rules.ExpectedException
private static final int
private static final int
private static final org.slf4j.Logger
private static org.apache.hadoop.hbase.master.MasterRpcServices
private static String
private static org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv>
private static org.apache.hadoop.hbase.TableName
private static org.apache.hadoop.hbase.TableName
private static List<org.apache.hadoop.hbase.client.RegionInfo>
private static List<org.apache.hadoop.hbase.client.RegionInfo>
private String
org.junit.rules.TestName
protected static final HBaseTestingUtility
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
awaitForLocked
(long procId, long timeoutInMs) Returns immediately if the lock is acquired.static void
private org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest
getNamespaceLock
(String namespace, String description) private org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest
getRegionLock
(List<org.apache.hadoop.hbase.client.RegionInfo> regionInfos, String description) private org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest
getTableExclusiveLock
(org.apache.hadoop.hbase.TableName tableName, String description) private long
queueLock
(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lockRequest) private void
releaseLock
(long procId) private void
sendHeartbeatAndCheckLocked
(long procId, boolean isLocked) void
setup()
static void
private static void
setupConf
(org.apache.hadoop.conf.Configuration conf) void
tearDown()
void
void
void
void
void
void
void
void
private void
testRemoteLockRecovery
(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lock) void
void
void
void
void
void
private void
validateLockRequestException
(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lockRequest, String message)
-
Field Details
-
CLASS_RULE
-
exception
-
testName
-
HEARTBEAT_TIMEOUT
- See Also:
-
LOCAL_LOCKS_TIMEOUT
- See Also:
-
LOG
-
UTIL
-
masterRpcService
-
procExec
private static org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec -
namespace
-
tableName1
-
tableRegions1
-
tableName2
-
tableRegions2
-
testMethodName
-
-
Constructor Details
-
TestLockProcedure
public TestLockProcedure()
-
-
Method Details
-
setupConf
-
setupCluster
- Throws:
Exception
-
cleanupTest
- Throws:
Exception
-
setup
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
getNamespaceLock
private org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest getNamespaceLock(String namespace, String description) -
getTableExclusiveLock
private org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest getTableExclusiveLock(org.apache.hadoop.hbase.TableName tableName, String description) -
getRegionLock
private org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest getRegionLock(List<org.apache.hadoop.hbase.client.RegionInfo> regionInfos, String description) -
validateLockRequestException
private void validateLockRequestException(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lockRequest, String message) throws Exception - Throws:
Exception
-
testLockRequestValidationEmptyDescription
- Throws:
Exception
-
testLockRequestValidationEmptyNamespaceName
- Throws:
Exception
-
testLockRequestValidationRegionsFromDifferentTable
- Throws:
Exception
-
awaitForLocked
Returns immediately if the lock is acquired.- Throws:
TimeoutException
- if lock couldn't be acquired.Exception
-
queueLock
private long queueLock(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lockRequest) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException - Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
sendHeartbeatAndCheckLocked
private void sendHeartbeatAndCheckLocked(long procId, boolean isLocked) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException - Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
releaseLock
private void releaseLock(long procId) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException - Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
testUpdateHeartbeatAndUnlockForTable
- Throws:
Exception
-
testAbort
- Throws:
Exception
-
testUpdateHeartbeatAndUnlockForNamespace
- Throws:
Exception
-
testTimeout
- Throws:
Exception
-
testMultipleLocks
- Throws:
Exception
-
testLatch
- Throws:
Exception
-
testLocalLockTimeout
- Throws:
Exception
-
testRemoteLockRecovery
private void testRemoteLockRecovery(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lock) throws Exception - Throws:
Exception
-
testRemoteTableLockRecovery
- Throws:
Exception
-
testRemoteNamespaceLockRecovery
- Throws:
Exception
-
testRemoteRegionLockRecovery
- Throws:
Exception
-
testLocalMasterLockRecovery
- Throws:
Exception
-