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.ThriftServerRunner.HBaseHandler 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.ThriftServerRunner.HBaseHandler 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 |
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
Exception
public static void afterClass() throws Exception
Exception
public void testAll() throws Exception
Exception
public void doTestTableCreateDrop() throws Exception
Exception
public static void doTestTableCreateDrop(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exception
private int getCurrentCount(String name, int maybe, org.apache.hadoop.hbase.thrift.ThriftMetrics metrics)
name
- maybe
- metrics
- public void doTestThriftMetrics() throws Exception
Exception
private 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
Exception
private static org.apache.hadoop.hbase.thrift.ThriftMetrics getMetrics(org.apache.hadoop.conf.Configuration conf) throws Exception
Exception
public static void createTestTables(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exception
public static void checkTableList(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exception
public static void dropTestTables(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exception
public void doTestIncrements() throws Exception
Exception
public static void doTestIncrements(org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler handler) throws Exception
Exception
public void doTestTableMutations() throws Exception
Exception
public static void doTestTableMutations(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exception
public void doTestTableTimestampsAndColumns() throws Exception
Exception
public void doTestTableScanners() throws Exception
Exception
public void doTestGetTableRegions() throws Exception
Exception
public static void doTestGetTableRegions(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exception
public void doTestFilterRegistration() throws Exception
Exception
public void doTestGetRegionInfo() throws Exception
Exception
public static void doTestGetRegionInfo(org.apache.hadoop.hbase.thrift.generated.Hbase.Iface handler) throws Exception
Exception
public static void doTestAppend() throws Exception
Exception
public static void doTestCheckAndPut() throws Exception
Exception
public void testMetricsWithException() throws Exception
Exception
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) throws Exception
Exception
private 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.ThriftServerRunner.HBaseHandler handler) throws Exception
scannerId
- the scanner to closehandler
- the HBaseHandler interfacing to HBaseException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.