Rollback test to iterate entries major for sbtree v1 is implemented.
@@ -392,13 +392,33 @@ public class SBTreeV1TestIT {
@Test
public void testIterateEntriesMajor() throws Exception {
NavigableMap<Integer, ORID> keyValues = new TreeMap<>();
- Random random = new Random();
+ final long seed = System.nanoTime();
+
+ System.out.println("testIterateEntriesMajor: " + seed);
+ final Random random = new Random(seed);
+
+ final int rollbackInterval = 100;
+ final OAtomicOperationsManager atomicOperationsManager = storage.getAtomicOperationsManager();
+
+ int printCounter = 0;
while (keyValues.size() < keysCount) {
- int key = random.nextInt(Integer.MAX_VALUE);
+ for (int n = 0; n < 2; n++) {
+ atomicOperationsManager.startAtomicOperation((String) null, false);
+ for (int j = 0; j < rollbackInterval; j++) {
+ int val = random.nextInt(Integer.MAX_VALUE);
+ sbTree.put(val, new ORecordId(val % 32000, val));
+ if (n == 1) {
+ keyValues.put(val, new ORecordId(val % 32000, val));
+ }
+ }
+ atomicOperationsManager.endAtomicOperation(n == 0);
+ }
- sbTree.put(key, new ORecordId(key % 32000, key));
- keyValues.put(key, new ORecordId(key % 32000, key));
+ if (keyValues.size() > printCounter * 100_000) {
+ System.out.println(keyValues.size() + " entries were added.");
+ printCounter++;
+ }
}
assertIterateMajorEntries(keyValues, random, true, true);
