in beam-collector/src/main/java/com/google/collector/persistence/ToJson.java [41:52]
public PDone expand(PCollection<Constellation> input) {
return input
.apply(ParDo.of(new DoFn<Constellation, String>() {
@ProcessElement
public void processElement(ProcessContext ctx) throws InvalidProtocolBufferException {
Constellation element = ctx.element();
String print = JsonFormat.printer().print(element);
ctx.output(print);
}
}))
.apply(TextIO.write().to(outputFilePath));
}