Class AbstractPartitionedIterator<T>

java.lang.Object
com.oracle.coherence.common.collections.AbstractStableIterator<T>
com.tangosol.net.partition.AbstractPartitionedIterator<T>
All Implemented Interfaces:
Enumeration<T>, Iterator<T>
Direct Known Subclasses:
PartitionedIterator

public abstract class AbstractPartitionedIterator<T> extends com.oracle.coherence.common.collections.AbstractStableIterator<T>
Abstract base class for partitioned iterators.
Author:
as 2015.01.27
  • Field Details

    • OPT_BY_PARTITION

      public static final int OPT_BY_PARTITION
      An option to iterate one partition at a time. This is the default.
      See Also:
    • OPT_BY_MEMBER

      public static final int OPT_BY_MEMBER
      An option to iterate one member at a time.
      See Also:
    • OPT_RANDOMIZED

      public static final int OPT_RANDOMIZED
      An option to iterate the members or partitions in a randomized order. Note that this does not refer to the order that the individual keys or entries themselves will be iterated.
      See Also:
    • m_cache

      protected NamedCache m_cache
      The cache to query from.
    • m_filter

      protected PartitionedFilter m_filter
      The filter to query with.
    • m_setPids

      protected PartitionSet m_setPids
      The remaining set of partitions to iterate.
    • m_fByMember

      protected boolean m_fByMember
      Differentiates between by-member and by-partition iteration. If true, all partitions of a given member are iterated in a single chunk; if false, each partition is iterated individually.
    • m_fRandom

      protected boolean m_fRandom
      An option to randomize the order of iteration to avoid harmonics in a clustered environment.
  • Constructor Details

    • AbstractPartitionedIterator

      protected AbstractPartitionedIterator(Filter filter, NamedCache cache, PartitionSet setPids)
      Create AbstractPartitionedIterator instance.
      Parameters:
      filter - the query expressed as a Filter
      cache - the cache to query
      setPids - the partitions to execute the query against
    • AbstractPartitionedIterator

      protected AbstractPartitionedIterator(Filter filter, NamedCache cache, PartitionSet setPids, boolean fByMember, boolean fRandom)
      Create AbstractPartitionedIterator instance.
      Parameters:
      filter - the query expressed as a Filter
      cache - the cache to query
      setPids - the partitions to execute the query against
      fByMember - indicates whether it is by-member iterations
      fRandom - indicates whether the order of iteration is randomized
  • Method Details

    • nextIterable

      protected abstract Iterable<T> nextIterable(PartitionedFilter filter)
      Obtain the next Iterable for a given filter. This method is called when the Iterable returned by the previous call is exhausted.
      Parameters:
      filter - filter to use
      Returns:
      a next Iterable or null if there is no more data to iterate
    • advance

      protected void advance()
      Description copied from class: com.oracle.coherence.common.collections.AbstractStableIterator
      Advance to the next object.

      This method must be implemented by the concrete sub-class by calling AbstractStableIterator.setNext(T) if there is a next object.

      Specified by:
      advance in class com.oracle.coherence.common.collections.AbstractStableIterator<T>
    • remove

      protected void remove(Object oPrev)
      Description copied from class: com.oracle.coherence.common.collections.AbstractStableIterator
      Remove the specified item.

      This is an optional operation. If the Iterator supports element removal, then it should implement this method, which is delegated to by the AbstractStableIterator.remove() method.

      Overrides:
      remove in class com.oracle.coherence.common.collections.AbstractStableIterator<T>
      Parameters:
      oPrev - the previously iterated object that should be removed