-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for dynamic rule detection for pipeline config transforma…
…tion (#4601) * Add support for dynamic rule detection for pipeline config transformation Signed-off-by: Srikanth Govindarajan <[email protected]> * Address comments Signed-off-by: Srikanth Govindarajan <[email protected]> * Move rules and templates to plugin level Signed-off-by: Srikanth Govindarajan <[email protected]> * Add dummy plugin for testing dynamic rule detection Signed-off-by: Srikanth Govindarajan <[email protected]> * Address comments Signed-off-by: Srikanth Govindarajan <[email protected]> --------- Signed-off-by: Srikanth Govindarajan <[email protected]> Signed-off-by: Srikanth Govindarajan <[email protected]>
- Loading branch information
1 parent
1ac6df2
commit 38f8079
Showing
23 changed files
with
574 additions
and
389 deletions.
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
18 changes: 18 additions & 0 deletions
18
...ser/src/main/java/org/opensearch/dataprepper/pipeline/parser/rule/RuleFileEvaluation.java
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.opensearch.dataprepper.pipeline.parser.rule; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Builder(setterPrefix = "with") | ||
@AllArgsConstructor | ||
@Data | ||
public class RuleFileEvaluation { | ||
private Boolean result; | ||
private String ruleFileName; | ||
private String pluginName; | ||
|
||
public RuleFileEvaluation() { | ||
|
||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...line-parser/src/main/java/org/opensearch/dataprepper/pipeline/parser/rule/RuleStream.java
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.opensearch.dataprepper.pipeline.parser.rule; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class RuleStream { | ||
private String name; | ||
private InputStream ruleStream; | ||
|
||
|
||
public void close() { | ||
if (ruleStream != null) { | ||
try { | ||
ruleStream.close(); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} | ||
} | ||
|
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
20 changes: 20 additions & 0 deletions
20
...-parser/src/main/java/org/opensearch/dataprepper/pipeline/parser/rule/TemplateStream.java
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.opensearch.dataprepper.pipeline.parser.rule; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
public class TemplateStream { | ||
private String name; | ||
private InputStream templateStream; | ||
|
||
|
||
public void close() { | ||
if (templateStream != null) { | ||
try { | ||
templateStream.close(); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.