Copilot commented on code in PR #15591:
URL: https://github.com/apache/pinot/pull/15591#discussion_r2050819216


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/metadata/ColumnMetadataImpl.java:
##########
@@ -164,10 +172,40 @@ public Set<Integer> getPartitions() {
     return _partitions;
   }
 
-  @Nullable
   @Override
-  public Map<IndexType<?, ?, ?>, Long> getIndexSizeMap() {
-    return _indexSizeMap;
+  public long getIndexSizeFor(IndexType type) {
+    short indexId = IndexService.getInstance().getNumericId(type);
+    for (int i = 0, n = getIndexTypeSizesCount(); i < n; i++) {
+      if (indexId == getIndexType(i)) {
+        return getIndexSize(i);
+      }
+    }
+
+    return INDEX_NOT_FOUND;
+  }
+
+  // size should be non-negative 48-bit value
+  public void addIndexSize(short indexType, long size) {
+    if (size < 0 || size > SIZE_MASK) {

Review Comment:
   Clamping negative or too-large index size values to 0 without logging could 
mask unexpected behavior. Consider logging a warning when a size is clamped to 
ease debugging.
   ```suggestion
       if (size < 0 || size > SIZE_MASK) {
         LOGGER.warn("Clamping invalid size value {} for indexType {} to 0. 
Valid range: [0, {}]", size, indexType, SIZE_MASK);
   ```



##########
pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java:
##########
@@ -443,7 +443,7 @@ protected void uploadSegments(String tableName, TableType 
tableType, List<File>
         }
       } else {
         // Upload all segments in parallel
-        ExecutorService executorService = 
Executors.newFixedThreadPool(numSegments);
+        ExecutorService executorService = 
Executors.newFixedThreadPool(Math.min(numSegments, 20));

Review Comment:
   [nitpick] Restricting the thread pool size to 20 may delay processing when 
handling a very large number of segments. Consider making this value 
configurable to better accommodate varying workloads.



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