@Override public void next() throws IOException { if (currentPartition == null) { return; } // precondition: the current row is set up and the sources all have the same column qualifier // while we don't have a match, seek in the source with the smallest column qualifier sources[0].iter.next(); advanceToIntersection(); }
@Override protected void advanceToIntersection() throws IOException { super.advanceToIntersection(); if (topKey == null) return; if (log.isTraceEnabled()) log.trace("using top key to seek for doc: {}", topKey); Key docKey = buildDocKey(); docSource.seek(new Range(docKey, true, null, false), docColfSet, true); log.debug("got doc key: {}", docSource.getTopKey()); if (docSource.hasTop() && docKey.equals(docSource.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL)) { value = docSource.getTopValue(); } log.debug("got doc value: {}", value); }
@Override public void seek(Range range, Collection<ByteSequence> seekColumnFamilies, boolean inclusive) throws IOException { overallRange = new Range(range); currentPartition = new Text(); currentDocID.set(emptyByteArray); // 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; if (range.getStartKey() != null) { if (range.getStartKey().getColumnQualifier() != null) { sourceKey = buildKey(getPartition(range.getStartKey()), sources[i].term, range.getStartKey().getColumnQualifier()); } else { sourceKey = buildKey(getPartition(range.getStartKey()), sources[i].term); } // Seek only to the term for this source as a column family sources[i].iter.seek(new Range(sourceKey, true, null, false), sources[i].seekColfams, true); } else { // Seek only to the term for this source as a column family sources[i].iter.seek(range, sources[i].seekColfams, true); } } advanceToIntersection(); }
@Override public void next() throws IOException { if (currentPartition == null) { return; } // precondition: the current row is set up and the sources all have the same column qualifier // while we don't have a match, seek in the source with the smallest column qualifier sources[0].iter.next(); advanceToIntersection(); }
@Override protected void advanceToIntersection() throws IOException { super.advanceToIntersection(); if (topKey == null) return; if (log.isTraceEnabled()) log.trace("using top key to seek for doc: " + topKey.toString()); Key docKey = buildDocKey(); docSource.seek(new Range(docKey, true, null, false), docColfSet, true); log.debug("got doc key: " + docSource.getTopKey().toString()); if (docSource.hasTop() && docKey.equals(docSource.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL)) { value = docSource.getTopValue(); } log.debug("got doc value: " + value.toString()); }
@Override public void seek(Range range, Collection<ByteSequence> seekColumnFamilies, boolean inclusive) throws IOException { overallRange = new Range(range); currentPartition = new Text(); currentDocID.set(emptyByteArray); // 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; if (range.getStartKey() != null) { if (range.getStartKey().getColumnQualifier() != null) { sourceKey = buildKey(getPartition(range.getStartKey()), sources[i].term, range.getStartKey().getColumnQualifier()); } else { sourceKey = buildKey(getPartition(range.getStartKey()), sources[i].term); } // Seek only to the term for this source as a column family sources[i].iter.seek(new Range(sourceKey, true, null, false), sources[i].seekColfams, true); } else { // Seek only to the term for this source as a column family sources[i].iter.seek(range, sources[i].seekColfams, true); } } advanceToIntersection(); }