|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.accumulo.examples.wikisearch.iterator.OrIterator
public class OrIterator
An iterator that handles "OR" query constructs on the server side. This code has been adapted/merged from Heap and Multi Iterators.
Nested Class Summary | |
---|---|
protected static class |
OrIterator.TermSource
|
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
log
|
Constructor Summary | |
---|---|
OrIterator()
|
Method Summary | |
---|---|
void |
addTerm(SortedKeyValueIterator<Key,Value> source,
org.apache.hadoop.io.Text term,
IteratorEnvironment env)
|
void |
addTerm(SortedKeyValueIterator<Key,Value> source,
org.apache.hadoop.io.Text dataLocation,
org.apache.hadoop.io.Text term,
IteratorEnvironment env)
|
protected Key |
buildTopKey(OrIterator.TermSource TS)
Construct the topKey given the current TermSource |
SortedKeyValueIterator<Key,Value> |
deepCopy(IteratorEnvironment env)
Creates a deep copy of this iterator as though seek had not yet been called. |
protected org.apache.hadoop.io.Text |
getDataLocation(Key key)
Returns the given key's dataLocation |
protected org.apache.hadoop.io.Text |
getDocID(Key key)
Returns the given key's DocID |
protected org.apache.hadoop.io.Text |
getPartition(Key key)
Returns the given key's row |
protected org.apache.hadoop.io.Text |
getTerm(Key key)
Returns the given key's term |
Key |
getTopKey()
Returns top key. |
Value |
getTopValue()
Returns top value. |
protected static String |
getUID(Key key)
Returns the given key's UID |
boolean |
hasTop()
Returns true if the iterator has more elements. |
void |
init(SortedKeyValueIterator<Key,Value> source,
Map<String,String> options,
IteratorEnvironment env)
Initializes the iterator. |
boolean |
jump(Key jumpKey)
|
void |
next()
Advances to the next K,V pair. |
void |
seek(Range range,
Collection<ByteSequence> columnFamilies,
boolean inclusive)
Seeks to the first key in the Range, restricting the resulting K,V pairs to those with the specified columns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger log
Constructor Detail |
---|
public OrIterator()
Method Detail |
---|
protected org.apache.hadoop.io.Text getPartition(Key key)
key
-
protected org.apache.hadoop.io.Text getDataLocation(Key key)
key
-
protected org.apache.hadoop.io.Text getTerm(Key key)
key
-
protected org.apache.hadoop.io.Text getDocID(Key key)
key
-
protected static String getUID(Key key)
key
-
public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env)
SortedKeyValueIterator
deepCopy
in interface SortedKeyValueIterator<Key,Value>
env
- IteratorEnvironment environment in which iterator is being run.
public void addTerm(SortedKeyValueIterator<Key,Value> source, org.apache.hadoop.io.Text term, IteratorEnvironment env)
public void addTerm(SortedKeyValueIterator<Key,Value> source, org.apache.hadoop.io.Text dataLocation, org.apache.hadoop.io.Text term, IteratorEnvironment env)
protected Key buildTopKey(OrIterator.TermSource TS)
TermSource
TS
-
public final void next() throws IOException
SortedKeyValueIterator
next
in interface SortedKeyValueIterator<Key,Value>
IOException
- if an I/O error occurs.public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException
SortedKeyValueIterator
SortedKeyValueIterator.init(org.apache.accumulo.core.iterators.SortedKeyValueIterator, java.util.Map, org.apache.accumulo.core.iterators.IteratorEnvironment)
is called.
Iterators that examine groups of adjacent key/value pairs (e.g. rows) to determine their top key and value should be sure that they properly handle a seek
to a key in the middle of such a group (e.g. the middle of a row). Even if the client always seeks to a range containing an entire group (a,c), the tablet
server could send back a batch of entries corresponding to (a,b], then reseek the iterator to range (b,c) when the scan is continued.
seek
in interface SortedKeyValueIterator<Key,Value>
range
- Range of keys to iterate over.columnFamilies
- Collection of column families to include or exclude.inclusive
- boolean that indicates whether to include (true) or exclude (false) column families.
IOException
- if an I/O error occurs.public final Key getTopKey()
SortedKeyValueIterator
getTopKey
in interface SortedKeyValueIterator<Key,Value>
public final Value getTopValue()
SortedKeyValueIterator
getTopValue
in interface SortedKeyValueIterator<Key,Value>
public final boolean hasTop()
SortedKeyValueIterator
hasTop
in interface SortedKeyValueIterator<Key,Value>
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException
SortedKeyValueIterator
init
in interface SortedKeyValueIterator<Key,Value>
source
- SortedKeyValueIterator source to read data from.options
- Map map of string option names to option values.env
- IteratorEnvironment environment in which iterator is being run.
IOException
- unused.public boolean jump(Key jumpKey) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |