Package org.apache.hadoop.hbase
Class TestServerSideScanMetricsFromClientSide
java.lang.Object
org.apache.hadoop.hbase.TestServerSideScanMetricsFromClientSide
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static longstatic final HBaseClassTestRuleprivate static byte[][]private static byte[]private static final org.slf4j.Loggerprivate static intprivate static intprivate static intprivate static intprivate static byte[]private static byte[][]private static byte[]private static byte[][]private static org.apache.hadoop.hbase.client.Tableprivate static org.apache.hadoop.hbase.TableNameTable configurationprivate static final HBaseTestingUtilprivate static byte[]private static int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static ArrayList<org.apache.hadoop.hbase.client.Put>createPuts(byte[][] rows, byte[][] families, byte[][] qualifiers, byte[] value) Make puts to put the input value into each combination of row, family, and qualifierprivate static org.apache.hadoop.hbase.client.TablecreateTestTable(org.apache.hadoop.hbase.TableName name, byte[][] rows, byte[][] families, byte[][] qualifiers, byte[] cellValue) private longstatic voidstatic voidvoidprivate voidtestMetric(org.apache.hadoop.hbase.client.Scan scan, String metricKey, long expectedValue) Run the scan to completetion and check the metric against the specified valueprivate voidtestMetric(org.apache.hadoop.hbase.client.Scan scan, String metricKey, long expectedValue, org.apache.hadoop.hbase.CompareOperator compareOperator) voidprivate voidtestRowsFilteredMetric(org.apache.hadoop.hbase.client.Scan baseScan) private voidtestRowsFilteredMetric(org.apache.hadoop.hbase.client.Scan baseScan, org.apache.hadoop.hbase.filter.Filter filter, int expectedNumFiltered) voidprivate voidtestRowsSeenMetric(org.apache.hadoop.hbase.client.Scan baseScan)
-
Field Details
-
LOG
-
CLASS_RULE
-
TEST_UTIL
-
TABLE
-
TABLE_NAME
Table configuration -
NUM_ROWS
-
ROW
-
ROWS
-
NUM_FAMILIES
-
FAMILY
-
FAMILIES
-
NUM_QUALIFIERS
-
QUALIFIER
-
QUALIFIERS
-
VALUE_SIZE
-
VALUE
-
NUM_COLS
-
CELL_HEAP_SIZE
-
-
Constructor Details
-
TestServerSideScanMetricsFromClientSide
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
createTestTable
private static org.apache.hadoop.hbase.client.Table createTestTable(org.apache.hadoop.hbase.TableName name, byte[][] rows, byte[][] families, byte[][] qualifiers, byte[] cellValue) throws IOException - Throws:
IOException
-
tearDownAfterClass
- Throws:
Exception
-
createPuts
private static ArrayList<org.apache.hadoop.hbase.client.Put> createPuts(byte[][] rows, byte[][] families, byte[][] qualifiers, byte[] value) throws IOException Make puts to put the input value into each combination of row, family, and qualifier- Parameters:
rows- the rows to usefamilies- the column families to usequalifiers- the column qualifiers to usevalue- the value to put- Returns:
- the putted input values added in puts
- Throws:
IOException- If an IO problem is encountered
-
getCellHeapSize
- Returns:
- The approximate heap size of a cell in the test table. All cells should have approximately the same heap size, so the value is cached to avoid repeating the calculation
- Throws:
Exception- on unexpected failure
-
testRowsSeenMetric
- Throws:
Exception
-
testFsReadTimeMetric
- Throws:
Exception
-
testRowsSeenMetric
- Throws:
Exception
-
testRowsFilteredMetric
- Throws:
Exception
-
testRowsFilteredMetric
- Throws:
Exception
-
testRowsFilteredMetric
private void testRowsFilteredMetric(org.apache.hadoop.hbase.client.Scan baseScan, org.apache.hadoop.hbase.filter.Filter filter, int expectedNumFiltered) throws Exception - Throws:
Exception
-
testMetric
private void testMetric(org.apache.hadoop.hbase.client.Scan scan, String metricKey, long expectedValue) throws Exception Run the scan to completetion and check the metric against the specified value- Parameters:
scan- The scan instance to use to record metricsmetricKey- The metric key nameexpectedValue- The expected value of metric- Throws:
Exception- on unexpected failure
-
testMetric
private void testMetric(org.apache.hadoop.hbase.client.Scan scan, String metricKey, long expectedValue, org.apache.hadoop.hbase.CompareOperator compareOperator) throws Exception - Throws:
Exception
-