You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "tkalkirill (via GitHub)" <gi...@apache.org> on 2023/06/07 07:46:11 UTC

[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #2155: IGNITE-19648 Failed to cancel rebalance

tkalkirill commented on code in PR #2155:
URL: https://github.com/apache/ignite-3/pull/2155#discussion_r1221075045


##########
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/util/StorageOperation.java:
##########
@@ -109,6 +109,34 @@ String inProcessErrorMessage(String storageInfo) {
      * Storage rebalancing start operation.
      */
     static class StartRebalanceStorageOperation extends StorageOperation {
+        private final AtomicReference<AbortRebalanceStorageOperation> abortRebalanceOperation = new AtomicReference<>();
+
+        private final CompletableFuture<Void> startRebalanceFuture = new CompletableFuture<>();
+
+        /**
+         * Attempts to set the abort rebalance operation.
+         *
+         * @param abortRebalanceOperation Abort rebalance operation.
+         * @return {@code True} if the operation was set by current method invocation, {@code false} if by another method invocation.
+         */
+        boolean setAbortOperation(AbortRebalanceStorageOperation abortRebalanceOperation) {
+            return this.abortRebalanceOperation.compareAndSet(null, abortRebalanceOperation);
+        }
+
+        /**
+         * Returns {@link #setAbortOperation(AbortRebalanceStorageOperation) set} a abort rebalance operation.

Review Comment:
   fix it



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org