List<KeyValue> kvs = generateKeyValues(100);
Path inputPath = tmpDir.getPath("in");
Path outputPath = tmpDir.getPath("out");
writeKeyValuesToHFile(inputPath, kvs);
Pipeline pipeline = new MRPipeline(HFileSourceIT.class, conf);
PCollection<KeyValue> in = pipeline.read(FromHBase.hfile(inputPath));
PCollection<String> texts = in.parallelDo(new MapFn<KeyValue, String>() {
@Override
public String map(KeyValue input) {
return input.toString();
}
}, strings());
texts.write(To.textFile(outputPath));
PipelineResult result = pipeline.run();
assertTrue(result.succeeded());
List<String> lines = FileUtils.readLines(new File(outputPath.toString(), "part-m-00000"));
assertEquals(kvs.size(), lines.size());
for (int i = 0; i < kvs.size(); i++) {