Path path = new Path("filename.of.sequence.file");
org.apache.hadoop.fs.RawLocalFileSystem fs = new org.apache.hadoop.fs.RawLocalFileSystem();
SequenceFile.Writer writer = new SequenceFile.Writer(fs, conf, path, Text.class, BytesWritable.class);
for(loop-through-data-here}
writer.append(new Text("key"), new BytesWritable("Value"));
Obviously, in the example above, the key is of type Text and the value of type BytesWritable; you can use other types.
No comments:
Post a Comment