diff --git a/.gitignore b/.gitignore index 72806b479..17e9070c8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,6 @@ logs/ #protobuf example/build/* -test/test-integration/build/* \ No newline at end of file +test/test-integration/build/* + +registry/registry-polaris/polaris/ \ No newline at end of file diff --git a/all/pom.xml b/all/pom.xml index ab6e1187d..b3d2126b0 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -61,16 +61,16 @@ 4.1.44.Final 3.4.0 3.6.3.Final - 1.5.10 + 1.6.6 3.0.8 1.4.1 1.9.8 - 5.2.0 + 6.3.0 1.6.9 7.0 4.5.13 4.4.13 - 1.33.1 + 1.53.0 27.0-jre 2.12.1 diff --git a/bom/pom.xml b/bom/pom.xml index e0131f398..8558dbb8a 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -24,7 +24,7 @@ 0.22.0 2.6.9 2.0.3 - 5.2.0 + 6.3.0 1.2.2 1.6.9 7.0 @@ -33,12 +33,12 @@ 3.4.0 0.9.2 - 3.16.3 + 3.22.0 2.12.7 2.12.7.1 0.6.12 1.5.9 - 1.33.1 + 1.53.0 4.4.13 @@ -51,7 +51,7 @@ 4.13.1 - 1.5.10 + 1.6.6 1.3.2 3.0.8 1.4.1 @@ -514,7 +514,7 @@ io.netty netty-tcnative-boringssl-static - 2.0.25.Final + 2.0.59.Final ${os.detected.classifier} @@ -557,6 +557,12 @@ ${prometheus.client.version} test + + io.prometheus + simpleclient_hotspot + 0.16.0 + test + diff --git a/example/pom.xml b/example/pom.xml index 6a8ff6b58..ca0b3cd87 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -11,10 +11,10 @@ - 3.11.0 - 1.17.0 + 3.22.0 + 1.53.0 0.0.3 - 1.33.1 + 1.53.0 3.7.0 @@ -194,7 +194,7 @@ protobuf-maven-plugin 0.5.1 - com.google.protobuf:protoc:3.7.1:exe:${os.detected.classifier} + com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier} grpc-java io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} build/generated/source/proto/main/java diff --git a/pom.xml b/pom.xml index 581d34dce..4974403de 100644 --- a/pom.xml +++ b/pom.xml @@ -87,8 +87,8 @@ 1.8 utf-8 false - 3.7.1 - 1.27.2 + 3.22.0 + 1.53.0 0.0.2 diff --git a/registry/registry-nacos/pom.xml b/registry/registry-nacos/pom.xml index ca82a7e22..c653c76d2 100644 --- a/registry/registry-nacos/pom.xml +++ b/registry/registry-nacos/pom.xml @@ -37,9 +37,13 @@ name.jervyshi nacos-embedded - 0.2.0 + 0.3.0 test + + commons-io + commons-io + diff --git a/registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryTest.java b/registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryTest.java index e39923f8d..373af0eb6 100644 --- a/registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryTest.java +++ b/registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryTest.java @@ -81,7 +81,7 @@ public void tearDown() { } /** - * 测试Zookeeper Provider Observer + * 测试 Nacos Provider Observer * * @throws Exception the exception */ @@ -93,21 +93,21 @@ public void testProviderObserver() throws Exception { TimeUnit.SECONDS.sleep(10); serverConfig = new ServerConfig() - .setProtocol("bolt") - .setHost("0.0.0.0") - .setPort(12200); + .setProtocol("bolt") + .setHost("0.0.0.0") + .setPort(12200); ProviderConfig provider = new ProviderConfig(); provider.setInterfaceId("com.alipay.xxx.NacosTestService") - .setApplication(new ApplicationConfig().setAppName("test-server")) - .setUniqueId("nacos-test") - .setProxy("javassist") - .setRegister(true) - .setRegistry(registryConfig) - .setSerialization("hessian2") - .setServer(serverConfig) - .setWeight(222) - .setTimeout(3000); + .setApplication(new ApplicationConfig().setAppName("test-server")) + .setUniqueId("nacos-test") + .setProxy("javassist") + .setRegister(true) + .setRegistry(registryConfig) + .setSerialization("hessian2") + .setServer(serverConfig) + .setWeight(222) + .setTimeout(3000); // 注册 try { @@ -120,13 +120,13 @@ public void testProviderObserver() throws Exception { ConsumerConfig consumer = new ConsumerConfig(); consumer.setInterfaceId("com.alipay.xxx.NacosTestService") - .setApplication(new ApplicationConfig().setAppName("test-server")) - .setUniqueId("nacos-test") - .setProxy("javassist") - .setSubscribe(true) - .setSerialization("java") - .setInvokeType("sync") - .setTimeout(4444); + .setApplication(new ApplicationConfig().setAppName("test-server")) + .setUniqueId("nacos-test") + .setProxy("javassist") + .setSubscribe(true) + .setSerialization("java") + .setInvokeType("sync") + .setTimeout(4444); // 订阅 CountDownLatch latch = new CountDownLatch(1); @@ -144,12 +144,12 @@ public void testProviderObserver() throws Exception { // 订阅 错误的uniqueId ConsumerConfig consumerNoUniqueId = new ConsumerConfig(); consumerNoUniqueId.setInterfaceId("com.alipay.xxx.NacosTestService") - .setApplication(new ApplicationConfig().setAppName("test-server")) - .setProxy("javassist") - .setSubscribe(true) - .setSerialization("java") - .setInvokeType("sync") - .setTimeout(4444); + .setApplication(new ApplicationConfig().setAppName("test-server")) + .setProxy("javassist") + .setSubscribe(true) + .setSerialization("java") + .setInvokeType("sync") + .setTimeout(4444); latch = new CountDownLatch(1); MockProviderInfoListener wrongProviderInfoListener = new MockProviderInfoListener(); wrongProviderInfoListener.setCountDownLatch(latch); @@ -174,9 +174,9 @@ public void testProviderObserver() throws Exception { latch = new CountDownLatch(2); providerInfoListener.setCountDownLatch(latch); provider.getServer().add(new ServerConfig() - .setProtocol("bolt") - .setHost("0.0.0.0") - .setPort(12201)); + .setProtocol("bolt") + .setHost("0.0.0.0") + .setPort(12201)); registry.register(provider); latch.await(timeoutPerSub * 2, TimeUnit.MILLISECONDS); @@ -189,13 +189,13 @@ public void testProviderObserver() throws Exception { // 重复订阅 ConsumerConfig consumer2 = new ConsumerConfig(); consumer2.setInterfaceId("com.alipay.xxx.NacosTestService") - .setUniqueId("nacos-test") - .setApplication(new ApplicationConfig().setAppName("test-server")) - .setProxy("javassist") - .setSubscribe(true) - .setSerialization("java") - .setInvokeType("sync") - .setTimeout(4444); + .setUniqueId("nacos-test") + .setApplication(new ApplicationConfig().setAppName("test-server")) + .setProxy("javassist") + .setSubscribe(true) + .setSerialization("java") + .setInvokeType("sync") + .setTimeout(4444); CountDownLatch latch2 = new CountDownLatch(1); MockProviderInfoListener providerInfoListener2 = new MockProviderInfoListener(); providerInfoListener2.setCountDownLatch(latch2); @@ -214,17 +214,17 @@ public void testProviderObserver() throws Exception { // 批量反注册,判断订阅者2的数据 latch = new CountDownLatch(2); providerInfoListener2.setCountDownLatch(latch); - List providerConfigList = new ArrayList(); + List providerConfigList = new ArrayList<>(); providerConfigList.add(provider); registry.batchUnRegister(providerConfigList); latch.await(timeoutPerSub * 2, TimeUnit.MILLISECONDS); - Assert.assertEquals("after unregister: 1", 1, ps2.size()); + Assert.assertEquals("after unregister: 0", 0, ps2.size()); // 所有的 Provider 都已经反向注册了,应该是 0 LOGGER.info("after unregister consumer, and consumer2 {}", ps); // 批量取消订阅 - List consumerConfigList = new ArrayList(); + List consumerConfigList = new ArrayList<>(); consumerConfigList.add(consumer2); registry.batchUnSubscribe(consumerConfigList); } diff --git a/registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/base/BaseNacosTest.java b/registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/base/BaseNacosTest.java index 8266b34a9..ec9f6d1e2 100644 --- a/registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/base/BaseNacosTest.java +++ b/registry/registry-nacos/src/test/java/com/alipay/sofa/rpc/registry/nacos/base/BaseNacosTest.java @@ -60,7 +60,7 @@ public static void adAfterClass() { @Before public void setup() { //see https://nacos.io/zh-cn/docs/2.0.0-compatibility.html - nacosProcess = NacosStarterBuilder.nacosStarter().withServerPort(8848).withNacosVersion("2.0.3").build() + nacosProcess = NacosStarterBuilder.nacosStarter().withServerPort(8848).withNacosVersion("2.2.3").build() .start(); } diff --git a/registry/registry-sofa/pom.xml b/registry/registry-sofa/pom.xml index 915299d13..f1427cb07 100644 --- a/registry/registry-sofa/pom.xml +++ b/registry/registry-sofa/pom.xml @@ -12,7 +12,7 @@ sofa-rpc-registry-sofa - 5.2.0 + 6.3.0 -Dnetwork_interface_denylist=docker0 @@ -66,14 +66,6 @@ log4j-jcl org.apache.logging.log4j - - log4j-core - org.apache.logging.log4j - - - log4j-api - org.apache.logging.log4j - @@ -81,6 +73,11 @@ junit test + + io.prometheus + simpleclient_hotspot + test + diff --git a/registry/registry-sofa/src/test/java/com/alipay/sofa/common/profile/StringUtil.java b/registry/registry-sofa/src/test/java/com/alipay/sofa/common/profile/StringUtil.java new file mode 100644 index 000000000..26475fc3a --- /dev/null +++ b/registry/registry-sofa/src/test/java/com/alipay/sofa/common/profile/StringUtil.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.alipay.sofa.common.profile; + +/** + * @author khotyn + * @version StringUtil.java, v 0.1 2023年07月05日 14:40 khotyn + */ +public class StringUtil { + public static boolean equals(String str1, String str2) { + return str1 == null ? str2 == null : str1.equals(str2); + } + + public static boolean isNotEmpty(String str) { + return str != null && str.length() > 0; + } + + public static boolean isNotBlank(String str) { + int length; + if (str != null && (length = str.length()) != 0) { + for (int i = 0; i < length; ++i) { + if (!Character.isWhitespace(str.charAt(i))) { + return true; + } + } + + return false; + } else { + return false; + } + } + + public static boolean isBlank(String str) { + int length; + if (str != null && (length = str.length()) != 0) { + for (int i = 0; i < length; ++i) { + if (!Character.isWhitespace(str.charAt(i))) { + return false; + } + } + + return true; + } else { + return true; + } + } +} \ No newline at end of file diff --git a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/GenericProto.java b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/GenericProto.java index 28601cbe1..808f3a3a7 100644 --- a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/GenericProto.java +++ b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/GenericProto.java @@ -40,18 +40,10 @@ public static void registerAllExtensions( "ervice\022 \n\007generic\022\010.Request\032\t.Response\"\000" + "B\030\n\006tripleB\014GenericProtoP\001b\006proto3" }; - 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; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor + descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); + }); internal_static_Request_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_Request_fieldAccessorTable = new diff --git a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/GenericServiceGrpc.java b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/GenericServiceGrpc.java index c23d3c0ea..75a2e5ba5 100644 --- a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/GenericServiceGrpc.java +++ b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/GenericServiceGrpc.java @@ -1,25 +1,13 @@ package triple; import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; /** */ @javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.27.2)", + value = "by gRPC proto compiler (version 1.53.0)", comments = "Source: transformer.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class GenericServiceGrpc { private GenericServiceGrpc() {} @@ -110,14 +98,14 @@ public static abstract class GenericServiceImplBase implements io.grpc.BindableS */ public void generic(triple.Request request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGenericMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGenericMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getGenericMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< triple.Request, triple.Response>( @@ -144,7 +132,7 @@ protected GenericServiceStub build( */ public void generic(triple.Request request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGenericMethod(), getCallOptions()), request, responseObserver); } } @@ -166,7 +154,7 @@ protected GenericServiceBlockingStub build( /** */ public triple.Response generic(triple.Request request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGenericMethod(), getCallOptions(), request); } } @@ -189,7 +177,7 @@ protected GenericServiceFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture generic( triple.Request request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGenericMethod(), getCallOptions()), request); } } diff --git a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/Request.java b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/Request.java index d32e467a4..f2c62638a 100644 --- a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/Request.java +++ b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/Request.java @@ -6,7 +6,7 @@ /** * Protobuf type {@code Request} */ -public final class Request extends +public final class Request extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:Request) RequestOrBuilder { @@ -18,81 +18,17 @@ private Request(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Request() { serializeType_ = ""; args_ = java.util.Collections.emptyList(); - argTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + argTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Request( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - serializeType_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - args_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - args_.add(input.readBytes()); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - argTypes_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - argTypes_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - args_ = java.util.Collections.unmodifiableList(args_); // C - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - argTypes_ = argTypes_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Request(); } + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return triple.GenericProto.internal_static_Request_descriptor; @@ -106,12 +42,14 @@ private Request( triple.Request.class, triple.Request.Builder.class); } - private int bitField0_; public static final int SERIALIZETYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object serializeType_; + @SuppressWarnings("serial") + private volatile java.lang.Object serializeType_ = ""; /** * string serializeType = 1; + * @return The serializeType. */ + @java.lang.Override public java.lang.String getSerializeType() { java.lang.Object ref = serializeType_; if (ref instanceof java.lang.String) { @@ -126,7 +64,9 @@ public java.lang.String getSerializeType() { } /** * string serializeType = 1; + * @return The bytes for serializeType. */ + @java.lang.Override public com.google.protobuf.ByteString getSerializeTypeBytes() { java.lang.Object ref = serializeType_; @@ -142,31 +82,40 @@ public java.lang.String getSerializeType() { } public static final int ARGS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") private java.util.List args_; /** * repeated bytes args = 2; + * @return A list containing the args. */ + @java.lang.Override public java.util.List getArgsList() { return args_; } /** * repeated bytes args = 2; + * @return The count of args. */ public int getArgsCount() { return args_.size(); } /** * repeated bytes args = 2; + * @param index The index of the element to return. + * @return The args at the given index. */ public com.google.protobuf.ByteString getArgs(int index) { return args_.get(index); } public static final int ARGTYPES_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList argTypes_; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList argTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); /** * repeated string argTypes = 3; + * @return A list containing the argTypes. */ public com.google.protobuf.ProtocolStringList getArgTypesList() { @@ -174,18 +123,23 @@ public com.google.protobuf.ByteString getArgs(int index) { } /** * repeated string argTypes = 3; + * @return The count of argTypes. */ public int getArgTypesCount() { return argTypes_.size(); } /** * repeated string argTypes = 3; + * @param index The index of the element to return. + * @return The argTypes at the given index. */ public java.lang.String getArgTypes(int index) { return argTypes_.get(index); } /** * repeated string argTypes = 3; + * @param index The index of the value to return. + * @return The bytes of the argTypes at the given index. */ public com.google.protobuf.ByteString getArgTypesBytes(int index) { @@ -206,7 +160,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getSerializeTypeBytes().isEmpty()) { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serializeType_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, serializeType_); } for (int i = 0; i < args_.size(); i++) { @@ -215,7 +169,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) for (int i = 0; i < argTypes_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, argTypes_.getRaw(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -224,7 +178,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getSerializeTypeBytes().isEmpty()) { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serializeType_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, serializeType_); } { @@ -244,7 +198,7 @@ public int getSerializedSize() { size += dataSize; size += 1 * getArgTypesList().size(); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -265,7 +219,7 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getArgsList())) return false; if (!getArgTypesList() .equals(other.getArgTypesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -286,7 +240,7 @@ public int hashCode() { hash = (37 * hash) + ARGTYPES_FIELD_NUMBER; hash = (53 * hash) + getArgTypesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -403,28 +357,22 @@ public static final class Builder extends // Construct using triple.Request.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; serializeType_ = ""; - args_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - argTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + argTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -451,56 +399,31 @@ public triple.Request build() { @java.lang.Override public triple.Request buildPartial() { triple.Request result = new triple.Request(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.serializeType_ = serializeType_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(triple.Request result) { if (((bitField0_ & 0x00000002) != 0)) { args_ = java.util.Collections.unmodifiableList(args_); bitField0_ = (bitField0_ & ~0x00000002); } result.args_ = args_; - if (((bitField0_ & 0x00000004) != 0)) { - argTypes_ = argTypes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.argTypes_ = argTypes_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(triple.Request result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.serializeType_ = serializeType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + argTypes_.makeImmutable(); + result.argTypes_ = argTypes_; + } } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof triple.Request) { @@ -515,6 +438,7 @@ public Builder mergeFrom(triple.Request other) { if (other == triple.Request.getDefaultInstance()) return this; if (!other.getSerializeType().isEmpty()) { serializeType_ = other.serializeType_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.args_.isEmpty()) { @@ -530,14 +454,14 @@ public Builder mergeFrom(triple.Request other) { if (!other.argTypes_.isEmpty()) { if (argTypes_.isEmpty()) { argTypes_ = other.argTypes_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ |= 0x00000004; } else { ensureArgTypesIsMutable(); argTypes_.addAll(other.argTypes_); } onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -552,17 +476,47 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - triple.Request parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + serializeType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + com.google.protobuf.ByteString v = input.readBytes(); + ensureArgsIsMutable(); + args_.add(v); + break; + } // case 18 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + ensureArgTypesIsMutable(); + argTypes_.add(s); + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (triple.Request) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; @@ -570,6 +524,7 @@ public Builder mergeFrom( private java.lang.Object serializeType_ = ""; /** * string serializeType = 1; + * @return The serializeType. */ public java.lang.String getSerializeType() { java.lang.Object ref = serializeType_; @@ -585,6 +540,7 @@ public java.lang.String getSerializeType() { } /** * string serializeType = 1; + * @return The bytes for serializeType. */ public com.google.protobuf.ByteString getSerializeTypeBytes() { @@ -601,37 +557,38 @@ public java.lang.String getSerializeType() { } /** * string serializeType = 1; + * @param value The serializeType to set. + * @return This builder for chaining. */ public Builder setSerializeType( java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + if (value == null) { throw new NullPointerException(); } serializeType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** * string serializeType = 1; + * @return This builder for chaining. */ public Builder clearSerializeType() { - serializeType_ = getDefaultInstance().getSerializeType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * string serializeType = 1; + * @param value The bytes for serializeType to set. + * @return This builder for chaining. */ public Builder setSerializeTypeBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); serializeType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -641,10 +598,11 @@ private void ensureArgsIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { args_ = new java.util.ArrayList(args_); bitField0_ |= 0x00000002; - } + } } /** * repeated bytes args = 2; + * @return A list containing the args. */ public java.util.List getArgsList() { @@ -653,43 +611,49 @@ private void ensureArgsIsMutable() { } /** * repeated bytes args = 2; + * @return The count of args. */ public int getArgsCount() { return args_.size(); } /** * repeated bytes args = 2; + * @param index The index of the element to return. + * @return The args at the given index. */ public com.google.protobuf.ByteString getArgs(int index) { return args_.get(index); } /** * repeated bytes args = 2; + * @param index The index to set the value at. + * @param value The args to set. + * @return This builder for chaining. */ public Builder setArgs( int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgsIsMutable(); + if (value == null) { throw new NullPointerException(); } + ensureArgsIsMutable(); args_.set(index, value); onChanged(); return this; } /** * repeated bytes args = 2; + * @param value The args to add. + * @return This builder for chaining. */ public Builder addArgs(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgsIsMutable(); + if (value == null) { throw new NullPointerException(); } + ensureArgsIsMutable(); args_.add(value); onChanged(); return this; } /** * repeated bytes args = 2; + * @param values The args to add. + * @return This builder for chaining. */ public Builder addAllArgs( java.lang.Iterable values) { @@ -701,6 +665,7 @@ public Builder addAllArgs( } /** * repeated bytes args = 2; + * @return This builder for chaining. */ public Builder clearArgs() { args_ = java.util.Collections.emptyList(); @@ -709,34 +674,42 @@ public Builder clearArgs() { return this; } - private com.google.protobuf.LazyStringList argTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList argTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureArgTypesIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!argTypes_.isModifiable()) { argTypes_ = new com.google.protobuf.LazyStringArrayList(argTypes_); - bitField0_ |= 0x00000004; - } + } + bitField0_ |= 0x00000004; } /** * repeated string argTypes = 3; + * @return A list containing the argTypes. */ public com.google.protobuf.ProtocolStringList getArgTypesList() { - return argTypes_.getUnmodifiableView(); + argTypes_.makeImmutable(); + return argTypes_; } /** * repeated string argTypes = 3; + * @return The count of argTypes. */ public int getArgTypesCount() { return argTypes_.size(); } /** * repeated string argTypes = 3; + * @param index The index of the element to return. + * @return The argTypes at the given index. */ public java.lang.String getArgTypes(int index) { return argTypes_.get(index); } /** * repeated string argTypes = 3; + * @param index The index of the value to return. + * @return The bytes of the argTypes at the given index. */ public com.google.protobuf.ByteString getArgTypesBytes(int index) { @@ -744,61 +717,70 @@ public java.lang.String getArgTypes(int index) { } /** * repeated string argTypes = 3; + * @param index The index to set the value at. + * @param value The argTypes to set. + * @return This builder for chaining. */ public Builder setArgTypes( int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgTypesIsMutable(); + if (value == null) { throw new NullPointerException(); } + ensureArgTypesIsMutable(); argTypes_.set(index, value); + bitField0_ |= 0x00000004; onChanged(); return this; } /** * repeated string argTypes = 3; + * @param value The argTypes to add. + * @return This builder for chaining. */ public Builder addArgTypes( java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgTypesIsMutable(); + if (value == null) { throw new NullPointerException(); } + ensureArgTypesIsMutable(); argTypes_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } /** * repeated string argTypes = 3; + * @param values The argTypes to add. + * @return This builder for chaining. */ public Builder addAllArgTypes( java.lang.Iterable values) { ensureArgTypesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, argTypes_); + bitField0_ |= 0x00000004; onChanged(); return this; } /** * repeated string argTypes = 3; + * @return This builder for chaining. */ public Builder clearArgTypes() { - argTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + argTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004);; onChanged(); return this; } /** * repeated string argTypes = 3; + * @param value The bytes of the argTypes to add. + * @return This builder for chaining. */ public Builder addArgTypesBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); ensureArgTypesIsMutable(); argTypes_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -835,7 +817,18 @@ public Request parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Request(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/RequestOrBuilder.java b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/RequestOrBuilder.java index 5bbe848e8..bd580afc0 100644 --- a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/RequestOrBuilder.java +++ b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/RequestOrBuilder.java @@ -9,42 +9,54 @@ public interface RequestOrBuilder extends /** * string serializeType = 1; + * @return The serializeType. */ java.lang.String getSerializeType(); /** * string serializeType = 1; + * @return The bytes for serializeType. */ com.google.protobuf.ByteString getSerializeTypeBytes(); /** * repeated bytes args = 2; + * @return A list containing the args. */ java.util.List getArgsList(); /** * repeated bytes args = 2; + * @return The count of args. */ int getArgsCount(); /** * repeated bytes args = 2; + * @param index The index of the element to return. + * @return The args at the given index. */ com.google.protobuf.ByteString getArgs(int index); /** * repeated string argTypes = 3; + * @return A list containing the argTypes. */ java.util.List getArgTypesList(); /** * repeated string argTypes = 3; + * @return The count of argTypes. */ int getArgTypesCount(); /** * repeated string argTypes = 3; + * @param index The index of the element to return. + * @return The argTypes at the given index. */ java.lang.String getArgTypes(int index); /** * repeated string argTypes = 3; + * @param index The index of the value to return. + * @return The bytes of the argTypes at the given index. */ com.google.protobuf.ByteString getArgTypesBytes(int index); diff --git a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/Response.java b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/Response.java index 19f0ffa6c..366f21ce7 100644 --- a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/Response.java +++ b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/Response.java @@ -6,7 +6,7 @@ /** * Protobuf type {@code Response} */ -public final class Response extends +public final class Response extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:Response) ResponseOrBuilder { @@ -22,65 +22,12 @@ private Response() { } @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Response( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - serializeType_ = s; - break; - } - case 18: { - - data_ = input.readBytes(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Response(); } + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return triple.GenericProto.internal_static_Response_descriptor; @@ -95,10 +42,13 @@ private Response( } public static final int SERIALIZETYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object serializeType_; + @SuppressWarnings("serial") + private volatile java.lang.Object serializeType_ = ""; /** * string serializeType = 1; + * @return The serializeType. */ + @java.lang.Override public java.lang.String getSerializeType() { java.lang.Object ref = serializeType_; if (ref instanceof java.lang.String) { @@ -113,7 +63,9 @@ public java.lang.String getSerializeType() { } /** * string serializeType = 1; + * @return The bytes for serializeType. */ + @java.lang.Override public com.google.protobuf.ByteString getSerializeTypeBytes() { java.lang.Object ref = serializeType_; @@ -129,19 +81,24 @@ public java.lang.String getSerializeType() { } public static final int DATA_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString data_; + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; /** * bytes data = 2; + * @return The data. */ + @java.lang.Override public com.google.protobuf.ByteString getData() { return data_; } public static final int TYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object type_; + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; /** * string type = 3; + * @return The type. */ + @java.lang.Override public java.lang.String getType() { java.lang.Object ref = type_; if (ref instanceof java.lang.String) { @@ -156,7 +113,9 @@ public java.lang.String getType() { } /** * string type = 3; + * @return The bytes for type. */ + @java.lang.Override public com.google.protobuf.ByteString getTypeBytes() { java.lang.Object ref = type_; @@ -185,16 +144,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getSerializeTypeBytes().isEmpty()) { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serializeType_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, serializeType_); } if (!data_.isEmpty()) { output.writeBytes(2, data_); } - if (!getTypeBytes().isEmpty()) { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -203,17 +162,17 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getSerializeTypeBytes().isEmpty()) { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serializeType_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, serializeType_); } if (!data_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, data_); } - if (!getTypeBytes().isEmpty()) { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -234,7 +193,7 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getData())) return false; if (!getType() .equals(other.getType())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -251,7 +210,7 @@ public int hashCode() { hash = (53 * hash) + getData().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + getType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -368,28 +327,21 @@ public static final class Builder extends // Construct using triple.Response.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; serializeType_ = ""; - data_ = com.google.protobuf.ByteString.EMPTY; - type_ = ""; - return this; } @@ -416,45 +368,24 @@ public triple.Response build() { @java.lang.Override public triple.Response buildPartial() { triple.Response result = new triple.Response(this); - result.serializeType_ = serializeType_; - result.data_ = data_; - result.type_ = type_; + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(triple.Response result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.serializeType_ = serializeType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.data_ = data_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = type_; + } } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof triple.Response) { @@ -469,6 +400,7 @@ public Builder mergeFrom(triple.Response other) { if (other == triple.Response.getDefaultInstance()) return this; if (!other.getSerializeType().isEmpty()) { serializeType_ = other.serializeType_; + bitField0_ |= 0x00000001; onChanged(); } if (other.getData() != com.google.protobuf.ByteString.EMPTY) { @@ -476,9 +408,10 @@ public Builder mergeFrom(triple.Response other) { } if (!other.getType().isEmpty()) { type_ = other.type_; + bitField0_ |= 0x00000004; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -493,23 +426,53 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - triple.Response parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + serializeType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + data_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (triple.Response) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; private java.lang.Object serializeType_ = ""; /** * string serializeType = 1; + * @return The serializeType. */ public java.lang.String getSerializeType() { java.lang.Object ref = serializeType_; @@ -525,6 +488,7 @@ public java.lang.String getSerializeType() { } /** * string serializeType = 1; + * @return The bytes for serializeType. */ public com.google.protobuf.ByteString getSerializeTypeBytes() { @@ -541,37 +505,38 @@ public java.lang.String getSerializeType() { } /** * string serializeType = 1; + * @param value The serializeType to set. + * @return This builder for chaining. */ public Builder setSerializeType( java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + if (value == null) { throw new NullPointerException(); } serializeType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** * string serializeType = 1; + * @return This builder for chaining. */ public Builder clearSerializeType() { - serializeType_ = getDefaultInstance().getSerializeType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * string serializeType = 1; + * @param value The bytes for serializeType to set. + * @return This builder for chaining. */ public Builder setSerializeTypeBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); serializeType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -579,27 +544,30 @@ public Builder setSerializeTypeBytes( private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; /** * bytes data = 2; + * @return The data. */ + @java.lang.Override public com.google.protobuf.ByteString getData() { return data_; } /** * bytes data = 2; + * @param value The data to set. + * @return This builder for chaining. */ public Builder setData(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - + if (value == null) { throw new NullPointerException(); } data_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } /** * bytes data = 2; + * @return This builder for chaining. */ public Builder clearData() { - + bitField0_ = (bitField0_ & ~0x00000002); data_ = getDefaultInstance().getData(); onChanged(); return this; @@ -608,6 +576,7 @@ public Builder clearData() { private java.lang.Object type_ = ""; /** * string type = 3; + * @return The type. */ public java.lang.String getType() { java.lang.Object ref = type_; @@ -623,6 +592,7 @@ public java.lang.String getType() { } /** * string type = 3; + * @return The bytes for type. */ public com.google.protobuf.ByteString getTypeBytes() { @@ -639,37 +609,38 @@ public java.lang.String getType() { } /** * string type = 3; + * @param value The type to set. + * @return This builder for chaining. */ public Builder setType( java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - + if (value == null) { throw new NullPointerException(); } type_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } /** * string type = 3; + * @return This builder for chaining. */ public Builder clearType() { - type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** * string type = 3; + * @param value The bytes for type to set. + * @return This builder for chaining. */ public Builder setTypeBytes( com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); type_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -706,7 +677,18 @@ public Response parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Response(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/ResponseOrBuilder.java b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/ResponseOrBuilder.java index cdf4c0eb0..6f989bddf 100644 --- a/remoting/remoting-triple/build/generated/source/proto/main/java/triple/ResponseOrBuilder.java +++ b/remoting/remoting-triple/build/generated/source/proto/main/java/triple/ResponseOrBuilder.java @@ -9,25 +9,30 @@ public interface ResponseOrBuilder extends /** * string serializeType = 1; + * @return The serializeType. */ java.lang.String getSerializeType(); /** * string serializeType = 1; + * @return The bytes for serializeType. */ com.google.protobuf.ByteString getSerializeTypeBytes(); /** * bytes data = 2; + * @return The data. */ com.google.protobuf.ByteString getData(); /** * string type = 3; + * @return The type. */ java.lang.String getType(); /** * string type = 3; + * @return The bytes for type. */ com.google.protobuf.ByteString getTypeBytes(); diff --git a/test/test-integration/pom.xml b/test/test-integration/pom.xml index d4a6c8a25..5d78a8e48 100644 --- a/test/test-integration/pom.xml +++ b/test/test-integration/pom.xml @@ -13,10 +13,10 @@ sofa-rpc-test-integration - 3.11.0 - 1.17.0 + 3.22.0 + 1.53.0 0.0.2 - 1.28.0 + 1.53.0 3.7.0 @@ -324,7 +324,7 @@ protobuf-maven-plugin 0.5.1 - com.google.protobuf:protoc:3.7.1:exe:${os.detected.classifier} + com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier} grpc-java io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} build/generated/source/proto/main/java diff --git a/test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/TripleServerTest.java b/test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/TripleServerTest.java index 3d1bbd970..3c608ca86 100644 --- a/test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/TripleServerTest.java +++ b/test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/TripleServerTest.java @@ -28,6 +28,8 @@ import com.alipay.sofa.rpc.context.RpcRunningState; import com.alipay.sofa.rpc.context.RpcRuntimeContext; import com.alipay.sofa.rpc.core.exception.SofaTimeOutException; +import io.grpc.Status; +import io.grpc.StatusException; import io.grpc.examples.helloworld.HelloReply; import io.grpc.examples.helloworld.HelloRequest; import io.grpc.examples.helloworld.SofaGreeterTriple; @@ -327,19 +329,19 @@ public void testDefaultMessageSize() { SampleService sampleService = consumerConfig.refer(); String msg = buildMsg(1); try { - sampleService.messageSize(msg, 5*1024); + sampleService.messageSize(msg, 5 * 1024); Assert.fail(); } catch (Exception e) { Assert.assertTrue(e.getMessage().contains("gRPC message exceeds maximum size 4194304:")); } - msg = buildMsg(5*1024); + msg = buildMsg(5 * 1024); try { sampleService.messageSize(msg, 1); Assert.fail(); } catch (Exception e) { // The client actively cancelled the request, resulting in the server returning a CANCELLED error. - Assert.assertTrue(e.getMessage().contains("CANCELLED: HTTP/2 error code: CANCEL")); + Assert.assertTrue(((StatusException) e.getCause()).getStatus().getCode().equals(Status.CANCELLED.getCode())); } } finally { RpcRunningState.setDebugMode(originDebugMode); diff --git a/tracer/tracer-opentracing/pom.xml b/tracer/tracer-opentracing/pom.xml index 381345d8f..64a7856fd 100644 --- a/tracer/tracer-opentracing/pom.xml +++ b/tracer/tracer-opentracing/pom.xml @@ -13,8 +13,6 @@ sofa-rpc-tracer-opentracing - - com.alipay.sofa tracer-core @@ -32,16 +30,6 @@ - - org.jmockit - jmockit - test - - - org.mockito - mockito-core - test - junit junit