Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B8ED310FBD for ; Wed, 23 Oct 2013 03:15:48 +0000 (UTC) Received: (qmail 27282 invoked by uid 500); 23 Oct 2013 03:15:48 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 27028 invoked by uid 500); 23 Oct 2013 03:15:46 -0000 Mailing-List: contact commits-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 commits@accumulo.apache.org Received: (qmail 26933 invoked by uid 99); 23 Oct 2013 03:15:44 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Oct 2013 03:15:44 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 42A3554BC9; Wed, 23 Oct 2013 03:15:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kturner@apache.org To: commits@accumulo.apache.org Message-Id: <912987be2a46478484220713758fe842@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: ACCUMULO-1732 fixed input format w/ mock Date: Wed, 23 Oct 2013 03:15:44 +0000 (UTC) Updated Branches: refs/heads/master 7f6e51227 -> 941e3cb1a ACCUMULO-1732 fixed input format w/ mock Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/941e3cb1 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/941e3cb1 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/941e3cb1 Branch: refs/heads/master Commit: 941e3cb1acbdb3ad2047e512d5fe3c95e595496b Parents: 7f6e512 Author: Keith Turner Authored: Tue Oct 22 23:15:33 2013 -0400 Committer: Keith Turner Committed: Tue Oct 22 23:15:33 2013 -0400 ---------------------------------------------------------------------- .../accumulo/core/client/mapred/AbstractInputFormat.java | 11 ++++++++--- .../core/client/mapreduce/AbstractInputFormat.java | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/941e3cb1/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java index c89c5d7..eaf99cb 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java +++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java @@ -371,6 +371,8 @@ public abstract class AbstractInputFormat implements InputFormat { log.debug("Authorizations are: " + authorizations); if (tableConfig.isOfflineScan()) { scanner = new OfflineScanner(instance, new Credentials(principal, token), split.getTableId(), authorizations); + } else if (instance instanceof MockInstance) { + scanner = instance.getConnector(principal, token).createScanner(split.getTableName(), authorizations); } else { scanner = new ScannerImpl(instance, new Credentials(principal, token), split.getTableId(), authorizations); } @@ -382,7 +384,7 @@ public abstract class AbstractInputFormat implements InputFormat { log.info("Using local iterators"); scanner = new ClientSideIteratorScanner(scanner); } - setupIterators(job, scanner, split.getTableId()); + setupIterators(job, scanner, split.getTableName()); } catch (Exception e) { throw new IOException(e); } @@ -460,7 +462,11 @@ public abstract class AbstractInputFormat implements InputFormat { TabletLocator tl; try { // resolve table name to id once, and use id from this point forward - tableId = Tables.getTableId(getInstance(job), tableName); + Instance instance = getInstance(job); + if (instance instanceof MockInstance) + tableId = ""; + else + tableId = Tables.getTableId(instance, tableName); if (tableConfig.isOfflineScan()) { binnedRanges = binOfflineTable(job, tableId, ranges); while (binnedRanges == null) { @@ -469,7 +475,6 @@ public abstract class AbstractInputFormat implements InputFormat { binnedRanges = binOfflineTable(job, tableId, ranges); } } else { - Instance instance = getInstance(job); tl = getTabletLocator(job, tableId); // its possible that the cache could contain complete, but old information about a tables tablets... so clear it tl.invalidateCache(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/941e3cb1/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java index 74f8f8b..d426caf 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java +++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java @@ -386,6 +386,8 @@ public abstract class AbstractInputFormat extends InputFormat { log.debug("Authorizations are: " + authorizations); if (tableConfig.isOfflineScan()) { scanner = new OfflineScanner(instance, new Credentials(principal, token), split.getTableId(), authorizations); + } else if (instance instanceof MockInstance) { + scanner = instance.getConnector(principal, token).createScanner(split.getTableName(), authorizations); } else { scanner = new ScannerImpl(instance, new Credentials(principal, token), split.getTableId(), authorizations); } @@ -397,7 +399,7 @@ public abstract class AbstractInputFormat extends InputFormat { log.info("Using local iterators"); scanner = new ClientSideIteratorScanner(scanner); } - setupIterators(attempt, scanner, split.getTableId()); + setupIterators(attempt, scanner, split.getTableName()); } catch (Exception e) { throw new IOException(e); } @@ -488,7 +490,11 @@ public abstract class AbstractInputFormat extends InputFormat { TabletLocator tl; try { // resolve table name to id once, and use id from this point forward - tableId = Tables.getTableId(getInstance(context), tableName); + Instance instance = getInstance(context); + if (instance instanceof MockInstance) + tableId = ""; + else + tableId = Tables.getTableId(instance, tableName); if (tableConfig.isOfflineScan()) { binnedRanges = binOfflineTable(context, tableId, ranges); while (binnedRanges == null) { @@ -498,7 +504,6 @@ public abstract class AbstractInputFormat extends InputFormat { } } else { - Instance instance = getInstance(context); tl = getTabletLocator(context, tableId); // its possible that the cache could contain complete, but old information about a tables tablets... so clear it tl.invalidateCache();