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

ramkrishna.s.vasudevan commented on HBASE-13450:
------------------------------------------------

{code}
246     if (comparator != null)
{ 247   Bytes.writeByteArray(out, 
Bytes.toBytes(comparator.getClass().getName())); 248  }
else {
249     Bytes.writeByteArray(out, 
Bytes.toBytes(Bytes.BYTES_RAWCOMPARATOR.getClass().getName()));
250
{code}
This method is already Bytes.writeByteArray, a generic static Util. It is upto 
us pass a byte[] to it.  I think it is better this way, right?

The major part is that after working on HBASE-10800 further, found that 
Bytes.java is public, stable API and the 
{code}
  public static int binarySearch(byte[][] arr, Cell key, RawComparator<Cell> 
comparator) 
  public static int binarySearch(byte [][]arr, byte []key, int offset,
      int length, RawComparator<?> comparator) 
{code}
should be changed to Comparator<?> or have one API with Comparator<Cell> and 
other with RawComparator<?>.  Now that RAW_COMPARATOR is not going be of type 
CellComparator this API will be changed.  What can we do there?

> Purge RawBytescomparator from the writers and readers after HBASE-10800
> -----------------------------------------------------------------------
>
>                 Key: HBASE-13450
>                 URL: https://issues.apache.org/jira/browse/HBASE-13450
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 2.0.0
>
>         Attachments: HBASE-13450.patch
>
>
> Currently KeyValue.RAW_COMPARATOR is written in the Trailer of the HFiles.  
> Ideally this need not be persisted to the trailer of the Hfiles because only 
> the ROW bloom and the meta index blocks uses this. Currently RAW_COMPARATOR 
> is also of type KVComparator.
> HBASE-10800 would introduce CellComparator and would expect only cells to be 
> compared.  We cannot have RAW_COMPARATOR a type of CellComparator.  Hence it 
> is better to avoid writing the RAW_COMPARATOR to the FFT and whereever we 
> need RAW_COMPARATOR we will directly use it as Bytes.BYTES_RAWCOMPARATOR.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to