use of org.embulk.config.ModelManager in project embulk by embulk.
the class EmbulkRunner method previewInternal.
private void previewInternal(final ConfigSource configSource, final String format) throws IOException {
final PreviewResult previewResult = this.embed.preview(configSource);
final ModelManager modelManager = this.embed.getModelManager();
final PreviewPrinter printer;
switch(format != null ? format : "table") {
case "table":
printer = new TablePreviewPrinter(System.out, modelManager, previewResult.getSchema());
break;
case "vertical":
printer = new VerticalPreviewPrinter(System.out, modelManager, previewResult.getSchema());
break;
default:
throw new IllegalArgumentException("Unknown preview output format '" + format + "'. Supported formats: table, vertical");
}
printer.printAllPages(previewResult.getPages());
printer.finish();
}
use of org.embulk.config.ModelManager in project embulk by embulk.
the class EmbulkRunner method dumpResumeStateInYaml.
private String dumpResumeStateInYaml(final ResumeState modelObject) {
final ModelManager modelManager = this.embed.getModelManager();
final Object object = modelManager.readObject(Object.class, modelManager.writeObject(modelObject));
return (new org.yaml.snakeyaml.Yaml()).dump(object);
}
use of org.embulk.config.ModelManager in project embulk by embulk.
the class EmbulkRunner method dumpDataSourceInYaml.
private String dumpDataSourceInYaml(final DataSource modelObject) {
final ModelManager modelManager = this.embed.getModelManager();
final Object object = modelManager.readObject(Object.class, modelManager.writeObject(modelObject));
return (new org.yaml.snakeyaml.Yaml()).dump(object);
}
Aggregations