/[Apache-SVN]
ViewVC logotype

Revision 1299147


Jump to revision: Previous Next
Author: mbautin
Date: Sat Mar 10 02:27:05 2012 UTC (12 years, 8 months ago)
Changed paths: 8
Log Message:
[jira] [HBASE-5292] Prevent counting getSize on compactions

Author: Zhiqiu Kong

Summary:
Added two separate metrics for both get() and next(). This is done by
refactoring on internal next() API. To be more specific, only Get.get()
and ResultScanner.next() passes the metric name ("getsize" and
"nextsize" repectively) to
  HRegion::RegionScanner::next(List<KeyValue>, String)

This will eventually hit StoreScanner()::next((List<KeyValue>,
int, String) where the metrics are counted.

And their call paths are:

1) Get

HTable::get(final Get get)
=> HRegionServer::get(byte [] regionName, Get get)
=> HRegion::get(final Get get, final Integer lockid)
=> HRegion::get(final Get get)      [pass METRIC_GETSIZE to the
callee]

=> HRegion::RegionScanner::next(List<KeyValue> outResults, String
metric)
=> HRegion::RegionScanner::next(List<KeyValue> outResults, int limit,
String metric)
=> HRegion::RegionScanner::nextInternal(int limit, String metric)
=> KeyValueHeap::next(List<KeyValue> result, int limit, String
metric)
=> StoreScanner::next(List<KeyValue> outResult, int limit, String
metric)

2) Next

HTable::ClientScanner::next()
=> ScannerCallable::call()
=> HRegionServer::next(long scannerId)
=> HRegionServer::next(final long scannerId, int nbRows)  [pass
METRIC_NEXTSIZE to the callee]

=> HRegion::RegionScanner::next(List<KeyValue> outResults, String
metric)
=> HRegion::RegionScanner::next(List<KeyValue> outResults, int limit,
String metric)
=> HRegion::RegionScanner::nextInternal(int limit, String metric)
=> KeyValueHeap::next(List<KeyValue> result, int limit, String
metric)
=> StoreScanner::next(List<KeyValue> outResult, int limit, String
metric)

Test Plan:
1. Passed unit tests.
2. Created a testcase TestRegionServerMetrics::testGetNextSize to
guarantee:
 * Get/Next contributes to getsize/nextsize metrics
 * Both getsize/nextsize are per Column Family
 * Flush/compaction won't affect these two metrics

Reviewed By: mbautin

Reviewers: Kannan, mbautin, Liyin, JIRA

CC: Kannan, mbautin, Liyin, zhiqiu

Differential Revision: https://reviews.facebook.net/D1617

Changed paths

Path Details
Directoryhbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java modified , text changed
Directoryhbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java modified , text changed
Directoryhbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/InternalScanner.java modified , text changed
Directoryhbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java modified , text changed
Directoryhbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java modified , text changed
Directoryhbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java modified , text changed
Directoryhbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java modified , text changed
Directoryhbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26