[
https://issues.apache.org/jira/browse/HBASE-16213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15444924#comment-15444924
]
binlijin commented on HBASE-16213:
----------------------------------
Because the rows are not ascending order. For example kv5 is sort order before
kv4. So the RowIndexEncoderV1#checkRow will throw IOException, and the master
already changed also.
{code}
/**
* Test seeking while file is encoded.
*/
@Test
public void testSeekingToBlockWithBiggerNonLength1() throws IOException {
List<KeyValue> sampleKv = new ArrayList<KeyValue>();
KeyValue kv1 = new KeyValue(Bytes.toBytes("aaa"), Bytes.toBytes("f1"),
Bytes.toBytes("q1"),
Bytes.toBytes("val"));
sampleKv.add(kv1);
KeyValue kv2 = new KeyValue(Bytes.toBytes("aab"), Bytes.toBytes("f1"),
Bytes.toBytes("q1"),
Bytes.toBytes("val"));
sampleKv.add(kv2);
KeyValue kv3 = new KeyValue(Bytes.toBytes("aac"), Bytes.toBytes("f1"),
Bytes.toBytes("q1"),
Bytes.toBytes("val"));
sampleKv.add(kv3);
KeyValue kv4 = new KeyValue(Bytes.toBytes("aad"), Bytes.toBytes("f1"),
Bytes.toBytes("q1"),
Bytes.toBytes("val"));
sampleKv.add(kv4);
KeyValue kv5 = new KeyValue(Bytes.toBytes("aaaad"), Bytes.toBytes("f1"),
Bytes.toBytes("q1"),
Bytes.toBytes("val"));
sampleKv.add(kv5);
KeyValue toSeek = new KeyValue(Bytes.toBytes("aaaa"), Bytes.toBytes("f1"),
Bytes.toBytes("q1"),
Bytes.toBytes("val"));
seekToTheKey(kv1, sampleKv, toSeek);
}
{code}
> A new HFileBlock structure for fast random get
> ----------------------------------------------
>
> Key: HBASE-16213
> URL: https://issues.apache.org/jira/browse/HBASE-16213
> Project: HBase
> Issue Type: New Feature
> Components: Performance
> Reporter: binlijin
> Assignee: binlijin
> Attachments: HBASE-16213-master_v1.patch,
> HBASE-16213-master_v3.patch, HBASE-16213-master_v4.patch,
> HBASE-16213-master_v5.patch, HBASE-16213-master_v6.patch,
> HBASE-16213.branch-1.v1.patch, HBASE-16213.branch-1.v4.patch,
> HBASE-16213.branch-1.v4.patch, HBASE-16213.patch,
> HBASE-16213_branch1_v3.patch, HBASE-16213_v2.patch, hfile-cpu.png,
> hfile_block_performance.pptx, hfile_block_performance2.pptx,
> hfile_block_performance_E2E.pptx
>
>
> HFileBlock store cells sequential, current when to get a row from the block,
> it scan from the first cell until the row's cell.
> The new structure store every row's start offset with data, so it can find
> the exact row with binarySearch.
> I use EncodedSeekPerformanceTest test the performance.
> First use ycsb write 100w data, every row have only one qualifier, and
> valueLength=16B/64/256B/1k.
> Then use EncodedSeekPerformanceTest to test random read 1w or 100w row, and
> also record HFileBlock's dataSize/dataWithMetaSize in the encoding.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)