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 65ED5107FD for ; Wed, 19 Mar 2014 16:09:21 +0000 (UTC) Received: (qmail 900 invoked by uid 500); 19 Mar 2014 16:08:46 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 794 invoked by uid 500); 19 Mar 2014 16:08:41 -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 99628 invoked by uid 99); 19 Mar 2014 16:08:13 -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, 19 Mar 2014 16:08:13 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E63E5984642; Wed, 19 Mar 2014 16:08:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ujustgotbilld@apache.org To: commits@accumulo.apache.org Date: Wed, 19 Mar 2014 16:08:32 -0000 Message-Id: <2a56a73a2f57436db55a5b3903fa092c@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [22/50] [abbrv] git commit: ACCUMULO-665: merge to 1.4 branch ACCUMULO-665: merge to 1.4 branch git-svn-id: https://svn.apache.org/repos/asf/accumulo/branches/1.4@1356403 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/commit/86aeddab Tree: http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/tree/86aeddab Diff: http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/diff/86aeddab Branch: refs/heads/master Commit: 86aeddab6414ea4876b39bdde5d229ce1031d3a3 Parents: 5c9f45a Author: Eric C. Newton Authored: Mon Jul 2 18:53:15 2012 +0000 Committer: Eric C. Newton Committed: Mon Jul 2 18:53:15 2012 +0000 ---------------------------------------------------------------------- .../examples/wikisearch/iterator/AndIterator.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo-wikisearch/blob/86aeddab/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java ---------------------------------------------------------------------- diff --git a/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java b/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java index 5ace7c8..b469625 100644 --- a/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java +++ b/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java @@ -17,9 +17,11 @@ package org.apache.accumulo.examples.wikisearch.iterator; import java.io.IOException; +import java.util.ArrayList; import java.util.Collection; import java.util.Map; +import org.apache.accumulo.core.data.ArrayByteSequence; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.PartialKey; @@ -86,7 +88,8 @@ public class AndIterator implements SortedKeyValueIterator { } /* - * | Row | Column Family | Column Qualifier | Value | {RowID} | {dataLocation} | {term}\0{dataType}\0{UID} | Empty + * | Row | Column Family | Column Qualifier | Value + * | {RowID} | {dataLocation} | {term}\0{dataType}\0{UID} | Empty */ protected Text getPartition(Key key) { return key.getRow(); @@ -778,21 +781,24 @@ public class AndIterator implements SortedKeyValueIterator { // seek each of the sources to the right column family within the row given by key for (int i = 0; i < sourcesCount; i++) { Key sourceKey; + Text dataLocation = (sources[i].dataLocation == null) ? nullText : sources[i].dataLocation; + Collection columnFamilies = new ArrayList(); + columnFamilies.add(new ArrayByteSequence(dataLocation.getBytes(), 0, dataLocation.getLength())); if (range.getStartKey() != null) { // Build a key with the DocID if one is given - if (range.getStartKey().getColumnFamily() != null) { - sourceKey = buildKey(getPartition(range.getStartKey()), (sources[i].dataLocation == null) ? nullText : sources[i].dataLocation, + if (range.getStartKey().getColumnFamily() != null) { + sourceKey = buildKey(getPartition(range.getStartKey()), dataLocation, (sources[i].term == null) ? nullText : new Text(sources[i].term + "\0" + range.getStartKey().getColumnFamily())); } // Build a key with just the term. else { - sourceKey = buildKey(getPartition(range.getStartKey()), (sources[i].dataLocation == null) ? nullText : sources[i].dataLocation, + sourceKey = buildKey(getPartition(range.getStartKey()), dataLocation, (sources[i].term == null) ? nullText : sources[i].term); } if (!range.isStartKeyInclusive()) sourceKey = sourceKey.followingKey(PartialKey.ROW_COLFAM_COLQUAL); - sources[i].iter.seek(new Range(sourceKey, true, null, false), seekColumnFamilies, inclusive); + sources[i].iter.seek(new Range(sourceKey, true, null, false), columnFamilies, inclusive); } else { - sources[i].iter.seek(range, seekColumnFamilies, inclusive); + sources[i].iter.seek(range, columnFamilies, inclusive); } }