[ 
https://issues.apache.org/jira/browse/HBASE-7845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13609345#comment-13609345
 ] 

stack commented on HBASE-7845:
------------------------------

[~xieliang007] I don't think you answered all my review questions above.  
Thanks.

getFakedKey is a bad name for what you are about.  How about 
getShortMidpointKey?  Also, in the comment, say what the method is trying to 
achieve.  You point at the issue but that is being a little (lazy) and besides 
the issue subject is 'optimize' which is pretty general.

Do you need to do this copy?

+      if (leftKey == null) {
+        return Arrays.copyOf(rightKey, rightKey.length);
+      }

I suppose it is safer.

This define should be in HFile rather than in HConstants so it is beside where 
it is used:

HConstants.FAKE_INDEX_KEY_MAGIC

Also, 'FAKE' has negative connotations whereas what you are doing here is 
clever in a good way; would suggest you drop use of 'fake' and just say 
INDEX_KEY_MAGIC (ditto for method names).

Why this now:

{code}
-      // Expected block reads: 2. [HBASE-4443]
-      kvs = getData(FAMILY, "row", Arrays.asList("col5"), 2);
+      // Expected block reads: 1. [HBASE-4443]&[HBASE-7845]
+      kvs = getData(FAMILY, "row", Arrays.asList("col5"), 1);
{code}

You have a good few tests of new functionality.  That is good.  I'd think we 
should try this as part of a long-running job before commit.  I can volunteer 
to do that....... 

                
> optimize hfile index key
> ------------------------
>
>                 Key: HBASE-7845
>                 URL: https://issues.apache.org/jira/browse/HBASE-7845
>             Project: HBase
>          Issue Type: Improvement
>          Components: HFile
>    Affects Versions: 0.96.0
>            Reporter: Liang Xie
>            Assignee: Liang Xie
>             Fix For: 0.98.0
>
>         Attachments: HBASE-7845.txt, HBASE-7845-v2.txt, HBASE-7845-v3.txt, 
> HBASE-7845-v4.txt, HBASE-7845-v5.txt, HBASE-7845-v6.txt, HBASE-7845-v7.txt, 
> HBASE-7845-v8.txt
>
>
> Leveldb uses ByteWiseComparatorImpl::FindShortestSeparator() & 
> FindShortSuccessor() to reduce index key size, it would be helpful under 
> special conditions.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to