ChenSammi commented on code in PR #7104:
URL: https://github.com/apache/ozone/pull/7104#discussion_r1743332137
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java:
##########
@@ -74,27 +76,31 @@ public class QuotaRepairTask {
private static final int TASK_THREAD_CNT = 3;
private static final AtomicBoolean IN_PROGRESS = new AtomicBoolean(false);
private static final RepairStatus REPAIR_STATUS = new RepairStatus();
+ private static final AtomicLong RUN_CNT = new AtomicLong(0);
private final OzoneManager om;
- private final AtomicLong runCount = new AtomicLong(0);
private ExecutorService executor;
public QuotaRepairTask(OzoneManager ozoneManager) {
this.om = ozoneManager;
}
- public CompletableFuture<Boolean> repair() throws Exception {
+ public CompletableFuture<Boolean> repair() throws IOException {
+ return repair(Collections.emptyList());
+ }
+
+ public CompletableFuture<Boolean> repair(List<String> buckets) throws
IOException {
// lock in progress operation and reject any other
if (!IN_PROGRESS.compareAndSet(false, true)) {
LOG.info("quota repair task already running");
- return CompletableFuture.supplyAsync(() -> false);
+ throw new OMException("Operation in progress",
OMException.ResultCodes.QUOTA_ERROR);
Review Comment:
Can you change the exception message something like "There is a quota repair
task already running. Please try it later"
--
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]