Class OvershadowableManager<T extends Overshadowable<T>>
java.lang.Object
org.apache.druid.timeline.partition.OvershadowableManager<T>
- All Implemented Interfaces:
PartitionHolderContents<T>
public class OvershadowableManager<T extends Overshadowable<T>>
extends Object
implements PartitionHolderContents<T>
OvershadowableManager manages the state of
AtomicUpdateGroup. See the below OvershadowableManager.State for details.
Note that an AtomicUpdateGroup can consist of Overshadowables of the same majorVersion, minorVersion,
rootPartition range, and atomicUpdateGroupSize.
In VersionedIntervalTimeline, this class is used to manage segments in the same
timeChunk.
OvershadowableManager is only used when segment locking is in play, and segments with minor version != 0 have
been created. See PartitionHolder.add(PartitionChunk).
This class is not thread-safe.-
Constructor Summary
Constructors -
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.booleanstatic <T extends Overshadowable<T>>
OvershadowableManager<T>fromSimple(SimplePartitionHolderContents<T> contents) getChunk(int partitionId) Returns the chunk with a given partition ID, or null if none exists.Returns chunks that are tracked but not visible.inthashCode()booleanisEmpty()Whether this holder is empty.removeChunk(PartitionChunk<T> partitionChunk) Removes and returns a chunk with the same partition boundaries as the provided chunk.toString()Iterates through all visible chunks.
-
Constructor Details
-
OvershadowableManager
public OvershadowableManager()
-
-
Method Details
-
fromSimple
public static <T extends Overshadowable<T>> OvershadowableManager<T> fromSimple(SimplePartitionHolderContents<T> contents) -
copyVisible
Description copied from interface:PartitionHolderContentsReturns a copy of this holder with only visible chunks.- Specified by:
copyVisiblein interfacePartitionHolderContents<T extends Overshadowable<T>>
-
deepCopy
Description copied from interface:PartitionHolderContentsReturns a copy of this holder with all chunks.- Specified by:
deepCopyin interfacePartitionHolderContents<T extends Overshadowable<T>>
-
addChunk
Description copied from interface:PartitionHolderContentsAdds a chunk.- Specified by:
addChunkin interfacePartitionHolderContents<T extends Overshadowable<T>>- Returns:
- true if no chunk previously existed with these partition boundaries
-
removeChunk
Description copied from interface:PartitionHolderContentsRemoves and returns a chunk with the same partition boundaries as the provided chunk. Returns null if no such chunk exists.- Specified by:
removeChunkin interfacePartitionHolderContents<T extends Overshadowable<T>>
-
isEmpty
public boolean isEmpty()Description copied from interface:PartitionHolderContentsWhether this holder is empty.- Specified by:
isEmptyin interfacePartitionHolderContents<T extends Overshadowable<T>>
-
areVisibleChunksConsistent
public boolean areVisibleChunksConsistent()Description copied from interface:PartitionHolderContentsWhether 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.- Specified by:
areVisibleChunksConsistentin interfacePartitionHolderContents<T extends Overshadowable<T>>
-
getChunk
Description copied from interface:PartitionHolderContentsReturns the chunk with a given partition ID, or null if none exists.- Specified by:
getChunkin interfacePartitionHolderContents<T extends Overshadowable<T>>
-
visibleChunksIterator
Description copied from interface:PartitionHolderContentsIterates through all visible chunks. When segment locking is not being used, all chunks are visible, so this returns all chunks.- Specified by:
visibleChunksIteratorin interfacePartitionHolderContents<T extends Overshadowable<T>>
-
getOvershadowedChunks
Description copied from interface:PartitionHolderContentsReturns chunks that are tracked but not visible. When segment locking is not being used, all chunks are visible, so this returns nothing.- Specified by:
getOvershadowedChunksin interfacePartitionHolderContents<T extends Overshadowable<T>>
-
equals
-
hashCode
public int hashCode() -
toString
-