-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Initial search pipelines implementation #6587
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0299907
Initial search pipelines implementation
msfroh 096a83a
Merge branch 'main' into search_pipelines
msfroh 425120b
Incorporate feedback from @reta and @navneet1v
msfroh bb1da6b
Register SearchPipelineProcessingException
msfroh 6f020ed
Remove unneeded dependencies from search-pipeline-common
msfroh 84c6d04
Merge branch 'main' into search_pipelines
msfroh 03eef02
Avoid cloning SearchRequest if no SearchRequestProcessors
msfroh 2019fdf
Use NamedWritableRegistry to deserialize SearchRequest
msfroh 7e32d6a
Check for empty pipeline with CollectionUtils.isEmpty
msfroh ba99f9c
Update server/src/main/java/org/opensearch/search/pipeline/SearchPipe…
msfroh ad4df47
Merge branch 'opensearch-project:main' into search_pipelines
msfroh 1379045
Incorporate feedback from @noCharger
msfroh 0a2203a
Incorporate feedback from @reta
msfroh 13a0419
Gate search pipelines behind a feature flag
msfroh 8e1ba27
More feature flag fixes for search pipeline testing
msfroh 179e4aa
Merge branch 'main' into search_pipelines
msfroh f49542c
Move feature flag into constructor parameter
msfroh 402e8b6
Move REST handlers behind feature flag
msfroh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,8 @@ public class SearchPipelineService implements ClusterStateApplier, ReportingServ | |
private final NamedWriteableRegistry namedWriteableRegistry; | ||
private volatile ClusterState state; | ||
|
||
private boolean forceEnabled = false; | ||
|
||
public SearchPipelineService( | ||
ClusterService clusterService, | ||
ThreadPool threadPool, | ||
|
@@ -212,7 +214,7 @@ public void putPipeline( | |
PutSearchPipelineRequest request, | ||
ActionListener<AcknowledgedResponse> listener | ||
) throws Exception { | ||
if (FeatureFlags.isEnabled(FeatureFlags.SEARCH_PIPELINE) == false) { | ||
if (isFeatureEnabled() == false) { | ||
throw new IllegalArgumentException("Experimental search pipeline feature is not enabled"); | ||
} | ||
|
||
|
@@ -330,7 +332,7 @@ static ClusterState innerDelete(DeleteSearchPipelineRequest request, ClusterStat | |
|
||
public SearchRequest transformRequest(SearchRequest originalRequest) { | ||
String pipelineId = originalRequest.pipeline(); | ||
if (pipelineId != null && FeatureFlags.isEnabled(FeatureFlags.SEARCH_PIPELINE)) { | ||
if (pipelineId != null && isFeatureEnabled()) { | ||
PipelineHolder pipeline = pipelines.get(pipelineId); | ||
if (pipeline == null) { | ||
throw new IllegalArgumentException("Pipeline " + pipelineId + " is not defined"); | ||
|
@@ -353,7 +355,7 @@ public SearchRequest transformRequest(SearchRequest originalRequest) { | |
|
||
public SearchResponse transformResponse(SearchRequest request, SearchResponse searchResponse) { | ||
String pipelineId = request.pipeline(); | ||
if (pipelineId != null && FeatureFlags.isEnabled(FeatureFlags.SEARCH_PIPELINE)) { | ||
if (pipelineId != null && isFeatureEnabled()) { | ||
PipelineHolder pipeline = pipelines.get(pipelineId); | ||
if (pipeline == null) { | ||
throw new IllegalArgumentException("Pipeline " + pipelineId + " is not defined"); | ||
|
@@ -426,4 +428,12 @@ static class PipelineHolder { | |
this.pipeline = Objects.requireNonNull(pipeline); | ||
} | ||
} | ||
|
||
private boolean isFeatureEnabled() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @msfroh since feature flags are on JVM level (they are not dynamic), I think we could use just simple |
||
return forceEnabled || FeatureFlags.isEnabled(FeatureFlags.SEARCH_PIPELINE); | ||
} | ||
|
||
void setForceEnabled(boolean forceEnabled) { | ||
this.forceEnabled = forceEnabled; | ||
} | ||
} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking nit - if we want to keep the name of
PipelineHolder
, renamepipeline
topipelineholder
to avoid invokepipeline.pipeline