public class TestThriftServer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TestThriftServer.MySlowHBaseHandler |
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
private static ByteBuffer |
columnAAname |
private static ByteBuffer |
columnAname |
private static ByteBuffer |
columnBname |
private static org.slf4j.Logger |
LOG |
protected static int |
MAXVERSIONS |
private static MetricsAssertHelper |
metricsHelper |
org.junit.rules.TestName |
name |
private static ByteBuffer |
rowAname |
private static ByteBuffer |
rowBname |
private static ByteBuffer |
tableAname |
private static ByteBuffer |
tableBname |
private static HBaseTestingUtility |
UTIL |
private static ByteBuffer |
valueAname |
private static ByteBuffer |
valueBname |
private static ByteBuffer |
valueCname |
private static ByteBuffer |
valueDname |
private static ByteBuffer |
valueEname |
| Constructor and Description |
|---|
TestThriftServer() |
| Modifier and Type | Method and Description |
|---|---|
static void |
afterClass() |
private static ByteBuffer |
asByteBuffer(long l) |
private static ByteBuffer |
asByteBuffer(String i) |
static void |
beforeClass() |
static void |
checkTableList(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) |
private void |
closeScanner(int scannerId,
org.apache.hadoop.hbase.thrift.ThriftHBaseServiceHandler handler)
Asserts that the passed scanner is exhausted, and then closes
the scanner.
|
static void |
createTestTables(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) |
static void |
doTestAppend()
Appends the value to a cell and checks that the cell value is updated properly.
|
static void |
doTestCheckAndPut()
Check that checkAndPut fails if the cell does not exist, then put in the cell, then check that
the checkAndPut succeeds.
|
void |
doTestFilterRegistration() |
void |
doTestGetRegionInfo() |
static void |
doTestGetRegionInfo(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) |
void |
doTestGetTableRegions()
For HBASE-2556
Tests for GetTableRegions
|
static void |
doTestGetTableRegions(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) |
void |
doTestIncrements() |
static void |
doTestIncrements(org.apache.hadoop.hbase.thrift.ThriftHBaseServiceHandler handler) |
void |
doTestTableCreateDrop()
Tests for creating, enabling, disabling, and deleting tables.
|
static void |
doTestTableCreateDrop(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) |
void |
doTestTableMutations()
Tests adding a series of Mutations and BatchMutations, including a
delete mutation.
|
static void |
doTestTableMutations(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) |
void |
doTestTableScanners()
Tests the four different scanner-opening methods (with and without
a stoprow, with and without a timestamp).
|
void |
doTestTableTimestampsAndColumns()
Similar to testTableMutations(), except Mutations are applied with
specific timestamps and data retrieval uses these timestamps to
extract specific versions of data.
|
void |
doTestThriftMetrics()
Tests if the metrics for thrift handler work correctly
|
static void |
dropTestTables(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) |
private static List<org.apache.hadoop.hbase.thrift.generated.BatchMutation> |
getBatchMutations() |
private static List<org.apache.hadoop.hbase.thrift.generated.ColumnDescriptor> |
getColumnDescriptors() |
private List<ByteBuffer> |
getColumnList(boolean includeA,
boolean includeB) |
private int |
getCurrentCount(String name,
int maybe,
org.apache.hadoop.hbase.thrift.ThriftMetrics metrics)
TODO: These counts are supposed to be zero but sometimes they are not, they are equal to the
passed in maybe.
|
private static org.apache.hadoop.hbase.thrift.generated.Hbase.Iface |
getHandlerForMetricsTest(org.apache.hadoop.hbase.thrift.ThriftMetrics metrics,
org.apache.hadoop.conf.Configuration conf) |
private static org.apache.hadoop.hbase.thrift.ThriftMetrics |
getMetrics(org.apache.hadoop.conf.Configuration conf) |
private static List<org.apache.hadoop.hbase.thrift.generated.Mutation> |
getMutations() |
void |
testAll()
Runs all of the tests under a single JUnit test method.
|
private void |
testExceptionType(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler,
org.apache.hadoop.hbase.thrift.ThriftMetrics metrics,
ByteBuffer tTableName,
String rowkey,
ErrorThrowingGetObserver.ErrorType errorType) |
void |
testGetThriftServerOneType()
Verify that thrift client calling thrift2 server can get the thrift2 server type correctly.
|
void |
testGetThriftServerType() |
void |
testMetricsWithException() |
public static final HBaseClassTestRule CLASS_RULE
private static final HBaseTestingUtility UTIL
private static final org.slf4j.Logger LOG
private static final MetricsAssertHelper metricsHelper
protected static final int MAXVERSIONS
private static ByteBuffer tableAname
private static ByteBuffer tableBname
private static ByteBuffer columnAname
private static ByteBuffer columnAAname
private static ByteBuffer columnBname
private static ByteBuffer rowAname
private static ByteBuffer rowBname
private static ByteBuffer valueAname
private static ByteBuffer valueBname
private static ByteBuffer valueCname
private static ByteBuffer valueDname
private static ByteBuffer valueEname
public org.junit.rules.TestName name
public TestThriftServer()
private static ByteBuffer asByteBuffer(String i)
private static ByteBuffer asByteBuffer(long l)
public static void beforeClass() throws Exception
Exceptionpublic static void afterClass() throws Exception
Exceptionpublic void testAll() throws Exception
Exceptionpublic void doTestTableCreateDrop() throws Exception
Exceptionpublic static void doTestTableCreateDrop(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exceptionprivate int getCurrentCount(String name, int maybe, org.apache.hadoop.hbase.thrift.ThriftMetrics metrics)
name - maybe - metrics - public void doTestThriftMetrics() throws Exception
Exceptionprivate static org.apache.hadoop.hbase.thrift.generated.Hbase.Iface getHandlerForMetricsTest(org.apache.hadoop.hbase.thrift.ThriftMetrics metrics, org.apache.hadoop.conf.Configuration conf) throws Exception
Exceptionprivate static org.apache.hadoop.hbase.thrift.ThriftMetrics getMetrics(org.apache.hadoop.conf.Configuration conf) throws Exception
Exceptionpublic static void createTestTables(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exceptionpublic static void checkTableList(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exceptionpublic static void dropTestTables(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exceptionpublic void doTestIncrements() throws Exception
Exceptionpublic static void doTestIncrements(org.apache.hadoop.hbase.thrift.ThriftHBaseServiceHandler handler) throws Exception
Exceptionpublic void doTestTableMutations() throws Exception
Exceptionpublic static void doTestTableMutations(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exceptionpublic void doTestTableTimestampsAndColumns() throws Exception
Exceptionpublic void doTestTableScanners() throws Exception
Exceptionpublic void doTestGetTableRegions() throws Exception
Exceptionpublic static void doTestGetTableRegions(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exceptionpublic void doTestFilterRegistration() throws Exception
Exceptionpublic void doTestGetRegionInfo() throws Exception
Exceptionpublic static void doTestGetRegionInfo(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exceptionpublic static void doTestAppend() throws Exception
Exceptionpublic static void doTestCheckAndPut() throws Exception
Exceptionpublic void testMetricsWithException() throws Exception
Exceptionprivate void testExceptionType(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler, org.apache.hadoop.hbase.thrift.ThriftMetrics metrics, ByteBuffer tTableName, String rowkey, ErrorThrowingGetObserver.ErrorType errorType) throws Exception
Exceptionprivate static List<org.apache.hadoop.hbase.thrift.generated.ColumnDescriptor> getColumnDescriptors()
private List<ByteBuffer> getColumnList(boolean includeA, boolean includeB)
includeA - whether or not to include columnAincludeB - whether or not to include columnBprivate static List<org.apache.hadoop.hbase.thrift.generated.Mutation> getMutations()
private static List<org.apache.hadoop.hbase.thrift.generated.BatchMutation> getBatchMutations()
private void closeScanner(int scannerId, org.apache.hadoop.hbase.thrift.ThriftHBaseServiceHandler handler) throws Exception
scannerId - the scanner to closehandler - the HBaseServiceHandler interfacing to HBaseExceptionpublic void testGetThriftServerType() throws Exception
Exceptionpublic void testGetThriftServerOneType() throws Exception
ExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.