Skip to content

Commit 6cf83ae

Browse files
committed
Merge #327 from branch '287-includePerformance' of https://github.com/metafacture/metafacture-fix
2 parents 6810484 + 4fb8426 commit 6cf83ae

File tree

122 files changed

+606393
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+606393
-0
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ editorconfig {
1414
'**/.*',
1515
'**/bin',
1616
'**/generated',
17+
'**/includeBenchmark*100000/expected.json',
1718
'**/node_modules',
1819
'**/out',
1920
'**/output-*',

metafix/src/main/java/org/metafacture/metafix/Metafix.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public class Metafix implements StreamPipe<StreamReceiver>, Maps { // checkstyle
7979
private final Map<String, Map<String, String>> maps = new HashMap<>();
8080
private final Map<String, RecordTransformer> fixCache = new HashMap<>();
8181
private final Map<String, RecordTransformer> macros = new HashMap<>();
82+
private final Map<String, String> pathCache = new HashMap<>();
8283
private final Map<String, String> vars = new HashMap<>();
8384
private final RecordTransformer recordTransformer;
8485
private final StreamFlattener flattener = new StreamFlattener();
@@ -149,6 +150,10 @@ public void literal(final String name, final String value) {
149150
}
150151

151152
public String resolvePath(final String path) {
153+
return pathCache.computeIfAbsent(path, this::resolvePathInternal);
154+
}
155+
156+
private String resolvePathInternal(final String path) {
152157
final String resolvedPath;
153158

154159
if (isValidUrl(path)) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
add_field("a", "1")
2+
add_field("b", "2")
3+
add_field("c", "3")
4+
add_field("d", "4")
5+
add_field("e", "5")
6+
add_field("f", "6")
7+
8+
copy_field("a", "g")
9+
copy_field("b", "h")
10+
copy_field("c", "i")
11+
copy_field("d", "j")
12+
copy_field("e", "k")
13+
copy_field("f", "l")
14+
15+
move_field("g", "m")
16+
move_field("h", "n")
17+
move_field("i", "o")
18+
move_field("j", "p")
19+
move_field("k", "q")
20+
move_field("l", "r")
21+
22+
copy_field("m", "s")
23+
copy_field("n", "t")
24+
copy_field("o", "u")
25+
copy_field("p", "v")
26+
copy_field("q", "w")
27+
copy_field("r", "x")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FLUX_DIR + "input.json"
2+
|open-file
3+
|as-lines
4+
|decode-json
5+
|fix(FLUX_DIR + "test.fix")
6+
|encode-json
7+
|write(FLUX_DIR + "output-metafix.json")
8+
;

metafix/src/test/resources/org/metafacture/metafix/integration/script/fromJson/toJson/includeBenchmarkBase1000/expected.json

Lines changed: 1000 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)