zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iv...@apache.org
Subject svn commit: r1354492 [3/3] - in /zookeeper/bookkeeper/trunk: ./ bookkeeper-server/ bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ bookkeeper-server/src/main/proto/ bookkeeper-s...
Date Wed, 27 Jun 2012 13:35:15 GMT
Modified: zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/java/org/apache/hedwig/protocol/PubSubProtocol.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/java/org/apache/hedwig/protocol/PubSubProtocol.java?rev=1354492&r1=1354491&r2=1354492&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/java/org/apache/hedwig/protocol/PubSubProtocol.java (original)
+++ zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/java/org/apache/hedwig/protocol/PubSubProtocol.java Wed Jun 27 13:35:11 2012
@@ -13,6 +13,8 @@ public final class PubSubProtocol {
     VERSION_ONE(0, 1),
     ;
     
+    public static final int VERSION_ONE_VALUE = 1;
+    
     
     public final int getNumber() { return value; }
     
@@ -31,8 +33,8 @@ public final class PubSubProtocol {
         internalValueMap =
           new com.google.protobuf.Internal.EnumLiteMap<ProtocolVersion>() {
             public ProtocolVersion findValueByNumber(int number) {
-              return ProtocolVersion.valueOf(number)
-    ;        }
+              return ProtocolVersion.valueOf(number);
+            }
           };
     
     public final com.google.protobuf.Descriptors.EnumValueDescriptor
@@ -51,6 +53,7 @@ public final class PubSubProtocol {
     private static final ProtocolVersion[] VALUES = {
       VERSION_ONE, 
     };
+    
     public static ProtocolVersion valueOf(
         com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
       if (desc.getType() != getDescriptor()) {
@@ -59,17 +62,15 @@ public final class PubSubProtocol {
       }
       return VALUES[desc.getIndex()];
     }
+    
     private final int index;
     private final int value;
+    
     private ProtocolVersion(int index, int value) {
       this.index = index;
       this.value = value;
     }
     
-    static {
-      org.apache.hedwig.protocol.PubSubProtocol.getDescriptor();
-    }
-    
     // @@protoc_insertion_point(enum_scope:Hedwig.ProtocolVersion)
   }
   
@@ -83,6 +84,13 @@ public final class PubSubProtocol {
     STOP_DELIVERY(5, 5),
     ;
     
+    public static final int PUBLISH_VALUE = 0;
+    public static final int SUBSCRIBE_VALUE = 1;
+    public static final int CONSUME_VALUE = 2;
+    public static final int UNSUBSCRIBE_VALUE = 3;
+    public static final int START_DELIVERY_VALUE = 4;
+    public static final int STOP_DELIVERY_VALUE = 5;
+    
     
     public final int getNumber() { return value; }
     
@@ -106,8 +114,8 @@ public final class PubSubProtocol {
         internalValueMap =
           new com.google.protobuf.Internal.EnumLiteMap<OperationType>() {
             public OperationType findValueByNumber(int number) {
-              return OperationType.valueOf(number)
-    ;        }
+              return OperationType.valueOf(number);
+            }
           };
     
     public final com.google.protobuf.Descriptors.EnumValueDescriptor
@@ -126,6 +134,7 @@ public final class PubSubProtocol {
     private static final OperationType[] VALUES = {
       PUBLISH, SUBSCRIBE, CONSUME, UNSUBSCRIBE, START_DELIVERY, STOP_DELIVERY, 
     };
+    
     public static OperationType valueOf(
         com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
       if (desc.getType() != getDescriptor()) {
@@ -134,17 +143,15 @@ public final class PubSubProtocol {
       }
       return VALUES[desc.getIndex()];
     }
+    
     private final int index;
     private final int value;
+    
     private OperationType(int index, int value) {
       this.index = index;
       this.value = value;
     }
     
-    static {
-      org.apache.hedwig.protocol.PubSubProtocol.getDescriptor();
-    }
-    
     // @@protoc_insertion_point(enum_scope:Hedwig.OperationType)
   }
   
@@ -164,6 +171,19 @@ public final class PubSubProtocol {
     COMPOSITE(11, 700),
     ;
     
+    public static final int SUCCESS_VALUE = 0;
+    public static final int MALFORMED_REQUEST_VALUE = 401;
+    public static final int NO_SUCH_TOPIC_VALUE = 402;
+    public static final int CLIENT_ALREADY_SUBSCRIBED_VALUE = 403;
+    public static final int CLIENT_NOT_SUBSCRIBED_VALUE = 404;
+    public static final int COULD_NOT_CONNECT_VALUE = 405;
+    public static final int TOPIC_BUSY_VALUE = 406;
+    public static final int NOT_RESPONSIBLE_FOR_TOPIC_VALUE = 501;
+    public static final int SERVICE_DOWN_VALUE = 502;
+    public static final int UNCERTAIN_STATE_VALUE = 503;
+    public static final int UNEXPECTED_CONDITION_VALUE = 600;
+    public static final int COMPOSITE_VALUE = 700;
+    
     
     public final int getNumber() { return value; }
     
@@ -193,8 +213,8 @@ public final class PubSubProtocol {
         internalValueMap =
           new com.google.protobuf.Internal.EnumLiteMap<StatusCode>() {
             public StatusCode findValueByNumber(int number) {
-              return StatusCode.valueOf(number)
-    ;        }
+              return StatusCode.valueOf(number);
+            }
           };
     
     public final com.google.protobuf.Descriptors.EnumValueDescriptor
@@ -213,6 +233,7 @@ public final class PubSubProtocol {
     private static final StatusCode[] VALUES = {
       SUCCESS, MALFORMED_REQUEST, NO_SUCH_TOPIC, CLIENT_ALREADY_SUBSCRIBED, CLIENT_NOT_SUBSCRIBED, COULD_NOT_CONNECT, TOPIC_BUSY, NOT_RESPONSIBLE_FOR_TOPIC, SERVICE_DOWN, UNCERTAIN_STATE, UNEXPECTED_CONDITION, COMPOSITE, 
     };
+    
     public static StatusCode valueOf(
         com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
       if (desc.getType() != getDescriptor()) {
@@ -221,25 +242,40 @@ public final class PubSubProtocol {
       }
       return VALUES[desc.getIndex()];
     }
+    
     private final int index;
     private final int value;
+    
     private StatusCode(int index, int value) {
       this.index = index;
       this.value = value;
     }
     
-    static {
-      org.apache.hedwig.protocol.PubSubProtocol.getDescriptor();
-    }
-    
     // @@protoc_insertion_point(enum_scope:Hedwig.StatusCode)
   }
   
+  public interface MessageOrBuilder
+      extends com.google.protobuf.MessageOrBuilder {
+    
+    // required bytes body = 1;
+    boolean hasBody();
+    com.google.protobuf.ByteString getBody();
+    
+    // optional bytes srcRegion = 2;
+    boolean hasSrcRegion();
+    com.google.protobuf.ByteString getSrcRegion();
+    
+    // optional .Hedwig.MessageSeqId msgId = 3;
+    boolean hasMsgId();
+    org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId getMsgId();
+    org.apache.hedwig.protocol.PubSubProtocol.MessageSeqIdOrBuilder getMsgIdOrBuilder();
+  }
   public static final class Message extends
-      com.google.protobuf.GeneratedMessage {
+      com.google.protobuf.GeneratedMessage
+      implements MessageOrBuilder {
     // Use Message.newBuilder() to construct.
-    private Message() {
-      initFields();
+    private Message(Builder builder) {
+      super(builder);
     }
     private Message(boolean noInit) {}
     
@@ -262,49 +298,75 @@ public final class PubSubProtocol {
       return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_Message_fieldAccessorTable;
     }
     
+    private int bitField0_;
     // required bytes body = 1;
     public static final int BODY_FIELD_NUMBER = 1;
-    private boolean hasBody;
-    private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY;
-    public boolean hasBody() { return hasBody; }
-    public com.google.protobuf.ByteString getBody() { return body_; }
+    private com.google.protobuf.ByteString body_;
+    public boolean hasBody() {
+      return ((bitField0_ & 0x00000001) == 0x00000001);
+    }
+    public com.google.protobuf.ByteString getBody() {
+      return body_;
+    }
     
     // optional bytes srcRegion = 2;
     public static final int SRCREGION_FIELD_NUMBER = 2;
-    private boolean hasSrcRegion;
-    private com.google.protobuf.ByteString srcRegion_ = com.google.protobuf.ByteString.EMPTY;
-    public boolean hasSrcRegion() { return hasSrcRegion; }
-    public com.google.protobuf.ByteString getSrcRegion() { return srcRegion_; }
+    private com.google.protobuf.ByteString srcRegion_;
+    public boolean hasSrcRegion() {
+      return ((bitField0_ & 0x00000002) == 0x00000002);
+    }
+    public com.google.protobuf.ByteString getSrcRegion() {
+      return srcRegion_;
+    }
     
     // optional .Hedwig.MessageSeqId msgId = 3;
     public static final int MSGID_FIELD_NUMBER = 3;
-    private boolean hasMsgId;
     private org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId msgId_;
-    public boolean hasMsgId() { return hasMsgId; }
-    public org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId getMsgId() { return msgId_; }
+    public boolean hasMsgId() {
+      return ((bitField0_ & 0x00000004) == 0x00000004);
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId getMsgId() {
+      return msgId_;
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.MessageSeqIdOrBuilder getMsgIdOrBuilder() {
+      return msgId_;
+    }
     
     private void initFields() {
+      body_ = com.google.protobuf.ByteString.EMPTY;
+      srcRegion_ = com.google.protobuf.ByteString.EMPTY;
       msgId_ = org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.getDefaultInstance();
     }
+    private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
-      if (!hasBody) return false;
+      byte isInitialized = memoizedIsInitialized;
+      if (isInitialized != -1) return isInitialized == 1;
+      
+      if (!hasBody()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
       if (hasMsgId()) {
-        if (!getMsgId().isInitialized()) return false;
+        if (!getMsgId().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
       }
+      memoizedIsInitialized = 1;
       return true;
     }
     
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
-      if (hasBody()) {
-        output.writeBytes(1, getBody());
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        output.writeBytes(1, body_);
       }
-      if (hasSrcRegion()) {
-        output.writeBytes(2, getSrcRegion());
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+        output.writeBytes(2, srcRegion_);
       }
-      if (hasMsgId()) {
-        output.writeMessage(3, getMsgId());
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        output.writeMessage(3, msgId_);
       }
       getUnknownFields().writeTo(output);
     }
@@ -315,23 +377,30 @@ public final class PubSubProtocol {
       if (size != -1) return size;
     
       size = 0;
-      if (hasBody()) {
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(1, getBody());
+          .computeBytesSize(1, body_);
       }
-      if (hasSrcRegion()) {
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(2, getSrcRegion());
+          .computeBytesSize(2, srcRegion_);
       }
-      if (hasMsgId()) {
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(3, getMsgId());
+          .computeMessageSize(3, msgId_);
       }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
     
+    private static final long serialVersionUID = 0L;
+    @java.lang.Override
+    protected java.lang.Object writeReplace()
+        throws java.io.ObjectStreamException {
+      return super.writeReplace();
+    }
+    
     public static org.apache.hedwig.protocol.PubSubProtocol.Message parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
@@ -406,34 +475,60 @@ public final class PubSubProtocol {
     }
     public Builder toBuilder() { return newBuilder(this); }
     
+    @java.lang.Override
+    protected Builder newBuilderForType(
+        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+      Builder builder = new Builder(parent);
+      return builder;
+    }
     public static final class Builder extends
-        com.google.protobuf.GeneratedMessage.Builder<Builder> {
-      private org.apache.hedwig.protocol.PubSubProtocol.Message result;
+        com.google.protobuf.GeneratedMessage.Builder<Builder>
+       implements org.apache.hedwig.protocol.PubSubProtocol.MessageOrBuilder {
+      public static final com.google.protobuf.Descriptors.Descriptor
+          getDescriptor() {
+        return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_Message_descriptor;
+      }
       
-      // Construct using org.apache.hedwig.protocol.PubSubProtocol.Message.newBuilder()
-      private Builder() {}
+      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+          internalGetFieldAccessorTable() {
+        return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_Message_fieldAccessorTable;
+      }
       
-      private static Builder create() {
-        Builder builder = new Builder();
-        builder.result = new org.apache.hedwig.protocol.PubSubProtocol.Message();
-        return builder;
+      // Construct using org.apache.hedwig.protocol.PubSubProtocol.Message.newBuilder()
+      private Builder() {
+        maybeForceBuilderInitialization();
       }
       
-      protected org.apache.hedwig.protocol.PubSubProtocol.Message internalGetResult() {
-        return result;
+      private Builder(BuilderParent parent) {
+        super(parent);
+        maybeForceBuilderInitialization();
+      }
+      private void maybeForceBuilderInitialization() {
+        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+          getMsgIdFieldBuilder();
+        }
+      }
+      private static Builder create() {
+        return new Builder();
       }
       
       public Builder clear() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "Cannot call clear() after build().");
+        super.clear();
+        body_ = com.google.protobuf.ByteString.EMPTY;
+        bitField0_ = (bitField0_ & ~0x00000001);
+        srcRegion_ = com.google.protobuf.ByteString.EMPTY;
+        bitField0_ = (bitField0_ & ~0x00000002);
+        if (msgIdBuilder_ == null) {
+          msgId_ = org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.getDefaultInstance();
+        } else {
+          msgIdBuilder_.clear();
         }
-        result = new org.apache.hedwig.protocol.PubSubProtocol.Message();
+        bitField0_ = (bitField0_ & ~0x00000004);
         return this;
       }
       
       public Builder clone() {
-        return create().mergeFrom(result);
+        return create().mergeFrom(buildPartial());
       }
       
       public com.google.protobuf.Descriptors.Descriptor
@@ -445,33 +540,47 @@ public final class PubSubProtocol {
         return org.apache.hedwig.protocol.PubSubProtocol.Message.getDefaultInstance();
       }
       
-      public boolean isInitialized() {
-        return result.isInitialized();
-      }
       public org.apache.hedwig.protocol.PubSubProtocol.Message build() {
-        if (result != null && !isInitialized()) {
+        org.apache.hedwig.protocol.PubSubProtocol.Message result = buildPartial();
+        if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
         }
-        return buildPartial();
+        return result;
       }
       
       private org.apache.hedwig.protocol.PubSubProtocol.Message buildParsed()
           throws com.google.protobuf.InvalidProtocolBufferException {
-        if (!isInitialized()) {
+        org.apache.hedwig.protocol.PubSubProtocol.Message result = buildPartial();
+        if (!result.isInitialized()) {
           throw newUninitializedMessageException(
             result).asInvalidProtocolBufferException();
         }
-        return buildPartial();
+        return result;
       }
       
       public org.apache.hedwig.protocol.PubSubProtocol.Message buildPartial() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "build() has already been called on this Builder.");
-        }
-        org.apache.hedwig.protocol.PubSubProtocol.Message returnMe = result;
-        result = null;
-        return returnMe;
+        org.apache.hedwig.protocol.PubSubProtocol.Message result = new org.apache.hedwig.protocol.PubSubProtocol.Message(this);
+        int from_bitField0_ = bitField0_;
+        int to_bitField0_ = 0;
+        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+          to_bitField0_ |= 0x00000001;
+        }
+        result.body_ = body_;
+        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+          to_bitField0_ |= 0x00000002;
+        }
+        result.srcRegion_ = srcRegion_;
+        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+          to_bitField0_ |= 0x00000004;
+        }
+        if (msgIdBuilder_ == null) {
+          result.msgId_ = msgId_;
+        } else {
+          result.msgId_ = msgIdBuilder_.build();
+        }
+        result.bitField0_ = to_bitField0_;
+        onBuilt();
+        return result;
       }
       
       public Builder mergeFrom(com.google.protobuf.Message other) {
@@ -498,6 +607,20 @@ public final class PubSubProtocol {
         return this;
       }
       
+      public final boolean isInitialized() {
+        if (!hasBody()) {
+          
+          return false;
+        }
+        if (hasMsgId()) {
+          if (!getMsgId().isInitialized()) {
+            
+            return false;
+          }
+        }
+        return true;
+      }
+      
       public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
@@ -510,21 +633,25 @@ public final class PubSubProtocol {
           switch (tag) {
             case 0:
               this.setUnknownFields(unknownFields.build());
+              onChanged();
               return this;
             default: {
               if (!parseUnknownField(input, unknownFields,
                                      extensionRegistry, tag)) {
                 this.setUnknownFields(unknownFields.build());
+                onChanged();
                 return this;
               }
               break;
             }
             case 10: {
-              setBody(input.readBytes());
+              bitField0_ |= 0x00000001;
+              body_ = input.readBytes();
               break;
             }
             case 18: {
-              setSrcRegion(input.readBytes());
+              bitField0_ |= 0x00000002;
+              srcRegion_ = input.readBytes();
               break;
             }
             case 26: {
@@ -540,103 +667,174 @@ public final class PubSubProtocol {
         }
       }
       
+      private int bitField0_;
       
       // required bytes body = 1;
+      private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY;
       public boolean hasBody() {
-        return result.hasBody();
+        return ((bitField0_ & 0x00000001) == 0x00000001);
       }
       public com.google.protobuf.ByteString getBody() {
-        return result.getBody();
+        return body_;
       }
       public Builder setBody(com.google.protobuf.ByteString value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  result.hasBody = true;
-        result.body_ = value;
+  bitField0_ |= 0x00000001;
+        body_ = value;
+        onChanged();
         return this;
       }
       public Builder clearBody() {
-        result.hasBody = false;
-        result.body_ = getDefaultInstance().getBody();
+        bitField0_ = (bitField0_ & ~0x00000001);
+        body_ = getDefaultInstance().getBody();
+        onChanged();
         return this;
       }
       
       // optional bytes srcRegion = 2;
+      private com.google.protobuf.ByteString srcRegion_ = com.google.protobuf.ByteString.EMPTY;
       public boolean hasSrcRegion() {
-        return result.hasSrcRegion();
+        return ((bitField0_ & 0x00000002) == 0x00000002);
       }
       public com.google.protobuf.ByteString getSrcRegion() {
-        return result.getSrcRegion();
+        return srcRegion_;
       }
       public Builder setSrcRegion(com.google.protobuf.ByteString value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  result.hasSrcRegion = true;
-        result.srcRegion_ = value;
+  bitField0_ |= 0x00000002;
+        srcRegion_ = value;
+        onChanged();
         return this;
       }
       public Builder clearSrcRegion() {
-        result.hasSrcRegion = false;
-        result.srcRegion_ = getDefaultInstance().getSrcRegion();
+        bitField0_ = (bitField0_ & ~0x00000002);
+        srcRegion_ = getDefaultInstance().getSrcRegion();
+        onChanged();
         return this;
       }
       
       // optional .Hedwig.MessageSeqId msgId = 3;
+      private org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId msgId_ = org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.getDefaultInstance();
+      private com.google.protobuf.SingleFieldBuilder<
+          org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId, org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.Builder, org.apache.hedwig.protocol.PubSubProtocol.MessageSeqIdOrBuilder> msgIdBuilder_;
       public boolean hasMsgId() {
-        return result.hasMsgId();
+        return ((bitField0_ & 0x00000004) == 0x00000004);
       }
       public org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId getMsgId() {
-        return result.getMsgId();
+        if (msgIdBuilder_ == null) {
+          return msgId_;
+        } else {
+          return msgIdBuilder_.getMessage();
+        }
       }
       public Builder setMsgId(org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId value) {
-        if (value == null) {
-          throw new NullPointerException();
+        if (msgIdBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          msgId_ = value;
+          onChanged();
+        } else {
+          msgIdBuilder_.setMessage(value);
         }
-        result.hasMsgId = true;
-        result.msgId_ = value;
+        bitField0_ |= 0x00000004;
         return this;
       }
-      public Builder setMsgId(org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.Builder builderForValue) {
-        result.hasMsgId = true;
-        result.msgId_ = builderForValue.build();
+      public Builder setMsgId(
+          org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.Builder builderForValue) {
+        if (msgIdBuilder_ == null) {
+          msgId_ = builderForValue.build();
+          onChanged();
+        } else {
+          msgIdBuilder_.setMessage(builderForValue.build());
+        }
+        bitField0_ |= 0x00000004;
         return this;
       }
       public Builder mergeMsgId(org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId value) {
-        if (result.hasMsgId() &&
-            result.msgId_ != org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.getDefaultInstance()) {
-          result.msgId_ =
-            org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.newBuilder(result.msgId_).mergeFrom(value).buildPartial();
+        if (msgIdBuilder_ == null) {
+          if (((bitField0_ & 0x00000004) == 0x00000004) &&
+              msgId_ != org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.getDefaultInstance()) {
+            msgId_ =
+              org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.newBuilder(msgId_).mergeFrom(value).buildPartial();
+          } else {
+            msgId_ = value;
+          }
+          onChanged();
         } else {
-          result.msgId_ = value;
+          msgIdBuilder_.mergeFrom(value);
         }
-        result.hasMsgId = true;
+        bitField0_ |= 0x00000004;
         return this;
       }
       public Builder clearMsgId() {
-        result.hasMsgId = false;
-        result.msgId_ = org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.getDefaultInstance();
+        if (msgIdBuilder_ == null) {
+          msgId_ = org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.getDefaultInstance();
+          onChanged();
+        } else {
+          msgIdBuilder_.clear();
+        }
+        bitField0_ = (bitField0_ & ~0x00000004);
         return this;
       }
+      public org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.Builder getMsgIdBuilder() {
+        bitField0_ |= 0x00000004;
+        onChanged();
+        return getMsgIdFieldBuilder().getBuilder();
+      }
+      public org.apache.hedwig.protocol.PubSubProtocol.MessageSeqIdOrBuilder getMsgIdOrBuilder() {
+        if (msgIdBuilder_ != null) {
+          return msgIdBuilder_.getMessageOrBuilder();
+        } else {
+          return msgId_;
+        }
+      }
+      private com.google.protobuf.SingleFieldBuilder<
+          org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId, org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.Builder, org.apache.hedwig.protocol.PubSubProtocol.MessageSeqIdOrBuilder> 
+          getMsgIdFieldBuilder() {
+        if (msgIdBuilder_ == null) {
+          msgIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+              org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId, org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.Builder, org.apache.hedwig.protocol.PubSubProtocol.MessageSeqIdOrBuilder>(
+                  msgId_,
+                  getParentForChildren(),
+                  isClean());
+          msgId_ = null;
+        }
+        return msgIdBuilder_;
+      }
       
       // @@protoc_insertion_point(builder_scope:Hedwig.Message)
     }
     
     static {
       defaultInstance = new Message(true);
-      org.apache.hedwig.protocol.PubSubProtocol.internalForceInit();
       defaultInstance.initFields();
     }
     
     // @@protoc_insertion_point(class_scope:Hedwig.Message)
   }
   
+  public interface RegionSpecificSeqIdOrBuilder
+      extends com.google.protobuf.MessageOrBuilder {
+    
+    // required bytes region = 1;
+    boolean hasRegion();
+    com.google.protobuf.ByteString getRegion();
+    
+    // required uint64 seqId = 2;
+    boolean hasSeqId();
+    long getSeqId();
+  }
   public static final class RegionSpecificSeqId extends
-      com.google.protobuf.GeneratedMessage {
+      com.google.protobuf.GeneratedMessage
+      implements RegionSpecificSeqIdOrBuilder {
     // Use RegionSpecificSeqId.newBuilder() to construct.
-    private RegionSpecificSeqId() {
-      initFields();
+    private RegionSpecificSeqId(Builder builder) {
+      super(builder);
     }
     private RegionSpecificSeqId(boolean noInit) {}
     
@@ -659,36 +857,56 @@ public final class PubSubProtocol {
       return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_RegionSpecificSeqId_fieldAccessorTable;
     }
     
+    private int bitField0_;
     // required bytes region = 1;
     public static final int REGION_FIELD_NUMBER = 1;
-    private boolean hasRegion;
-    private com.google.protobuf.ByteString region_ = com.google.protobuf.ByteString.EMPTY;
-    public boolean hasRegion() { return hasRegion; }
-    public com.google.protobuf.ByteString getRegion() { return region_; }
+    private com.google.protobuf.ByteString region_;
+    public boolean hasRegion() {
+      return ((bitField0_ & 0x00000001) == 0x00000001);
+    }
+    public com.google.protobuf.ByteString getRegion() {
+      return region_;
+    }
     
     // required uint64 seqId = 2;
     public static final int SEQID_FIELD_NUMBER = 2;
-    private boolean hasSeqId;
-    private long seqId_ = 0L;
-    public boolean hasSeqId() { return hasSeqId; }
-    public long getSeqId() { return seqId_; }
+    private long seqId_;
+    public boolean hasSeqId() {
+      return ((bitField0_ & 0x00000002) == 0x00000002);
+    }
+    public long getSeqId() {
+      return seqId_;
+    }
     
     private void initFields() {
+      region_ = com.google.protobuf.ByteString.EMPTY;
+      seqId_ = 0L;
     }
+    private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
-      if (!hasRegion) return false;
-      if (!hasSeqId) return false;
+      byte isInitialized = memoizedIsInitialized;
+      if (isInitialized != -1) return isInitialized == 1;
+      
+      if (!hasRegion()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasSeqId()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      memoizedIsInitialized = 1;
       return true;
     }
     
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
-      if (hasRegion()) {
-        output.writeBytes(1, getRegion());
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        output.writeBytes(1, region_);
       }
-      if (hasSeqId()) {
-        output.writeUInt64(2, getSeqId());
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+        output.writeUInt64(2, seqId_);
       }
       getUnknownFields().writeTo(output);
     }
@@ -699,19 +917,26 @@ public final class PubSubProtocol {
       if (size != -1) return size;
     
       size = 0;
-      if (hasRegion()) {
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(1, getRegion());
+          .computeBytesSize(1, region_);
       }
-      if (hasSeqId()) {
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeUInt64Size(2, getSeqId());
+          .computeUInt64Size(2, seqId_);
       }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
     
+    private static final long serialVersionUID = 0L;
+    @java.lang.Override
+    protected java.lang.Object writeReplace()
+        throws java.io.ObjectStreamException {
+      return super.writeReplace();
+    }
+    
     public static org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
@@ -786,34 +1011,53 @@ public final class PubSubProtocol {
     }
     public Builder toBuilder() { return newBuilder(this); }
     
+    @java.lang.Override
+    protected Builder newBuilderForType(
+        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+      Builder builder = new Builder(parent);
+      return builder;
+    }
     public static final class Builder extends
-        com.google.protobuf.GeneratedMessage.Builder<Builder> {
-      private org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId result;
+        com.google.protobuf.GeneratedMessage.Builder<Builder>
+       implements org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder {
+      public static final com.google.protobuf.Descriptors.Descriptor
+          getDescriptor() {
+        return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_RegionSpecificSeqId_descriptor;
+      }
       
-      // Construct using org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.newBuilder()
-      private Builder() {}
+      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+          internalGetFieldAccessorTable() {
+        return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_RegionSpecificSeqId_fieldAccessorTable;
+      }
       
-      private static Builder create() {
-        Builder builder = new Builder();
-        builder.result = new org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId();
-        return builder;
+      // Construct using org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.newBuilder()
+      private Builder() {
+        maybeForceBuilderInitialization();
       }
       
-      protected org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId internalGetResult() {
-        return result;
+      private Builder(BuilderParent parent) {
+        super(parent);
+        maybeForceBuilderInitialization();
+      }
+      private void maybeForceBuilderInitialization() {
+        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+        }
+      }
+      private static Builder create() {
+        return new Builder();
       }
       
       public Builder clear() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "Cannot call clear() after build().");
-        }
-        result = new org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId();
+        super.clear();
+        region_ = com.google.protobuf.ByteString.EMPTY;
+        bitField0_ = (bitField0_ & ~0x00000001);
+        seqId_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00000002);
         return this;
       }
       
       public Builder clone() {
-        return create().mergeFrom(result);
+        return create().mergeFrom(buildPartial());
       }
       
       public com.google.protobuf.Descriptors.Descriptor
@@ -825,33 +1069,39 @@ public final class PubSubProtocol {
         return org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.getDefaultInstance();
       }
       
-      public boolean isInitialized() {
-        return result.isInitialized();
-      }
       public org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId build() {
-        if (result != null && !isInitialized()) {
+        org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId result = buildPartial();
+        if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
         }
-        return buildPartial();
+        return result;
       }
       
       private org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId buildParsed()
           throws com.google.protobuf.InvalidProtocolBufferException {
-        if (!isInitialized()) {
+        org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId result = buildPartial();
+        if (!result.isInitialized()) {
           throw newUninitializedMessageException(
             result).asInvalidProtocolBufferException();
         }
-        return buildPartial();
+        return result;
       }
       
       public org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId buildPartial() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "build() has already been called on this Builder.");
-        }
-        org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId returnMe = result;
-        result = null;
-        return returnMe;
+        org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId result = new org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId(this);
+        int from_bitField0_ = bitField0_;
+        int to_bitField0_ = 0;
+        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+          to_bitField0_ |= 0x00000001;
+        }
+        result.region_ = region_;
+        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+          to_bitField0_ |= 0x00000002;
+        }
+        result.seqId_ = seqId_;
+        result.bitField0_ = to_bitField0_;
+        onBuilt();
+        return result;
       }
       
       public Builder mergeFrom(com.google.protobuf.Message other) {
@@ -875,6 +1125,18 @@ public final class PubSubProtocol {
         return this;
       }
       
+      public final boolean isInitialized() {
+        if (!hasRegion()) {
+          
+          return false;
+        }
+        if (!hasSeqId()) {
+          
+          return false;
+        }
+        return true;
+      }
+      
       public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
@@ -887,64 +1149,75 @@ public final class PubSubProtocol {
           switch (tag) {
             case 0:
               this.setUnknownFields(unknownFields.build());
+              onChanged();
               return this;
             default: {
               if (!parseUnknownField(input, unknownFields,
                                      extensionRegistry, tag)) {
                 this.setUnknownFields(unknownFields.build());
+                onChanged();
                 return this;
               }
               break;
             }
             case 10: {
-              setRegion(input.readBytes());
+              bitField0_ |= 0x00000001;
+              region_ = input.readBytes();
               break;
             }
             case 16: {
-              setSeqId(input.readUInt64());
+              bitField0_ |= 0x00000002;
+              seqId_ = input.readUInt64();
               break;
             }
           }
         }
       }
       
+      private int bitField0_;
       
       // required bytes region = 1;
+      private com.google.protobuf.ByteString region_ = com.google.protobuf.ByteString.EMPTY;
       public boolean hasRegion() {
-        return result.hasRegion();
+        return ((bitField0_ & 0x00000001) == 0x00000001);
       }
       public com.google.protobuf.ByteString getRegion() {
-        return result.getRegion();
+        return region_;
       }
       public Builder setRegion(com.google.protobuf.ByteString value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  result.hasRegion = true;
-        result.region_ = value;
+  bitField0_ |= 0x00000001;
+        region_ = value;
+        onChanged();
         return this;
       }
       public Builder clearRegion() {
-        result.hasRegion = false;
-        result.region_ = getDefaultInstance().getRegion();
+        bitField0_ = (bitField0_ & ~0x00000001);
+        region_ = getDefaultInstance().getRegion();
+        onChanged();
         return this;
       }
       
       // required uint64 seqId = 2;
+      private long seqId_ ;
       public boolean hasSeqId() {
-        return result.hasSeqId();
+        return ((bitField0_ & 0x00000002) == 0x00000002);
       }
       public long getSeqId() {
-        return result.getSeqId();
+        return seqId_;
       }
       public Builder setSeqId(long value) {
-        result.hasSeqId = true;
-        result.seqId_ = value;
+        bitField0_ |= 0x00000002;
+        seqId_ = value;
+        onChanged();
         return this;
       }
       public Builder clearSeqId() {
-        result.hasSeqId = false;
-        result.seqId_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00000002);
+        seqId_ = 0L;
+        onChanged();
         return this;
       }
       
@@ -953,18 +1226,35 @@ public final class PubSubProtocol {
     
     static {
       defaultInstance = new RegionSpecificSeqId(true);
-      org.apache.hedwig.protocol.PubSubProtocol.internalForceInit();
       defaultInstance.initFields();
     }
     
     // @@protoc_insertion_point(class_scope:Hedwig.RegionSpecificSeqId)
   }
   
+  public interface MessageSeqIdOrBuilder
+      extends com.google.protobuf.MessageOrBuilder {
+    
+    // optional uint64 localComponent = 1;
+    boolean hasLocalComponent();
+    long getLocalComponent();
+    
+    // repeated .Hedwig.RegionSpecificSeqId remoteComponents = 2;
+    java.util.List<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId> 
+        getRemoteComponentsList();
+    org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId getRemoteComponents(int index);
+    int getRemoteComponentsCount();
+    java.util.List<? extends org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder> 
+        getRemoteComponentsOrBuilderList();
+    org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder getRemoteComponentsOrBuilder(
+        int index);
+  }
   public static final class MessageSeqId extends
-      com.google.protobuf.GeneratedMessage {
+      com.google.protobuf.GeneratedMessage
+      implements MessageSeqIdOrBuilder {
     // Use MessageSeqId.newBuilder() to construct.
-    private MessageSeqId() {
-      initFields();
+    private MessageSeqId(Builder builder) {
+      super(builder);
     }
     private MessageSeqId(boolean noInit) {}
     
@@ -987,42 +1277,65 @@ public final class PubSubProtocol {
       return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_MessageSeqId_fieldAccessorTable;
     }
     
+    private int bitField0_;
     // optional uint64 localComponent = 1;
     public static final int LOCALCOMPONENT_FIELD_NUMBER = 1;
-    private boolean hasLocalComponent;
-    private long localComponent_ = 0L;
-    public boolean hasLocalComponent() { return hasLocalComponent; }
-    public long getLocalComponent() { return localComponent_; }
+    private long localComponent_;
+    public boolean hasLocalComponent() {
+      return ((bitField0_ & 0x00000001) == 0x00000001);
+    }
+    public long getLocalComponent() {
+      return localComponent_;
+    }
     
     // repeated .Hedwig.RegionSpecificSeqId remoteComponents = 2;
     public static final int REMOTECOMPONENTS_FIELD_NUMBER = 2;
-    private java.util.List<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId> remoteComponents_ =
-      java.util.Collections.emptyList();
+    private java.util.List<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId> remoteComponents_;
     public java.util.List<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId> getRemoteComponentsList() {
       return remoteComponents_;
     }
-    public int getRemoteComponentsCount() { return remoteComponents_.size(); }
+    public java.util.List<? extends org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder> 
+        getRemoteComponentsOrBuilderList() {
+      return remoteComponents_;
+    }
+    public int getRemoteComponentsCount() {
+      return remoteComponents_.size();
+    }
     public org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId getRemoteComponents(int index) {
       return remoteComponents_.get(index);
     }
+    public org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder getRemoteComponentsOrBuilder(
+        int index) {
+      return remoteComponents_.get(index);
+    }
     
     private void initFields() {
+      localComponent_ = 0L;
+      remoteComponents_ = java.util.Collections.emptyList();
     }
+    private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
-      for (org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId element : getRemoteComponentsList()) {
-        if (!element.isInitialized()) return false;
+      byte isInitialized = memoizedIsInitialized;
+      if (isInitialized != -1) return isInitialized == 1;
+      
+      for (int i = 0; i < getRemoteComponentsCount(); i++) {
+        if (!getRemoteComponents(i).isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
       }
+      memoizedIsInitialized = 1;
       return true;
     }
     
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
-      if (hasLocalComponent()) {
-        output.writeUInt64(1, getLocalComponent());
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        output.writeUInt64(1, localComponent_);
       }
-      for (org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId element : getRemoteComponentsList()) {
-        output.writeMessage(2, element);
+      for (int i = 0; i < remoteComponents_.size(); i++) {
+        output.writeMessage(2, remoteComponents_.get(i));
       }
       getUnknownFields().writeTo(output);
     }
@@ -1033,19 +1346,26 @@ public final class PubSubProtocol {
       if (size != -1) return size;
     
       size = 0;
-      if (hasLocalComponent()) {
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeUInt64Size(1, getLocalComponent());
+          .computeUInt64Size(1, localComponent_);
       }
-      for (org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId element : getRemoteComponentsList()) {
+      for (int i = 0; i < remoteComponents_.size(); i++) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(2, element);
+          .computeMessageSize(2, remoteComponents_.get(i));
       }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
     
+    private static final long serialVersionUID = 0L;
+    @java.lang.Override
+    protected java.lang.Object writeReplace()
+        throws java.io.ObjectStreamException {
+      return super.writeReplace();
+    }
+    
     public static org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
@@ -1120,34 +1440,58 @@ public final class PubSubProtocol {
     }
     public Builder toBuilder() { return newBuilder(this); }
     
+    @java.lang.Override
+    protected Builder newBuilderForType(
+        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+      Builder builder = new Builder(parent);
+      return builder;
+    }
     public static final class Builder extends
-        com.google.protobuf.GeneratedMessage.Builder<Builder> {
-      private org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId result;
+        com.google.protobuf.GeneratedMessage.Builder<Builder>
+       implements org.apache.hedwig.protocol.PubSubProtocol.MessageSeqIdOrBuilder {
+      public static final com.google.protobuf.Descriptors.Descriptor
+          getDescriptor() {
+        return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_MessageSeqId_descriptor;
+      }
       
-      // Construct using org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.newBuilder()
-      private Builder() {}
+      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+          internalGetFieldAccessorTable() {
+        return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_MessageSeqId_fieldAccessorTable;
+      }
       
-      private static Builder create() {
-        Builder builder = new Builder();
-        builder.result = new org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId();
-        return builder;
+      // Construct using org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.newBuilder()
+      private Builder() {
+        maybeForceBuilderInitialization();
       }
       
-      protected org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId internalGetResult() {
-        return result;
+      private Builder(BuilderParent parent) {
+        super(parent);
+        maybeForceBuilderInitialization();
+      }
+      private void maybeForceBuilderInitialization() {
+        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+          getRemoteComponentsFieldBuilder();
+        }
+      }
+      private static Builder create() {
+        return new Builder();
       }
       
       public Builder clear() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "Cannot call clear() after build().");
+        super.clear();
+        localComponent_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00000001);
+        if (remoteComponentsBuilder_ == null) {
+          remoteComponents_ = java.util.Collections.emptyList();
+          bitField0_ = (bitField0_ & ~0x00000002);
+        } else {
+          remoteComponentsBuilder_.clear();
         }
-        result = new org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId();
         return this;
       }
       
       public Builder clone() {
-        return create().mergeFrom(result);
+        return create().mergeFrom(buildPartial());
       }
       
       public com.google.protobuf.Descriptors.Descriptor
@@ -1159,37 +1503,44 @@ public final class PubSubProtocol {
         return org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId.getDefaultInstance();
       }
       
-      public boolean isInitialized() {
-        return result.isInitialized();
-      }
       public org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId build() {
-        if (result != null && !isInitialized()) {
+        org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId result = buildPartial();
+        if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
         }
-        return buildPartial();
+        return result;
       }
       
       private org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId buildParsed()
           throws com.google.protobuf.InvalidProtocolBufferException {
-        if (!isInitialized()) {
+        org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId result = buildPartial();
+        if (!result.isInitialized()) {
           throw newUninitializedMessageException(
             result).asInvalidProtocolBufferException();
         }
-        return buildPartial();
+        return result;
       }
       
       public org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId buildPartial() {
-        if (result == null) {
-          throw new IllegalStateException(
-            "build() has already been called on this Builder.");
-        }
-        if (result.remoteComponents_ != java.util.Collections.EMPTY_LIST) {
-          result.remoteComponents_ =
-            java.util.Collections.unmodifiableList(result.remoteComponents_);
-        }
-        org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId returnMe = result;
-        result = null;
-        return returnMe;
+        org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId result = new org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId(this);
+        int from_bitField0_ = bitField0_;
+        int to_bitField0_ = 0;
+        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+          to_bitField0_ |= 0x00000001;
+        }
+        result.localComponent_ = localComponent_;
+        if (remoteComponentsBuilder_ == null) {
+          if (((bitField0_ & 0x00000002) == 0x00000002)) {
+            remoteComponents_ = java.util.Collections.unmodifiableList(remoteComponents_);
+            bitField0_ = (bitField0_ & ~0x00000002);
+          }
+          result.remoteComponents_ = remoteComponents_;
+        } else {
+          result.remoteComponents_ = remoteComponentsBuilder_.build();
+        }
+        result.bitField0_ = to_bitField0_;
+        onBuilt();
+        return result;
       }
       
       public Builder mergeFrom(com.google.protobuf.Message other) {
@@ -1206,16 +1557,46 @@ public final class PubSubProtocol {
         if (other.hasLocalComponent()) {
           setLocalComponent(other.getLocalComponent());
         }
-        if (!other.remoteComponents_.isEmpty()) {
-          if (result.remoteComponents_.isEmpty()) {
-            result.remoteComponents_ = new java.util.ArrayList<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId>();
+        if (remoteComponentsBuilder_ == null) {
+          if (!other.remoteComponents_.isEmpty()) {
+            if (remoteComponents_.isEmpty()) {
+              remoteComponents_ = other.remoteComponents_;
+              bitField0_ = (bitField0_ & ~0x00000002);
+            } else {
+              ensureRemoteComponentsIsMutable();
+              remoteComponents_.addAll(other.remoteComponents_);
+            }
+            onChanged();
+          }
+        } else {
+          if (!other.remoteComponents_.isEmpty()) {
+            if (remoteComponentsBuilder_.isEmpty()) {
+              remoteComponentsBuilder_.dispose();
+              remoteComponentsBuilder_ = null;
+              remoteComponents_ = other.remoteComponents_;
+              bitField0_ = (bitField0_ & ~0x00000002);
+              remoteComponentsBuilder_ = 
+                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+                   getRemoteComponentsFieldBuilder() : null;
+            } else {
+              remoteComponentsBuilder_.addAllMessages(other.remoteComponents_);
+            }
           }
-          result.remoteComponents_.addAll(other.remoteComponents_);
         }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
       
+      public final boolean isInitialized() {
+        for (int i = 0; i < getRemoteComponentsCount(); i++) {
+          if (!getRemoteComponents(i).isInitialized()) {
+            
+            return false;
+          }
+        }
+        return true;
+      }
+      
       public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
@@ -1228,17 +1609,20 @@ public final class PubSubProtocol {
           switch (tag) {
             case 0:
               this.setUnknownFields(unknownFields.build());
+              onChanged();
               return this;
             default: {
               if (!parseUnknownField(input, unknownFields,
                                      extensionRegistry, tag)) {
                 this.setUnknownFields(unknownFields.build());
+                onChanged();
                 return this;
               }
               break;
             }
             case 8: {
-              setLocalComponent(input.readUInt64());
+              bitField0_ |= 0x00000001;
+              localComponent_ = input.readUInt64();
               break;
             }
             case 18: {
@@ -1251,93 +1635,290 @@ public final class PubSubProtocol {
         }
       }
       
+      private int bitField0_;
       
       // optional uint64 localComponent = 1;
+      private long localComponent_ ;
       public boolean hasLocalComponent() {
-        return result.hasLocalComponent();
+        return ((bitField0_ & 0x00000001) == 0x00000001);
       }
       public long getLocalComponent() {
-        return result.getLocalComponent();
+        return localComponent_;
       }
       public Builder setLocalComponent(long value) {
-        result.hasLocalComponent = true;
-        result.localComponent_ = value;
+        bitField0_ |= 0x00000001;
+        localComponent_ = value;
+        onChanged();
         return this;
       }
       public Builder clearLocalComponent() {
-        result.hasLocalComponent = false;
-        result.localComponent_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00000001);
+        localComponent_ = 0L;
+        onChanged();
         return this;
       }
       
       // repeated .Hedwig.RegionSpecificSeqId remoteComponents = 2;
+      private java.util.List<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId> remoteComponents_ =
+        java.util.Collections.emptyList();
+      private void ensureRemoteComponentsIsMutable() {
+        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
+          remoteComponents_ = new java.util.ArrayList<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId>(remoteComponents_);
+          bitField0_ |= 0x00000002;
+         }
+      }
+      
+      private com.google.protobuf.RepeatedFieldBuilder<
+          org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder> remoteComponentsBuilder_;
+      
       public java.util.List<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId> getRemoteComponentsList() {
-        return java.util.Collections.unmodifiableList(result.remoteComponents_);
+        if (remoteComponentsBuilder_ == null) {
+          return java.util.Collections.unmodifiableList(remoteComponents_);
+        } else {
+          return remoteComponentsBuilder_.getMessageList();
+        }
       }
       public int getRemoteComponentsCount() {
-        return result.getRemoteComponentsCount();
+        if (remoteComponentsBuilder_ == null) {
+          return remoteComponents_.size();
+        } else {
+          return remoteComponentsBuilder_.getCount();
+        }
       }
       public org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId getRemoteComponents(int index) {
-        return result.getRemoteComponents(index);
+        if (remoteComponentsBuilder_ == null) {
+          return remoteComponents_.get(index);
+        } else {
+          return remoteComponentsBuilder_.getMessage(index);
+        }
       }
-      public Builder setRemoteComponents(int index, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId value) {
-        if (value == null) {
-          throw new NullPointerException();
+      public Builder setRemoteComponents(
+          int index, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId value) {
+        if (remoteComponentsBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensureRemoteComponentsIsMutable();
+          remoteComponents_.set(index, value);
+          onChanged();
+        } else {
+          remoteComponentsBuilder_.setMessage(index, value);
         }
-        result.remoteComponents_.set(index, value);
         return this;
       }
-      public Builder setRemoteComponents(int index, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder builderForValue) {
-        result.remoteComponents_.set(index, builderForValue.build());
+      public Builder setRemoteComponents(
+          int index, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder builderForValue) {
+        if (remoteComponentsBuilder_ == null) {
+          ensureRemoteComponentsIsMutable();
+          remoteComponents_.set(index, builderForValue.build());
+          onChanged();
+        } else {
+          remoteComponentsBuilder_.setMessage(index, builderForValue.build());
+        }
         return this;
       }
       public Builder addRemoteComponents(org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId value) {
-        if (value == null) {
-          throw new NullPointerException();
+        if (remoteComponentsBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensureRemoteComponentsIsMutable();
+          remoteComponents_.add(value);
+          onChanged();
+        } else {
+          remoteComponentsBuilder_.addMessage(value);
+        }
+        return this;
+      }
+      public Builder addRemoteComponents(
+          int index, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId value) {
+        if (remoteComponentsBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensureRemoteComponentsIsMutable();
+          remoteComponents_.add(index, value);
+          onChanged();
+        } else {
+          remoteComponentsBuilder_.addMessage(index, value);
         }
-        if (result.remoteComponents_.isEmpty()) {
-          result.remoteComponents_ = new java.util.ArrayList<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId>();
+        return this;
+      }
+      public Builder addRemoteComponents(
+          org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder builderForValue) {
+        if (remoteComponentsBuilder_ == null) {
+          ensureRemoteComponentsIsMutable();
+          remoteComponents_.add(builderForValue.build());
+          onChanged();
+        } else {
+          remoteComponentsBuilder_.addMessage(builderForValue.build());
         }
-        result.remoteComponents_.add(value);
         return this;
       }
-      public Builder addRemoteComponents(org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder builderForValue) {
-        if (result.remoteComponents_.isEmpty()) {
-          result.remoteComponents_ = new java.util.ArrayList<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId>();
+      public Builder addRemoteComponents(
+          int index, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder builderForValue) {
+        if (remoteComponentsBuilder_ == null) {
+          ensureRemoteComponentsIsMutable();
+          remoteComponents_.add(index, builderForValue.build());
+          onChanged();
+        } else {
+          remoteComponentsBuilder_.addMessage(index, builderForValue.build());
         }
-        result.remoteComponents_.add(builderForValue.build());
         return this;
       }
       public Builder addAllRemoteComponents(
           java.lang.Iterable<? extends org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId> values) {
-        if (result.remoteComponents_.isEmpty()) {
-          result.remoteComponents_ = new java.util.ArrayList<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId>();
+        if (remoteComponentsBuilder_ == null) {
+          ensureRemoteComponentsIsMutable();
+          super.addAll(values, remoteComponents_);
+          onChanged();
+        } else {
+          remoteComponentsBuilder_.addAllMessages(values);
         }
-        super.addAll(values, result.remoteComponents_);
         return this;
       }
       public Builder clearRemoteComponents() {
-        result.remoteComponents_ = java.util.Collections.emptyList();
+        if (remoteComponentsBuilder_ == null) {
+          remoteComponents_ = java.util.Collections.emptyList();
+          bitField0_ = (bitField0_ & ~0x00000002);
+          onChanged();
+        } else {
+          remoteComponentsBuilder_.clear();
+        }
+        return this;
+      }
+      public Builder removeRemoteComponents(int index) {
+        if (remoteComponentsBuilder_ == null) {
+          ensureRemoteComponentsIsMutable();
+          remoteComponents_.remove(index);
+          onChanged();
+        } else {
+          remoteComponentsBuilder_.remove(index);
+        }
         return this;
       }
+      public org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder getRemoteComponentsBuilder(
+          int index) {
+        return getRemoteComponentsFieldBuilder().getBuilder(index);
+      }
+      public org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder getRemoteComponentsOrBuilder(
+          int index) {
+        if (remoteComponentsBuilder_ == null) {
+          return remoteComponents_.get(index);  } else {
+          return remoteComponentsBuilder_.getMessageOrBuilder(index);
+        }
+      }
+      public java.util.List<? extends org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder> 
+           getRemoteComponentsOrBuilderList() {
+        if (remoteComponentsBuilder_ != null) {
+          return remoteComponentsBuilder_.getMessageOrBuilderList();
+        } else {
+          return java.util.Collections.unmodifiableList(remoteComponents_);
+        }
+      }
+      public org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder addRemoteComponentsBuilder() {
+        return getRemoteComponentsFieldBuilder().addBuilder(
+            org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.getDefaultInstance());
+      }
+      public org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder addRemoteComponentsBuilder(
+          int index) {
+        return getRemoteComponentsFieldBuilder().addBuilder(
+            index, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.getDefaultInstance());
+      }
+      public java.util.List<org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder> 
+           getRemoteComponentsBuilderList() {
+        return getRemoteComponentsFieldBuilder().getBuilderList();
+      }
+      private com.google.protobuf.RepeatedFieldBuilder<
+          org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder> 
+          getRemoteComponentsFieldBuilder() {
+        if (remoteComponentsBuilder_ == null) {
+          remoteComponentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+              org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId.Builder, org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqIdOrBuilder>(
+                  remoteComponents_,
+                  ((bitField0_ & 0x00000002) == 0x00000002),
+                  getParentForChildren(),
+                  isClean());
+          remoteComponents_ = null;
+        }
+        return remoteComponentsBuilder_;
+      }
       
       // @@protoc_insertion_point(builder_scope:Hedwig.MessageSeqId)
     }
     
     static {
       defaultInstance = new MessageSeqId(true);
-      org.apache.hedwig.protocol.PubSubProtocol.internalForceInit();
       defaultInstance.initFields();
     }
     
     // @@protoc_insertion_point(class_scope:Hedwig.MessageSeqId)
   }
   
+  public interface PubSubRequestOrBuilder
+      extends com.google.protobuf.MessageOrBuilder {
+    
+    // required .Hedwig.ProtocolVersion protocolVersion = 1;
+    boolean hasProtocolVersion();
+    org.apache.hedwig.protocol.PubSubProtocol.ProtocolVersion getProtocolVersion();
+    
+    // required .Hedwig.OperationType type = 2;
+    boolean hasType();
+    org.apache.hedwig.protocol.PubSubProtocol.OperationType getType();
+    
+    // repeated bytes triedServers = 3;
+    java.util.List<com.google.protobuf.ByteString> getTriedServersList();
+    int getTriedServersCount();
+    com.google.protobuf.ByteString getTriedServers(int index);
+    
+    // required uint64 txnId = 4;
+    boolean hasTxnId();
+    long getTxnId();
+    
+    // optional bool shouldClaim = 5;
+    boolean hasShouldClaim();
+    boolean getShouldClaim();
+    
+    // required bytes topic = 6;
+    boolean hasTopic();
+    com.google.protobuf.ByteString getTopic();
+    
+    // optional .Hedwig.PublishRequest publishRequest = 52;
+    boolean hasPublishRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.PublishRequest getPublishRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.PublishRequestOrBuilder getPublishRequestOrBuilder();
+    
+    // optional .Hedwig.SubscribeRequest subscribeRequest = 53;
+    boolean hasSubscribeRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.SubscribeRequest getSubscribeRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.SubscribeRequestOrBuilder getSubscribeRequestOrBuilder();
+    
+    // optional .Hedwig.ConsumeRequest consumeRequest = 54;
+    boolean hasConsumeRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.ConsumeRequest getConsumeRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.ConsumeRequestOrBuilder getConsumeRequestOrBuilder();
+    
+    // optional .Hedwig.UnsubscribeRequest unsubscribeRequest = 55;
+    boolean hasUnsubscribeRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.UnsubscribeRequest getUnsubscribeRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.UnsubscribeRequestOrBuilder getUnsubscribeRequestOrBuilder();
+    
+    // optional .Hedwig.StopDeliveryRequest stopDeliveryRequest = 56;
+    boolean hasStopDeliveryRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.StopDeliveryRequest getStopDeliveryRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.StopDeliveryRequestOrBuilder getStopDeliveryRequestOrBuilder();
+    
+    // optional .Hedwig.StartDeliveryRequest startDeliveryRequest = 57;
+    boolean hasStartDeliveryRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.StartDeliveryRequest getStartDeliveryRequest();
+    org.apache.hedwig.protocol.PubSubProtocol.StartDeliveryRequestOrBuilder getStartDeliveryRequestOrBuilder();
+  }
   public static final class PubSubRequest extends
-      com.google.protobuf.GeneratedMessage {
+      com.google.protobuf.GeneratedMessage
+      implements PubSubRequestOrBuilder {
     // Use PubSubRequest.newBuilder() to construct.
-    private PubSubRequest() {
-      initFields();
+    private PubSubRequest(Builder builder) {
+      super(builder);
     }
     private PubSubRequest(boolean noInit) {}
     
@@ -1360,98 +1941,156 @@ public final class PubSubProtocol {
       return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_PubSubRequest_fieldAccessorTable;
     }
     
+    private int bitField0_;
     // required .Hedwig.ProtocolVersion protocolVersion = 1;
     public static final int PROTOCOLVERSION_FIELD_NUMBER = 1;
-    private boolean hasProtocolVersion;
     private org.apache.hedwig.protocol.PubSubProtocol.ProtocolVersion protocolVersion_;
-    public boolean hasProtocolVersion() { return hasProtocolVersion; }
-    public org.apache.hedwig.protocol.PubSubProtocol.ProtocolVersion getProtocolVersion() { return protocolVersion_; }
+    public boolean hasProtocolVersion() {
+      return ((bitField0_ & 0x00000001) == 0x00000001);
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.ProtocolVersion getProtocolVersion() {
+      return protocolVersion_;
+    }
     
     // required .Hedwig.OperationType type = 2;
     public static final int TYPE_FIELD_NUMBER = 2;
-    private boolean hasType;
     private org.apache.hedwig.protocol.PubSubProtocol.OperationType type_;
-    public boolean hasType() { return hasType; }
-    public org.apache.hedwig.protocol.PubSubProtocol.OperationType getType() { return type_; }
+    public boolean hasType() {
+      return ((bitField0_ & 0x00000002) == 0x00000002);
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.OperationType getType() {
+      return type_;
+    }
     
     // repeated bytes triedServers = 3;
     public static final int TRIEDSERVERS_FIELD_NUMBER = 3;
-    private java.util.List<com.google.protobuf.ByteString> triedServers_ =
-      java.util.Collections.emptyList();
-    public java.util.List<com.google.protobuf.ByteString> getTriedServersList() {
+    private java.util.List<com.google.protobuf.ByteString> triedServers_;
+    public java.util.List<com.google.protobuf.ByteString>
+        getTriedServersList() {
       return triedServers_;
     }
-    public int getTriedServersCount() { return triedServers_.size(); }
+    public int getTriedServersCount() {
+      return triedServers_.size();
+    }
     public com.google.protobuf.ByteString getTriedServers(int index) {
       return triedServers_.get(index);
     }
     
     // required uint64 txnId = 4;
     public static final int TXNID_FIELD_NUMBER = 4;
-    private boolean hasTxnId;
-    private long txnId_ = 0L;
-    public boolean hasTxnId() { return hasTxnId; }
-    public long getTxnId() { return txnId_; }
+    private long txnId_;
+    public boolean hasTxnId() {
+      return ((bitField0_ & 0x00000004) == 0x00000004);
+    }
+    public long getTxnId() {
+      return txnId_;
+    }
     
     // optional bool shouldClaim = 5;
     public static final int SHOULDCLAIM_FIELD_NUMBER = 5;
-    private boolean hasShouldClaim;
-    private boolean shouldClaim_ = false;
-    public boolean hasShouldClaim() { return hasShouldClaim; }
-    public boolean getShouldClaim() { return shouldClaim_; }
+    private boolean shouldClaim_;
+    public boolean hasShouldClaim() {
+      return ((bitField0_ & 0x00000008) == 0x00000008);
+    }
+    public boolean getShouldClaim() {
+      return shouldClaim_;
+    }
     
     // required bytes topic = 6;
     public static final int TOPIC_FIELD_NUMBER = 6;
-    private boolean hasTopic;
-    private com.google.protobuf.ByteString topic_ = com.google.protobuf.ByteString.EMPTY;
-    public boolean hasTopic() { return hasTopic; }
-    public com.google.protobuf.ByteString getTopic() { return topic_; }
+    private com.google.protobuf.ByteString topic_;
+    public boolean hasTopic() {
+      return ((bitField0_ & 0x00000010) == 0x00000010);
+    }
+    public com.google.protobuf.ByteString getTopic() {
+      return topic_;
+    }
     
     // optional .Hedwig.PublishRequest publishRequest = 52;
     public static final int PUBLISHREQUEST_FIELD_NUMBER = 52;
-    private boolean hasPublishRequest;
     private org.apache.hedwig.protocol.PubSubProtocol.PublishRequest publishRequest_;
-    public boolean hasPublishRequest() { return hasPublishRequest; }
-    public org.apache.hedwig.protocol.PubSubProtocol.PublishRequest getPublishRequest() { return publishRequest_; }
+    public boolean hasPublishRequest() {
+      return ((bitField0_ & 0x00000020) == 0x00000020);
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.PublishRequest getPublishRequest() {
+      return publishRequest_;
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.PublishRequestOrBuilder getPublishRequestOrBuilder() {
+      return publishRequest_;
+    }
     
     // optional .Hedwig.SubscribeRequest subscribeRequest = 53;
     public static final int SUBSCRIBEREQUEST_FIELD_NUMBER = 53;
-    private boolean hasSubscribeRequest;
     private org.apache.hedwig.protocol.PubSubProtocol.SubscribeRequest subscribeRequest_;
-    public boolean hasSubscribeRequest() { return hasSubscribeRequest; }
-    public org.apache.hedwig.protocol.PubSubProtocol.SubscribeRequest getSubscribeRequest() { return subscribeRequest_; }
+    public boolean hasSubscribeRequest() {
+      return ((bitField0_ & 0x00000040) == 0x00000040);
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.SubscribeRequest getSubscribeRequest() {
+      return subscribeRequest_;
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.SubscribeRequestOrBuilder getSubscribeRequestOrBuilder() {
+      return subscribeRequest_;
+    }
     
     // optional .Hedwig.ConsumeRequest consumeRequest = 54;
     public static final int CONSUMEREQUEST_FIELD_NUMBER = 54;
-    private boolean hasConsumeRequest;
     private org.apache.hedwig.protocol.PubSubProtocol.ConsumeRequest consumeRequest_;
-    public boolean hasConsumeRequest() { return hasConsumeRequest; }
-    public org.apache.hedwig.protocol.PubSubProtocol.ConsumeRequest getConsumeRequest() { return consumeRequest_; }
+    public boolean hasConsumeRequest() {
+      return ((bitField0_ & 0x00000080) == 0x00000080);
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.ConsumeRequest getConsumeRequest() {
+      return consumeRequest_;
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.ConsumeRequestOrBuilder getConsumeRequestOrBuilder() {
+      return consumeRequest_;
+    }
     
     // optional .Hedwig.UnsubscribeRequest unsubscribeRequest = 55;
     public static final int UNSUBSCRIBEREQUEST_FIELD_NUMBER = 55;
-    private boolean hasUnsubscribeRequest;
     private org.apache.hedwig.protocol.PubSubProtocol.UnsubscribeRequest unsubscribeRequest_;
-    public boolean hasUnsubscribeRequest() { return hasUnsubscribeRequest; }
-    public org.apache.hedwig.protocol.PubSubProtocol.UnsubscribeRequest getUnsubscribeRequest() { return unsubscribeRequest_; }
+    public boolean hasUnsubscribeRequest() {
+      return ((bitField0_ & 0x00000100) == 0x00000100);
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.UnsubscribeRequest getUnsubscribeRequest() {
+      return unsubscribeRequest_;
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.UnsubscribeRequestOrBuilder getUnsubscribeRequestOrBuilder() {
+      return unsubscribeRequest_;
+    }
     
     // optional .Hedwig.StopDeliveryRequest stopDeliveryRequest = 56;
     public static final int STOPDELIVERYREQUEST_FIELD_NUMBER = 56;
-    private boolean hasStopDeliveryRequest;
     private org.apache.hedwig.protocol.PubSubProtocol.StopDeliveryRequest stopDeliveryRequest_;
-    public boolean hasStopDeliveryRequest() { return hasStopDeliveryRequest; }
-    public org.apache.hedwig.protocol.PubSubProtocol.StopDeliveryRequest getStopDeliveryRequest() { return stopDeliveryRequest_; }
+    public boolean hasStopDeliveryRequest() {
+      return ((bitField0_ & 0x00000200) == 0x00000200);
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.StopDeliveryRequest getStopDeliveryRequest() {
+      return stopDeliveryRequest_;
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.StopDeliveryRequestOrBuilder getStopDeliveryRequestOrBuilder() {
+      return stopDeliveryRequest_;
+    }
     
     // optional .Hedwig.StartDeliveryRequest startDeliveryRequest = 57;
     public static final int STARTDELIVERYREQUEST_FIELD_NUMBER = 57;
-    private boolean hasStartDeliveryRequest;
     private org.apache.hedwig.protocol.PubSubProtocol.StartDeliveryRequest startDeliveryRequest_;
-    public boolean hasStartDeliveryRequest() { return hasStartDeliveryRequest; }
-    public org.apache.hedwig.protocol.PubSubProtocol.StartDeliveryRequest getStartDeliveryRequest() { return startDeliveryRequest_; }
+    public boolean hasStartDeliveryRequest() {
+      return ((bitField0_ & 0x00000400) == 0x00000400);
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.StartDeliveryRequest getStartDeliveryRequest() {
+      return startDeliveryRequest_;
+    }
+    public org.apache.hedwig.protocol.PubSubProtocol.StartDeliveryRequestOrBuilder getStartDeliveryRequestOrBuilder() {
+      return startDeliveryRequest_;
+    }
     
     private void initFields() {
       protocolVersion_ = org.apache.hedwig.protocol.PubSubProtocol.ProtocolVersion.VERSION_ONE;
       type_ = org.apache.hedwig.protocol.PubSubProtocol.OperationType.PUBLISH;
+      triedServers_ = java.util.Collections.emptyList();;
+      txnId_ = 0L;
+      shouldClaim_ = false;
+      topic_ = com.google.protobuf.ByteString.EMPTY;
       publishRequest_ = org.apache.hedwig.protocol.PubSubProtocol.PublishRequest.getDefaultInstance();
       subscribeRequest_ = org.apache.hedwig.protocol.PubSubProtocol.SubscribeRequest.getDefaultInstance();
       consumeRequest_ = org.apache.hedwig.protocol.PubSubProtocol.ConsumeRequest.getDefaultInstance();
@@ -1459,70 +2098,105 @@ public final class PubSubProtocol {
       stopDeliveryRequest_ = org.apache.hedwig.protocol.PubSubProtocol.StopDeliveryRequest.getDefaultInstance();
       startDeliveryRequest_ = org.apache.hedwig.protocol.PubSubProtocol.StartDeliveryRequest.getDefaultInstance();
     }
+    private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
-      if (!hasProtocolVersion) return false;
-      if (!hasType) return false;
-      if (!hasTxnId) return false;
-      if (!hasTopic) return false;
+      byte isInitialized = memoizedIsInitialized;
+      if (isInitialized != -1) return isInitialized == 1;
+      
+      if (!hasProtocolVersion()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasType()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasTxnId()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
+      if (!hasTopic()) {
+        memoizedIsInitialized = 0;
+        return false;
+      }
       if (hasPublishRequest()) {
-        if (!getPublishRequest().isInitialized()) return false;
+        if (!getPublishRequest().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
       }
       if (hasSubscribeRequest()) {
-        if (!getSubscribeRequest().isInitialized()) return false;
+        if (!getSubscribeRequest().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
       }
       if (hasConsumeRequest()) {
-        if (!getConsumeRequest().isInitialized()) return false;
+        if (!getConsumeRequest().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
       }
       if (hasUnsubscribeRequest()) {
-        if (!getUnsubscribeRequest().isInitialized()) return false;
+        if (!getUnsubscribeRequest().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
       }
       if (hasStopDeliveryRequest()) {
-        if (!getStopDeliveryRequest().isInitialized()) return false;
+        if (!getStopDeliveryRequest().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
       }
       if (hasStartDeliveryRequest()) {
-        if (!getStartDeliveryRequest().isInitialized()) return false;
+        if (!getStartDeliveryRequest().isInitialized()) {
+          memoizedIsInitialized = 0;
+          return false;
+        }
       }
+      memoizedIsInitialized = 1;
       return true;
     }
     
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
-      if (hasProtocolVersion()) {
-        output.writeEnum(1, getProtocolVersion().getNumber());
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+        output.writeEnum(1, protocolVersion_.getNumber());
       }
-      if (hasType()) {
-        output.writeEnum(2, getType().getNumber());
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+        output.writeEnum(2, type_.getNumber());
       }
-      for (com.google.protobuf.ByteString element : getTriedServersList()) {
-        output.writeBytes(3, element);
+      for (int i = 0; i < triedServers_.size(); i++) {
+        output.writeBytes(3, triedServers_.get(i));
       }
-      if (hasTxnId()) {
-        output.writeUInt64(4, getTxnId());
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        output.writeUInt64(4, txnId_);
       }
-      if (hasShouldClaim()) {
-        output.writeBool(5, getShouldClaim());
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        output.writeBool(5, shouldClaim_);
       }
-      if (hasTopic()) {
-        output.writeBytes(6, getTopic());
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        output.writeBytes(6, topic_);
       }
-      if (hasPublishRequest()) {
-        output.writeMessage(52, getPublishRequest());
+      if (((bitField0_ & 0x00000020) == 0x00000020)) {
+        output.writeMessage(52, publishRequest_);
       }
-      if (hasSubscribeRequest()) {
-        output.writeMessage(53, getSubscribeRequest());
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
+        output.writeMessage(53, subscribeRequest_);
       }
-      if (hasConsumeRequest()) {
-        output.writeMessage(54, getConsumeRequest());
+      if (((bitField0_ & 0x00000080) == 0x00000080)) {
+        output.writeMessage(54, consumeRequest_);
       }
-      if (hasUnsubscribeRequest()) {
-        output.writeMessage(55, getUnsubscribeRequest());
+      if (((bitField0_ & 0x00000100) == 0x00000100)) {
+        output.writeMessage(55, unsubscribeRequest_);
       }
-      if (hasStopDeliveryRequest()) {
-        output.writeMessage(56, getStopDeliveryRequest());
+      if (((bitField0_ & 0x00000200) == 0x00000200)) {
+        output.writeMessage(56, stopDeliveryRequest_);
       }
-      if (hasStartDeliveryRequest()) {
-        output.writeMessage(57, getStartDeliveryRequest());
+      if (((bitField0_ & 0x00000400) == 0x00000400)) {
+        output.writeMessage(57, startDeliveryRequest_);
       }
       getUnknownFields().writeTo(output);
     }
@@ -1533,64 +2207,71 @@ public final class PubSubProtocol {
       if (size != -1) return size;
     
       size = 0;
-      if (hasProtocolVersion()) {
+      if (((bitField0_ & 0x00000001) == 0x00000001)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeEnumSize(1, getProtocolVersion().getNumber());
+          .computeEnumSize(1, protocolVersion_.getNumber());
       }
-      if (hasType()) {
+      if (((bitField0_ & 0x00000002) == 0x00000002)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeEnumSize(2, getType().getNumber());
+          .computeEnumSize(2, type_.getNumber());
       }
       {
         int dataSize = 0;
-        for (com.google.protobuf.ByteString element : getTriedServersList()) {
+        for (int i = 0; i < triedServers_.size(); i++) {
           dataSize += com.google.protobuf.CodedOutputStream
-            .computeBytesSizeNoTag(element);
+            .computeBytesSizeNoTag(triedServers_.get(i));
         }
         size += dataSize;
         size += 1 * getTriedServersList().size();
       }
-      if (hasTxnId()) {
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeUInt64Size(4, getTxnId());
+          .computeUInt64Size(4, txnId_);
       }
-      if (hasShouldClaim()) {
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBoolSize(5, getShouldClaim());
+          .computeBoolSize(5, shouldClaim_);
       }
-      if (hasTopic()) {
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(6, getTopic());
+          .computeBytesSize(6, topic_);
       }
-      if (hasPublishRequest()) {
+      if (((bitField0_ & 0x00000020) == 0x00000020)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(52, getPublishRequest());
+          .computeMessageSize(52, publishRequest_);
       }
-      if (hasSubscribeRequest()) {
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(53, getSubscribeRequest());
+          .computeMessageSize(53, subscribeRequest_);
       }
-      if (hasConsumeRequest()) {
+      if (((bitField0_ & 0x00000080) == 0x00000080)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(54, getConsumeRequest());
+          .computeMessageSize(54, consumeRequest_);
       }
-      if (hasUnsubscribeRequest()) {
+      if (((bitField0_ & 0x00000100) == 0x00000100)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(55, getUnsubscribeRequest());
+          .computeMessageSize(55, unsubscribeRequest_);
       }
-      if (hasStopDeliveryRequest()) {
+      if (((bitField0_ & 0x00000200) == 0x00000200)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(56, getStopDeliveryRequest());
+          .computeMessageSize(56, stopDeliveryRequest_);
       }
-      if (hasStartDeliveryRequest()) {
+      if (((bitField0_ & 0x00000400) == 0x00000400)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeMessageSize(57, getStartDeliveryRequest());
+          .computeMessageSize(57, startDeliveryRequest_);
       }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
     }
     
+    private static final long serialVersionUID = 0L;
+    @java.lang.Override
+    protected java.lang.Object writeReplace()
+        throws java.io.ObjectStreamException {
+      return super.writeReplace();
+    }
+    
     public static org.apache.hedwig.protocol.PubSubProtocol.PubSubRequest parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
@@ -1665,34 +2346,103 @@ public final class PubSubProtocol {
     }
     public Builder toBuilder() { return newBuilder(this); }
     
+    @java.lang.Override
+    protected Builder newBuilderForType(
+        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+      Builder builder = new Builder(parent);
+      return builder;
+    }
     public static final class Builder extends
-        com.google.protobuf.GeneratedMessage.Builder<Builder> {
-      private org.apache.hedwig.protocol.PubSubProtocol.PubSubRequest result;
+        com.google.protobuf.GeneratedMessage.Builder<Builder>
+       implements org.apache.hedwig.protocol.PubSubProtocol.PubSubRequestOrBuilder {
+      public static final com.google.protobuf.Descriptors.Descriptor
+          getDescriptor() {
+        return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_PubSubRequest_descriptor;
+      }
       
-      // Construct using org.apache.hedwig.protocol.PubSubProtocol.PubSubRequest.newBuilder()
-      private Builder() {}
+      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+          internalGetFieldAccessorTable() {
+        return org.apache.hedwig.protocol.PubSubProtocol.internal_static_Hedwig_PubSubRequest_fieldAccessorTable;
+      }
       
-      private static Builder create() {
-        Builder builder = new Builder();
-        builder.result = new org.apache.hedwig.protocol.PubSubProtocol.PubSubRequest();
-        return builder;
+      // Construct using org.apache.hedwig.protocol.PubSubProtocol.PubSubRequest.newBuilder()
+      private Builder() {
+        maybeForceBuilderInitialization();
       }
       
-      protected org.apache.hedwig.protocol.PubSubProtocol.PubSubRequest internalGetResult() {
-        return result;
+      private Builder(BuilderParent parent) {
+        super(parent);
+        maybeForceBuilderInitialization();
+      }
+      private void maybeForceBuilderInitialization() {
+        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+          getPublishRequestFieldBuilder();

[... 6156 lines stripped ...]


Mime
View raw message