From d6ba5bd9a731aeb9e9368f776c9feac09b328332 Mon Sep 17 00:00:00 2001 From: Seth Date: Tue, 27 Aug 2024 14:45:02 -0400 Subject: [PATCH 1/6] Replaced IIE with datawave version --- .../iterators/IterationInterruptedException.java | 16 ++++++++++++++++ .../iterators/SortedMultiMapIterator.java | 2 +- .../query/function/AbstractVersionFilter.java | 2 +- .../query/function/DescendantCountFunction.java | 2 +- .../datawave/query/iterator/QueryIterator.java | 2 +- .../query/iterator/logic/AndIterator.java | 2 +- .../query/RebuildingScannerTestHelper.java | 2 +- .../query/iterator/logic/AndIteratorIT.java | 2 +- .../query/iterator/logic/AndOrIteratorIT.java | 2 +- .../iterator/logic/IndexIteratorBridgeTest.java | 2 +- .../query/iterator/logic/IndexIteratorTest.java | 2 +- .../query/iterator/logic/OrIteratorIT.java | 2 +- 12 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java diff --git a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java new file mode 100644 index 0000000000..68e5de65c1 --- /dev/null +++ b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java @@ -0,0 +1,16 @@ +package datawave.iterators; + + +/** + * Exception thrown if an interrupt flag is detected. + */ +public class IterationInterruptedException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public IterationInterruptedException() {} + + public IterationInterruptedException(String msg) { + super(msg); + } +} \ No newline at end of file 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..a23d934581 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,7 @@ 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 datawave.iterators.IterationInterruptedException; import com.google.common.collect.TreeMultimap; 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..72dc7a8e66 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,7 @@ 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 datawave.iterators.IterationInterruptedException; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.WritableComparator; 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..839cdad312 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,7 @@ 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 datawave.iterators.IterationInterruptedException; import org.apache.accumulo.core.security.ColumnVisibility; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; 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..be38501490 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,7 @@ 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 datawave.iterators.IterationInterruptedException; import org.apache.accumulo.tserver.tablet.TabletClosedException; import org.apache.commons.collections4.iterators.EmptyIterator; import org.apache.commons.jexl3.JexlArithmetic; 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..c5d4ff60b9 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,7 +15,7 @@ import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; +import datawave.iterators.IterationInterruptedException; import org.apache.log4j.Logger; import com.google.common.collect.TreeMultimap; 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..5c20d01387 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,7 @@ 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 datawave.iterators.IterationInterruptedException; import org.apache.accumulo.core.security.Authorizations; import org.apache.hadoop.io.Text; 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..eadae910ac 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,7 +16,7 @@ import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; +import datawave.iterators.IterationInterruptedException; import org.junit.jupiter.api.Test; import com.google.common.collect.Sets; 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..c4d218cfbd 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,7 +20,7 @@ import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; +import datawave.iterators.IterationInterruptedException; import org.apache.log4j.Logger; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; 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..bb8556651e 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,7 +12,7 @@ import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; +import datawave.iterators.IterationInterruptedException; import org.apache.commons.jexl3.parser.JexlNode; import org.junit.jupiter.api.Test; 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..ce95410422 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,7 +17,7 @@ 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 datawave.iterators.IterationInterruptedException; import org.apache.accumulo.core.iteratorsImpl.system.SortedMapIterator; import org.apache.hadoop.io.Text; import org.junit.jupiter.api.Test; 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..f66757b599 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,7 +20,7 @@ import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException; +import datawave.iterators.IterationInterruptedException; import org.junit.jupiter.api.Test; import datawave.query.attributes.Document; From a6e735a94797d08208a7cc0e84fef657829d498f Mon Sep 17 00:00:00 2001 From: Seth Date: Tue, 27 Aug 2024 14:54:14 -0400 Subject: [PATCH 2/6] Formatting --- .../java/datawave/iterators/IterationInterruptedException.java | 3 +-- .../test/java/datawave/iterators/SortedMultiMapIterator.java | 3 ++- .../java/datawave/query/function/AbstractVersionFilter.java | 2 +- .../java/datawave/query/function/DescendantCountFunction.java | 2 +- .../src/main/java/datawave/query/iterator/QueryIterator.java | 2 +- .../main/java/datawave/query/iterator/logic/AndIterator.java | 2 +- .../test/java/datawave/query/RebuildingScannerTestHelper.java | 2 +- .../test/java/datawave/query/iterator/logic/AndIteratorIT.java | 2 +- .../java/datawave/query/iterator/logic/AndOrIteratorIT.java | 2 +- .../datawave/query/iterator/logic/IndexIteratorBridgeTest.java | 2 +- .../java/datawave/query/iterator/logic/IndexIteratorTest.java | 2 +- .../test/java/datawave/query/iterator/logic/OrIteratorIT.java | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java index 68e5de65c1..960322171f 100644 --- a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java +++ b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java @@ -1,6 +1,5 @@ package datawave.iterators; - /** * Exception thrown if an interrupt flag is detected. */ @@ -13,4 +12,4 @@ public IterationInterruptedException() {} public IterationInterruptedException(String msg) { super(msg); } -} \ No newline at end of file +} 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 a23d934581..ffba9bdcdf 100644 --- a/warehouse/ingest-core/src/test/java/datawave/iterators/SortedMultiMapIterator.java +++ b/warehouse/ingest-core/src/test/java/datawave/iterators/SortedMultiMapIterator.java @@ -14,10 +14,11 @@ import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; import org.apache.accumulo.core.iteratorsImpl.system.InterruptibleIterator; -import datawave.iterators.IterationInterruptedException; import com.google.common.collect.TreeMultimap; +import datawave.iterators.IterationInterruptedException; + /** * */ 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 72dc7a8e66..8af2277a1a 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 datawave.iterators.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.IterationInterruptedException; import datawave.query.attributes.Attribute; import datawave.query.attributes.Document; import datawave.query.iterator.SourcedOptions; 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 839cdad312..6b33de5f73 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 datawave.iterators.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.IterationInterruptedException; import datawave.query.Constants; import datawave.query.iterator.QueryOptions; import datawave.query.util.Tuple3; 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 be38501490..c89b5911be 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 datawave.iterators.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.IterationInterruptedException; import datawave.marking.MarkingFunctionsFactory; import datawave.query.Constants; import datawave.query.attributes.AttributeKeepFilter; 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 c5d4ff60b9..25760b2db7 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 datawave.iterators.IterationInterruptedException; import org.apache.log4j.Logger; import com.google.common.collect.TreeMultimap; +import datawave.iterators.IterationInterruptedException; import datawave.query.attributes.Document; import datawave.query.exceptions.DatawaveFatalQueryException; import datawave.query.exceptions.QueryIteratorYieldingException; 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 5c20d01387..ddc1bea15d 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 datawave.iterators.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.IterationInterruptedException; import datawave.query.attributes.Document; import datawave.query.function.deserializer.KryoDocumentDeserializer; import datawave.query.iterator.profile.FinalDocumentTrackingIterator; 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 eadae910ac..01ec5d5a7f 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 datawave.iterators.IterationInterruptedException; import org.junit.jupiter.api.Test; import com.google.common.collect.Sets; +import datawave.iterators.IterationInterruptedException; import datawave.query.attributes.Document; import datawave.query.iterator.NestedIterator; 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 c4d218cfbd..d2d5f8bb06 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 datawave.iterators.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.IterationInterruptedException; import datawave.query.attributes.Attribute; import datawave.query.attributes.Attributes; import datawave.query.attributes.Document; 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 bb8556651e..21b92edd7a 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 datawave.iterators.IterationInterruptedException; import org.apache.commons.jexl3.parser.JexlNode; import org.junit.jupiter.api.Test; +import datawave.iterators.IterationInterruptedException; import datawave.query.attributes.Document; import datawave.query.jexl.JexlNodeFactory; 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 ce95410422..02fe60ca21 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 datawave.iterators.IterationInterruptedException; import org.apache.accumulo.core.iteratorsImpl.system.SortedMapIterator; import org.apache.hadoop.io.Text; import org.junit.jupiter.api.Test; +import datawave.iterators.IterationInterruptedException; import datawave.query.attributes.Attribute; import datawave.query.attributes.Document; 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 f66757b599..b881265969 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 datawave.iterators.IterationInterruptedException; import org.junit.jupiter.api.Test; +import datawave.iterators.IterationInterruptedException; import datawave.query.attributes.Document; import datawave.query.iterator.NestedIterator; import datawave.query.iterator.SeekableIterator; From 05db63f3ed085e6d2d60ff4c7cfaef2785dcbcd4 Mon Sep 17 00:00:00 2001 From: Seth Date: Thu, 29 Aug 2024 14:04:30 -0400 Subject: [PATCH 3/6] Documentation --- .../datawave/iterators/IterationInterruptedException.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java index 960322171f..9b25e5c40c 100644 --- a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java +++ b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java @@ -1,7 +1,9 @@ package datawave.iterators; /** - * Exception thrown if an interrupt flag is detected. + * 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 IterationInterruptedException extends RuntimeException { From 419f4e2f00c66233d5e0bf79976f219aa22d0b96 Mon Sep 17 00:00:00 2001 From: Seth Date: Thu, 29 Aug 2024 14:09:39 -0400 Subject: [PATCH 4/6] Rename class to avoid IDE referencing Accumulo's import --- ...n.java => IterationInterruptException.java} | 8 ++++---- .../iterators/SortedMultiMapIterator.java | 6 ++---- ...ieldIndexCountingIteratorPerVisibility.java | 2 +- .../query/function/AbstractVersionFilter.java | 4 ++-- .../function/DescendantCountFunction.java | 6 +++--- .../datawave/query/iterator/QueryIterator.java | 14 +++++++------- .../query/iterator/logic/AndIterator.java | 10 +++++----- .../iterators/FieldIndexCountingIterator.java | 4 ++-- .../query/RebuildingScannerTestHelper.java | 8 ++++---- .../query/iterator/logic/AndIteratorIT.java | 16 ++++++++-------- .../query/iterator/logic/AndOrIteratorIT.java | 18 +++++++++--------- .../logic/IndexIteratorBridgeTest.java | 6 +++--- .../iterator/logic/IndexIteratorTest.java | 10 +++++----- .../query/iterator/logic/OrIteratorIT.java | 4 ++-- 14 files changed, 57 insertions(+), 59 deletions(-) rename warehouse/core/src/main/java/datawave/iterators/{IterationInterruptedException.java => IterationInterruptException.java} (66%) diff --git a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java similarity index 66% rename from warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java rename to warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java index 9b25e5c40c..de6cf6044a 100644 --- a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptedException.java +++ b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java @@ -1,17 +1,17 @@ package datawave.iterators; /** - * This code was repurposed from org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptedException. + * This code was repurposed from org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptException. * 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 IterationInterruptedException extends RuntimeException { +public class IterationInterruptException extends RuntimeException { private static final long serialVersionUID = 1L; - public IterationInterruptedException() {} + public IterationInterruptException() {} - public IterationInterruptedException(String msg) { + 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 ffba9bdcdf..560324eaf1 100644 --- a/warehouse/ingest-core/src/test/java/datawave/iterators/SortedMultiMapIterator.java +++ b/warehouse/ingest-core/src/test/java/datawave/iterators/SortedMultiMapIterator.java @@ -17,8 +17,6 @@ import com.google.common.collect.TreeMultimap; -import datawave.iterators.IterationInterruptedException; - /** * */ @@ -71,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(); @@ -87,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 8af2277a1a..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 @@ -29,7 +29,7 @@ import datawave.data.hash.UID; import datawave.data.type.NumberType; import datawave.data.type.util.NumericalEncoder; -import datawave.iterators.IterationInterruptedException; +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 6b33de5f73..2b4b024564 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 @@ -12,6 +12,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.ArrayByteSequence; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Key; @@ -27,7 +28,6 @@ import datawave.data.hash.UID; import datawave.data.hash.UIDConstants; -import datawave.iterators.IterationInterruptedException; 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 c89b5911be..a93b3c3c3d 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 @@ -21,6 +21,7 @@ import javax.annotation.Nullable; +import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; @@ -58,7 +59,6 @@ import datawave.data.type.Type; import datawave.data.type.util.NumericalEncoder; import datawave.ingest.data.config.ingest.CompositeIngest; -import datawave.iterators.IterationInterruptedException; 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 25760b2db7..c76b000c90 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 @@ -13,13 +13,13 @@ import java.util.SortedSet; import java.util.TreeSet; +import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Range; import org.apache.log4j.Logger; import com.google.common.collect.TreeMultimap; -import datawave.iterators.IterationInterruptedException; 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 ddc1bea15d..718805d537 100644 --- a/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java +++ b/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java @@ -10,6 +10,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; +import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.client.AccumuloClient; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; @@ -36,7 +37,6 @@ import datawave.accumulo.inmemory.InMemoryScanner; import datawave.accumulo.inmemory.InMemoryScannerBase; import datawave.accumulo.inmemory.ScannerRebuilder; -import datawave.iterators.IterationInterruptedException; 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 01ec5d5a7f..941246ee03 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 @@ -14,13 +14,13 @@ import java.util.SortedSet; import java.util.TreeSet; +import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; import org.junit.jupiter.api.Test; import com.google.common.collect.Sets; -import datawave.iterators.IterationInterruptedException; 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 d2d5f8bb06..d0c196b0dc 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 @@ -18,6 +18,7 @@ import java.util.SortedSet; import java.util.TreeSet; +import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; import org.apache.log4j.Logger; @@ -26,7 +27,6 @@ import com.google.common.collect.Sets; -import datawave.iterators.IterationInterruptedException; 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 21b92edd7a..ae9afe900e 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 @@ -10,12 +10,12 @@ import java.util.SortedSet; import java.util.TreeSet; +import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; import org.apache.commons.jexl3.parser.JexlNode; import org.junit.jupiter.api.Test; -import datawave.iterators.IterationInterruptedException; 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 02fe60ca21..a94f555022 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 @@ -13,6 +13,7 @@ import java.util.TreeMap; import java.util.TreeSet; +import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; @@ -21,7 +22,6 @@ import org.apache.hadoop.io.Text; import org.junit.jupiter.api.Test; -import datawave.iterators.IterationInterruptedException; 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 b881265969..9e7b88ee03 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 @@ -18,11 +18,11 @@ import java.util.SortedSet; import java.util.TreeSet; +import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; import org.junit.jupiter.api.Test; -import datawave.iterators.IterationInterruptedException; 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 From 8bbaad7f0f3f0ccd4a8356ccdae2a92dd3fb9c9b Mon Sep 17 00:00:00 2001 From: Seth Date: Thu, 29 Aug 2024 14:10:11 -0400 Subject: [PATCH 5/6] Correct name in reference --- .../java/datawave/iterators/IterationInterruptException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java index de6cf6044a..4113c6a784 100644 --- a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java +++ b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java @@ -1,7 +1,7 @@ package datawave.iterators; /** - * This code was repurposed from org.apache.accumulo.core.iteratorsImpl.system.IterationInterruptException. + * 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. */ From e8acd0cafd1071f3e506b189b9561cd6d7ef2d16 Mon Sep 17 00:00:00 2001 From: Seth Date: Fri, 30 Aug 2024 14:03:20 -0400 Subject: [PATCH 6/6] Formatting --- .../datawave/iterators/IterationInterruptException.java | 6 +++--- .../datawave/query/function/DescendantCountFunction.java | 2 +- .../main/java/datawave/query/iterator/QueryIterator.java | 2 +- .../java/datawave/query/iterator/logic/AndIterator.java | 2 +- .../java/datawave/query/RebuildingScannerTestHelper.java | 2 +- .../java/datawave/query/iterator/logic/AndIteratorIT.java | 2 +- .../java/datawave/query/iterator/logic/AndOrIteratorIT.java | 2 +- .../query/iterator/logic/IndexIteratorBridgeTest.java | 2 +- .../datawave/query/iterator/logic/IndexIteratorTest.java | 2 +- .../java/datawave/query/iterator/logic/OrIteratorIT.java | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java index 4113c6a784..154324e399 100644 --- a/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java +++ b/warehouse/core/src/main/java/datawave/iterators/IterationInterruptException.java @@ -1,9 +1,9 @@ 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. + * 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 { 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 2b4b024564..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 @@ -12,7 +12,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.ArrayByteSequence; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Key; @@ -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; 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 a93b3c3c3d..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 @@ -21,7 +21,6 @@ import javax.annotation.Nullable; -import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; @@ -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; 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 c76b000c90..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 @@ -13,13 +13,13 @@ import java.util.SortedSet; import java.util.TreeSet; -import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Range; 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; 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 718805d537..e811c73b12 100644 --- a/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java +++ b/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java @@ -10,7 +10,6 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.client.AccumuloClient; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; @@ -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; 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 941246ee03..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 @@ -14,13 +14,13 @@ import java.util.SortedSet; import java.util.TreeSet; -import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; 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; 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 d0c196b0dc..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 @@ -18,7 +18,6 @@ import java.util.SortedSet; import java.util.TreeSet; -import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; import org.apache.log4j.Logger; @@ -27,6 +26,7 @@ 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; 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 ae9afe900e..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 @@ -10,12 +10,12 @@ import java.util.SortedSet; import java.util.TreeSet; -import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; 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; 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 a94f555022..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 @@ -13,7 +13,6 @@ import java.util.TreeMap; import java.util.TreeSet; -import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; @@ -22,6 +21,7 @@ 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; 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 9e7b88ee03..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 @@ -18,11 +18,11 @@ import java.util.SortedSet; import java.util.TreeSet; -import datawave.iterators.IterationInterruptException; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; 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;