Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Pipeline p = Pipeline.create(options);
- p.apply("read", HBaseIO.read().withConfiguration(configuration).withTableId(HBASE_TABLE))
- .apply(ParDo.of(new DoFn<Result, String>() {
- @ProcessElement
- public void processElement(ProcessContext c) {
- Result result = c.element();
- String rowkey = Bytes.toString(result.getRow());
- System.out.println("row key: " + rowkey);
- c.output(rowkey);
- }
- }))
- .apply(Count.<String>globally())
- .apply("FormatResults", MapElements.via(new SimpleFunction<Long, String>() {
- public String apply(Long element) {
- System.out.println("result: " + element.toString());
- return element.toString();
- }
- }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement