bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject [1/4] bookkeeper git commit: BOOKKEEPER-937: Upgrade protobuf to 2.6
Date Tue, 16 Aug 2016 17:42:19 GMT
Repository: bookkeeper
Updated Branches:
  refs/heads/master 64f596f45 -> 28f23e80b


http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/28f23e80/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestDataFormats.java
----------------------------------------------------------------------
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestDataFormats.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestDataFormats.java
index c3f675f..84e1a77 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestDataFormats.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestDataFormats.java
@@ -9,20 +9,41 @@ public final class TestDataFormats {
       com.google.protobuf.ExtensionRegistry registry) {
     registry.add(org.apache.bookkeeper.proto.TestDataFormats.messageType);
   }
+  /**
+   * Protobuf enum {@code AuthMessageType}
+   */
   public enum AuthMessageType
       implements com.google.protobuf.ProtocolMessageEnum {
+    /**
+     * <code>SUCCESS_RESPONSE = 1;</code>
+     */
     SUCCESS_RESPONSE(0, 1),
+    /**
+     * <code>FAILURE_RESPONSE = 2;</code>
+     */
     FAILURE_RESPONSE(1, 2),
+    /**
+     * <code>PAYLOAD_MESSAGE = 3;</code>
+     */
     PAYLOAD_MESSAGE(2, 3),
     ;
-    
+
+    /**
+     * <code>SUCCESS_RESPONSE = 1;</code>
+     */
     public static final int SUCCESS_RESPONSE_VALUE = 1;
+    /**
+     * <code>FAILURE_RESPONSE = 2;</code>
+     */
     public static final int FAILURE_RESPONSE_VALUE = 2;
+    /**
+     * <code>PAYLOAD_MESSAGE = 3;</code>
+     */
     public static final int PAYLOAD_MESSAGE_VALUE = 3;
-    
-    
+
+
     public final int getNumber() { return value; }
-    
+
     public static AuthMessageType valueOf(int value) {
       switch (value) {
         case 1: return SUCCESS_RESPONSE;
@@ -31,7 +52,7 @@ public final class TestDataFormats {
         default: return null;
       }
     }
-    
+
     public static com.google.protobuf.Internal.EnumLiteMap<AuthMessageType>
         internalGetValueMap() {
       return internalValueMap;
@@ -43,7 +64,7 @@ public final class TestDataFormats {
               return AuthMessageType.valueOf(number);
             }
           };
-    
+
     public final com.google.protobuf.Descriptors.EnumValueDescriptor
         getValueDescriptor() {
       return getDescriptor().getValues().get(index);
@@ -56,11 +77,9 @@ public final class TestDataFormats {
         getDescriptor() {
       return org.apache.bookkeeper.proto.TestDataFormats.getDescriptor().getEnumTypes().get(0);
     }
-    
-    private static final AuthMessageType[] VALUES = {
-      SUCCESS_RESPONSE, FAILURE_RESPONSE, PAYLOAD_MESSAGE, 
-    };
-    
+
+    private static final AuthMessageType[] VALUES = values();
+
     public static AuthMessageType valueOf(
         com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
       if (desc.getType() != getDescriptor()) {
@@ -69,19 +88,22 @@ public final class TestDataFormats {
       }
       return VALUES[desc.getIndex()];
     }
-    
+
     private final int index;
     private final int value;
-    
+
     private AuthMessageType(int index, int value) {
       this.index = index;
       this.value = value;
     }
-    
+
     // @@protoc_insertion_point(enum_scope:AuthMessageType)
   }
-  
+
   public static final int MESSAGETYPE_FIELD_NUMBER = 1000;
+  /**
+   * <code>extend .AuthMessage { ... }</code>
+   */
   public static final
     com.google.protobuf.GeneratedMessage.GeneratedExtension<
       org.apache.bookkeeper.proto.BookkeeperProtocol.AuthMessage,
@@ -89,7 +111,7 @@ public final class TestDataFormats {
           .newFileScopedGeneratedExtension(
         org.apache.bookkeeper.proto.TestDataFormats.AuthMessageType.class,
         null);
-  
+
   public static com.google.protobuf.Descriptors.FileDescriptor
       getDescriptor() {
     return descriptor;
@@ -102,25 +124,26 @@ public final class TestDataFormats {
       "src/main/proto/BookkeeperProtocol.proto*" +
       "R\n\017AuthMessageType\022\024\n\020SUCCESS_RESPONSE\020\001" +
       "\022\024\n\020FAILURE_RESPONSE\020\002\022\023\n\017PAYLOAD_MESSAG" +
-      "E\020\003:4\n\013messageType\022\014.AuthMessage\030\350\007 \002(\0162" +
+      "E\020\003:4\n\013messageType\022\014.AuthMessage\030\350\007 \001(\0162" +
       "\020.AuthMessageTypeB\037\n\033org.apache.bookkeep" +
       "er.protoH\001"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
-      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
-        public com.google.protobuf.ExtensionRegistry assignDescriptors(
-            com.google.protobuf.Descriptors.FileDescriptor root) {
-          descriptor = root;
-          messageType.internalInit(descriptor.getExtensions().get(0));
-          return null;
-        }
-      };
+        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner()
{
+          public com.google.protobuf.ExtensionRegistry assignDescriptors(
+              com.google.protobuf.Descriptors.FileDescriptor root) {
+            descriptor = root;
+            return null;
+          }
+        };
     com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
         new com.google.protobuf.Descriptors.FileDescriptor[] {
           org.apache.bookkeeper.proto.BookkeeperProtocol.getDescriptor(),
         }, assigner);
+    messageType.internalInit(descriptor.getExtensions().get(0));
+    org.apache.bookkeeper.proto.BookkeeperProtocol.getDescriptor();
   }
-  
+
   // @@protoc_insertion_point(outer_class_scope)
 }

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/28f23e80/bookkeeper-server/src/test/proto/TestDataFormats.proto
----------------------------------------------------------------------
diff --git a/bookkeeper-server/src/test/proto/TestDataFormats.proto b/bookkeeper-server/src/test/proto/TestDataFormats.proto
index 0c616d7..be149ed 100644
--- a/bookkeeper-server/src/test/proto/TestDataFormats.proto
+++ b/bookkeeper-server/src/test/proto/TestDataFormats.proto
@@ -30,5 +30,5 @@ enum AuthMessageType {
  *
  */
 extend AuthMessage {
-    required AuthMessageType messageType = 1000;
+    optional AuthMessageType messageType = 1000;
 }

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/28f23e80/compat-deps/bookkeeper-server-compat-4.0.0/pom.xml
----------------------------------------------------------------------
diff --git a/compat-deps/bookkeeper-server-compat-4.0.0/pom.xml b/compat-deps/bookkeeper-server-compat-4.0.0/pom.xml
index d84c64e..3530174 100644
--- a/compat-deps/bookkeeper-server-compat-4.0.0/pom.xml
+++ b/compat-deps/bookkeeper-server-compat-4.0.0/pom.xml
@@ -33,6 +33,11 @@
   </properties>
   <dependencies>
     <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java</artifactId>
+      <version>2.4.1</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.bookkeeper</groupId>
       <artifactId>bookkeeper-server</artifactId>
       <version>4.0.0</version>
@@ -54,6 +59,7 @@
               <createDependencyReducedPom>false</createDependencyReducedPom>
               <artifactSet>
                 <includes>
+                  <include>com.google.protobuf:protobuf-java</include>
                   <include>org.apache.*:*</include>
                   <include>org.jboss.*:*</include>
                   <include>commons-*:*</include>
@@ -64,6 +70,10 @@
               </artifactSet>
               <relocations>
                 <relocation>
+                  <pattern>com.google.protobuf</pattern>
+                  <shadedPattern>bk-shade.com.google.proto_bk_v4_0_0</shadedPattern>
+                </relocation>
+                <relocation>
                   <pattern>org.apache</pattern>
                   <shadedPattern>org.apache.bk_v4_0_0</shadedPattern>
                   <excludes>

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/28f23e80/compat-deps/bookkeeper-server-compat-4.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/compat-deps/bookkeeper-server-compat-4.1.0/pom.xml b/compat-deps/bookkeeper-server-compat-4.1.0/pom.xml
index 76b8b91..9b716e4 100644
--- a/compat-deps/bookkeeper-server-compat-4.1.0/pom.xml
+++ b/compat-deps/bookkeeper-server-compat-4.1.0/pom.xml
@@ -33,6 +33,11 @@
   </properties>
   <dependencies>
     <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java</artifactId>
+      <version>2.4.1</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.bookkeeper</groupId>
       <artifactId>bookkeeper-server</artifactId>
       <version>4.1.0</version>
@@ -54,6 +59,7 @@
               <createDependencyReducedPom>false</createDependencyReducedPom>
               <artifactSet>
                 <includes>
+                  <include>com.google.protobuf:protobuf-java</include>
                   <include>org.apache.*:*</include>
                   <include>org.jboss.*:*</include>
                   <include>commons-*:*</include>
@@ -64,6 +70,10 @@
               </artifactSet>
               <relocations>
                 <relocation>
+                  <pattern>com.google.protobuf</pattern>
+                  <shadedPattern>bk-shade.com.google.proto_bk_v4_1_0</shadedPattern>
+                </relocation>
+                <relocation>
                   <pattern>org.apache.commons</pattern>
                   <shadedPattern>org.apache.bk_v4_1_0.commons</shadedPattern>
                 </relocation>

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/28f23e80/compat-deps/bookkeeper-server-compat-4.2.0/pom.xml
----------------------------------------------------------------------
diff --git a/compat-deps/bookkeeper-server-compat-4.2.0/pom.xml b/compat-deps/bookkeeper-server-compat-4.2.0/pom.xml
index 8c3b44a..729d68b 100644
--- a/compat-deps/bookkeeper-server-compat-4.2.0/pom.xml
+++ b/compat-deps/bookkeeper-server-compat-4.2.0/pom.xml
@@ -33,6 +33,11 @@
   </properties>
   <dependencies>
     <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java</artifactId>
+      <version>2.4.1</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.bookkeeper</groupId>
       <artifactId>bookkeeper-server</artifactId>
       <version>4.2.0</version>
@@ -54,6 +59,7 @@
               <createDependencyReducedPom>false</createDependencyReducedPom>
               <artifactSet>
                 <includes>
+                  <include>com.google.protobuf:protobuf-java</include>
                   <include>org.apache.*:*</include>
                   <include>org.jboss.*:*</include>
                   <include>commons-*:*</include>
@@ -64,6 +70,10 @@
               </artifactSet>
               <relocations>
                 <relocation>
+                  <pattern>com.google.protobuf</pattern>
+                  <shadedPattern>bk-shade.com.google.proto_bk_v4_2_0</shadedPattern>
+                </relocation>
+                <relocation>
                   <pattern>org.apache.commons</pattern>
                   <shadedPattern>org.apache.bk_v4_2_0.commons</shadedPattern>
                 </relocation>

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/28f23e80/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 27ffbf0..298520b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,7 +41,7 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    <protobuf.version>2.4.1</protobuf.version>
+    <protobuf.version>2.6.1</protobuf.version>
     <guava.version>13.0.1</guava.version>
     <netty.version>3.9.4.Final</netty.version>
     <zookeeper.version>3.4.6</zookeeper.version>


Mime
View raw message