Path root = new Path("file://" + path);
fs.mkdirs(root);
fs.create(new Path(root, "finished")).close();
FileSystem ns = fs.getVolumeByPath(root).getFileSystem();
@SuppressWarnings("deprecation")
Writer oddWriter = new Writer(ns.getConf(), ns, new Path(root, "odd").toString(), IntWritable.class, BytesWritable.class);
BytesWritable value = new BytesWritable("someValue".getBytes());
for (int i = 1; i < 1000; i += 2) {
oddWriter.append(new IntWritable(i), value);
}
oddWriter.close();
@SuppressWarnings("deprecation")
Writer evenWriter = new Writer(ns.getConf(), ns, new Path(root, "even").toString(), IntWritable.class, BytesWritable.class);
for (int i = 0; i < 1000; i += 2) {
if (i == 10)
continue;
evenWriter.append(new IntWritable(i), value);
}
evenWriter.close();
}