tkalkirill commented on code in PR #1325:
URL: https://github.com/apache/ignite-3/pull/1325#discussion_r1031369130
##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/hash/PageMemoryHashIndexStorage.java:
##########
@@ -123,11 +188,34 @@ public void remove(IndexRow row) throws StorageException {
remove.afterCompletion();
} catch (IgniteInternalCheckedException e) {
throw new StorageException("Failed to remove value from index", e);
+ } finally {
+ closeBusyLock.leaveBusy();
}
}
@Override
public void destroy() throws StorageException {
- //TODO IGNITE-17626 Implement.
+ // TODO: IGNITE-17626 Remove it
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Closes the hash index storage.
+ */
+ public void close() {
+ if (!STARTED.compareAndSet(this, true, false)) {
Review Comment:
Change name
##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/PageMemorySortedIndexStorage.java:
##########
@@ -120,22 +188,63 @@ public void remove(IndexRow row) {
remove.afterCompletion();
} catch (IgniteInternalCheckedException e) {
throw new StorageException("Failed to remove value from index", e);
+ } finally {
+ closeBusyLock.leaveBusy();
}
}
@Override
public Cursor<IndexRow> scan(@Nullable BinaryTuplePrefix lowerBound,
@Nullable BinaryTuplePrefix upperBound, int flags) {
- boolean includeLower = (flags & GREATER_OR_EQUAL) != 0;
- boolean includeUpper = (flags & LESS_OR_EQUAL) != 0;
-
- SortedIndexRowKey lower = createBound(lowerBound, !includeLower);
-
- SortedIndexRowKey upper = createBound(upperBound, includeUpper);
+ if (!closeBusyLock.enterBusy()) {
+ throwStorageClosedException();
+ }
try {
- return map(sortedIndexTree.find(lower, upper),
this::toIndexRowImpl);
+ boolean includeLower = (flags & GREATER_OR_EQUAL) != 0;
+ boolean includeUpper = (flags & LESS_OR_EQUAL) != 0;
+
+ SortedIndexRowKey lower = createBound(lowerBound, !includeLower);
+
+ SortedIndexRowKey upper = createBound(upperBound, includeUpper);
+
+ Cursor<SortedIndexRow> cursor = sortedIndexTree.find(lower, upper);
+
+ return new Cursor<>() {
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]