accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <...@git.apache.org>
Subject [GitHub] accumulo pull request #247: ACCUMULO-3208 Integration test for the OrIterato...
Date Tue, 11 Apr 2017 20:11:42 GMT
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/247#discussion_r111001594
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/iterators/OrIterator.java ---
    @@ -30,36 +33,66 @@
     import org.apache.accumulo.core.data.Key;
     import org.apache.accumulo.core.data.Range;
     import org.apache.accumulo.core.data.Value;
    +import org.apache.commons.lang.StringUtils;
     import org.apache.hadoop.io.Text;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
     
     /**
      * An iterator that handles "OR" query constructs on the server side. This code has been
adapted/merged from Heap and Multi Iterators.
    + *
    + * The table structure should have the following form:
    + *
    + * <pre>
    + * row term:docId =&lt; value
    + * </pre>
    + *
    + * This Iterator will return a sorted iteration of docIDs for a given set of terms.
    + *
    + * For example, given the data and an OR'ing of "bob,steve":
    + *
    + * <pre>
    + * row1 bob:4
    + * row1 george:2
    + * row1 steve:3
    + * </pre>
    + *
    + * This Iterator will return:
    + *
    + * <pre>
    + * row1 steve:3
    + * row1 bob:4
    + * </pre>
      */
     
    -public class OrIterator implements SortedKeyValueIterator<Key,Value> {
    +public class OrIterator implements SortedKeyValueIterator<Key,Value>, OptionDescriber
{
    +  private static final Logger LOG = LoggerFactory.getLogger(OrIterator.class);
    +  public static final String COLUMNS_KEY = "or.iterator.columns";
     
       private TermSource currentTerm;
    -  private ArrayList<TermSource> sources;
    +  private List<TermSource> sources;
       private PriorityQueue<TermSource> sorted = new PriorityQueue<>(5);
    --- End diff --
    
    Look at the class level javadoc again. It's sorting by row and then colqual, not row then
colfam. e.g. "row1 bob:4" should come before "row1 steve:3" but it will not.


---
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.
---

Mime
View raw message