Jackie-Jiang commented on code in PR #14811:
URL: https://github.com/apache/pinot/pull/14811#discussion_r1936533387


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -1848,15 +1860,130 @@ private boolean isTmpAndCanDelete(String filePath, 
Set<String> downloadUrls, Pin
    * @return the set of consuming segments for which commit was initiated
    */
   public Set<String> forceCommit(String tableNameWithType, @Nullable String 
partitionGroupIdsToCommit,
-      @Nullable String segmentsToCommit) {
+      @Nullable String segmentsToCommit, ForceCommitBatchConfig 
forceCommitBatchConfig) {
     IdealState idealState = getIdealState(tableNameWithType);
     Set<String> allConsumingSegments = findConsumingSegments(idealState);
     Set<String> targetConsumingSegments = 
filterSegmentsToCommit(allConsumingSegments, partitionGroupIdsToCommit,
         segmentsToCommit);
-    sendForceCommitMessageToServers(tableNameWithType, 
targetConsumingSegments);
+
+    List<Set<String>> segmentBatchList =
+        getSegmentBatchList(idealState, targetConsumingSegments, 
forceCommitBatchConfig.getBatchSize());

Review Comment:
   To reduce overhead, can we use the old way when batch size is non-positive?



##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java:
##########
@@ -169,19 +169,40 @@ public Map<String, String> forceCommit(
       @ApiParam(value = "Comma separated list of partition group IDs to be 
committed") @QueryParam("partitions")
       String partitionGroupIds,
       @ApiParam(value = "Comma separated list of consuming segments to be 
committed") @QueryParam("segments")
-      String consumingSegments, @Context HttpHeaders headers) {
+      String consumingSegments,
+      @ApiParam(value = "Max number of consuming segments to commit at once 
(default = Integer.MAX_VALUE)")
+      @QueryParam("batchSize")
+      Integer batchSize,

Review Comment:
   We can directly put default in the API:
   ```suggestion
         @ApiParam(value = "Max number of consuming segments to commit at once 
(default = Integer.MAX_VALUE)")
         @QueryParam("batchSize") 
@DefaultValue(Integer.toString(Integer.MAX_VALUE))
         int batchSize,
   ```



##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/ForceCommitBatchConfig.java:
##########
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.controller.api.resources;
+
+public class ForceCommitBatchConfig {
+
+  private static final int DEFAULT_BATCH_SIZE = Integer.MAX_VALUE;
+  private static final int DEFAULT_BATCH_STATUS_CHECK_INTERVAL_SEC = 5;
+  private static final int DEFAULT_BATCH_STATUS_CHECK_TIMEOUT_SEC = 180;
+
+  private final int _batchSize;
+  private final int _batchStatusCheckIntervalMs;
+  private final int _batchStatusCheckTimeoutMs;
+
+  private ForceCommitBatchConfig(Integer batchSize, Integer 
batchStatusCheckIntervalMs,

Review Comment:
   Add `@Nullabe` annotation for parameters that can be null. Same for other 
places



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

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to