org.apache.accumulo.core.client
Class IteratorSetting

java.lang.Object
  extended by org.apache.accumulo.core.client.IteratorSetting
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class IteratorSetting
extends Object
implements org.apache.hadoop.io.Writable

Configure an iterator for minc, majc, and/or scan. By default, IteratorSetting will be configured for scan. Every iterator has a priority, a name, a class, a set of scopes, and configuration parameters. A typical use case configured for scan:

 IteratorSetting cfg = new IteratorSetting(priority, "myIter", MyIterator.class);
 MyIterator.addOption(cfg, 42);
 scanner.addScanIterator(cfg);
 


Nested Class Summary
static class IteratorSetting.Column
          A convenience class for passing column family and column qualifiers to iterator configuration methods.
 
Constructor Summary
IteratorSetting(DataInput din)
           
IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass)
          Constructs an iterator setting using the given class's SimpleName for the iterator name.
IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, Map<String,String> properties)
          Constructs an iterator setting using the given class's SimpleName for the iterator name and configured for the specified scopes with the specified parameters.
IteratorSetting(int priority, String name, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass)
          Constructs an iterator setting configured for the scan scope with no parameters.
IteratorSetting(int priority, String name, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, Map<String,String> properties)
          Constructs an iterator setting using the provided name and the provided class's name for the scan scope with the provided parameters.
IteratorSetting(int priority, String name, String iteratorClass)
          Constructs an iterator setting configured for the scan scope with no parameters.
IteratorSetting(int priority, String name, String iteratorClass, Map<String,String> properties)
          Constructs an iterator setting configured for the specified scopes with the specified parameters.
 
Method Summary
 void addOption(String option, String value)
          Add another option to the iterator.
 void addOptions(Map<String,String> properties)
          Add many options to the iterator.
 void addOptions(Set<Map.Entry<String,String>> propertyEntries)
          Add many options to the iterator.
 void clearOptions()
          Remove all options from the iterator.
 boolean equals(Object obj)
           
 String getIteratorClass()
          Get the name of the class that implements the iterator.
 String getName()
          Get the iterator's name.
 Map<String,String> getOptions()
          Get the configuration parameters for this iterator.
 int getPriority()
          Get layer at which this iterator applies.
 int hashCode()
           
 void readFields(DataInput din)
           
 String removeOption(String option)
          Remove an option from the iterator.
 void setIteratorClass(String iteratorClass)
          Set the name of the class that implements the iterator.
 void setName(String name)
          Set the iterator's name.
 void setPriority(int priority)
          Set layer at which this iterator applies.
 String toString()
           
 void write(DataOutput dout)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IteratorSetting

public IteratorSetting(int priority,
                       String name,
                       String iteratorClass)
Constructs an iterator setting configured for the scan scope with no parameters. (Parameters can be added later.)

Parameters:
priority - the priority for the iterator (see setPriority(int))
name - the distinguishing name for the iterator
iteratorClass - the fully qualified class name for the iterator

IteratorSetting

public IteratorSetting(int priority,
                       String name,
                       String iteratorClass,
                       Map<String,String> properties)
Constructs an iterator setting configured for the specified scopes with the specified parameters.

Parameters:
priority - the priority for the iterator (see setPriority(int))
name - the distinguishing name for the iterator
iteratorClass - the fully qualified class name for the iterator
properties - any properties for the iterator

IteratorSetting

public IteratorSetting(int priority,
                       Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass)
Constructs an iterator setting using the given class's SimpleName for the iterator name. The iterator setting will be configured for the scan scope with no parameters.

Parameters:
priority - the priority for the iterator (see setPriority(int))
iteratorClass - the class for the iterator

IteratorSetting

public IteratorSetting(int priority,
                       Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass,
                       Map<String,String> properties)
Constructs an iterator setting using the given class's SimpleName for the iterator name and configured for the specified scopes with the specified parameters.

Parameters:
priority - the priority for the iterator (see setPriority(int))
iteratorClass - the class for the iterator
properties - any properties for the iterator

IteratorSetting

public IteratorSetting(int priority,
                       String name,
                       Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass)
Constructs an iterator setting configured for the scan scope with no parameters.

Parameters:
priority - the priority for the iterator (see setPriority(int))
name - the distinguishing name for the iterator
iteratorClass - the class for the iterator

IteratorSetting

public IteratorSetting(int priority,
                       String name,
                       Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass,
                       Map<String,String> properties)
Constructs an iterator setting using the provided name and the provided class's name for the scan scope with the provided parameters.

Parameters:
priority - The priority for the iterator (see setPriority(int))
name - The distinguishing name for the iterator
iteratorClass - The class for the iterator
properties - Any properties for the iterator
Since:
1.6.0

IteratorSetting

public IteratorSetting(DataInput din)
                throws IOException
Throws:
IOException
Since:
1.5.0
Method Detail

getPriority

public int getPriority()
Get layer at which this iterator applies. See setPriority(int) for how the priority is used.

Returns:
the priority of this Iterator

setPriority

public void setPriority(int priority)
Set layer at which this iterator applies.

Parameters:
priority - determines the order in which iterators are applied (system iterators are always applied first, then user-configured iterators, lowest priority first)

getName

public String getName()
Get the iterator's name.

Returns:
the name of the iterator

setName

public void setName(String name)
Set the iterator's name. Must be a simple alphanumeric identifier.


getIteratorClass

public String getIteratorClass()
Get the name of the class that implements the iterator.

Returns:
the iterator's class name

setIteratorClass

public void setIteratorClass(String iteratorClass)
Set the name of the class that implements the iterator. The class does not have to be present on the client, but it must be available to all tablet servers.


addOption

public void addOption(String option,
                      String value)
Add another option to the iterator.

Parameters:
option - the name of the option
value - the value of the option

removeOption

public String removeOption(String option)
Remove an option from the iterator.

Parameters:
option - the name of the option
Returns:
the value previously associated with the option, or null if no such option existed

addOptions

public void addOptions(Set<Map.Entry<String,String>> propertyEntries)
Add many options to the iterator.

Parameters:
propertyEntries - a set of entries to add to the options

addOptions

public void addOptions(Map<String,String> properties)
Add many options to the iterator.

Parameters:
properties - a map of entries to add to the options

getOptions

public Map<String,String> getOptions()
Get the configuration parameters for this iterator.

Returns:
the properties

clearOptions

public void clearOptions()
Remove all options from the iterator.


hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

readFields

public void readFields(DataInput din)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException
Since:
1.5.0

write

public void write(DataOutput dout)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException
Since:
1.5.0


Copyright © 2015 Apache Accumulo Project. All rights reserved.