Copilot commented on code in PR #17512:
URL: https://github.com/apache/pinot/pull/17512#discussion_r2693484906
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java:
##########
@@ -627,8 +627,12 @@ private SuccessResponse uploadSegments(String tableName,
TableType tableType, Fo
SegmentValidationUtils.validateTimeInterval(segmentMetadata,
tableConfig);
}
// TODO: Include the un-tarred segment size when using the METADATA
push rest API. Currently we can only use the
- // tarred segment size as an approximation. Additionally, add the
storage quota check for batch upload mode.
+ // tarred segment size as an approximation.
long segmentSizeInBytes = getSegmentSizeFromFile(sourceDownloadURIStr);
+ // Adding Storage Quota Check
+ long untarredSegmentSizeInBytes = segmentSizeInBytes;
+ SegmentValidationUtils.checkStorageQuota(segmentName,
segmentSizeInBytes, untarredSegmentSizeInBytes,
Review Comment:
The variable `untarredSegmentSizeInBytes` is assigned the same value as
`segmentSizeInBytes`, making it redundant. Since the TODO comment on line 630
states that the tarred segment size is being used as an approximation, consider
passing `segmentSizeInBytes` directly for both parameters to
`checkStorageQuota()` without the intermediate variable assignment.
```suggestion
SegmentValidationUtils.checkStorageQuota(segmentName,
segmentSizeInBytes, segmentSizeInBytes,
```
--
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]