tkalkirill commented on code in PR #1471:
URL: https://github.com/apache/ignite-3/pull/1471#discussion_r1057187847
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/index/impl/TestSortedIndexStorage.java:
##########
@@ -315,4 +314,51 @@ private RowId getRowId(@Nullable Entry<RowId, ?>
rowIdEntry) {
return rowIdEntry == null ? null : rowIdEntry.getKey();
}
}
+
+ private void checkStorageClosed() {
+ if (closed) {
+ throw new StorageClosedException("Storage is already closed");
+ }
+ }
+
+ private void checkStorageClosedOrInProcessOfRebalance() {
+ checkStorageClosed();
+
+ if (fullRebalance) {
+ throw new StorageFullRebalanceException("Storage in the process of
a full rebalancing");
+ }
+ }
+
+ /**
+ * Starts a full rebalancing for the storage.
+ */
+ public void startFullRebalance() {
+ checkStorageClosed();
+
+ fullRebalance = true;
+
+ clear();
+ }
+
+ /**
+ * Aborts a full rebalance of the storage.
+ */
+ public void abortFullRebalance() {
+ checkStorageClosed();
+
+ fullRebalance = false;
+
+ clear();
+ }
+
+ /**
+ * Completes a full rebalance of the storage.
+ */
+ public void finishFullRebalance() {
+ checkStorageClosed();
+
+ assert fullRebalance;
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]