kfaraz commented on code in PR #17775:
URL: https://github.com/apache/druid/pull/17775#discussion_r2010348516


##########
server/src/main/java/org/apache/druid/server/coordinator/config/HttpLoadQueuePeonConfig.java:
##########
@@ -35,21 +38,28 @@ public class HttpLoadQueuePeonConfig
   private final Duration repeatDelay;
 
   @JsonProperty
-  private final int batchSize;
+  @Nullable
+  private final Integer batchSize;
 
   @JsonCreator
   public HttpLoadQueuePeonConfig(
       @JsonProperty("hostTimeout") Duration hostTimeout,
       @JsonProperty("repeatDelay") Duration repeatDelay,
-      @JsonProperty("batchSize") Integer batchSize
+      @JsonProperty("batchSize") @Nullable Integer batchSize
   )
   {
     this.hostTimeout = Configs.valueOrDefault(hostTimeout, 
Duration.standardMinutes(5));
     this.repeatDelay = Configs.valueOrDefault(repeatDelay, 
Duration.standardMinutes(1));
-    this.batchSize = Configs.valueOrDefault(batchSize, 1);
+
+    if (batchSize != null && batchSize < 1) {
+      throw new RE("Batch size must be greater than 0.");

Review Comment:
   Note for follow-up:
   This can be an `InvalidInput.exception` instead.



##########
server/src/main/java/org/apache/druid/server/http/SegmentLoadingCapabilities.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.druid.server.http;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Contains information related to the capability of a server to load 
segments, for example the number of threads
+ * available.
+ */
+public class SegmentLoadingCapabilities
+{
+  private final int numLoadingThreads;
+  private final int numTurboLoadingThreads;
+
+  @JsonCreator
+  public SegmentLoadingCapabilities(
+      @JsonProperty("numLoadingThreads") int numLoadingThreads,
+      @JsonProperty("numTurboLoadingThreads") int numTurboLoadingThreads
+  )
+  {
+    this.numLoadingThreads = numLoadingThreads;
+    this.numTurboLoadingThreads = numTurboLoadingThreads;
+  }
+
+  @JsonProperty("numLoadingThreads")

Review Comment:
   Note for follow-up:
   Property names are not needed in this annotation since they are the same as 
the field name.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to