ccaominh commented on a change in pull request #9274: Refactoring some codes
around ingestion
URL: https://github.com/apache/druid/pull/9274#discussion_r373793664
##########
File path:
core/src/main/java/org/apache/druid/timeline/partition/PartialShardSpec.java
##########
@@ -20,34 +20,37 @@
package org.apache.druid.timeline.partition;
import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.ObjectMapper;
import javax.annotation.Nullable;
/**
- * Factory to be used to allocate segments remotely in the overlord.
+ * Class to contain all information of a {@link ShardSpec} except for the
partition ID.
+ * This class is mainly used by the indexing tasks to allocate new segments
using the Overlord.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({
- @JsonSubTypes.Type(name = "numbered", value =
NumberedShardSpecFactory.class),
- @JsonSubTypes.Type(name = "hashed", value =
HashBasedNumberedShardSpecFactory.class),
- @JsonSubTypes.Type(name = "numbered_overwrite", value =
NumberedOverwritingShardSpecFactory.class),
+ @Type(name = "numbered", value = NumberedPartialShardSpec.class),
+ @Type(name = "hashed", value = HashBasedNumberedPartialShardSpec.class),
+ @Type(name = "single_dim", value = SingleDimensionPartialShardSpec.class),
+ @Type(name = "numbered_overwrite", value =
NumberedOverwritePartialShardSpec.class),
})
-public interface ShardSpecFactory
+public interface PartialShardSpec
{
/**
* Create a new shardSpec based on {@code specOfPreviousMaxPartitionId}. If
it's null, it assumes that this is the
* first call for the timeChunk where the new segment is created.
* Note that {@code specOfPreviousMaxPartitionId} can also be null for
{@link OverwriteShardSpec} if all segments
* in the timeChunk are first-generation segments.
*/
- ShardSpec create(ObjectMapper objectMapper, @Nullable ShardSpec
specOfPreviousMaxPartitionId);
+ ShardSpec complete(ObjectMapper objectMapper, @Nullable ShardSpec
specOfPreviousMaxPartitionId);
Review comment:
Maybe revise the javadoc wording to match the method rename better (similar
comment for the method below)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]