forked from opensearch-project/opensearch-migrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I've added all of the transformer jars to the runtime closure of the replayer since it's going to be a challenge for users using a cloud-deployment shrink-wrap solution to add addition jarfiles. Change the syntax/rules for Transformer configs. * If no argument was specified for the transformer config, no transformer used, regardless of what's in the classpath. * To use multiple transformers, you’ll need to specify the transformer-config as a json array (of json transformer configs) * To use one transformer with default settings, you can JUST put the name of the transformer in the arg. e.g. --transformer-config JsonTransformerForOpenSearch23PlusTargetTransformerProvider. I've also updated the key name to only use the short, simple name of a class rather than the fully qualified one with the namespace. Add a NoopTransformer, which makes unit and sanity testing a lot simpler. Signed-off-by: Greg Schohn <greg.schohn@gmail.com>
- Loading branch information
1 parent
bce4aed
commit c66da0e
Showing
7 changed files
with
49 additions
and
16 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
17 changes: 17 additions & 0 deletions
17
...rInterface/src/main/java/org/opensearch/migrations/transform/NoopTransformerProvider.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,17 @@ | ||
package org.opensearch.migrations.transform; | ||
|
||
import java.util.Map; | ||
|
||
public class NoopTransformerProvider implements IJsonTransformerProvider { | ||
private static class NoopTransformer implements IJsonTransformer { | ||
@Override | ||
public Map<String, Object> transformJson(Map<String, Object> incomingJson) { | ||
return incomingJson; | ||
} | ||
} | ||
|
||
@Override | ||
public IJsonTransformer createTransformer(Object jsonConfig) { | ||
return new NoopTransformer(); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
.../resources/META-INF.services/org.opensearch.migrations.transform.IJsonTransformerProvider
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 @@ | ||
org.opensearch.migrations.transform.NoopTransformerProvider |
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
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