Commit 20ecfc51 authored by Daniel Lehmberg's avatar Daniel Lehmberg
Browse files

WIP: include new field to optionally write out meta data #199

parent 778ef1aa
Pipeline #84969 failed with stages
in 54 seconds
......@@ -47,6 +47,7 @@ public class DataProcessingJsonManager {
private static final String PROCESSORID_KEY = "id";
private static final String ATTRIBUTESTYPE_KEY = "attributesType";
private static final String TIMESTAMP_KEY = "isTimestamped";
private static final String WRITEMETA_KEY = "writeMetaData";
public static ObjectWriter writer;
private static ObjectMapper mapper;
......@@ -60,11 +61,13 @@ public class DataProcessingJsonManager {
private List<OutputFile<?>> outputFiles;
private List<DataProcessor<?, ?>> dataProcessors;
private boolean isTimestamped;
private boolean writeMetaData;
public DataProcessingJsonManager() {
this.outputFiles = new ArrayList<>();
this.dataProcessors = new ArrayList<>();
this.isTimestamped = true;
this.writeMetaData = false;
this.outputFileFactory = OutputFileFactory.instance();
this.processorFactory = DataProcessorFactory.instance();
}
......@@ -145,6 +148,11 @@ public class DataProcessingJsonManager {
manager.setTimestamped(timestampArrayNode.asBoolean());
}
JsonNode writeMetaData = node.get(WRITEMETA_KEY);
if (writeMetaData != null) {
manager.setWriteMetaData(writeMetaData.asBoolean());
}
return manager;
}
......@@ -233,10 +241,18 @@ public class DataProcessingJsonManager {
return this.isTimestamped;
}
public boolean isWriteMetaData(){
return this.writeMetaData;
}
public void setTimestamped(boolean isTimestamped) {
this.isTimestamped = isTimestamped;
}
public void setWriteMetaData(boolean writeMetaData){
this.writeMetaData = writeMetaData;
}
public String serialize() throws JsonProcessingException {
return writer.writeValueAsString(serializeToNode());
}
......@@ -258,8 +274,9 @@ public class DataProcessingJsonManager {
});
main.set(PROCESSORS_KEY, processorsArrayNode);
// part 3: timestamp
// part 3: timestamp + write meta data option
main.put(TIMESTAMP_KEY, this.isTimestamped);
main.put(WRITEMETA_KEY, this.writeMetaData);
return main;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment