jihoonson commented on a change in pull request #8141: Use PartitionsSpec for 
all task types
URL: https://github.com/apache/incubator-druid/pull/8141#discussion_r307897135
 
 

 ##########
 File path: 
indexing-hadoop/src/main/java/org/apache/druid/indexer/partitions/HashedPartitionsSpec.java
 ##########
 @@ -20,45 +20,103 @@
 package org.apache.druid.indexer.partitions;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.collect.ImmutableList;
-import org.apache.druid.indexer.DetermineHashedPartitionsJob;
-import org.apache.druid.indexer.HadoopDruidIndexerConfig;
-import org.apache.druid.indexer.Jobby;
+import com.google.common.base.Preconditions;
+import org.apache.druid.java.util.common.logger.Logger;
 
 import javax.annotation.Nullable;
+import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 
-public class HashedPartitionsSpec extends AbstractPartitionsSpec
+public class HashedPartitionsSpec implements DimensionBasedPartitionsSpec
 {
-  private static final List<String> DEFAULT_PARTITION_DIMENSIONS = 
ImmutableList.of();
+  private static final Logger LOG = new Logger(HashedPartitionsSpec.class);
 
-  public static HashedPartitionsSpec makeDefaultHashedPartitionsSpec()
-  {
-    return new HashedPartitionsSpec(null, null, null, null, null);
-  }
-
-  @JsonIgnore
+  @Nullable
+  private final Integer maxRowsPerSegment;
+  @Nullable
+  private final Integer numShards;
   private final List<String> partitionDimensions;
 
   @JsonCreator
   public HashedPartitionsSpec(
-      @JsonProperty("targetPartitionSize") @Nullable Long targetPartitionSize,
-      @JsonProperty("maxPartitionSize") @Nullable Long maxPartitionSize,
-      @JsonProperty("assumeGrouped") @Nullable Boolean assumeGrouped,
+      @JsonProperty("maxRowsPerSegment") @Nullable Integer maxRowsPerSegment,
       @JsonProperty("numShards") @Nullable Integer numShards,
       @JsonProperty("partitionDimensions") @Nullable List<String> 
partitionDimensions
   )
   {
-    super(targetPartitionSize, maxPartitionSize, assumeGrouped, numShards);
-    this.partitionDimensions = partitionDimensions == null ? 
DEFAULT_PARTITION_DIMENSIONS : partitionDimensions;
+    Preconditions.checkArgument(
+        PartitionsSpec.isEffectivelyNull(maxRowsPerSegment) || 
PartitionsSpec.isEffectivelyNull(numShards),
+        "Can't use maxRowsPerSegment and numShards together"
+    );
+    // Needs to determin partitions if the _given_ numShards is null
 
 Review comment:
   Thanks, fixed.

----------------------------------------------------------------
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]

Reply via email to