org.apache.accumulo.examples.wikisearch.iterator
Class EvaluatingIterator

java.lang.Object
  extended by org.apache.accumulo.examples.wikisearch.iterator.AbstractEvaluatingIterator
      extended by org.apache.accumulo.examples.wikisearch.iterator.EvaluatingIterator
All Implemented Interfaces:
OptionDescriber, SortedKeyValueIterator<Key,Value>

public class EvaluatingIterator
extends AbstractEvaluatingIterator


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.accumulo.core.iterators.OptionDescriber
OptionDescriber.IteratorOptions
 
Field Summary
static String NULL_BYTE_STRING
           
 
Fields inherited from class org.apache.accumulo.examples.wikisearch.iterator.AbstractEvaluatingIterator
iterator, NULL_BYTE, QUERY_OPTION, UNEVALUTED_EXPRESSIONS
 
Constructor Summary
EvaluatingIterator()
           
EvaluatingIterator(AbstractEvaluatingIterator other, IteratorEnvironment env)
           
 
Method Summary
 SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env)
          Creates a deep copy of this iterator as though seek had not yet been called.
 void fillMap(EventFields event, Key key, Value value)
          Implementations will need to fill the map with field visibilities, names, and values.
 ColumnVisibility getColumnVisibility(Key key)
           
 PartialKey getKeyComparator()
          Implementations will return the PartialKey value to use for comparing keys for aggregating events
 Key getReturnKey(Key k)
          When the query expression evaluates to true against the event, the event fields will be serialized into the Value and returned up the iterator stack.
 boolean isKeyAccepted(Key key)
          Don't accept this key if the colf starts with 'fi'
 
Methods inherited from class org.apache.accumulo.examples.wikisearch.iterator.AbstractEvaluatingIterator
describeOptions, getQueryExpression, getTopKey, getTopValue, hasTop, init, next, reset, seek, validateOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_BYTE_STRING

public static final String NULL_BYTE_STRING
See Also:
Constant Field Values
Constructor Detail

EvaluatingIterator

public EvaluatingIterator()

EvaluatingIterator

public EvaluatingIterator(AbstractEvaluatingIterator other,
                          IteratorEnvironment env)
Method Detail

deepCopy

public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env)
Description copied from interface: SortedKeyValueIterator
Creates a deep copy of this iterator as though seek had not yet been called. init should be called on an iterator before deepCopy is called. init should not need to be called on the copy that is returned by deepCopy; that is, when necessary init should be called in the deepCopy method on the iterator it returns. The behavior is unspecified if init is called after deepCopy either on the original or the copy.

Parameters:
env - IteratorEnvironment environment in which iterator is being run.
Returns:
SortedKeyValueIterator a copy of this iterator (with the same source and settings).

getKeyComparator

public PartialKey getKeyComparator()
Description copied from class: AbstractEvaluatingIterator
Implementations will return the PartialKey value to use for comparing keys for aggregating events

Specified by:
getKeyComparator in class AbstractEvaluatingIterator
Returns:
the type of comparator to use

getReturnKey

public Key getReturnKey(Key k)
Description copied from class: AbstractEvaluatingIterator
When the query expression evaluates to true against the event, the event fields will be serialized into the Value and returned up the iterator stack. Implemenations will need to provide a key to be used with the event.

Specified by:
getReturnKey in class AbstractEvaluatingIterator
Returns:
the key that should be returned with the map of values.

fillMap

public void fillMap(EventFields event,
                    Key key,
                    Value value)
Description copied from class: AbstractEvaluatingIterator
Implementations will need to fill the map with field visibilities, names, and values. When all fields have been aggregated the event will be evaluated against the query expression.

Specified by:
fillMap in class AbstractEvaluatingIterator
Parameters:
event - Multimap of event names and fields.
key - current Key
value - current Value

getColumnVisibility

public ColumnVisibility getColumnVisibility(Key key)
Parameters:
key -
Returns:

isKeyAccepted

public boolean isKeyAccepted(Key key)
                      throws IOException
Don't accept this key if the colf starts with 'fi'

Specified by:
isKeyAccepted in class AbstractEvaluatingIterator
Returns:
true if the key should be acted upon, otherwise false.
Throws:
IOException


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.