public class TestMetaTableLocator extends Object
MetaTableLocator
Modifier and Type | Class and Description |
---|---|
(package private) class |
TestMetaTableLocator.WaitOnMetaThread
Wait on META.
|
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.hbase.Abortable |
abortable |
static HBaseClassTestRule |
CLASS_RULE |
private static org.slf4j.Logger |
LOG |
private static org.apache.hadoop.hbase.ServerName |
SN |
private static HBaseTestingUtility |
UTIL |
private org.apache.hadoop.hbase.zookeeper.ZKWatcher |
watcher |
Constructor and Description |
---|
TestMetaTableLocator() |
Modifier and Type | Method and Description |
---|---|
void |
after() |
static void |
afterClass() |
void |
before() |
static void |
beforeClass() |
private org.apache.hadoop.hbase.client.ClusterConnection |
mockConnection(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin,
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface client) |
private void |
startWaitAliveThenWaitItLives(Thread t,
int ms) |
void |
testGetMetaServerConnectionFails()
Test we survive a connection refused
ConnectException |
void |
testInterruptWaitOnMeta()
Test interruptable while blocking wait on meta.
|
void |
testMetaLookup()
Test normal operations
|
void |
testNoTimeoutWaitForMeta()
Test waiting on meat w/ no timeout specified.
|
void |
testTimeoutWaitForMeta() |
void |
testVerifyMetaRegionLocationFails()
Test get of meta region fails properly if nothing to connect to.
|
private void |
testVerifyMetaRegionLocationWithException(Exception ex) |
void |
testVerifyMetaRegionServerNotRunning()
Test that verifyMetaRegionLocation properly handles getting a
ServerNotRunningException.
|
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final HBaseTestingUtility UTIL
private static final org.apache.hadoop.hbase.ServerName SN
private org.apache.hadoop.hbase.zookeeper.ZKWatcher watcher
private org.apache.hadoop.hbase.Abortable abortable
public TestMetaTableLocator()
public static void beforeClass() throws Exception
Exception
public static void afterClass() throws IOException
IOException
public void before() throws IOException
IOException
public void after()
public void testMetaLookup() throws IOException, InterruptedException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException, org.apache.zookeeper.KeeperException
IOException
InterruptedException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
org.apache.zookeeper.KeeperException
public void testInterruptWaitOnMeta() throws IOException, InterruptedException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
IOException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
InterruptedException
private void testVerifyMetaRegionLocationWithException(Exception ex) throws IOException, InterruptedException, org.apache.zookeeper.KeeperException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
IOException
InterruptedException
org.apache.zookeeper.KeeperException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
public void testGetMetaServerConnectionFails() throws IOException, InterruptedException, org.apache.zookeeper.KeeperException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
ConnectException
IOException
InterruptedException
org.apache.zookeeper.KeeperException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
public void testVerifyMetaRegionServerNotRunning() throws IOException, InterruptedException, org.apache.zookeeper.KeeperException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
IOException
InterruptedException
org.apache.zookeeper.KeeperException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
public void testVerifyMetaRegionLocationFails() throws IOException, InterruptedException, org.apache.zookeeper.KeeperException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
IOException
InterruptedException
org.apache.zookeeper.KeeperException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
public void testTimeoutWaitForMeta() throws IOException, InterruptedException
IOException
InterruptedException
public void testNoTimeoutWaitForMeta() throws IOException, InterruptedException, org.apache.zookeeper.KeeperException
IOException
InterruptedException
org.apache.zookeeper.KeeperException
private org.apache.hadoop.hbase.client.ClusterConnection mockConnection(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface admin, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface client) throws IOException
admin
- An AdminProtos.AdminService.BlockingInterface
instance; you'll likely
want to pass a mocked HRS; can be null.client
- A mocked ClientProtocol instance, can be nullConfiguration
when
Connection.getConfiguration()
is called, a 'location' when
RegionLocator.getRegionLocation(byte[], boolean)
is called,
and that returns the passed AdminProtos.AdminService.BlockingInterface
instance when
ClusterConnection.getAdmin(ServerName)
is called, returns the passed
ClientProtos.ClientService.BlockingInterface
instance when
ClusterConnection.getClient(ServerName)
is called.IOException
private void startWaitAliveThenWaitItLives(Thread t, int ms)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.