-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add abilty to yield in Ivarators, AndIterator, OrIterator and return metrics before yield (#704) #2042
Open
billoley
wants to merge
1
commit into
integration
Choose a base branch
from
feature/issue-704
base: integration
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
billoley
force-pushed
the
feature/issue-704
branch
from
July 22, 2023 15:52
64a4062
to
5eb1278
Compare
billoley
force-pushed
the
feature/issue-704
branch
from
July 24, 2023 15:16
5eb1278
to
b887203
Compare
ivakegg
reviewed
Jul 26, 2023
warehouse/query-core/src/main/java/datawave/query/iterator/waitwindow/WaitWindowObserver.java
Outdated
Show resolved
Hide resolved
warehouse/query-core/src/main/java/datawave/query/iterator/waitwindow/WaitWindowObserver.java
Outdated
Show resolved
Hide resolved
warehouse/query-core/src/main/java/datawave/query/iterator/waitwindow/WaitWindowObserver.java
Show resolved
Hide resolved
.../query-core/src/main/java/datawave/query/iterator/waitwindow/WaitWindowOverseerIterator.java
Show resolved
Hide resolved
warehouse/query-core/src/main/java/datawave/query/iterator/waitwindow/WaitWindowObserver.java
Outdated
Show resolved
Hide resolved
warehouse/query-core/src/main/java/datawave/query/iterator/waitwindow/WaitWindowObserver.java
Outdated
Show resolved
Hide resolved
Rexblk81
approved these changes
Jul 27, 2023
ivakegg
reviewed
Jul 28, 2023
warehouse/query-core/src/main/java/datawave/query/iterator/waitwindow/WaitWindowObserver.java
Show resolved
Hide resolved
ivakegg
reviewed
Jul 28, 2023
warehouse/query-core/src/main/java/datawave/core/iterators/IteratorThreadPoolManager.java
Outdated
Show resolved
Hide resolved
ivakegg
reviewed
Jul 28, 2023
warehouse/query-core/src/main/java/datawave/query/exceptions/WaitWindowOverrunException.java
Outdated
Show resolved
Hide resolved
ivakegg
reviewed
Jul 28, 2023
.../query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexCachingIteratorJexl.java
Outdated
Show resolved
Hide resolved
ivakegg
reviewed
Jul 28, 2023
warehouse/query-core/src/main/java/datawave/query/jexl/functions/KeyAdjudicator.java
Show resolved
Hide resolved
billoley
force-pushed
the
feature/issue-704
branch
2 times, most recently
from
October 3, 2023 13:28
5be0608
to
1935337
Compare
billoley
force-pushed
the
feature/issue-704
branch
from
October 26, 2023 14:57
4fa6746
to
7582320
Compare
apmoriarty
reviewed
Oct 26, 2023
.../query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexCachingIteratorJexl.java
Outdated
Show resolved
Hide resolved
warehouse/query-core/src/main/java/datawave/query/iterator/waitwindow/WaitWindowObserver.java
Outdated
Show resolved
Hide resolved
warehouse/query-core/src/main/java/datawave/query/iterator/logic/OrIterator.java
Outdated
Show resolved
Hide resolved
warehouse/query-core/src/main/java/datawave/query/iterator/logic/AndIterator.java
Show resolved
Hide resolved
apmoriarty
previously approved these changes
Nov 3, 2023
billoley
force-pushed
the
feature/issue-704
branch
from
February 1, 2024 20:26
41a39a8
to
1fced91
Compare
billoley
force-pushed
the
feature/issue-704
branch
from
June 13, 2024 15:49
1fced91
to
d91ca47
Compare
billoley
force-pushed
the
feature/issue-704
branch
from
August 23, 2024 14:19
d91ca47
to
071254f
Compare
billoley
force-pushed
the
feature/issue-704
branch
from
September 20, 2024 18:03
071254f
to
50599b9
Compare
…metrics before yield
billoley
force-pushed
the
feature/issue-704
branch
from
November 14, 2024 16:40
50599b9
to
3632ca3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add abilty to yield in Ivarators, AndIterator, OrIterator and return metrics before yield (#704)
WaitWindowObserver object tracks the remaining time before a yield and has a bunch of convenience methods for manipulating keys. !YIELD_AT_BEGIN and \uffffYIELD_AT_END are used to yield either before a given key or after a given key. They are used most often in the colFam but sometimes in the colQual if the query is using non-sorted UIDs as an optimization. The ! sorts before alphanumeric characters and the \uffff sorts after alphanumerics. The rest of the strings are for easy identification.
The remaining time is tracked in the WaitWindowObserver using a separate thread to minimize the calls to System.currentTimeMillis.
When time is expired, a WaitWindowOverrunException is thrown and then caught/propagated (determining the correct yieldKey) at each AndIterator/OrIterator up to the WaitWindowOverseerIterator which is under either the SerialIterator of the PipelineIterator but above the rest of the boolean stack of iterators.
If collectTimingDetails=false, we simply yield when either the SerialIterator of the PipelineIterator detects a WaitWindowOverrun. If collectTimingDetails=true, then we return a document with a WAIT_WINDOW_OVERRUN attribute and a TIMING_METADATA that hands off its souce, next, yield, etc metrics to the DocumentTransformerSupport class and then gets ignored. On the next call to the QueryIterator, the hasTop method checks with the WaitWindowObserver and yields.
IveratorFutures are now tracked in IteratorThreadPoolManager so that when an Ivarator yields before fillSortedSet is completed for all ranges, a post-yield call can reclaim the HDFS-backed sorted set from the IvaratorFuture.
Included fixes to the PipelineIterator discovered during testing:
When yielding, PipelineIterator should evaluate all possible keys to find the lowest, including the evaluationQueue, results, and yieldKey from WaitWindowOverrun. This could have caused missed data when yielding in the PipelineIterator
Must fill the evaluationQueue after calling flushCompletedResults in getNext otherwise flushCompletedResults might empty the evaluationQueue with no valid results and on the next call to getNext, results will be empty and when cacheNextResult is called, evaluationQueue will be empty and PipelineIterator declares itself done. This could have caused missed data when yielding in the PipelineIterator
Pipeline should save any caught Exception so that the PipelineIterator can propagate the Exception when calling getResult. This is particularly important when running Pipline in an Executor via the PipelineIterator. Otherwise, the evaluation of that Document just returns null which is the same as a Document not matching. The SerialIterator runs the Pipline.run() method inline and was not subject to this bug.
QueryIteratorIT and extended classes WaitWindowQueryIteratorSerialIT and WaitWindowQueryIteratorPipelineIT use a test harness that more closely simulates Accumulo's LookupTask.
IvaratorYieldingTest now tests Pipeline/Serial, sortedUIDs/unsortedUIDs, and collectTimingDetails T/F for 8 variations instead of the previous 2 variations Serial + sortedUIDs/unsortedUIDs.