Package com.tangosol.net.partition
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 Summary
Modifier and TypeFieldDescriptionprotected NamedCache
The cache to query from.protected boolean
Differentiates between by-member and by-partition iteration.protected PartitionedFilter
The filter to query with.protected boolean
An option to randomize the order of iteration to avoid harmonics in a clustered environment.protected PartitionSet
The remaining set of partitions to iterate.static final int
An option to iterate one member at a time.static final int
An option to iterate one partition at a time.static final int
An option to iterate the members or partitions in a randomized order. -
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractPartitionedIterator
(Filter filter, NamedCache cache, PartitionSet setPids) Create AbstractPartitionedIterator instance.protected
AbstractPartitionedIterator
(Filter filter, NamedCache cache, PartitionSet setPids, boolean fByMember, boolean fRandom) Create AbstractPartitionedIterator instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
advance()
Advance to the next object.nextIterable
(PartitionedFilter filter) Obtain the next Iterable for a given filter.protected void
Remove the specified item.Methods inherited from class com.oracle.coherence.common.collections.AbstractStableIterator
getPrevious, hasMoreElements, hasNext, next, nextElement, remove, setNext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Enumeration
asIterator
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
OPT_BY_PARTITION
public static final int OPT_BY_PARTITIONAn option to iterate one partition at a time. This is the default.- See Also:
-
OPT_BY_MEMBER
public static final int OPT_BY_MEMBERAn option to iterate one member at a time.- See Also:
-
OPT_RANDOMIZED
public static final int OPT_RANDOMIZEDAn 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
The cache to query from. -
m_filter
The filter to query with. -
m_setPids
The remaining set of partitions to iterate. -
m_fByMember
protected boolean m_fByMemberDifferentiates 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_fRandomAn option to randomize the order of iteration to avoid harmonics in a clustered environment.
-
-
Constructor Details
-
AbstractPartitionedIterator
Create AbstractPartitionedIterator instance.- Parameters:
filter
- the query expressed as a Filtercache
- the cache to querysetPids
- 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 Filtercache
- the cache to querysetPids
- the partitions to execute the query againstfByMember
- indicates whether it is by-member iterationsfRandom
- indicates whether the order of iteration is randomized
-
-
Method Details
-
nextIterable
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 classcom.oracle.coherence.common.collections.AbstractStableIterator<T>
-
remove
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 classcom.oracle.coherence.common.collections.AbstractStableIterator<T>
- Parameters:
oPrev
- the previously iterated object that should be removed
-