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
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate static org.apache.hadoop.hbase.client.ColumnFamilyDescriptor[]private static byte[]private static byte[]private static final org.slf4j.Loggerprivate static final MetricsAssertHelperorg.junit.rules.TestNameprivate static byte[]private static byte[]private static byte[]private static final HBaseTestingUtilprivate static byte[]private static byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidassertTColumnValueEqual(org.apache.hadoop.hbase.thrift2.generated.TColumnValue a, org.apache.hadoop.hbase.thrift2.generated.TColumnValue b) voidassertTColumnValuesEqual(List<org.apache.hadoop.hbase.thrift2.generated.TColumnValue> columnValuesA, List<org.apache.hadoop.hbase.thrift2.generated.TColumnValue> columnValuesB) static voidprivate org.apache.hadoop.hbase.thrift2.ThriftHBaseServiceHandlerprivate static org.apache.hadoop.hbase.thrift.ThriftMetricsgetMetrics(org.apache.hadoop.conf.Configuration conf) private Stringpad(int n, byte pad) Padding numbers to make comparison of sort order easier in a for loopvoidsetup()voidvoidvoidcheck that checkAndDelete fails if the cell does not exist, then put in the cell, then check that the checkAndDelete succeeds.voidvoidcheck that checkAndPut fails if the cell does not exist, then put in the cell, then check that the checkAndPut succeeds.voidvoidvoidvoidvoidvoidvoidvoidvoidCreate TPut, TDelete , TIncrement objects, set durability then call ThriftUtility functions to get Put , Delete and Increment respectively.private voidtestExceptionType(org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface handler, org.apache.hadoop.hbase.thrift.ThriftMetrics metrics, ByteBuffer tTableName, byte[] rowkey, ErrorThrowingGetObserver.ErrorType errorType) voidvoidvoidvoidvoidvoidvoidVerify that thrift2 client calling thrift server can get the thrift server type correctly.voidvoidvoidTests keeping a HBase scanner alive for long periods of time.voidvoidSee HBASE-17611 Latency metrics were capped at ~ 2 seconds due to the use of an int variable to capture the duration.voidvoidPut 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.voidvoidvoidvoidvoidvoidvoidtestScan()voidvoidvoidvoidvoid
-
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.TIOErrororg.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.TIOErrororg.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
-