use of org.yaml.snakeyaml.Yaml in project pinot by linkedin.
the class PerfBenchmarkDriverConf method main.
public static void main(String[] args) {
DumperOptions options = new DumperOptions();
options.setIndent(4);
options.setDefaultFlowStyle(FlowStyle.BLOCK);
Yaml yaml = new Yaml(options);
String dump = yaml.dump(new PerfBenchmarkDriverConf());
System.out.println(dump);
}
use of org.yaml.snakeyaml.Yaml in project storm by apache.
the class FluxParser method parseInputStream.
public static TopologyDef parseInputStream(InputStream inputStream, boolean dumpYaml, boolean processIncludes, String propertiesFile, boolean envSub) throws IOException {
Yaml yaml = yaml();
if (inputStream == null) {
LOG.error("Unable to load input stream");
System.exit(1);
}
TopologyDef topology = loadYaml(yaml, inputStream, propertiesFile, envSub);
if (dumpYaml) {
dumpYaml(topology, yaml);
}
if (processIncludes) {
return processIncludes(yaml, topology, propertiesFile, envSub);
} else {
return topology;
}
}
use of org.yaml.snakeyaml.Yaml in project sharding-jdbc by dangdangdotcom.
the class BestEffortsDeliveryJobMain method main.
/**
* 启动入口.
*
* @param args 启动参数
*/
// CHECKSTYLE:OFF
public static void main(final String[] args) throws Exception {
// CHECKSTYLE:ON
try (InputStreamReader inputStreamReader = new InputStreamReader(BestEffortsDeliveryJobMain.class.getResourceAsStream("/conf/config.yaml"), "UTF-8")) {
BestEffortsDeliveryConfiguration config = new Yaml(new Constructor(BestEffortsDeliveryConfiguration.class)).loadAs(inputStreamReader, BestEffortsDeliveryConfiguration.class);
new BestEffortsDeliveryJobFactory(config).init();
}
}
use of org.yaml.snakeyaml.Yaml in project kiimate by SINeWang.
the class VisitRawAssetCtl method visit.
@RequestMapping(value = "/{" + GROUP + "}/{" + NAME + "}/{" + STABILITY + "}/{" + VERSION + ":.+}/raw")
public ResponseEntity<?> visit(@RequestHeader(value = ErestHeaders.REQUEST_ID, required = false) String requestId, @RequestHeader(ErestHeaders.VISITOR_ID) String visitorId, @PathVariable(OWNER_ID) String ownerId, @PathVariable(GROUP) String group, @PathVariable(NAME) String name, @PathVariable(STABILITY) String stability, @PathVariable(VERSION) String version, @RequestParam(value = FORMAT_YML, required = false) String yml) {
ReadContext context = buildContext(requestId, ownerId, visitorId);
VisitRawAssetApi.GroupNameForm form = new VisitRawAssetApi.GroupNameForm();
form.setGroup(group);
form.setName(name);
if (null != stability) {
form.setStability(stability);
}
if (null != version) {
form.setVersion(version);
}
try {
if (yml == null) {
return VisitApiCaller.sync(api, context, form);
} else {
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
try {
Yaml yaml = new Yaml(options);
return ErestResponse.ok(requestId, yaml.dump(api.visit(context, form)));
} catch (BadRequest badRequest) {
return ErestResponse.badRequest(requestId, badRequest.getKeys());
} catch (Panic panic) {
return ErestResponse.badRequest(requestId, panic.getKeys());
}
}
} catch (NotFound notFound) {
return ErestResponse.notFound(requestId, notFound.getKeys());
}
}
use of org.yaml.snakeyaml.Yaml in project yyl_example by Relucent.
the class SnakeyamlTest method main.
public static void main(String[] args) throws IOException {
Yaml yaml = new Yaml();
try (InputStream input = SnakeyamlTest.class.getResourceAsStream("sample.yml")) {
Object result = yaml.load(input);
System.out.println(result.getClass());
System.out.println(result);
}
}
Aggregations