saintstack commented on a change in pull request #1062: HBASE-23705 Add
CellComparator to HFileContext
URL: https://github.com/apache/hbase/pull/1062#discussion_r368612232
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/FixedFileTrailer.java
##########
@@ -624,19 +624,22 @@ private String getHBase1CompatibleName(final String
comparator) {
return comparatorKlass;
}
- public static CellComparator createComparator(
- String comparatorClassName) throws IOException {
+ static CellComparator createComparator(String comparatorClassName) throws
IOException {
+ if
(comparatorClassName.equals(CellComparatorImpl.COMPARATOR.getClass().getName()))
{
+ return CellComparatorImpl.COMPARATOR;
+ } else if (comparatorClassName.equals(
+ CellComparatorImpl.META_COMPARATOR.getClass().getName())) {
+ return CellComparatorImpl.META_COMPARATOR;
+ }
Review comment:
Just to avoid the reflection in near all cases.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services