Skip to content

Commit

Permalink
Merge #327 from branch '287-includePerformance' of https://github.com…
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Oct 30, 2023
2 parents 6810484 + 4fb8426 commit 6cf83ae
Show file tree
Hide file tree
Showing 122 changed files with 606,393 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ editorconfig {
'**/.*',
'**/bin',
'**/generated',
'**/includeBenchmark*100000/expected.json',
'**/node_modules',
'**/out',
'**/output-*',
Expand Down
5 changes: 5 additions & 0 deletions metafix/src/main/java/org/metafacture/metafix/Metafix.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public class Metafix implements StreamPipe<StreamReceiver>, Maps { // checkstyle
private final Map<String, Map<String, String>> maps = new HashMap<>();
private final Map<String, RecordTransformer> fixCache = new HashMap<>();
private final Map<String, RecordTransformer> macros = new HashMap<>();
private final Map<String, String> pathCache = new HashMap<>();
private final Map<String, String> vars = new HashMap<>();
private final RecordTransformer recordTransformer;
private final StreamFlattener flattener = new StreamFlattener();
Expand Down Expand Up @@ -149,6 +150,10 @@ public void literal(final String name, final String value) {
}

public String resolvePath(final String path) {
return pathCache.computeIfAbsent(path, this::resolvePathInternal);
}

private String resolvePathInternal(final String path) {
final String resolvedPath;

if (isValidUrl(path)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"a":"1","b":"2","c":"3","d":"4","e":"5","f":"6","m":"1","n":"2","o":"3","p":"4","q":"5","r":"6","s":"1","t":"2","u":"3","v":"4","w":"5","x":"6"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
add_field("a", "1")
add_field("b", "2")
add_field("c", "3")
add_field("d", "4")
add_field("e", "5")
add_field("f", "6")

copy_field("a", "g")
copy_field("b", "h")
copy_field("c", "i")
copy_field("d", "j")
copy_field("e", "k")
copy_field("f", "l")

move_field("g", "m")
move_field("h", "n")
move_field("i", "o")
move_field("j", "p")
move_field("k", "q")
move_field("l", "r")

copy_field("m", "s")
copy_field("n", "t")
copy_field("o", "u")
copy_field("p", "v")
copy_field("q", "w")
copy_field("r", "x")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-lines
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json
|write(FLUX_DIR + "output-metafix.json")
;

Large diffs are not rendered by default.

Loading

0 comments on commit 6cf83ae

Please sign in to comment.