This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 81eff2bc51 Fixed ScanIteratorIT test for iterator priorities (#6245)
81eff2bc51 is described below
commit 81eff2bc51e8650aa3b24005d313f2142fd8f12c
Author: Dave Marion <[email protected]>
AuthorDate: Wed Mar 25 13:34:52 2026 -0400
Fixed ScanIteratorIT test for iterator priorities (#6245)
Iterators with the same priority are handled in 2.1.x by
ordering them by priority and then name. In the main branch an
exception is thrown when iterators with the same priority
are set. This commit removes residual comments from the
changes in the 2.1 branch and fixes an IT test to use
different priorities when testing iterator order.
---
.../accumulo/core/iteratorsImpl/IteratorConfigUtil.java | 2 --
.../org/apache/accumulo/test/functional/ScanIteratorIT.java | 12 ++++++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/iteratorsImpl/IteratorConfigUtil.java
b/core/src/main/java/org/apache/accumulo/core/iteratorsImpl/IteratorConfigUtil.java
index 8ed40831dc..4e9f8576cf 100644
---
a/core/src/main/java/org/apache/accumulo/core/iteratorsImpl/IteratorConfigUtil.java
+++
b/core/src/main/java/org/apache/accumulo/core/iteratorsImpl/IteratorConfigUtil.java
@@ -297,8 +297,6 @@ public class IteratorConfigUtil {
public static void checkIteratorConflicts(String logContext, IteratorSetting
iterToCheck,
EnumSet<IteratorScope> iterScopesToCheck,
Map<IteratorScope,List<IteratorSetting>> existingIters) throws
AccumuloException {
- // The reason for the 'shouldThrow' var is to prevent newly added 2.x
checks from breaking
- // existing user code. Just log the problem and proceed. Major version > 2
will always throw
for (var scope : iterScopesToCheck) {
var existingItersForScope = existingIters.get(scope);
if (existingItersForScope == null) {
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/ScanIteratorIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/ScanIteratorIT.java
index 38912fc9c3..a27507174d 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ScanIteratorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ScanIteratorIT.java
@@ -19,6 +19,7 @@
package org.apache.accumulo.test.functional;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.IOException;
import java.time.Duration;
@@ -299,6 +300,7 @@ public class ScanIteratorIT extends AccumuloClusterHarness {
writer.addMutation(m);
}
+ // Ensures duplicate scan iterator priorities fail
try (var scanner = c.createScanner(tableName)) {
assertEquals("base:xa",
scanner.iterator().next().getValue().toString());
scanner.addScanIterator(AppendingIterator.configure(70, "m"));
@@ -307,6 +309,16 @@ public class ScanIteratorIT extends AccumuloClusterHarness
{
// their name in that case
scanner.addScanIterator(AppendingIterator.configure(50, "b"));
scanner.addScanIterator(AppendingIterator.configure(100, "c"));
+ assertThrows(IllegalStateException.class,
+ () -> scanner.iterator().next().getValue().toString());
+ }
+
+ try (var scanner = c.createScanner(tableName)) {
+ assertEquals("base:xa",
scanner.iterator().next().getValue().toString());
+ scanner.addScanIterator(AppendingIterator.configure(70, "m"));
+ assertEquals("base:xma",
scanner.iterator().next().getValue().toString());
+ scanner.addScanIterator(AppendingIterator.configure(49, "b"));
+ scanner.addScanIterator(AppendingIterator.configure(101, "c"));
assertEquals("base:bxmac",
scanner.iterator().next().getValue().toString());
// There are no compaction iterators, so this should not change value
c.tableOperations().compact(tableName, new
CompactionConfig().setWait(true));