huaxiangsun commented on a change in pull request #2776:
URL: https://github.com/apache/hbase/pull/2776#discussion_r544702117
##########
File path:
hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparatorImpl.java
##########
@@ -82,6 +86,337 @@ public int compare(final Cell a, final Cell b, boolean
ignoreSequenceid) {
return ignoreSequenceid? diff: Long.compare(b.getSequenceId(),
a.getSequenceId());
}
+ /**
+ * Compares cells that are of type {@link ContiguousCellFormat}. It is
basically to peel off the common
+ * comparisons that happen and on top of it make the parsing of individual
cell items only once.
+ * @param l the left cell
+ * @param r the right cell
+ * @param ignoreSequenceid if to ignore the sequence id
+ * @return return > 0 if left cell is bigger, < 0 if right is bigger, == 0
if both cells are same
+ */
+ public final static int compare(final ContiguousCellFormat l, final
ContiguousCellFormat r, boolean ignoreSequenceid) {
+ int diff = 0;
+ if (l instanceof KeyValue && r instanceof KeyValue) {
Review comment:
Can be abstract this into a separate method, say KVCompare? Per
discussion in the jira, this size of this method is too big to be inlined.
----------------------------------------------------------------
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]