Add support for providing absolute start time to SearchRequest#37142
Merged
javanna merged 3 commits intoelastic:masterfrom Jan 7, 2019
Merged
Add support for providing absolute start time to SearchRequest#37142javanna merged 3 commits intoelastic:masterfrom
javanna merged 3 commits intoelastic:masterfrom
Conversation
We have recently added support for providing a local cluster alias to a SearchRequest through a package protected constructor. When executing cross-cluster search requests with local reduction on each cluster, the CCS coordinating node will have to provide such cluster alias to each remote cluster, as well as the absolute start time of the search action in milliseconds from the time epoch, to be used when evaluating date math expressions both while executing queries / scripts as well as when resolving index names. This commit adds support for providing the start time together with the cluster alias. It is a final member in the search request, which will only be set when using cross-cluster search with local reduction (also known as alternate execution mode). When not provided, the coordinating node will determine the current time and pass it through (by calling `System.currentTimeMillis`). Relates to elastic#32125
Collaborator
|
Pinging @elastic/es-search |
jimczi
approved these changes
Jan 4, 2019
Contributor
jimczi
left a comment
There was a problem hiding this comment.
I left a minor comment but the change looks good to me.
| */ | ||
| @Nullable | ||
| Long getAbsoluteStartMillis() { | ||
| return absoluteStartMillis == DEFAULT_ABSOLUTE_START_MILLIS ? null : absoluteStartMillis; |
Contributor
There was a problem hiding this comment.
Since this is called only once it could be called getOrCreateAbsoluteStartMillis() and return System.currentTimeMillis() if the absoluteStartMillis is not set (equals to `-1) ?
Contributor
Author
There was a problem hiding this comment.
we could even use currentTimeMillis as a default in the constructor considering when the search request gets created on the coord node, if it wasn't for the transport client, in which case that would take the current time on the client instead of on the server.. Too bad :)
javanna
referenced
this pull request
Jan 4, 2019
In Lucene 8 searches can skip non-competitive hits if the total hit count is not requested. It is also possible to track the number of hits up to a certain threshold. This is a trade off to speed up searches while still being able to know a lower bound of the total hit count. This change adds the ability to set this threshold directly in the track_total_hits search option. A boolean value (true, false) indicates whether the total hit count should be tracked in the response. When set as an integer this option allows to compute a lower bound of the total hits while preserving the ability to skip non-competitive hits when enough matches have been collected. Relates #33028
javanna
added a commit
to javanna/elasticsearch
that referenced
this pull request
Jan 7, 2019
This was referenced Jan 7, 2019
javanna
added a commit
that referenced
this pull request
Jan 7, 2019
javanna
added a commit
that referenced
this pull request
Jan 7, 2019
We have recently added support for providing a local cluster alias to a SearchRequest through a package protected constructor. When executing cross-cluster search requests with local reduction on each cluster, the CCS coordinating node will have to provide such cluster alias to each remote cluster, as well as the absolute start time of the search action in milliseconds from the time epoch, to be used when evaluating date math expressions both while executing queries / scripts as well as when resolving index names. This commit adds support for providing the start time together with the cluster alias. It is a final member in the search request, which will only be set when using cross-cluster search with local reduction (also known as alternate execution mode). When not provided, the coordinating node will determine the current time and pass it through (by calling `System.currentTimeMillis`). Relates to #32125
javanna
added a commit
that referenced
this pull request
Jan 7, 2019
This file contains hidden or 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
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.
We have recently added support for providing a local cluster alias to a
SearchRequest through a package protected constructor. When executing
cross-cluster search requests with local reduction on each cluster, the
CCS coordinating node will have to provide such cluster alias to each
remote cluster, as well as the absolute start time of the search action
in milliseconds from the time epoch, to be used when evaluating date
math expressions both while executing queries / scripts as well as when
resolving index names.
This commit adds support for providing the start time together with the
cluster alias. It is a final member in the search request, which will
only be set when using cross-cluster search with local reduction (also
known as alternate execution mode). When not provided, the coordinating
node will determine the current time and pass it through (by calling
System.currentTimeMillis).Relates to #32125