[
https://issues.apache.org/jira/browse/HBASE-13448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14537639#comment-14537639
]
Anoop Sam John commented on HBASE-13448:
----------------------------------------
This is my test
{code}
public class MyTest {
public static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
public final static byte[] row1 = Bytes.toBytes("row1");
public final static byte[] row2 = Bytes.toBytes("row2");
public final static byte[] fam = Bytes.toBytes("info");
public final static byte[] qual = Bytes.toBytes("qual");
public final static byte[] val = Bytes.toBytes("value1");
@Rule
public final TestName TEST_NAME = new TestName();
@BeforeClass
public static void setupBeforeClass() throws Exception {
TEST_UTIL.startMiniCluster(2);
}
@Test
public void testSimpleScan() throws Throwable {
TableName tableName = TableName.valueOf(TEST_NAME.getMethodName());
Table table = TEST_UTIL.createTable(tableName, fam);
Put put = new Put(row1);
put.addColumn(fam, qual, val);
table.put(put);
/*put = new Put(row2);
put.addColumn(fam, qual, val);
table.put(put);*/
Scan s = new Scan();
//s.addColumn(fam, qual);
s.setCaching(1);
ResultScanner scanner = table.getScanner(s);
Result res = scanner.next();
/*Get get = new Get(row1);
get.addColumn(fam, qual);
res = table.get(get);
System.out.println(res);*/
}
}
{code}'
Above is the Scan test.
Yes, this is a new clean table with only one cell in it.
Scan with out ExplicitColumnTracker
{code}
public short getRowLength() {
System.out.println("getRowLength > " + this);
new Exception().printStackTrace();
return Bytes.toShort(this.bytes, getKeyOffset());
}
{code}
Just using the above in getRowLength() method of KeyValue, am tracking the
usage.
getRowLength - 6
RegionScannerImpl.nextInternal(HRegion.java:5509)
StoreScanner.next(StoreScanner.java:509)
ScanQueryMatcher.match(ScanQueryMatcher.java:281)
Above 3 are direct calls to getRowLength
SQM.match (Line 308 and 309) calls getQualOffset() and getQualLength which in
turn calls getRowLength() on same KV 3 times!
> New Cell implementation with cached component offsets/lengths
> -------------------------------------------------------------
>
> Key: HBASE-13448
> URL: https://issues.apache.org/jira/browse/HBASE-13448
> Project: HBase
> Issue Type: Sub-task
> Components: Scanners
> Reporter: Anoop Sam John
> Assignee: Anoop Sam John
> Fix For: 2.0.0
>
> Attachments: HBASE-13448.patch, HBASE-13448_V2.patch, gc.png, hits.png
>
>
> This can be extension to KeyValue and can be instantiated and used in read
> path.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)