public class TestClientNoCluster extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.util.Tool
Modifier and Type | Class and Description |
---|---|
(package private) static class |
TestClientNoCluster.FakeServer
Fake 'server'.
|
(package private) static class |
TestClientNoCluster.ManyServersManyRegionsConnection
Fake many regionservers and many regions on a connection implementation.
|
private static class |
TestClientNoCluster.MetaRowsComparator
Comparator for meta row keys.
|
(package private) static class |
TestClientNoCluster.RegionServerStoppedOnScannerOpenConnection
Override to shutdown going to zookeeper for cluster id and meta location.
|
(package private) static class |
TestClientNoCluster.RpcTimeoutConnection
Override to check we are setting rpc timeout right.
|
(package private) static class |
TestClientNoCluster.SimpleRegistry
Simple cluster registry inserted in place of our usual zookeeper based one.
|
Modifier and Type | Field and Description |
---|---|
private static byte[] |
BIG_USER_TABLE |
private static org.apache.hbase.thirdparty.com.google.protobuf.ByteString |
CATALOG_FAMILY_BYTESTRING |
static HBaseClassTestRule |
CLASS_RULE |
private org.apache.hadoop.conf.Configuration |
conf |
private static org.slf4j.Logger |
LOG |
static org.apache.hadoop.hbase.ServerName |
META_SERVERNAME |
private static org.apache.hbase.thirdparty.com.google.protobuf.ByteString |
REGIONINFO_QUALIFIER_BYTESTRING |
private static org.apache.hbase.thirdparty.com.google.protobuf.ByteString |
SERVER_QUALIFIER_BYTESTRING |
Constructor and Description |
---|
TestClientNoCluster() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
cycle(int id,
org.apache.hadoop.conf.Configuration c,
org.apache.hadoop.hbase.client.Connection sharedConnection)
Code for each 'client' to run.
|
(package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.GetResponse |
doMetaGetResponse(SortedMap<byte[],org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.HRegionInfo,org.apache.hadoop.hbase.ServerName>> meta,
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.GetRequest request) |
(package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse |
doMetaScanResponse(SortedMap<byte[],org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.HRegionInfo,org.apache.hadoop.hbase.ServerName>> meta,
AtomicLong sequenceids,
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest request) |
(package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiResponse |
doMultiResponse(SortedMap<byte[],org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.HRegionInfo,org.apache.hadoop.hbase.ServerName>> meta,
AtomicLong sequenceids,
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiRequest request) |
private static byte[] |
format(long number)
Format passed integer.
|
(package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell.Builder |
getBaseCellBuilder(org.apache.hbase.thirdparty.com.google.protobuf.ByteString row) |
(package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell |
getRegionInfo(org.apache.hbase.thirdparty.com.google.protobuf.ByteString row,
org.apache.hadoop.hbase.HRegionInfo hri) |
(package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell |
getServer(org.apache.hbase.thirdparty.com.google.protobuf.ByteString row,
org.apache.hadoop.hbase.ServerName sn) |
(package private) static org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell |
getStartCode(org.apache.hbase.thirdparty.com.google.protobuf.ByteString row) |
(package private) static boolean |
isMetaRegion(byte[] name,
org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType type) |
static void |
main(String[] args)
Run a client instance against a faked up server.
|
private static org.apache.hadoop.hbase.HRegionInfo[] |
makeHRegionInfos(byte[] tableName,
int count,
long namespaceSpan) |
(package private) static SortedMap<byte[],org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.HRegionInfo,org.apache.hadoop.hbase.ServerName>> |
makeMeta(byte[] tableName,
int regionCount,
long namespaceSpan,
int serverCount)
Create up a map that is keyed by meta row name and whose value is the HRegionInfo and
ServerName to return for this row.
|
private static org.apache.hadoop.hbase.ServerName[] |
makeServerNames(int count) |
int |
run(String[] arg0) |
void |
setUp() |
void |
testConnectionClosedOnRegionLocate() |
void |
testDoNotRetryMetaTableAccessor() |
void |
testDoNotRetryOnScanNext() |
void |
testRegionServerStoppedOnScannerOpen() |
void |
testRpcTimeout()
Test that operation timeout prevails over rpc default timeout and retries, etc.
|
void |
testTimeoutAndRetries()
Remove the @Ignore to try out timeout and retry asettings
|
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private org.apache.hadoop.conf.Configuration conf
public static final org.apache.hadoop.hbase.ServerName META_SERVERNAME
private static final org.apache.hbase.thirdparty.com.google.protobuf.ByteString CATALOG_FAMILY_BYTESTRING
private static final org.apache.hbase.thirdparty.com.google.protobuf.ByteString REGIONINFO_QUALIFIER_BYTESTRING
private static final org.apache.hbase.thirdparty.com.google.protobuf.ByteString SERVER_QUALIFIER_BYTESTRING
private static final byte[] BIG_USER_TABLE
public TestClientNoCluster()
public void testTimeoutAndRetries() throws IOException
IOException
public void testRpcTimeout() throws IOException
IOException
public void testDoNotRetryMetaTableAccessor() throws IOException
IOException
public void testDoNotRetryOnScanNext() throws IOException
IOException
public void testRegionServerStoppedOnScannerOpen() throws IOException
IOException
public void testConnectionClosedOnRegionLocate() throws IOException
IOException
static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiResponse doMultiResponse(SortedMap<byte[],org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.HRegionInfo,org.apache.hadoop.hbase.ServerName>> meta, AtomicLong sequenceids, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiRequest request)
static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse doMetaScanResponse(SortedMap<byte[],org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.HRegionInfo,org.apache.hadoop.hbase.ServerName>> meta, AtomicLong sequenceids, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest request)
static org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.GetResponse doMetaGetResponse(SortedMap<byte[],org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.HRegionInfo,org.apache.hadoop.hbase.ServerName>> meta, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.GetRequest request)
static boolean isMetaRegion(byte[] name, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType type)
name
- region name or encoded region name.type
- static org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell.Builder getBaseCellBuilder(org.apache.hbase.thirdparty.com.google.protobuf.ByteString row)
static org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell getRegionInfo(org.apache.hbase.thirdparty.com.google.protobuf.ByteString row, org.apache.hadoop.hbase.HRegionInfo hri)
static org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell getServer(org.apache.hbase.thirdparty.com.google.protobuf.ByteString row, org.apache.hadoop.hbase.ServerName sn)
static org.apache.hadoop.hbase.shaded.protobuf.generated.CellProtos.Cell getStartCode(org.apache.hbase.thirdparty.com.google.protobuf.ByteString row)
private static byte[] format(long number)
number
- private static org.apache.hadoop.hbase.HRegionInfo[] makeHRegionInfos(byte[] tableName, int count, long namespaceSpan)
count
- namespaceSpan
- count
regionsprivate static org.apache.hadoop.hbase.ServerName[] makeServerNames(int count)
count
- count
servernames.static SortedMap<byte[],org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.HRegionInfo,org.apache.hadoop.hbase.ServerName>> makeMeta(byte[] tableName, int regionCount, long namespaceSpan, int serverCount)
static void cycle(int id, org.apache.hadoop.conf.Configuration c, org.apache.hadoop.hbase.client.Connection sharedConnection) throws IOException
id
- c
- sharedConnection
- IOException
public int run(String[] arg0) throws Exception
run
in interface org.apache.hadoop.util.Tool
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.