@Override public Key getTopKey() { if (!hasTop) throw new IllegalStateException(); return reader.getTopKey(); }
@Override public final Key getTopKey() { final Key k = currentTerm.iter.getTopKey(); LOG.trace("getTopKey() = {}", k); return k; }
private void pullReferencesFromHeap() { topIdx = heap.remove(); if (!heap.isEmpty()) { nextKey = heap.peek().getTopKey(); } else { nextKey = null; } }
@Override public Key getTopKey() { Key top = source.getTopKey(); if (top.isDeleted()) { throw new IllegalStateException("Saw unexpected delete " + top); } return top; } };
@Override public int compareTo(TermSource o) { // NOTE: If your implementation can have more than one row in a tablet, // you must compare row key here first, then column qualifier. // NOTE2: A null check is not needed because things are only added to the // sorted after they have been determined to be valid. return this.iter.getTopKey().compareColumnQualifier(o.iter.getTopKey().getColumnQualifier()); }
@Override public Key getTopKey() { if (!seenSeek) throw new IllegalStateException("never been seeked"); return getSource().getTopKey(); }
@Override public Key getTopKey() { Key key = source.getTopKey(); key.setTimestamp(time); return key; }
public static String stringTopKey(SortedKeyValueIterator<Key,Value> iter) { if (iter.hasTop()) return iter.getTopKey().toString(); return ""; }
/** * Constructs an iterator over Values whose Keys are versions of the current topKey of the * source SortedKeyValueIterator. * * @param source * The {@code SortedKeyValueIterator<Key,Value>} from which to read data. */ public ValueIterator(SortedKeyValueIterator<Key,Value> source) { this.source = source; topKey = new Key(source.getTopKey()); hasNext = _hasNext(); }
@Override public boolean hasTop() { // only have a top if the prefix matches return hasTop = source.hasTop() && source.getTopKey().equals(prefixKey, keyPrefix); }
@Override public void next() throws IOException { if (!hasTop) throw new IllegalStateException(); reader.next(); hasTop = reader.hasTop() && !range.afterEndKey(reader.getTopKey()); }
TreeMap<Key,Value> consume(SortedKeyValueIterator<Key,Value> skvi) throws IOException { TreeMap<Key,Value> data = new TreeMap<>(); while (skvi.hasTop()) { // Make sure to copy the K-V data.put(new Key(skvi.getTopKey()), new Value(skvi.getTopValue())); skvi.next(); } return data; }
private void findTop() throws IOException { if (!propogateDeletes) { while (source.hasTop() && source.getTopKey().isDeleted()) { skipRowColumn(); } } }
@Override public void next() throws IOException { if (source.getTopKey().isDeleted()) skipRowColumn(); else source.next(); findTop(); }
/** * Iterates over the source until an acceptable key/value pair is found. */ private void findTop() throws IOException { while (source.hasTop()) { Key top = source.getTopKey(); if (top.isDeleted() || (accept(top, source.getTopValue()))) { break; } source.next(); } }
/** * Iterates over the source until an acceptable key/value pair is found. */ private void findTop() throws IOException { while (source.hasTop()) { Key top = source.getTopKey(); if (top.isDeleted() || (accept(top, source.getTopValue()))) { break; } source.next(); } }
@Override public Entry<Key,Value> next() { try { Entry<Key,Value> result = new KeyValue(new Key(inner.getTopKey()), new Value(inner.getTopValue()).get()); inner.next(); return result; } catch (IOException ex) { throw new NoSuchElementException(); } }
@Override public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException { reader.seek(range, columnFamilies, inclusive); this.range = range; hasTop = reader.hasTop() && !range.afterEndKey(reader.getTopKey()); while (hasTop() && range.beforeStartKey(getTopKey())) { next(); } }