Package org.apache.crunch.lib.PersonProtos.Person

Examples of org.apache.crunch.lib.PersonProtos.Person.Builder


  private static class GenerateProto extends DoFn<String, Pair<String, Person>> {
      @Override
      public void process(String input, Emitter<Pair<String, Person>> emitter) {
          String[] fields = input.split(",");
          String key = fields[0];
          Builder b = Person.newBuilder().setFirst("first"+key).setLast("last"+key);
          emitter.emit(Pair.of(fields[0], b.build()));
      }
View Full Code Here


  private static class GenerateProtoPairs extends DoFn<String, Pair<String, Pair<String, Person>>> {
      @Override
      public void process(String input, Emitter<Pair<String, Pair<String, Person>>> emitter) {
          String[] fields = input.split(",");
          String key = fields[0];
          Builder b = Person.newBuilder().setFirst("first"+key).setLast("last"+key);
          emitter.emit(Pair.of(fields[0], Pair.of(fields[1], b.build())));
      }
View Full Code Here

TOP

Related Classes of org.apache.crunch.lib.PersonProtos.Person.Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.