writer.close();
}
private void writeSequenceFileFromPCollection(final FileSystem fs, final Path path,
final PCollection collection) throws IOException {
final PType pType = collection.getPType();
final Converter converter = pType.getConverter();
final Class valueClass = converter.getValueClass();
final SequenceFile.Writer writer = new SequenceFile.Writer(fs, fs.getConf(), path,
NullWritable.class, valueClass);
for (final Object o : collection.materialize()) {
final Object value = pType.getOutputMapFn().map(o);
writer.append(NullWritable.get(), value);
}
writer.close();
}