-
Notifications
You must be signed in to change notification settings - Fork 202
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
ENH: support pipeline extensions in pipeline config #3299
Changes from 29 commits
9b59ec1
43a52d7
fb9af26
f906fce
a3b4c24
2049066
250ae6f
e143fbb
79f20cf
50f8e0d
bd2c0a6
e1dec5b
51df8e3
d545390
bab025d
d7a057d
1081eb3
09c2146
3a84ff3
6527e07
b7c19f3
7b29f73
0204d4d
0c2c6dc
c785db6
9153a21
88942aa
6955a3b
1722ad9
4631943
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pipeline_extensions: | ||
test_extension: | ||
test-pipeline: | ||
source: | ||
testSource: null | ||
processor: | ||
- testProcessor: null | ||
sink: | ||
- testSink: null | ||
workers: 8 | ||
delay: 50 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.opensearch.dataprepper.plugin; | ||
|
||
import org.opensearch.dataprepper.model.configuration.PipelinesDataFlowModel; | ||
import org.opensearch.dataprepper.parser.model.DataPrepperConfiguration; | ||
|
||
import javax.inject.Inject; | ||
import javax.inject.Named; | ||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@Named | ||
public class ExtensionPluginConfigurationResolver { | ||
private final Map<String, Object> extensionMap; | ||
|
||
@Inject | ||
public ExtensionPluginConfigurationResolver(final DataPrepperConfiguration dataPrepperConfiguration, | ||
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. As noted in another comment, we should not tie extensions configurations directly with pipeline configurations. Can we decouple these somewhat? 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. Would you mind if I do it in the other PR: #3340. There has been some tweaks on the interface 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. That seems reasonable. |
||
final PipelinesDataFlowModel pipelinesDataFlowModel) { | ||
extensionMap = dataPrepperConfiguration.getPipelineExtensions() == null? | ||
new HashMap<>() : new HashMap<>(dataPrepperConfiguration.getPipelineExtensions().getExtensionMap()); | ||
if (pipelinesDataFlowModel.getPipelineExtensions() != null) { | ||
extensionMap.putAll(pipelinesDataFlowModel.getPipelineExtensions().getExtensionMap()); | ||
} | ||
} | ||
|
||
public Map<String, Object> getExtensionMap() { | ||
return Collections.unmodifiableMap(extensionMap); | ||
} | ||
} |
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.
In #2590 this is proposed as
pipeline_configurations
. I tend to think that we should keep this original name.There are a couple reasons:
pipeline_configurations
should be somewhat different from theextensions
. Not everything in extensions should be configurable in the pipeline.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.
Will rename this part