BinShi-SecularBird commented on a change in pull request #485: Add common
utility function ScanUtil.splityKeyRangesByBoundaries()
URL: https://github.com/apache/phoenix/pull/485#discussion_r276995113
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
##########
@@ -953,4 +953,85 @@ public static int getClientVersion(Scan scan) {
public static void setClientVersion(Scan scan, int version) {
scan.setAttribute(BaseScannerRegionObserver.CLIENT_VERSION,
Bytes.toBytes(version));
}
+
+ /**
+ * Split the key ranges into multiple groups along the given boundaries
+ *
+ * @param boundaries
+ * The boundaries is a byte[] list like "b0, b1, ..., bn" which forms
+ * space (UNBOUND, b0), [b0, b1), ..., [bn, UNBOUND). Every boundary
+ * can't be null or empty.
+ * @param keyRanges
+ * The key ranges to split along the given boundaries. Coalesced.
+ * @return
+ * List<Pair<RangeIndex, Query Key Range List in this range>>.
Review comment:
@twdsilva , N boundaries split the key space into N+1 ranges. Here each pair
is the index of of such a range and the query key ranges belongs to that range.
Probably still use <RangeIndex, Query Key Range List in the range>? Let me add
more comment and you can decide how it will be more accurate.
----------------------------------------------------------------
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