hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-10800) Use CellComparator instead of KVComparator
Date Sat, 02 May 2015 08:40:07 GMT

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

Anoop Sam John commented on HBASE-10800:
----------------------------------------

FFT.java
{code}
private static Class<? extends CellComparator> getComparatorClass(
      String comparatorClassName) throws IOException {
    try {
      // HFile V2 legacy comparator class names.
      if (comparatorClassName.equals(CellComparator.COMPARATOR.getLegacyKeyComparatorName()))
{
        comparatorClassName = CellComparator.COMPARATOR.getClass().getName();
      } else if (comparatorClassName.equals(CellComparator.META_COMPARATOR
          .getLegacyKeyComparatorName())) {
        comparatorClassName = CellComparator.META_COMPARATOR.getClass().getName();
      }

      // if the name wasn't one of the legacy names, maybe its a legit new kind of comparator.
      // TODO : This is deprecated. While removing this code introduce
      // Bytes.getV2LegacyKeyComparatorName()
      if (comparatorClassName.equals(KeyValue.RAW_COMPARATOR.getClass().getName())) {
        // Return null for Bytes.BYTES_RAWCOMPARATOR
        return null;
      } else if (comparatorClassName.equals(KeyValue.RAW_COMPARATOR.getLegacyKeyComparatorName()))
{
        return null;
      } else {
        return (Class<? extends CellComparator>) Class.forName(comparatorClassName);
      }
    } catch (ClassNotFoundException ex) {
      throw new IOException(ex);
    }
  }
{code}
CellComparator.getLegacyKeyComparatorName() return same value as KVComparator.getLegacyKeyComparatorName().
    When the className in FFT for a file is, KVComparator, then also we need to return CellComparator
instance.
This check also required for completeness.

Functionally it wont create any BC issue as we still were writing the legacy class name only
to new files also.

> Use CellComparator instead of KVComparator
> ------------------------------------------
>
>                 Key: HBASE-10800
>                 URL: https://issues.apache.org/jira/browse/HBASE-10800
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 2.0.0
>
>         Attachments: HBASE-10800_1.patch, HBASE-10800_11.patch, HBASE-10800_12.patch,
HBASE-10800_13.patch, HBASE-10800_14.patch, HBASE-10800_15.patch, HBASE-10800_16.patch, HBASE-10800_18.patch,
HBASE-10800_2.patch, HBASE-10800_23.patch, HBASE-10800_23.patch, HBASE-10800_24.patch, HBASE-10800_25.patch,
HBASE-10800_26.patch, HBASE-10800_3.patch, HBASE-10800_4.patch, HBASE-10800_4.patch, HBASE-10800_5.patch,
HBASE-10800_6.patch, HBASE-10800_7.patch
>
>




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

Mime
View raw message