-
Notifications
You must be signed in to change notification settings - Fork 30
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
Modify transformationPlugins contract to return Object to support One to Many transformations #1206
Modify transformationPlugins contract to return Object to support One to Many transformations #1206
Conversation
… to Many transformations Signed-off-by: Andre Kurait <[email protected]>
86a29fa
to
4452d8c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1206 +/- ##
============================================
- Coverage 80.64% 80.55% -0.09%
+ Complexity 3076 3075 -1
============================================
Files 421 421
Lines 15610 15629 +19
Branches 1053 1057 +4
============================================
+ Hits 12588 12590 +2
- Misses 2381 2394 +13
- Partials 641 645 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Thanks for the quick turn around
return MAPPER.writeValueAsString(map); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
private MigrationItem transformMigrationItem(MigrationItem migrationItem) { | ||
// Keep untouched original for logging | ||
final Map<String, Object> originalMap = MAPPER.convertValue(migrationItem, Map.class); | ||
var transformedMigrationItem = transformer.transformJson(MAPPER.convertValue(migrationItem, Map.class)); | ||
Object transformedMigrationItem = transformer.transformJson(MAPPER.convertValue(migrationItem, Map.class)); |
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.
Could you switch back to var?
Object transformedMigrationItem = transformer.transformJson(MAPPER.convertValue(migrationItem, Map.class)); | |
var transformedMigrationItem = transformer.transformJson(MAPPER.convertValue(migrationItem, Map.class)); |
@@ -142,7 +142,7 @@ public void accept(SourceTargetCaptureTuple tuple, ParsedHttpMessagesAsDicts par | |||
if (tupleLogger.isInfoEnabled()) { | |||
try { | |||
var originalTuple = toJSONObject(tuple, parsedMessages); | |||
var transformedTuple = tupleTransformer.transformJson(originalTuple); | |||
Object transformedTuple = tupleTransformer.transformJson(originalTuple); |
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.
Object transformedTuple = tupleTransformer.transformJson(originalTuple); | |
var transformedTuple = tupleTransformer.transformJson(originalTuple); |
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.
Seems to be in a number of other places in this PR too. Seems like it might reduce the change surface area, your call.
var headers = (Map<String, Object>) incomingJson.get(JsonKeysForHttpMessage.HEADERS_KEY); | ||
public Object transformJson(Object incomingJson) { | ||
@SuppressWarnings("unchecked") | ||
var headers = (Map<String, Object>) ((Map<String, Object>) incomingJson).get(JsonKeysForHttpMessage.HEADERS_KEY); |
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.
Could we make a function that encapsulates (read as 'hides') the casting cases?
Description
Modify transformationPlugins contract to return Object to support One to Many transformations.
Initial step in plugin framework, applications (RFS, Metadata, Replayer) still need to be updated to support
Issues Resolved
Testing
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.