[
https://issues.apache.org/jira/browse/HBASE-18945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16222606#comment-16222606
]
Sean Busbey commented on HBASE-18945:
-------------------------------------
I think this breaks our ability to do rolling upgrade come 2.0.0-beta-*
{code}
diff --git
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/FixedFileTrailer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/FixedFileTrailer.java
index d82dd170dd..115302e9d1 100644
---
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/FixedFileTrailer.java
+++
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/FixedFileTrailer.java
@@ -28,7 +28,8 @@ import java.nio.ByteBuffer;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.hbase.CellComparator;
-import org.apache.hadoop.hbase.CellComparator.MetaCellComparator;
+import org.apache.hadoop.hbase.CellComparatorImpl;
+import org.apache.hadoop.hbase.CellComparatorImpl.MetaCellComparator;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.yetus.audience.InterfaceAudience;
import org.apache.hadoop.hbase.io.compress.Compression;
@@ -109,7 +110,7 @@ public class FixedFileTrailer {
/** Raw key comparator class name in version 3 */
// We could write the actual class name from 2.0 onwards and handle BC
- private String comparatorClassName =
CellComparator.COMPARATOR.getClass().getName();
+ private String comparatorClassName =
CellComparatorImpl.COMPARATOR.getClass().getName();
/** The encryption key */
private byte[] encryptionKey;
@@ -559,11 +560,15 @@ public class FixedFileTrailer {
private static Class<? extends CellComparator> getComparatorClass(String
comparatorClassName)
throws IOException {
Class<? extends CellComparator> comparatorKlass;
+ // for BC
if
(comparatorClassName.equals(KeyValue.COMPARATOR.getLegacyKeyComparatorName())
- ||
comparatorClassName.equals(KeyValue.COMPARATOR.getClass().getName())) {
- comparatorKlass = CellComparator.class;
+ || comparatorClassName.equals(KeyValue.COMPARATOR.getClass().getName())
+ ||
(comparatorClassName.equals("org.apache.hadoop.hbase.CellComparator"))) {
+ comparatorKlass = CellComparatorImpl.class;
} else if
(comparatorClassName.equals(KeyValue.META_COMPARATOR.getLegacyKeyComparatorName())
- ||
comparatorClassName.equals(KeyValue.META_COMPARATOR.getClass().getName())) {
+ ||
comparatorClassName.equals(KeyValue.META_COMPARATOR.getClass().getName())
+ || (comparatorClassName
+
.equals("org.apache.hadoop.hbase.CellComparator$MetaCellComparator"))) {
comparatorKlass = MetaCellComparator.class;
} else if
(comparatorClassName.equals("org.apache.hadoop.hbase.KeyValue.RawBytesComparator")
||
comparatorClassName.equals("org.apache.hadoop.hbase.util.Bytes$ByteArrayComparator"))
{
{code}
The above snippet in the hfile trailer handles the case where an older server
is writing hfiles that say the comparator is CellComparator. But our
newly-upgraded RegionServers will be writing out hfiles that have a comparator
of CellComparatorImpl. None of the old RegionServers will know how to handle
that class.
reopen or file a follow-on jira?
> Make a IA.LimitedPrivate interface for CellComparator
> -----------------------------------------------------
>
> Key: HBASE-18945
> URL: https://issues.apache.org/jira/browse/HBASE-18945
> Project: HBase
> Issue Type: Sub-task
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Fix For: 2.0.0-alpha-4
>
> Attachments: 18945-addendum-branch-2.txt, HBASE-18495.patch,
> HBASE-18945_2.patch, HBASE-18945_3.patch, HBASE-18945_4.patch,
> HBASE-18945_5.patch, HBASE-18945_6.patch, HBASE-18945_6.patch,
> HBASE-18945_7.patch
>
>
> Based on discussions over in HBASE-18826 and HBASE-18183 it is better we
> expose CellComparator as a public interface so that it could be used in
> Region/Store interfaces to be exposed to CPs.
> Currently the Comparator is exposed in Region, STore and StoreFile. There is
> another discussion whether to expose it at all layers or only at Region.
> However since we are exposing this to CPs CellComparator being @Private is
> not the ideal way to do it. We have to change it to LimitedPrivate. But
> CellComparator has lot of additional methods which are internal (like where a
> Cell is compared with an incoming byte[] used in index comparsions etc).
> One way to expose is that as being done now in HBASE-18826 - by exposing the
> return type as Comparator<Cell>. But this is not powerful. It only allows to
> compare cells. So we try to expose an IA.LimitedPrivate interface that is
> more powerful and allows comparing individual cell components also.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)