Class ORecordIteratorClusters<REC extends ORecord>
java.lang.Object
com.orientechnologies.orient.core.iterator.OIdentifiableIterator<REC>
com.orientechnologies.orient.core.iterator.ORecordIteratorClusters<REC>
- Direct Known Subclasses:
ORecordIteratorClass
Iterator to browse multiple clusters forward and backward. Once browsed in a direction, the
iterator cannot change it. This iterator with "live updates" set is able to catch updates to the
cluster sizes while browsing. This is the case when concurrent clients/threads insert and remove
item in any cluster the iterator is browsing. If the cluster are hot removed by from the database
the iterator could be invalid and throw exception of cluster not found.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ORIDprotected int[]protected intprotected ORecordprotected ORIDFields inherited from class com.orientechnologies.orient.core.iterator.OIdentifiableIterator
brokenRIDs, browsedRecords, current, currentTxEntryPosition, database, firstClusterEntry, lastClusterEntry, limit, liveUpdated, lockingStrategy, totalAvailableRecords, txEntries -
Constructor Summary
ConstructorsModifierConstructorDescriptionORecordIteratorClusters(ODatabaseDocumentInternal iDatabase, int[] iClusterIds) ORecordIteratorClusters(ODatabaseDocumentInternal iDatabase, int[] iClusterIds, OStorage.LOCKING_STRATEGY iLockingStrategy) Deprecated.protectedORecordIteratorClusters(ODatabaseDocumentInternal iDatabase, OStorage.LOCKING_STRATEGY iLockingStrategy) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbegin()Move the iterator to the begin of the range.protected voidconfig()int[]booleanhasNext()booleanprotected booleanlast()Move the iterator to the end of the range.next()Return the element at the current position and move forward the stream to the next position available.previous()Return the element at the current position and move backward the stream to the previous position available.setLiveUpdated(boolean iLiveUpdated) Tell to the iterator that the upper limit must be checked at every cycle.toString()protected voidMethods inherited from class com.orientechnologies.orient.core.iterator.OIdentifiableIterator
checkCurrentPosition, checkDirection, checkForSystemClusters, current, currentPosition, getBrokenRIDs, getCurrentEntry, getFetchPlan, getLimit, getRecord, getTransactionEntry, isLiveUpdated, isReuseSameRecord, iterator, nextPosition, prevPosition, readCurrentRecord, remove, resetCurrentPosition, setFetchPlan, setLimit, setReuseSameRecordMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
clusterIds
protected int[] clusterIds -
currentClusterIdx
protected int currentClusterIdx -
currentRecord
-
beginRange
-
endRange
-
-
Constructor Details
-
ORecordIteratorClusters
-
ORecordIteratorClusters
@Deprecated public ORecordIteratorClusters(ODatabaseDocumentInternal iDatabase, int[] iClusterIds, OStorage.LOCKING_STRATEGY iLockingStrategy) Deprecated. -
ORecordIteratorClusters
@Deprecated protected ORecordIteratorClusters(ODatabaseDocumentInternal iDatabase, OStorage.LOCKING_STRATEGY iLockingStrategy) Deprecated.
-
-
Method Details
-
setRange
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPreviousin classOIdentifiableIterator<REC extends ORecord>
-
hasNext
public boolean hasNext() -
next
Return the element at the current position and move forward the stream to the next position available.- Returns:
- the next record found, otherwise the NoSuchElementException exception is thrown when no more records are found.
-
previous
Return the element at the current position and move backward the stream to the previous position available.- Specified by:
previousin classOIdentifiableIterator<REC extends ORecord>- Returns:
- the previous record found, otherwise the NoSuchElementException exception is thrown when no more records are found.
-
begin
Move the iterator to the begin of the range. If no range was specified move to the first record of the cluster.- Specified by:
beginin classOIdentifiableIterator<REC extends ORecord>- Returns:
- The object itself
-
last
Move the iterator to the end of the range. If no range was specified move to the last record of the cluster.- Specified by:
lastin classOIdentifiableIterator<REC extends ORecord>- Returns:
- The object itself
-
setLiveUpdated
Tell to the iterator that the upper limit must be checked at every cycle. Useful when concurrent deletes or additions change the size of the cluster while you're browsing it. Default is false.- Overrides:
setLiveUpdatedin classOIdentifiableIterator<REC extends ORecord>- Parameters:
iLiveUpdated- True to activate it, otherwise false (default)- See Also:
-
getBeginRange
-
getEndRange
-
getClusterIds
public int[] getClusterIds() -
toString
-
include
-
updateClusterRange
protected void updateClusterRange() -
config
protected void config()
-