Class PartitionHolder<T extends Overshadowable<T>>
java.lang.Object
org.apache.druid.timeline.partition.PartitionHolder<T>
- All Implemented Interfaces:
Iterable<PartitionChunk<T>>
public class PartitionHolder<T extends Overshadowable<T>>
extends Object
implements Iterable<PartitionChunk<T>>
An object that clumps together multiple other objects which each represent a shard of some space.
-
Constructor Summary
ConstructorsConstructorDescriptionPartitionHolder(List<PartitionChunk<T>> initialChunks) PartitionHolder(PartitionChunk<T> initialChunk) PartitionHolder(PartitionHolderContents<T> contents, short maxMinorVersion) Constructor for situations where the caller already has aPartitionHolderContents. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(PartitionChunk<T> chunk) static <T extends Overshadowable<T>>
PartitionHolder<T>copyWithOnlyVisibleChunks(PartitionHolder<T> partitionHolder) static <T extends Overshadowable<T>>
PartitionHolder<T>deepCopy(PartitionHolder<T> partitionHolder) booleangetChunk(int partitionNum) shortReturns the maximum minor version across all the added segments.booleanhasData()inthashCode()booleanbooleanisEmpty()iterator()payloads()remove(PartitionChunk<T> chunk) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PartitionHolder
-
PartitionHolder
-
PartitionHolder
Constructor for situations where the caller already has aPartitionHolderContents. Generally used for copying. Also used for tests.
-
-
Method Details
-
copyWithOnlyVisibleChunks
public static <T extends Overshadowable<T>> PartitionHolder<T> copyWithOnlyVisibleChunks(PartitionHolder<T> partitionHolder) -
deepCopy
public static <T extends Overshadowable<T>> PartitionHolder<T> deepCopy(PartitionHolder<T> partitionHolder) -
add
-
getMaxMinorVersion
public short getMaxMinorVersion()Returns the maximum minor version across all the added segments. We do not handle updates of this variable when segments are removed for the sake of simplicity. -
remove
-
isEmpty
public boolean isEmpty() -
isComplete
public boolean isComplete() -
getChunk
-
iterator
- Specified by:
iteratorin interfaceIterable<T extends Overshadowable<T>>
-
getOvershadowed
-
payloads
-
equals
-
hashCode
public int hashCode() -
toString
-
hasData
public boolean hasData()
-