saintstack commented on a change in pull request #1062: HBASE-23705 Add 
CellComparator to HFileContext
URL: https://github.com/apache/hbase/pull/1062#discussion_r368611582
 
 

 ##########
 File path: 
hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparatorImpl.java
 ##########
 @@ -387,4 +409,23 @@ public Comparator getSimpleComparator() {
   public Comparator getSimpleComparator() {
     return new BBKVComparator(this);
   }
+
+  /**
+   * Utility method that makes a guess at comparator to use based off passed 
tableName.
+   * Use in extreme when no comparator specified.
+   * @return CellComparator to use going off the <code>tableName</code> passed.
+   */
+  public static CellComparator getCellComparator(TableName tableName) {
+    return getCellComparator(tableName.toBytes());
 
 Review comment:
   Need both. In actual filecontext, it hosts tablename as bytes only -- not as 
a TableName object. The TableName.toBytes doesn't actually make bytes. TN 
itself hosts the name in bytes.
   
   Maybe I should be clearer in a comment that no new arrays are being made in 
this code?

----------------------------------------------------------------
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

Reply via email to