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


##########
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/util/StorageUtils.java:
##########
@@ -36,6 +36,49 @@ public static String 
createMissingMvPartitionErrorMessage(int partitionId) {
         return "Partition ID " + partitionId + " does not exist";
     }
 
+    /**
+     * Throws an exception if the state of the storage is not {@link 
StorageState#RUNNABLE}.
+     *
+     * @param state Storage state.
+     * @param storageInfoSupplier Storage information supplier, for example in 
the format "table=user, partitionId=1".
+     * @throws StorageClosedException If the storage is closed.
+     * @throws StorageRebalanceException If storage is in the process of 
rebalancing.
+     * @throws StorageException For other {@link StorageState}.
+     */
+    public static void throwExceptionIfStorageNotInRunnableState(StorageState 
state, Supplier<String> storageInfoSupplier) {
+        if (state != StorageState.RUNNABLE) {
+            throwExceptionDependingOnStorageState(state, 
storageInfoSupplier.get());
+        }
+    }
+
+    /**
+     * Throws an exception if the state of the storage is not {@link 
StorageState#RUNNABLE} OR {@link StorageState#REBALANCE}.
+     *
+     * @param state Storage state.
+     * @param storageInfoSupplier Storage information supplier, for example in 
the format "table=user, partitionId=1".
+     * @throws StorageClosedException If the storage is closed.
+     * @throws StorageException For other {@link StorageState}.
+     */
+    public static void 
throwExceptionIfStorageNotInRunnableOrRebalancedState(StorageState state, 
Supplier<String> storageInfoSupplier) {

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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to