Interface PartialShardSpec
-
- All Known Implementing Classes:
HashBasedNumberedPartialShardSpec
,LinearPartialShardSpec
,NumberedOverwritePartialShardSpec
,NumberedPartialShardSpec
,SingleDimensionPartialShardSpec
public interface PartialShardSpec
This interface is used in the segment allocation protocol when it is coordinated by the Overlord; when appending segments to an existing datasource (either streaming ingestion or batch append) or any case when segment lock is used. The implementations of this interface contain all information of the correspondingShardSpec
except the partition ID. The ingestion tasks send all information required for allocating a new segment using this interface and the Overlord determines the partition ID to create a new segment.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ShardSpec
complete(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int partitionId, int numCorePartitions)
Creates a new ShardSpec with given partitionId and numCorePartitions.Class<? extends ShardSpec>
getShardSpecClass()
Returns the class of the shardSpec created by this factory.default boolean
useNonRootGenerationPartitionSpace()
Returns true if this partialShardSpec needs a partitionId of a non-root generation.
-
-
-
Method Detail
-
complete
ShardSpec complete(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int partitionId, int numCorePartitions)
Creates a new ShardSpec with given partitionId and numCorePartitions.- Parameters:
objectMapper
- jsonMapper used only forHashBasedNumberedShardSpec
partitionId
- partitionId of the shardSpec. must be carefully chosen to be unique in a time chunknumCorePartitions
- the core partition set size. Should be set properly to determine if this segment belongs to the core partitions.
-
getShardSpecClass
Class<? extends ShardSpec> getShardSpecClass()
Returns the class of the shardSpec created by this factory.
-
useNonRootGenerationPartitionSpace
default boolean useNonRootGenerationPartitionSpace()
Returns true if this partialShardSpec needs a partitionId of a non-root generation. Any partialShardSpec to overwrite a subset of segments in a time chunk such asNumberedOverwritePartialShardSpec
should return true.- See Also:
PartitionIds
-
-