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

Examples of org.apache.crunch.lib.PersonProtos.Person.Builder.build()


      @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()));
      }
  }

  private static class GenerateProtoPairs extends DoFn<String, Pair<String, Pair<String, Person>>> {
      @Override
View Full Code Here


      @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())));
      }
  }

  private static Collection<String> coll(String... values) {
    return ImmutableSet.copyOf(values);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.