From issues-return-6086-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Wed Apr 17 01:13:20 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6BC9E180630 for ; Wed, 17 Apr 2019 03:13:20 +0200 (CEST) Received: (qmail 98897 invoked by uid 500); 17 Apr 2019 01:13:19 -0000 Mailing-List: contact issues-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list issues@phoenix.apache.org Received: (qmail 98888 invoked by uid 99); 17 Apr 2019 01:13:19 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Apr 2019 01:13:19 +0000 From: GitBox To: issues@phoenix.apache.org Subject: [GitHub] [phoenix] dbwong commented on a change in pull request #485: Add common utility function ScanUtil.splityKeyRangesByBoundaries() Message-ID: <155546359975.10043.9020386430529887325.gitbox@gitbox.apache.org> Date: Wed, 17 Apr 2019 01:13:19 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit dbwong commented on a change in pull request #485: Add common utility function ScanUtil.splityKeyRangesByBoundaries() URL: https://github.com/apache/phoenix/pull/485#discussion_r276046512 ########## File path: phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java ########## @@ -953,4 +953,80 @@ 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) + * @param keyRanges + * The key ranges to split along the given boundaries. Coalesced. + * @return + * key ranges in two dimensions. + */ + public static List> splitKeyRangesByBoundaries(List boundaries, List keyRanges) { Review comment: Also it appears you do not generate empty keyRanges for boundaries that have no keys may want to comment on that. On a side note how will you determine which region these correspond to in your work without those empty to allign? I base this on testcase #7 you added. ---------------------------------------------------------------- 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: users@infra.apache.org With regards, Apache Git Services