Class SimplePartitionHolderContents<T extends Overshadowable<T>>
java.lang.Object
org.apache.druid.timeline.partition.SimplePartitionHolderContents<T>
- All Implemented Interfaces:
PartitionHolderContents<T>
public class SimplePartitionHolderContents<T extends Overshadowable<T>>
extends Object
implements PartitionHolderContents<T>
Contents for
PartitionHolder when segment locking was not used, and therefore no chunks have
Overshadowable.getMinorVersion().-
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.booleangetChunk(int partitionNum) 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> chunk) Removes and returns a chunk with the same partition boundaries as the provided chunk.toString()Iterates through all visible chunks.
-
Constructor Details
-
SimplePartitionHolderContents
public SimplePartitionHolderContents()
-
-
Method Details
-
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>>
-
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>>
-
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>>
-
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>>
-
equals
-
hashCode
public int hashCode() -
toString
-