Package com.twitter.elephantbird.examples.proto.AddressBookProtos

Examples of com.twitter.elephantbird.examples.proto.AddressBookProtos.Person


    private final Text name_ = new Text();
    private final Text phoneNumber_ = new Text();

    @Override
    protected void map(LongWritable key, ProtobufWritable<Person> value, Context context) throws IOException, InterruptedException {
      Person p = value.get();

      name_.set(p.getName());
      for (PhoneNumber phoneNumber: p.getPhoneList()) {
        // Could do something with the PhoneType here; note that the protobuf data structure is fully preserved
        // inside the writable, including nesting.
        // PhoneType type = phoneNumber.getType()
        phoneNumber_.set(phoneNumber.getNumber());
        context.write(name_, phoneNumber_);
View Full Code Here

TOP

Related Classes of com.twitter.elephantbird.examples.proto.AddressBookProtos.Person

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.