Interface PartitionHolderContents<T>
- All Known Implementing Classes:
OvershadowableManager,SimplePartitionHolderContents
public interface PartitionHolderContents<T>
Contents for
PartitionHolder.-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddChunk(PartitionChunk<T> chunk) Adds a chunk.booleanWhether all visible chunks are consistent, meaning they can possibly be considered forPartitionHolder.isComplete().Returns a copy of this holder with only visible chunks.deepCopy()Returns a copy of this holder with all chunks.getChunk(int partitionId) Returns the chunk with a given partition ID, or null if none exists.Returns chunks that are tracked but not visible.booleanisEmpty()Whether this holder is empty.removeChunk(PartitionChunk<T> partitionChunk) Removes and returns a chunk with the same partition boundaries as the provided chunk.Iterates through all visible chunks.
-
Method Details
-
isEmpty
boolean isEmpty()Whether this holder is empty. -
areVisibleChunksConsistent
boolean areVisibleChunksConsistent()Whether all visible chunks are consistent, meaning they can possibly be considered forPartitionHolder.isComplete(). When segment locking is not being used, all chunks are consistent, so this always returns true. -
addChunk
Adds a chunk.- Returns:
- true if no chunk previously existed with these partition boundaries
-
removeChunk
Removes and returns a chunk with the same partition boundaries as the provided chunk. Returns null if no such chunk exists. -
getChunk
Returns the chunk with a given partition ID, or null if none exists. -
visibleChunksIterator
Iterator<PartitionChunk<T>> visibleChunksIterator()Iterates through all visible chunks. When segment locking is not being used, all chunks are visible, so this returns all chunks. -
getOvershadowedChunks
List<PartitionChunk<T>> getOvershadowedChunks()Returns chunks that are tracked but not visible. When segment locking is not being used, all chunks are visible, so this returns nothing. -
copyVisible
PartitionHolderContents<T> copyVisible()Returns a copy of this holder with only visible chunks. -
deepCopy
PartitionHolderContents<T> deepCopy()Returns a copy of this holder with all chunks.
-