Class ScannerImpl

  • All Implemented Interfaces:
    AutoCloseable, Iterable<Map.Entry<Key,​Value>>, Scanner, ScannerBase

    public class ScannerImpl
    extends ScannerOptions
    implements Scanner
    provides scanner functionality "Clients can iterate over multiple column families, and there are several mechanisms for limiting the rows, columns, and timestamps traversed by a scan. For example, we could restrict [a] scan ... to only produce anchors whose columns match [a] regular expression ..., or to only produce anchors whose timestamps fall within ten days of the current time."
    • Method Detail

      • setRange

        public void setRange​(Range range)
        Description copied from interface: Scanner
        Sets the range of keys to scan over.
        Specified by:
        setRange in interface Scanner
        Parameters:
        range - key range to begin and end scan
      • getRange

        public Range getRange()
        Description copied from interface: Scanner
        Returns the range of keys to scan over.
        Specified by:
        getRange in interface Scanner
        Returns:
        the range configured for this scanner
      • setBatchSize

        public void setBatchSize​(int size)
        Description copied from interface: Scanner
        Sets the number of Key/Value pairs that will be fetched at a time from a tablet server.
        Specified by:
        setBatchSize in interface Scanner
        Parameters:
        size - the number of Key/Value pairs to fetch per call to Accumulo
      • getBatchSize

        public int getBatchSize()
        Description copied from interface: Scanner
        Returns the batch size (number of Key/Value pairs) that will be fetched at a time from a tablet server.
        Specified by:
        getBatchSize in interface Scanner
        Returns:
        the batch size configured for this scanner
      • iterator

        public Iterator<Map.Entry<Key,​Value>> iterator()
        Description copied from interface: ScannerBase
        Returns an iterator over an accumulo table. This iterator uses the options that are currently set for its lifetime, so setting options will have no effect on existing iterators.

        Keys returned by the iterator are not guaranteed to be in sorted order.

        Specified by:
        iterator in interface Iterable<Map.Entry<Key,​Value>>
        Specified by:
        iterator in interface ScannerBase
        Overrides:
        iterator in class ScannerOptions
        Returns:
        an iterator over Key,Value pairs which meet the restrictions set on the scanner
      • enableIsolation

        public void enableIsolation()
        Description copied from interface: Scanner
        Enables row isolation. Writes that occur to a row after a scan of that row has begun will not be seen if this option is enabled.
        Specified by:
        enableIsolation in interface Scanner
      • disableIsolation

        public void disableIsolation()
        Description copied from interface: Scanner
        Disables row isolation. Writes that occur to a row after a scan of that row has begun may be seen if this option is enabled.
        Specified by:
        disableIsolation in interface Scanner
      • setReadaheadThreshold

        public void setReadaheadThreshold​(long batches)
        Description copied from interface: Scanner
        Sets the number of batches of Key/Value pairs returned before the Scanner will begin to prefetch the next batch
        Specified by:
        setReadaheadThreshold in interface Scanner
        Parameters:
        batches - Non-negative number of batches
      • getReadaheadThreshold

        public long getReadaheadThreshold()
        Description copied from interface: Scanner
        The number of batches of Key/Value pairs returned before the Scanner will begin to prefetch the next batch
        Specified by:
        getReadaheadThreshold in interface Scanner
        Returns:
        Number of batches before read-ahead begins
      • close

        public void close()
        Description copied from interface: ScannerBase
        Closes any underlying connections on the scanner. This may invalidate any iterators derived from the Scanner, causing them to throw exceptions.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface ScannerBase
        Overrides:
        close in class ScannerOptions