diff --git a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java new file mode 100644 index 0000000000..154324e399 --- /dev/null +++ b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java @@ -0,0 +1,17 @@ +package datawave.iterators; + +/** + * This code was repurposed from org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException. It was not part of the public API, so we've + * created a DataWave equivalent. This exception should be used in place of {@link org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException} + * when thrown from an iterator. + */ +public class IterationInterruptException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public IterationInterruptException() {} + + public IterationInterruptException(String msg) { + super(msg); + } +} diff --git a/warehouse/ingest-core/src/test/java/datawave/iterators/SortedMultiMapIterator.java b/warehouse/ingest-core/src/test/java/datawave/iterators/SortedMultiMapIterator.java index 322717db83..560324eaf1 100644 --- a/warehouse/ingest-core/src/test/java/datawave/iterators/SortedMultiMapIterator.java +++ b/warehouse/ingest-core/src/test/java/datawave/iterators/SortedMultiMapIterator.java @@ -14,7 +14,6 @@ import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; import org.apache.accumulo.core.iteratorsImpl.system.InterruptibleIterator; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import com.google.common.collect.TreeMultimap; @@ -70,7 +69,7 @@ public void next() throws IOException { throw new IllegalStateException(); if (interruptFlag != null && interruptCheckCount++ % 100 == 0 && interruptFlag.get()) - throw new IterationInterruptedException(); + throw new IterationInterruptException(); if (iter.hasNext()) { entry = iter.next(); @@ -86,7 +85,7 @@ public void next() throws IOException { public void seek(Range range, Collection columnFamilies, boolean inclusive) throws IOException { if (interruptFlag != null && interruptFlag.get()) - throw new IterationInterruptedException(); + throw new IterationInterruptException(); this.range = range; diff --git a/warehouse/query-core/src/main/java/datawave/core/iterators/FieldIndexCountingIteratorPerVisibility.java b/warehouse/query-core/src/main/java/datawave/core/iterators/FieldIndexCountingIteratorPerVisibility.java index f1994e2562..68bb497811 100644 --- a/warehouse/query-core/src/main/java/datawave/core/iterators/FieldIndexCountingIteratorPerVisibility.java +++ b/warehouse/query-core/src/main/java/datawave/core/iterators/FieldIndexCountingIteratorPerVisibility.java @@ -287,7 +287,7 @@ public void seek(Range r, Collection columnFamilies, boolean inclu Key pStartKey = parentRange.getStartKey(); - // Check if we are recovering from IterationInterruptedException + // Check if we are recovering from IterationInterruptException if (null != pStartKey && null != pStartKey.getRow() && null != pStartKey.getColumnFamily() && !pStartKey.getColumnFamily().toString().isEmpty() && null != pStartKey.getColumnQualifier() && !pStartKey.getColumnQualifier().toString().isEmpty() && !parentRange.isStartKeyInclusive()) { diff --git a/warehouse/query-core/src/main/java/datawave/query/function/AbstractVersionFilter.java b/warehouse/query-core/src/main/java/datawave/query/function/AbstractVersionFilter.java index 2903dbad09..9b15ae9924 100644 --- a/warehouse/query-core/src/main/java/datawave/query/function/AbstractVersionFilter.java +++ b/warehouse/query-core/src/main/java/datawave/query/function/AbstractVersionFilter.java @@ -19,7 +19,6 @@ import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.WritableComparator; @@ -30,6 +29,7 @@ import datawave.data.hash.UID; import datawave.data.type.NumberType; import datawave.data.type.util.NumericalEncoder; +import datawave.iterators.IterationInterruptException; import datawave.query.attributes.Attribute; import datawave.query.attributes.Document; import datawave.query.iterator.SourcedOptions; @@ -693,7 +693,7 @@ private boolean validate(final Text row, final String dataType, final String uid isValid = validate(range); } } - } catch (final IterationInterruptedException e) { + } catch (final IterationInterruptException e) { // Re-throw iteration interrupted as-is since this is an expected event from // a client going away. Re-throwing as-is will let the // tserver catch and ignore it as intended. diff --git a/warehouse/query-core/src/main/java/datawave/query/function/DescendantCountFunction.java b/warehouse/query-core/src/main/java/datawave/query/function/DescendantCountFunction.java index 1aa09e1753..1b542935c8 100644 --- a/warehouse/query-core/src/main/java/datawave/query/function/DescendantCountFunction.java +++ b/warehouse/query-core/src/main/java/datawave/query/function/DescendantCountFunction.java @@ -19,7 +19,6 @@ import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.apache.accumulo.core.security.ColumnVisibility; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; @@ -28,6 +27,7 @@ import datawave.data.hash.UID; import datawave.data.hash.UIDConstants; +import datawave.iterators.IterationInterruptException; import datawave.query.Constants; import datawave.query.iterator.QueryOptions; import datawave.query.util.Tuple3; @@ -325,7 +325,7 @@ private int getCountByEventScan(final Range seekRange, final Text row, final Str // and return the count return uids.size(); - } catch (IterationInterruptedException e) { + } catch (IterationInterruptException e) { // Re-throw iteration interrupted as-is since this is an expected event from // a client going away. Re-throwing as an IOException will cause the tserver // to catch the exception and log a warning. Re-throwing as-is will let the @@ -423,7 +423,7 @@ private CountResult getCountByFieldIndexScan(final Range seekRange, final Text r final CountResult result = new CountResult(numberOfImmediateChildren, numberOfDescendants); result.setSkippedDescendants(skippedSomeDescendants); return result; - } catch (IterationInterruptedException e) { + } catch (IterationInterruptException e) { // Re-throw iteration interrupted as-is since this is an expected event from // a client going away. Re-throwing as an IOException will cause the tserver // to catch the exception and log a warning. Re-throwing as-is will let the diff --git a/warehouse/query-core/src/main/java/datawave/query/iterator/QueryIterator.java b/warehouse/query-core/src/main/java/datawave/query/iterator/QueryIterator.java index 1d4dc14dcb..189b394883 100644 --- a/warehouse/query-core/src/main/java/datawave/query/iterator/QueryIterator.java +++ b/warehouse/query-core/src/main/java/datawave/query/iterator/QueryIterator.java @@ -29,7 +29,6 @@ import org.apache.accumulo.core.iterators.SortedKeyValueIterator; import org.apache.accumulo.core.iterators.YieldCallback; import org.apache.accumulo.core.iterators.YieldingKeyValueIterator; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.apache.accumulo.tserver.tablet.TabletClosedException; import org.apache.commons.collections4.iterators.EmptyIterator; import org.apache.commons.jexl3.JexlArithmetic; @@ -59,6 +58,7 @@ import datawave.data.type.Type; import datawave.data.type.util.NumericalEncoder; import datawave.ingest.data.config.ingest.CompositeIngest; +import datawave.iterators.IterationInterruptException; import datawave.marking.MarkingFunctionsFactory; import datawave.query.Constants; import datawave.query.attributes.AttributeKeepFilter; @@ -538,7 +538,7 @@ else if (documentRange != null && (!this.isContainsIndexOnlyTerms() && this.getT } /** - * Handle an exception returned from seek or next. This will silently ignore IterationInterruptedException as that happens when the underlying iterator was + * Handle an exception returned from seek or next. This will silently ignore IterationInterruptException as that happens when the underlying iterator was * interrupted because the client is no longer listening. * * @param e @@ -552,14 +552,14 @@ private void handleException(Exception e) throws IOException { // We need to pass IOException, IteratorInterruptedException, and TabletClosedExceptions up to the Tablet as they are // handled specially to ensure that the client will retry the scan elsewhere IOException ioe = null; - IterationInterruptedException iie = null; + IterationInterruptException iie = null; QueryIteratorYieldingException qiy = null; TabletClosedException tce = null; if (reason instanceof IOException) { ioe = (IOException) reason; } - if (reason instanceof IterationInterruptedException) { - iie = (IterationInterruptedException) reason; + if (reason instanceof IterationInterruptException) { + iie = (IterationInterruptException) reason; } if (reason instanceof QueryIteratorYieldingException) { qiy = (QueryIteratorYieldingException) reason; @@ -574,8 +574,8 @@ private void handleException(Exception e) throws IOException { if (reason instanceof IOException) { ioe = (IOException) reason; } - if (reason instanceof IterationInterruptedException) { - iie = (IterationInterruptedException) reason; + if (reason instanceof IterationInterruptException) { + iie = (IterationInterruptException) reason; } if (reason instanceof QueryIteratorYieldingException) { qiy = (QueryIteratorYieldingException) reason; diff --git a/warehouse/query-core/src/main/java/datawave/query/iterator/logic/AndIterator.java b/warehouse/query-core/src/main/java/datawave/query/iterator/logic/AndIterator.java index e15774ab57..34a6c28c73 100644 --- a/warehouse/query-core/src/main/java/datawave/query/iterator/logic/AndIterator.java +++ b/warehouse/query-core/src/main/java/datawave/query/iterator/logic/AndIterator.java @@ -15,11 +15,11 @@ import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.apache.log4j.Logger; import com.google.common.collect.TreeMultimap; +import datawave.iterators.IterationInterruptException; import datawave.query.attributes.Document; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.exceptions.QueryIteratorYieldingException; @@ -262,7 +262,7 @@ public void seek(Range range, Collection columnFamilies, boolean i if (itr instanceof SeekableIterator) { try { ((SeekableIterator) itr).seek(range, columnFamilies, inclusive); - } catch (IterationInterruptedException e2) { + } catch (IterationInterruptException e2) { // throw IterationInterrupted exceptions as-is with no modifications so the QueryIterator can handle it throw e2; } catch (Exception e2) { @@ -282,11 +282,11 @@ public void seek(Range range, Collection columnFamilies, boolean i } } catch (QueryIteratorYieldingException qye) { throw qye; - } catch (IterationInterruptedException iie) { + } catch (IterationInterruptException iie) { throw iie; } catch (Exception e) { include.remove(); - if (includes.isEmpty() || e instanceof DatawaveFatalQueryException || e instanceof IterationInterruptedException) { + if (includes.isEmpty() || e instanceof DatawaveFatalQueryException || e instanceof IterationInterruptException) { throw e; } else { log.warn("Lookup of event field failed, precision of query reduced."); @@ -406,7 +406,7 @@ protected TreeMultimap> advanceIterators(T key) { } } catch (QueryIteratorYieldingException qe) { throw qe; - } catch (IterationInterruptedException ie) { + } catch (IterationInterruptException ie) { throw ie; } catch (Exception e) { seenException = true; diff --git a/warehouse/query-core/src/main/java/datawave/query/iterators/FieldIndexCountingIterator.java b/warehouse/query-core/src/main/java/datawave/query/iterators/FieldIndexCountingIterator.java index 137cc924b0..f8746ec66b 100644 --- a/warehouse/query-core/src/main/java/datawave/query/iterators/FieldIndexCountingIterator.java +++ b/warehouse/query-core/src/main/java/datawave/query/iterators/FieldIndexCountingIterator.java @@ -280,12 +280,12 @@ public void seek(Range r, Collection columnFamilies, boolean inclu } else { // We have a valid start key and row - // Check if we are recovering from IterationInterruptedException (verify that we have the right key parts + // Check if we are recovering from IterationInterruptException (verify that we have the right key parts // and that the start key is NOT inclusive). if (null != pStartKey.getColumnFamily() && !pStartKey.getColumnFamily().toString().trim().isEmpty() && null != pStartKey.getColumnQualifier() && !pStartKey.getColumnQualifier().toString().trim().isEmpty() && !parentRange.isStartKeyInclusive()) { - // Iteration interrupted case, need to seek to the end of this FN:FV range. IterationInterruptedException + // Iteration interrupted case, need to seek to the end of this FN:FV range. IterationInterruptException // should always seek with the previously returned top key but with the inclusivity bit set to false. // i.e. Key-> Row:000 CFAM:fi\x00COLOR CQ:red, inclusive:False // we want to seek to the end of 'red' to the next unknown value, so CQ: red\u0001 should get us there. diff --git a/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java b/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java index ff5396df4d..e811c73b12 100644 --- a/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java +++ b/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java @@ -27,7 +27,6 @@ import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.apache.accumulo.core.security.Authorizations; import org.apache.hadoop.io.Text; @@ -37,6 +36,7 @@ import datawave.accumulo.inmemory.InMemoryScanner; import datawave.accumulo.inmemory.InMemoryScannerBase; import datawave.accumulo.inmemory.ScannerRebuilder; +import datawave.iterators.IterationInterruptException; import datawave.query.attributes.Document; import datawave.query.function.deserializer.KryoDocumentDeserializer; import datawave.query.iterator.profile.FinalDocumentTrackingIterator; @@ -122,7 +122,7 @@ public boolean hasTop() { @Override public void next() throws IOException { if (initialized && interruptListener != null && interruptListener.interrupt(source.getTopKey())) { - throw new IterationInterruptedException("testing next interrupt"); + throw new IterationInterruptException("testing next interrupt"); } source.next(); @@ -131,7 +131,7 @@ public void next() throws IOException { @Override public void seek(Range range, Collection collection, boolean inclusive) throws IOException { if (interruptListener != null && interruptListener.interrupt(null)) { - throw new IterationInterruptedException("testing seek interrupt"); + throw new IterationInterruptException("testing seek interrupt"); } source.seek(range, collection, inclusive); @@ -403,7 +403,7 @@ private void findNext() { } // reset interrupted flag interrupted = false; - } catch (IterationInterruptedException e) { + } catch (IterationInterruptException e) { interrupted = true; interruptListener.processedInterrupt(true); interruptCount++; diff --git a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/AndIteratorIT.java b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/AndIteratorIT.java index 46c30398ef..cff1711f7c 100644 --- a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/AndIteratorIT.java +++ b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/AndIteratorIT.java @@ -16,11 +16,11 @@ import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.junit.jupiter.api.Test; import com.google.common.collect.Sets; +import datawave.iterators.IterationInterruptException; import datawave.query.attributes.Document; import datawave.query.iterator.NestedIterator; @@ -90,7 +90,7 @@ void testIterationInterruptedOnInitialSeekOfEventField() throws IOException { // "Lookup of event field failed, precision of query reduced." SortedSet uids = new TreeSet<>(uidsA); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids)); } /** @@ -104,7 +104,7 @@ void testIterationInterruptedOnInitialSeekOfIndexOnlyField() { includes.add(IndexIteratorBridgeTest.createInterruptibleIndexIteratorBridge("FIELD_B", uidsB, true, 1)); AndIterator itr = new AndIterator<>(includes); - assertThrows(IterationInterruptedException.class, () -> itr.seek(new Range(), Collections.emptyList(), false)); + assertThrows(IterationInterruptException.class, () -> itr.seek(new Range(), Collections.emptyList(), false)); } // 1) handles the next() -> advanceIterators() path with an event field @@ -120,7 +120,7 @@ void testIterationInterruptedOnNextCallEventField() throws IOException { includes.add(IndexIteratorBridgeTest.createIndexIteratorBridge("FIELD_C", uidsC, false)); AndIterator itr = new AndIterator<>(includes); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, intersectUids(uidsA, uidsB, uidsC))); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, intersectUids(uidsA, uidsB, uidsC))); } @Test @@ -136,7 +136,7 @@ void testIterationInterruptedOnNextCallAllIteratorsFail() { AndIterator itr = new AndIterator<>(includes); SortedSet uids = intersectUids(uidsA, uidsB, uidsC); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids)); } // 1) handles the next() -> advanceIterators() path with an index only term @@ -156,7 +156,7 @@ void testIterationInterruptedOnNextCallIndexOnlyField() { Set indexOnlyFields = Sets.newHashSet("FIELD_A", "FIELD_B", "FIELD_C"); Set droppedFields = Collections.singleton("FIELD_C"); SortedSet uids = intersectUids(uidsA, uidsB, uidsC); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids, indexOnlyFields, droppedFields)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids, indexOnlyFields, droppedFields)); } // 2) handles the next() -> advanceIterators() path when a negation is in play @@ -178,7 +178,7 @@ void testIterationInterruptedOnNextCallWithNegation() { Set indexOnlyFields = Sets.newHashSet("FIELD_A", "FIELD_B"); Set droppedFields = Collections.singleton("FIELD_B"); SortedSet uids = intersectUids(uidsA, uidsB); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids, indexOnlyFields, droppedFields)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids, indexOnlyFields, droppedFields)); } // 3) applyContextRequired -> contextIncludes are uneven and there's no high key @@ -213,7 +213,7 @@ void testIterationExceptionDuringApplyContextRequired() throws IOException { Set indexOnlyFields = Sets.newHashSet("FIELD_A", "FIELD_B"); Set droppedFields = Collections.singleton("FIELD_B"); SortedSet uids = intersectUids(uidsA, uidsB); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids, indexOnlyFields, droppedFields)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids, indexOnlyFields, droppedFields)); } @Test diff --git a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/AndOrIteratorIT.java b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/AndOrIteratorIT.java index c367db8bd2..52fe3e65cb 100644 --- a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/AndOrIteratorIT.java +++ b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/AndOrIteratorIT.java @@ -20,13 +20,13 @@ import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.apache.log4j.Logger; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import com.google.common.collect.Sets; +import datawave.iterators.IterationInterruptException; import datawave.query.attributes.Attribute; import datawave.query.attributes.Attributes; import datawave.query.attributes.Document; @@ -210,7 +210,7 @@ void testInterruptedExceptionDuringInitSubtree() { final SortedSet uids = intersect(union(uidsEven, uidsOdd), uidsAll); AndIterator itr = new AndIterator(includes); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids)); } @Test @@ -227,7 +227,7 @@ void testInterruptedExceptionInNestedUnion() throws IOException { final SortedSet uids = intersect(union(uidsEven, uidsOdd), uidsAll); AndIterator itr = new AndIterator(includes); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids)); } @Test @@ -244,7 +244,7 @@ void testInterruptedExceptionInAnchorTerm() throws IOException { final SortedSet uids = intersect(union(uidsEven, uidsOdd), uidsAll); AndIterator itr = new AndIterator(includes); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids)); } // === test index only exceptions === @@ -306,7 +306,7 @@ void testIndexOnlyIterationExceptionInAnchorTerm() { final SortedSet uids = intersect(union(uidsEven, uidsOdd), uidsAll); AndIterator itr = new AndIterator(includes); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids)); } @Test @@ -327,7 +327,7 @@ void testIndexOnlyIterationExceptionInNestedUnion() { indexOnlyCounts.put("FIELD_C", 1); // compare to #testIndexOnlyNestedUnionTermAssertions AndIterator itr = new AndIterator(includes); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids, indexOnlyCounts)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids, indexOnlyCounts)); } @Test @@ -349,7 +349,7 @@ void testWholeUnionOfIndexOnlyTermsPrunedViaInterruptedExceptions() { indexOnlyCounts.put("FIELD_C", 1); AndIterator itr = new AndIterator(includes); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids, indexOnlyCounts)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids, indexOnlyCounts)); } // nested union with negated term that is interrupted @@ -377,7 +377,7 @@ void testNestedUnionWithNegatedIndexOnlyTermIsInterrupted() { // indexOnlyCounts.put("FIELD_B", 2); AndIterator itr = new AndIterator(includes); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uidsAll, indexOnlyCounts)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uidsAll, indexOnlyCounts)); } // nested union of negated terms which is interrupted @@ -398,7 +398,7 @@ void testNegatedNestedUnionOfIndexOnlyFieldsIsInterrupted() { indexOnlyCounts.put("FIELD_A", 5); AndIterator itr = new AndIterator(includes, Collections.singleton(union)); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uidsEven, indexOnlyCounts)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uidsEven, indexOnlyCounts)); } // === test by volume === diff --git a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/IndexIteratorBridgeTest.java b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/IndexIteratorBridgeTest.java index a2fec90e4c..51ecac9761 100644 --- a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/IndexIteratorBridgeTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/IndexIteratorBridgeTest.java @@ -12,10 +12,10 @@ import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.apache.commons.jexl3.parser.JexlNode; import org.junit.jupiter.api.Test; +import datawave.iterators.IterationInterruptException; import datawave.query.attributes.Document; import datawave.query.jexl.JexlNodeFactory; @@ -32,7 +32,7 @@ void testIteration() { @Test void testIterationInterrupted() { IndexIteratorBridge itr = createInterruptibleIndexIteratorBridge("FIELD_A", uids, true, 2); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, "FIELD_A", uids)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, "FIELD_A", uids)); } @Test @@ -44,7 +44,7 @@ void testIterationInterruptedOnThirdNext() { itr.next(); assertTrue(itr.hasNext()); - assertThrows(IterationInterruptedException.class, itr::next); + assertThrows(IterationInterruptException.class, itr::next); } // === assert methods === diff --git a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/IndexIteratorTest.java b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/IndexIteratorTest.java index 0dea95c645..394cf6acbd 100644 --- a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/IndexIteratorTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/IndexIteratorTest.java @@ -17,11 +17,11 @@ import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.apache.accumulo.core.iteratorsImpl.system.SortedMapIterator; import org.apache.hadoop.io.Text; import org.junit.jupiter.api.Test; +import datawave.iterators.IterationInterruptException; import datawave.query.attributes.Attribute; import datawave.query.attributes.Document; @@ -46,7 +46,7 @@ void testNoInit() { @Test void testIterationInterrupted() { IndexIterator itr = createInterruptibleIndexIterator("FIELD_A", uids); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uids, "FIELD_A")); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uids, "FIELD_A")); } @Test @@ -58,7 +58,7 @@ void testInterruptOnSecondNext() throws IOException { itr.next(); assertTrue(itr.hasTop()); - assertThrows(IterationInterruptedException.class, itr::next); + assertThrows(IterationInterruptException.class, itr::next); } @Test @@ -209,7 +209,7 @@ protected static Key createFiKey(String field, String uid) { } /** - * Helper class that will throw an {@link IterationInterruptedException} after reaching the preconfigured number of max iterations. + * Helper class that will throw an {@link IterationInterruptException} after reaching the preconfigured number of max iterations. *

* When using this class be sure that the backing data contains at least three elements. */ @@ -247,7 +247,7 @@ public void next() throws IOException { super.next(); if (++count > maxIterations) { - throw new IterationInterruptedException("throwing exception for tests"); + throw new IterationInterruptException("throwing exception for tests"); } } } diff --git a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/OrIteratorIT.java b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/OrIteratorIT.java index 13fa0049a6..8cb0aabae1 100644 --- a/warehouse/query-core/src/test/java/datawave/query/iterator/logic/OrIteratorIT.java +++ b/warehouse/query-core/src/test/java/datawave/query/iterator/logic/OrIteratorIT.java @@ -20,9 +20,9 @@ import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; import org.junit.jupiter.api.Test; +import datawave.iterators.IterationInterruptException; import datawave.query.attributes.Document; import datawave.query.iterator.NestedIterator; import datawave.query.iterator.SeekableIterator; @@ -74,7 +74,7 @@ void testUnionWithIndexOnlyTermThatIsInterrupted() { indexOnlyCounts.put("FIELD_B", 3); OrIterator itr = new OrIterator(includes); - assertThrows(IterationInterruptedException.class, () -> driveIterator(itr, uidsAll, indexOnlyCounts)); + assertThrows(IterationInterruptException.class, () -> driveIterator(itr, uidsAll, indexOnlyCounts)); } // A union with a negated term cannot be evaluated by itself