Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignite stored procedures #335

Merged
merged 1 commit into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public String apply(List<BinaryObject> inodes) {
BinaryObjectBuilder inodeKeyBuilder = ignite.binary().builder("InodeKey");

Transaction tx = ignite.transactions().txStart(
TransactionConcurrency.OPTIMISTIC, TransactionIsolation.SERIALIZABLE);
TransactionConcurrency.PESSIMISTIC, TransactionIsolation.SERIALIZABLE);

IgniteCache<BinaryObject, BinaryObject> inodesBinary = ignite.cache("inodes").withKeepBinary();
for (int i = 0; i < inodes.size(); ++i) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.apache.hadoop.hdfs.db.ignite;

import java.util.List;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.Map;
import javax.cache.Cache;
Expand Down Expand Up @@ -31,7 +31,7 @@ public String apply(RenamePayload payload) {
IgniteCache<BinaryObject, BinaryObject> inodesBinary = ignite.cache("inodes").withKeepBinary();

Transaction tx = ignite.transactions().txStart(
TransactionConcurrency.OPTIMISTIC, TransactionIsolation.SERIALIZABLE);
TransactionConcurrency.PESSIMISTIC, TransactionIsolation.SERIALIZABLE);

// 1. query subtree inodes
List<Cache.Entry<BinaryObject, BinaryObject>> result;
Expand All @@ -46,8 +46,8 @@ public boolean apply(BinaryObject binaryKey, BinaryObject binaryObject) {
result = inodesBinary.query(scanAddress).getAll();

// 2. update subtree inodes
Set<BinaryObject> keys = new TreeSet<>();
Map<BinaryObject, BinaryObject> map = new TreeMap<>();
Set<BinaryObject> keys = new HashSet<>();
Map<BinaryObject, BinaryObject> map = new HashMap<>();
BinaryObjectBuilder inodeKeyBuilder = ignite.binary().builder("InodeKey");
for (Cache.Entry<BinaryObject, BinaryObject> entry : result) {
BinaryObject inodeValue = entry.getValue();
Expand Down