Package org.apache.hadoop.hbase
Class TestServerSideScanMetricsFromClientSide
java.lang.Object
org.apache.hadoop.hbase.TestServerSideScanMetricsFromClientSide
-
Field Summary
Modifier and TypeFieldDescriptionprivate static long
static final HBaseClassTestRule
private static byte[][]
private static byte[]
private static final org.slf4j.Logger
private static int
private static int
private static int
private static int
private static byte[]
private static byte[][]
private static byte[]
private static byte[][]
private static org.apache.hadoop.hbase.client.Table
private static org.apache.hadoop.hbase.TableName
Table configurationprivate static final HBaseTestingUtil
private static byte[]
private static int
-
Constructor Summary
-
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.Table
createTestTable
(org.apache.hadoop.hbase.TableName name, byte[][] rows, byte[][] families, byte[][] qualifiers, byte[] cellValue) private long
static void
static void
void
private void
testMetric
(org.apache.hadoop.hbase.client.Scan scan, String metricKey, long expectedValue) Run the scan to completetion and check the metric against the specified valueprivate void
testMetric
(org.apache.hadoop.hbase.client.Scan scan, String metricKey, long expectedValue, org.apache.hadoop.hbase.CompareOperator compareOperator) void
private void
testRowsFilteredMetric
(org.apache.hadoop.hbase.client.Scan baseScan) private void
testRowsFilteredMetric
(org.apache.hadoop.hbase.client.Scan baseScan, org.apache.hadoop.hbase.filter.Filter filter, int expectedNumFiltered) void
private void
testRowsSeenMetric
(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
-