public class TestLockProcedure extends Object
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
org.junit.rules.ExpectedException |
exception |
private static int |
HEARTBEAT_TIMEOUT |
private static int |
LOCAL_LOCKS_TIMEOUT |
private static org.slf4j.Logger |
LOG |
private static org.apache.hadoop.hbase.master.MasterRpcServices |
masterRpcService |
private static String |
namespace |
private static org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> |
procExec |
private static org.apache.hadoop.hbase.TableName |
tableName1 |
private static org.apache.hadoop.hbase.TableName |
tableName2 |
private static List<org.apache.hadoop.hbase.client.RegionInfo> |
tableRegions1 |
private static List<org.apache.hadoop.hbase.client.RegionInfo> |
tableRegions2 |
private String |
testMethodName |
org.junit.rules.TestName |
testName |
protected static HBaseTestingUtility |
UTIL |
| Constructor and Description |
|---|
TestLockProcedure() |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
awaitForLocked(long procId,
long timeoutInMs)
Returns immediately if the lock is acquired.
|
static void |
cleanupTest() |
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 |
setupCluster() |
private static void |
setupConf(org.apache.hadoop.conf.Configuration conf) |
void |
tearDown() |
void |
testAbort() |
void |
testLatch() |
void |
testLocalLockTimeout() |
void |
testLocalMasterLockRecovery() |
void |
testLockRequestValidationEmptyDescription() |
void |
testLockRequestValidationEmptyNamespaceName() |
void |
testLockRequestValidationRegionsFromDifferentTable() |
void |
testMultipleLocks() |
private void |
testRemoteLockRecovery(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lock) |
void |
testRemoteNamespaceLockRecovery() |
void |
testRemoteRegionLockRecovery() |
void |
testRemoteTableLockRecovery() |
void |
testTimeout() |
void |
testUpdateHeartbeatAndUnlockForNamespace() |
void |
testUpdateHeartbeatAndUnlockForTable() |
private void |
validateLockRequestException(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lockRequest,
String message) |
public static final HBaseClassTestRule CLASS_RULE
public final org.junit.rules.ExpectedException exception
public org.junit.rules.TestName testName
private static final int HEARTBEAT_TIMEOUT
private static final int LOCAL_LOCKS_TIMEOUT
private static final org.slf4j.Logger LOG
protected static final HBaseTestingUtility UTIL
private static org.apache.hadoop.hbase.master.MasterRpcServices masterRpcService
private static org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec
private static org.apache.hadoop.hbase.TableName tableName1
private static List<org.apache.hadoop.hbase.client.RegionInfo> tableRegions1
private static org.apache.hadoop.hbase.TableName tableName2
private static List<org.apache.hadoop.hbase.client.RegionInfo> tableRegions2
private String testMethodName
public TestLockProcedure()
private static void setupConf(org.apache.hadoop.conf.Configuration conf)
public static void setupCluster() throws Exception
Exceptionpublic static void cleanupTest() throws Exception
Exceptionprivate org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest getNamespaceLock(String namespace, String description)
private org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest getTableExclusiveLock(org.apache.hadoop.hbase.TableName tableName, String description)
private org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest getRegionLock(List<org.apache.hadoop.hbase.client.RegionInfo> regionInfos, String description)
private void validateLockRequestException(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lockRequest, String message) throws Exception
Exceptionpublic void testLockRequestValidationEmptyDescription() throws Exception
Exceptionpublic void testLockRequestValidationEmptyNamespaceName() throws Exception
Exceptionpublic void testLockRequestValidationRegionsFromDifferentTable() throws Exception
Exceptionprivate boolean awaitForLocked(long procId, long timeoutInMs) throws Exception
TimeoutException - if lock couldn't be acquired.Exceptionprivate long queueLock(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lockRequest) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionprivate void sendHeartbeatAndCheckLocked(long procId, boolean isLocked) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionprivate void releaseLock(long procId) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionpublic void testUpdateHeartbeatAndUnlockForTable() throws Exception
Exceptionpublic void testUpdateHeartbeatAndUnlockForNamespace() throws Exception
Exceptionpublic void testTimeout() throws Exception
Exceptionpublic void testMultipleLocks() throws Exception
Exceptionpublic void testLocalLockTimeout() throws Exception
Exceptionprivate void testRemoteLockRecovery(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lock) throws Exception
Exceptionpublic void testRemoteTableLockRecovery() throws Exception
Exceptionpublic void testRemoteNamespaceLockRecovery() throws Exception
Exceptionpublic void testRemoteRegionLockRecovery() throws Exception
Exceptionpublic void testLocalMasterLockRecovery() throws Exception
ExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.