|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.accumulo.examples.wikisearch.iterator.BooleanLogicIterator
public class BooleanLogicIterator
Nested Class Summary | |
---|---|
class |
BooleanLogicIterator.BooleanLogicTreeNodeComparator
|
Nested classes/interfaces inherited from interface org.apache.accumulo.core.iterators.OptionDescriber |
---|
OptionDescriber.IteratorOptions |
Field Summary | |
---|---|
static String |
FIELD_INDEX_QUERY
|
static String |
FIELD_NAME_PREFIX
|
protected static org.apache.log4j.Logger |
log
|
protected org.apache.hadoop.io.Text |
nullText
|
static String |
QUERY_OPTION
|
static String |
TERM_CARDINALITIES
|
Constructor Summary | |
---|---|
BooleanLogicIterator()
|
|
BooleanLogicIterator(BooleanLogicIterator other,
IteratorEnvironment env)
|
Method Summary | |
---|---|
static void |
collapseBranches(BooleanLogicTreeNode myroot)
|
SortedKeyValueIterator<Key,Value> |
deepCopy(IteratorEnvironment env)
Creates a deep copy of this iterator as though seek had not yet been called. |
OptionDescriber.IteratorOptions |
describeOptions()
Gets an iterator options object that contains information needed to configure this iterator. |
Key |
getTopKey()
Returns top key. |
Value |
getTopValue()
Returns top value. |
boolean |
hasTop()
Returns true if the iterator has more elements. |
void |
init(SortedKeyValueIterator<Key,Value> source,
Map<String,String> options,
IteratorEnvironment env)
init is responsible for setting up the iterator. |
void |
next()
Advances to the next K,V pair. |
BooleanLogicTreeNode |
refactorTree(BooleanLogicTreeNode myroot)
|
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. |
void |
setDebug(org.apache.log4j.Level lev)
|
static void |
setLogLevel(org.apache.log4j.Level lev)
|
static void |
showBreadthFirstTraversal(BooleanLogicTreeNode root)
|
static void |
showDepthFirstTraversal(BooleanLogicTreeNode root)
Small utility function to print out the depth-first enumeration of the tree. |
BooleanLogicTreeNode |
transformTreeNode(TreeNode node)
|
boolean |
validateOptions(Map<String,String> options)
Check to see if an options map contains all options required by an iterator and that the option values are in the expected formats. |
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
public static final String QUERY_OPTION
public static final String TERM_CARDINALITIES
public static final String FIELD_INDEX_QUERY
public static final String FIELD_NAME_PREFIX
protected org.apache.hadoop.io.Text nullText
Constructor Detail |
---|
public BooleanLogicIterator()
public BooleanLogicIterator(BooleanLogicIterator other, IteratorEnvironment env)
Method Detail |
---|
public static void setLogLevel(org.apache.log4j.Level lev)
public void setDebug(org.apache.log4j.Level lev)
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 init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException
init
in interface SortedKeyValueIterator<Key,Value>
source
- The underlying SortedkeyValueIterator.options
- A Mapenv
- The iterator environment
IOException
public BooleanLogicTreeNode transformTreeNode(TreeNode node) throws org.apache.commons.jexl2.parser.ParseException
org.apache.commons.jexl2.parser.ParseException
public static void collapseBranches(BooleanLogicTreeNode myroot) throws Exception
Exception
public BooleanLogicTreeNode refactorTree(BooleanLogicTreeNode myroot)
public static void showDepthFirstTraversal(BooleanLogicTreeNode root)
root
- The root node of the tree or sub-tree.public static void showBreadthFirstTraversal(BooleanLogicTreeNode root)
public boolean hasTop()
SortedKeyValueIterator
hasTop
in interface SortedKeyValueIterator<Key,Value>
public Key getTopKey()
SortedKeyValueIterator
getTopKey
in interface SortedKeyValueIterator<Key,Value>
public Value getTopValue()
SortedKeyValueIterator
getTopValue
in interface SortedKeyValueIterator<Key,Value>
public 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 OptionDescriber.IteratorOptions describeOptions()
OptionDescriber
describeOptions
in interface OptionDescriber
public boolean validateOptions(Map<String,String> options)
OptionDescriber
validateOptions
in interface OptionDescriber
options
- a map of option names to option values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |