Return-Path: X-Original-To: apmail-accumulo-dev-archive@www.apache.org Delivered-To: apmail-accumulo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7A3A1747C for ; Thu, 2 Apr 2015 02:29:45 +0000 (UTC) Received: (qmail 43573 invoked by uid 500); 2 Apr 2015 02:29:45 -0000 Delivered-To: apmail-accumulo-dev-archive@accumulo.apache.org Received: (qmail 43529 invoked by uid 500); 2 Apr 2015 02:29:45 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 43518 invoked by uid 99); 2 Apr 2015 02:29:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2015 02:29:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EADFDE10D1; Thu, 2 Apr 2015 02:29:44 +0000 (UTC) From: joshelser To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request: ACCUMULO-3602 BatchScanner optimization for... Content-Type: text/plain Message-Id: <20150402022944.EADFDE10D1@git1-us-west.apache.org> Date: Thu, 2 Apr 2015 02:29:44 +0000 (UTC) Github user joshelser commented on a diff in the pull request: https://github.com/apache/accumulo/pull/25#discussion_r27628899 --- Diff: core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java --- @@ -675,32 +711,53 @@ public V getCurrentValue() throws IOException, InterruptedException { } for (Map.Entry> extentRanges : tserverBin.getValue().entrySet()) { Range ke = extentRanges.getKey().toDataRange(); - for (Range r : extentRanges.getValue()) { - if (autoAdjust) { - // divide ranges into smaller ranges, based on the tablets - RangeInputSplit split = new RangeInputSplit(tableName, tableId, ke.clip(r), new String[] {location}); - - split.setOffline(tableConfig.isOfflineScan()); - split.setIsolatedScan(tableConfig.shouldUseIsolatedScanners()); - split.setUsesLocalIterators(tableConfig.shouldUseLocalIterators()); - split.setMockInstance(mockInstance); - split.setFetchedColumns(tableConfig.getFetchedColumns()); - split.setPrincipal(principal); - split.setToken(token); - split.setInstanceName(instance.getInstanceName()); - split.setZooKeepers(instance.getZooKeepers()); - split.setAuths(auths); - split.setIterators(tableConfig.getIterators()); - split.setLogLevel(logLevel); - - splits.add(split); - } else { - // don't divide ranges - ArrayList locations = splitsToAdd.get(r); - if (locations == null) - locations = new ArrayList(1); - locations.add(location); - splitsToAdd.put(r, locations); + if (batchScan && supportBatchScan) { + // group ranges by tablet to be read by a BatchScanner + ArrayList clippedRanges = new ArrayList(); + for(Range r: extentRanges.getValue()) + clippedRanges.add(ke.clip(r)); + BatchInputSplit split = new BatchInputSplit(tableName, tableId, clippedRanges, new String[] {location}); + split.setMockInstance(mockInstance); --- End diff -- Same point as before -- would be nice to consolidate these setters where possible. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---