可用于将数据写入 HDFS 的“storm-hdfs 连接器”的源代码。github url 是:https ://github.com/ptgoetz/storm-hdfs 有一个特殊的拓扑:“HdfsFileTopology”用来写'|' 分隔数据到 HDFS。链接:https ://github.com/ptgoetz/storm-hdfs/blob/master/src/test/java/org/apache/storm/hdfs/bolt/HdfsFileTopology.java
我对代码的一部分有疑问:
Yaml yaml = new Yaml();
InputStream in = new FileInputStream(args[1]);
Map<String, Object> yamlConf = (Map<String, Object>) yaml.load(in);
in.close();
config.put("hdfs.config", yamlConf);
HdfsBolt bolt = new HdfsBolt()
.withConfigKey("hdfs.config")
.withFsUrl(args[0])
.withFileNameFormat(fileNameFormat)
.withRecordFormat(format)
.withRotationPolicy(rotationPolicy)
.withSyncPolicy(syncPolicy)
.addRotationAction(new MoveFileAction().toDestination("/dest2/"));
这部分代码是做什么的,尤其是 YAML 部分?