QiuMM commented on a change in pull request #6780: Add support 
maxRowsPerSegment for auto compaction
URL: https://github.com/apache/incubator-druid/pull/6780#discussion_r245498668
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/client/indexing/ClientCompactQueryTuningConfig.java
 ##########
 @@ -35,26 +36,45 @@
   private static final int DEFAULT_MAX_PENDING_PERSISTS = 0;
   private static final long DEFAULT_PUBLISH_TIMEOUT = 0;
 
+  @Nullable
+  private final Integer maxRowsPerSegment;
   private final int maxRowsInMemory;
   private final int maxTotalRows;
   private final IndexSpec indexSpec;
   private final int maxPendingPersists;
-  private final long publishTimeout;
+  private final long pushTimeout;
+
+  public static ClientCompactQueryTuningConfig from(
+      @Nullable UserCompactTuningConfig userCompactTuningConfig,
+      @Nullable Integer maxRowsPerSegment
+  )
+  {
+    return new ClientCompactQueryTuningConfig(
+        maxRowsPerSegment,
+        userCompactTuningConfig == null ? null : 
userCompactTuningConfig.getMaxRowsInMemory(),
+        userCompactTuningConfig == null ? null : 
userCompactTuningConfig.getMaxTotalRows(),
+        userCompactTuningConfig == null ? null : 
userCompactTuningConfig.getIndexSpec(),
+        userCompactTuningConfig == null ? null : 
userCompactTuningConfig.getMaxPendingPersists(),
+        userCompactTuningConfig == null ? null : 
userCompactTuningConfig.getPushTimeout()
+    );
+  }
 
   @JsonCreator
   public ClientCompactQueryTuningConfig(
+      @JsonProperty("maxRowsPerSegment") @Nullable Integer maxRowsPerSegment,
       @JsonProperty("maxRowsInMemory") @Nullable Integer maxRowsInMemory,
       @JsonProperty("maxTotalRows") @Nullable Integer maxTotalRows,
       @JsonProperty("indexSpec") @Nullable IndexSpec indexSpec,
       @JsonProperty("maxPendingPersists") @Nullable Integer maxPendingPersists,
-      @JsonProperty("publishTimeout") @Nullable Long publishTimeout
+      @JsonProperty("pushTimeout") @Nullable Long pushTimeout
   )
   {
+    this.maxRowsPerSegment = maxRowsPerSegment;
     this.maxRowsInMemory = maxRowsInMemory == null ? 
DEFAULT_MAX_ROWS_IN_MEMORY : maxRowsInMemory;
     this.maxTotalRows = maxTotalRows == null ? DEFAULT_MAX_TOTAL_ROWS : 
maxTotalRows;
     this.indexSpec = indexSpec == null ? DEFAULT_INDEX_SPEC : indexSpec;
     this.maxPendingPersists = maxPendingPersists == null ? 
DEFAULT_MAX_PENDING_PERSISTS : maxPendingPersists;
-    this.publishTimeout = publishTimeout == null ? DEFAULT_PUBLISH_TIMEOUT : 
publishTimeout;
+    this.pushTimeout = pushTimeout == null ? DEFAULT_PUBLISH_TIMEOUT : 
pushTimeout;
 
 Review comment:
   Maybe change `DEFAULT_PUBLISH_TIMEOUT` to `DEFAULT_PUSH_TIMEOUT`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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