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
Exception
public static void cleanupTest() throws Exception
Exception
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 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
Exception
public void testLockRequestValidationEmptyDescription() throws Exception
Exception
public void testLockRequestValidationEmptyNamespaceName() throws Exception
Exception
public void testLockRequestValidationRegionsFromDifferentTable() throws Exception
Exception
private boolean awaitForLocked(long procId, long timeoutInMs) throws Exception
TimeoutException
- if lock couldn't be acquired.Exception
private 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.ServiceException
private void sendHeartbeatAndCheckLocked(long procId, boolean isLocked) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
private void releaseLock(long procId) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
public void testUpdateHeartbeatAndUnlockForTable() throws Exception
Exception
public void testUpdateHeartbeatAndUnlockForNamespace() throws Exception
Exception
public void testTimeout() throws Exception
Exception
public void testMultipleLocks() throws Exception
Exception
public void testLocalLockTimeout() throws Exception
Exception
private void testRemoteLockRecovery(org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest lock) throws Exception
Exception
public void testRemoteTableLockRecovery() throws Exception
Exception
public void testRemoteNamespaceLockRecovery() throws Exception
Exception
public void testRemoteRegionLockRecovery() throws Exception
Exception
public void testLocalMasterLockRecovery() throws Exception
Exception
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.