Class CfCqSliceSeekingFilter

  • All Implemented Interfaces:
    OptionDescriber, SortedKeyValueIterator<Key,​Value>, YieldingKeyValueIterator<Key,​Value>

    public class CfCqSliceSeekingFilter
    extends SeekingFilter
    implements OptionDescriber
    Filters key/value pairs for a range of column families and a range of column qualifiers. Only keys which fall in both ranges will be passed by the filter. Note that if you have a small, well-defined set of column families it will be much more efficient to configure locality groups to isolate that data instead of configuring this iterator to seek over it. This filter may be more efficient than the CfCqSliceFilter or the ColumnSlice filter for small slices of large rows as it will seek to the next potential match once it determines that it has iterated past the end of a slice.
    See Also:
    for a description of this iterator's options.
    • Constructor Detail

      • CfCqSliceSeekingFilter

        public CfCqSliceSeekingFilter()
    • Method Detail

      • filter

        public SeekingFilter.FilterResult filter​(Key k,
                                                 Value v)
        Description copied from class: SeekingFilter
        Subclasses must provide an implementation which examines the given key and value and determines (1) whether to accept the KV pair and (2) how far to advance the source iterator past the key.
        Specified by:
        filter in class SeekingFilter
        Parameters:
        k - a key
        v - a value
        Returns:
        indicating whether to pass or block the key, and how far the source iterator should be advanced.
      • getNextKeyHint

        public Key getNextKeyHint​(Key k,
                                  Value v)
                           throws IllegalArgumentException
        Description copied from class: SeekingFilter
        Whenever the subclass returns AdvanceResult.USE_HINT from its filter predicate, this method will be called to see how far to advance the source iterator. The return value must be a key which is greater than (sorts after) the input key. If the subclass never returns USE_HINT, this method will never be called and may safely return null.
        Specified by:
        getNextKeyHint in class SeekingFilter
        Parameters:
        k - a key
        v - a value
        Returns:
        as above
        Throws:
        IllegalArgumentException
      • 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. A proper implementation would call deepCopy on the source.
        Specified by:
        deepCopy in interface SortedKeyValueIterator<Key,​Value>
        Overrides:
        deepCopy in class SeekingFilter
        Parameters:
        env - IteratorEnvironment environment in which iterator is being run.
        Returns:
        SortedKeyValueIterator a copy of this iterator (with the same source and settings).
      • describeOptions

        public OptionDescriber.IteratorOptions describeOptions()
        Description copied from interface: OptionDescriber
        Gets an iterator options object that contains information needed to configure this iterator. This object will be used by the accumulo shell to prompt the user to input the appropriate information.
        Specified by:
        describeOptions in interface OptionDescriber
        Returns:
        an iterator options object
      • validateOptions

        public boolean validateOptions​(Map<String,​String> options)
        Description copied from interface: OptionDescriber
        Check to see if an options map contains all options required by an iterator and that the option values are in the expected formats.
        Specified by:
        validateOptions in interface OptionDescriber
        Parameters:
        options - a map of option names to option values
        Returns:
        true if options are valid, false otherwise (IllegalArgumentException preferred)