Package org.apache.hadoop.hbase.thrift2
Class TestThriftHBaseServiceHandler
java.lang.Object
org.apache.hadoop.hbase.thrift2.TestThriftHBaseServiceHandler
Unit testing for ThriftServer.HBaseServiceHandler, a part of the org.apache.hadoop.hbase.thrift2
package.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static org.apache.hadoop.hbase.client.ColumnFamilyDescriptor[]
private static byte[]
private static byte[]
private static final org.slf4j.Logger
private static final MetricsAssertHelper
org.junit.rules.TestName
private static byte[]
private static byte[]
private static byte[]
private static final HBaseTestingUtil
private static byte[]
private static byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
assertTColumnValueEqual
(org.apache.hadoop.hbase.thrift2.generated.TColumnValue a, org.apache.hadoop.hbase.thrift2.generated.TColumnValue b) void
assertTColumnValuesEqual
(List<org.apache.hadoop.hbase.thrift2.generated.TColumnValue> columnValuesA, List<org.apache.hadoop.hbase.thrift2.generated.TColumnValue> columnValuesB) static void
private org.apache.hadoop.hbase.thrift2.ThriftHBaseServiceHandler
private static org.apache.hadoop.hbase.thrift.ThriftMetrics
getMetrics
(org.apache.hadoop.conf.Configuration conf) private String
pad
(int n, byte pad) Padding numbers to make comparison of sort order easier in a for loopvoid
setup()
void
void
void
check that checkAndDelete fails if the cell does not exist, then put in the cell, then check that the checkAndDelete succeeds.void
void
check that checkAndPut fails if the cell does not exist, then put in the cell, then check that the checkAndPut succeeds.void
void
void
void
void
void
void
void
void
Create TPut, TDelete , TIncrement objects, set durability then call ThriftUtility functions to get Put , Delete and Increment respectively.private void
testExceptionType
(org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface handler, org.apache.hadoop.hbase.thrift.ThriftMetrics metrics, ByteBuffer tTableName, byte[] rowkey, ErrorThrowingGetObserver.ErrorType errorType) void
void
void
void
void
void
void
Verify that thrift2 client calling thrift server can get the thrift server type correctly.void
void
void
Tests keeping a HBase scanner alive for long periods of time.void
void
See HBASE-17611 Latency metrics were capped at ~ 2 seconds due to the use of an int variable to capture the duration.void
void
Put valueA to a row, make sure put has happened, then create a mutation object to put valueB and delete ValueA, then check that the row value is only valueB.void
void
void
void
void
void
void
testScan()
void
void
void
void
void
-
Field Details
-
CLASS_RULE
-
LOG
-
UTIL
-
tableAname
-
familyAname
-
familyBname
-
qualifierAname
-
qualifierBname
-
valueAname
-
valueBname
-
families
-
metricsHelper
-
name
-
-
Constructor Details
-
TestThriftHBaseServiceHandler
public TestThriftHBaseServiceHandler()
-
-
Method Details
-
assertTColumnValuesEqual
public void assertTColumnValuesEqual(List<org.apache.hadoop.hbase.thrift2.generated.TColumnValue> columnValuesA, List<org.apache.hadoop.hbase.thrift2.generated.TColumnValue> columnValuesB) -
assertTColumnValueEqual
public void assertTColumnValueEqual(org.apache.hadoop.hbase.thrift2.generated.TColumnValue a, org.apache.hadoop.hbase.thrift2.generated.TColumnValue b) -
beforeClass
- Throws:
Exception
-
afterClass
- Throws:
Exception
-
setup
- Throws:
Exception
-
createHandler
private org.apache.hadoop.hbase.thrift2.ThriftHBaseServiceHandler createHandler() throws org.apache.thrift.TException- Throws:
org.apache.thrift.TException
-
testExists
public void testExists() throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException- Throws:
org.apache.hadoop.hbase.thrift2.generated.TIOError
org.apache.thrift.TException
-
testExistsAll
public void testExistsAll() throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException- Throws:
org.apache.hadoop.hbase.thrift2.generated.TIOError
org.apache.thrift.TException
-
testPutGet
- Throws:
Exception
-
testPutGetMultiple
- Throws:
Exception
-
testDeleteMultiple
- Throws:
Exception
-
testDelete
- Throws:
Exception
-
testDeleteAllTimestamps
- Throws:
Exception
-
testDeleteSingleTimestamp
- Throws:
Exception
-
testDeleteFamily
- Throws:
Exception
-
testDeleteFamilyVersion
- Throws:
Exception
-
testIncrement
- Throws:
Exception
-
testAppend
- Throws:
Exception
-
testCheckAndPut
check that checkAndPut fails if the cell does not exist, then put in the cell, then check that the checkAndPut succeeds.- Throws:
Exception
-
testCheckAndDelete
check that checkAndDelete fails if the cell does not exist, then put in the cell, then check that the checkAndDelete succeeds.- Throws:
Exception
-
testScan
- Throws:
Exception
-
testLongLivedScan
Tests keeping a HBase scanner alive for long periods of time. Each call to getScannerRow() should reset the ConnectionCache timeout for the scanner's connection.- Throws:
Exception
-
testReverseScan
- Throws:
Exception
-
testScanWithFilter
- Throws:
Exception
-
testScanWithColumnFamilyTimeRange
- Throws:
Exception
-
testSmallScan
- Throws:
Exception
-
testExpiredScanner
- Throws:
Exception
-
testPutTTL
- Throws:
Exception
-
pad
Padding numbers to make comparison of sort order easier in a for loop- Parameters:
n
- The number to pad.pad
- The length to pad up to.- Returns:
- The padded number as a string.
-
testScanWithBatchSize
- Throws:
Exception
-
testGetScannerResults
- Throws:
Exception
-
testFilterRegistration
- Throws:
Exception
-
testMetrics
- Throws:
Exception
-
getMetrics
private static org.apache.hadoop.hbase.thrift.ThriftMetrics getMetrics(org.apache.hadoop.conf.Configuration conf) throws Exception - Throws:
Exception
-
testMetricsWithException
- Throws:
Exception
-
testExceptionType
private void testExceptionType(org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface handler, org.apache.hadoop.hbase.thrift.ThriftMetrics metrics, ByteBuffer tTableName, byte[] rowkey, ErrorThrowingGetObserver.ErrorType errorType) -
testMetricsPrecision
See HBASE-17611 Latency metrics were capped at ~ 2 seconds due to the use of an int variable to capture the duration.- Throws:
Exception
-
testAttribute
- Throws:
Exception
-
testMutateRow
Put valueA to a row, make sure put has happened, then create a mutation object to put valueB and delete ValueA, then check that the row value is only valueB.- Throws:
Exception
-
testDurability
Create TPut, TDelete , TIncrement objects, set durability then call ThriftUtility functions to get Put , Delete and Increment respectively. Use getDurability to make sure the returned objects have the appropriate durability setting.- Throws:
Exception
-
testCheckAndMutate
- Throws:
Exception
-
testConsistency
- Throws:
Exception
-
testDDLOpertions
- Throws:
Exception
-
testGetTableDescriptor
- Throws:
Exception
-
testGetThriftServerType
- Throws:
Exception
-
testGetThriftServerOneType
Verify that thrift2 client calling thrift server can get the thrift server type correctly.- Throws:
Exception
-
testSlowLogResponses
- Throws:
Exception
-
testPerformTablePermissions
- Throws:
Throwable
-
testPerformNamespacePermissions
- Throws:
Throwable
-