Copilot commented on code in PR #17579:
URL: https://github.com/apache/pinot/pull/17579#discussion_r2739482742
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java:
##########
@@ -403,6 +411,26 @@ private SuccessResponse uploadSegment(@Nullable String
tableName, TableType tabl
SegmentValidationUtils.checkStorageQuota(segmentName,
segmentSizeInBytes, untarredSegmentSizeInBytes, tableConfig,
_storageQuotaChecker);
+ // Perform resource utilization checks
+ UtilizationChecker.CheckResult isDiskUtilizationWithinLimits =
+
_diskUtilizationChecker.isResourceUtilizationWithinLimits(tableNameWithType,
+ UtilizationChecker.CheckPurpose.OFFLINE_SEGMENT_UPLOAD);
+ if (isDiskUtilizationWithinLimits ==
UtilizationChecker.CheckResult.FAIL) {
+ _controllerMetrics.setOrUpdateTableGauge(tableNameWithType,
ControllerGauge.RESOURCE_UTILIZATION_LIMIT_EXCEEDED,
+ 1L);
+ throw new ControllerApplicationException(LOGGER,
+ String.format("Disk utilization limit exceeded for table: %s,
rejecting upload for segment: %s",
+ tableNameWithType,
+ segmentName),
+ Response.Status.FORBIDDEN);
+ } else if (isDiskUtilizationWithinLimits ==
UtilizationChecker.CheckResult.UNDETERMINED) {
+ LOGGER.warn(
+ "Disk utilization status could not be determined for for table:
{}. Will allow segment upload to proceed.",
Review Comment:
Duplicate word 'for' in log message. Should be 'determined for table'.
```suggestion
"Disk utilization status could not be determined for table: {}.
Will allow segment upload to proceed.",
```
--
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]