diff --git a/pom.xml b/pom.xml index bb544a7..50e453c 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,14 @@ UTF-8 + 11 + 11 11 + + 3.20.1 + 1.7.4 + + 1.45.1 @@ -22,11 +29,93 @@ 3.8.1 test + - - com.google.protobuf - protobuf-java - 3.20.1 - + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + + io.protostuff + protostuff-core + ${protostuff.version} + + + + io.protostuff + protostuff-runtime + ${protostuff.version} + + + + javax.annotation + javax.annotation-api + 1.3.2 + + + + + + io.grpc + grpc-netty + 1.46.0 + + + io.grpc + grpc-protobuf + 1.46.0 + + + io.grpc + grpc-stub + 1.46.0 + + + io.grpc + grpc-all + 1.46.0 + + + + + + + + + + + kr.motd.maven + os-maven-plugin + 1.7.0 + + + + + + kr.motd.maven + os-maven-plugin + 1.6.2 + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + com.google.protobuf:protoc:3.13.0:exe:${os.detected.classifier} + grpc-java + io.grpc:protoc-gen-grpc-java:1.46.0:exe:${os.detected.classifier} + + + + + compile + compile-custom + + + + + + diff --git a/proto_grpc.sh b/proto_grpc.sh index 0e03266..c8414bb 100755 --- a/proto_grpc.sh +++ b/proto_grpc.sh @@ -1,2 +1,4 @@ #! /bin/bash -protoc src/main/java/com/yuandian/dataflow/rpc/*.proto --java_out=./src/main/java/ \ No newline at end of file +OUTPUT_FILE="./src/main/java/" + +protoc src/main/java/com/yuandian/dataflow/rpc/*.proto --plugin=protoc-gen-grpc-java --java_out=$OUTPUT_FILE --grpc-java_out=$OUTPUT_FILE \ No newline at end of file diff --git a/src/main/java/com/yuandian/dataflow/rpc/DataFlowGrpc.java b/src/main/java/com/yuandian/dataflow/rpc/DataFlowGrpc.java new file mode 100644 index 0000000..52926d0 --- /dev/null +++ b/src/main/java/com/yuandian/dataflow/rpc/DataFlowGrpc.java @@ -0,0 +1,276 @@ +package com.yuandian.dataflow.rpc; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.46.0)", + comments = "Source: scheduler.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DataFlowGrpc { + + private DataFlowGrpc() {} + + public static final String SERVICE_NAME = "com.yuandian.dataflow.rpc.DataFlow"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getUpdateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Update", + requestType = com.yuandian.dataflow.rpc.Scheduler.State.class, + responseType = com.yuandian.dataflow.rpc.Scheduler.Response.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUpdateMethod() { + io.grpc.MethodDescriptor getUpdateMethod; + if ((getUpdateMethod = DataFlowGrpc.getUpdateMethod) == null) { + synchronized (DataFlowGrpc.class) { + if ((getUpdateMethod = DataFlowGrpc.getUpdateMethod) == null) { + DataFlowGrpc.getUpdateMethod = getUpdateMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Update")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.yuandian.dataflow.rpc.Scheduler.State.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.yuandian.dataflow.rpc.Scheduler.Response.getDefaultInstance())) + .setSchemaDescriptor(new DataFlowMethodDescriptorSupplier("Update")) + .build(); + } + } + } + return getUpdateMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static DataFlowStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DataFlowStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataFlowStub(channel, callOptions); + } + }; + return DataFlowStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DataFlowBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DataFlowBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataFlowBlockingStub(channel, callOptions); + } + }; + return DataFlowBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static DataFlowFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DataFlowFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataFlowFutureStub(channel, callOptions); + } + }; + return DataFlowFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class DataFlowImplBase implements io.grpc.BindableService { + + /** + */ + public void update(com.yuandian.dataflow.rpc.Scheduler.State request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getUpdateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.yuandian.dataflow.rpc.Scheduler.State, + com.yuandian.dataflow.rpc.Scheduler.Response>( + this, METHODID_UPDATE))) + .build(); + } + } + + /** + */ + public static final class DataFlowStub extends io.grpc.stub.AbstractAsyncStub { + private DataFlowStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DataFlowStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataFlowStub(channel, callOptions); + } + + /** + */ + public void update(com.yuandian.dataflow.rpc.Scheduler.State request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class DataFlowBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private DataFlowBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DataFlowBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataFlowBlockingStub(channel, callOptions); + } + + /** + */ + public com.yuandian.dataflow.rpc.Scheduler.Response update(com.yuandian.dataflow.rpc.Scheduler.State request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class DataFlowFutureStub extends io.grpc.stub.AbstractFutureStub { + private DataFlowFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DataFlowFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataFlowFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture update( + com.yuandian.dataflow.rpc.Scheduler.State request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_UPDATE = 0; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final DataFlowImplBase serviceImpl; + private final int methodId; + + MethodHandlers(DataFlowImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_UPDATE: + serviceImpl.update((com.yuandian.dataflow.rpc.Scheduler.State) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class DataFlowBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DataFlowBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.yuandian.dataflow.rpc.Scheduler.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DataFlow"); + } + } + + private static final class DataFlowFileDescriptorSupplier + extends DataFlowBaseDescriptorSupplier { + DataFlowFileDescriptorSupplier() {} + } + + private static final class DataFlowMethodDescriptorSupplier + extends DataFlowBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + DataFlowMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DataFlowGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DataFlowFileDescriptorSupplier()) + .addMethod(getUpdateMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/main/java/com/yuandian/dataflow/rpc/Scheduler.java b/src/main/java/com/yuandian/dataflow/rpc/Scheduler.java index 1439195..3d926ad 100644 --- a/src/main/java/com/yuandian/dataflow/rpc/Scheduler.java +++ b/src/main/java/com/yuandian/dataflow/rpc/Scheduler.java @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: src/main/java/com/yuandian/dataflow/rpc/scheduler.proto +// source: scheduler.proto package com.yuandian.dataflow.rpc; @@ -55,7 +55,7 @@ public final class Scheduler { /** * Protobuf type {@code com.yuandian.dataflow.rpc.State} */ - public static final class State extends + public static final class State extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.yuandian.dataflow.rpc.State) StateOrBuilder { @@ -67,6 +67,13 @@ public final class Scheduler { private State() { } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new State(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { @@ -92,7 +99,7 @@ public final class Scheduler { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { queueMap_ = com.google.protobuf.MapField.newMapField( QueueMapDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000001; @@ -105,7 +112,7 @@ public final class Scheduler { break; } default: { - if (!parseUnknownFieldProto3( + if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -178,6 +185,7 @@ public final class Scheduler { * map<int32, .com.yuandian.dataflow.rpc.QueueState> QueueMap = 1; */ + @java.lang.Override public boolean containsQueueMap( int key) { @@ -186,6 +194,7 @@ public final class Scheduler { /** * Use {@link #getQueueMapMap()} instead. */ + @java.lang.Override @java.lang.Deprecated public java.util.Map getQueueMap() { return getQueueMapMap(); @@ -193,6 +202,7 @@ public final class Scheduler { /** * map<int32, .com.yuandian.dataflow.rpc.QueueState> QueueMap = 1; */ + @java.lang.Override public java.util.Map getQueueMapMap() { return internalGetQueueMap().getMap(); @@ -200,6 +210,7 @@ public final class Scheduler { /** * map<int32, .com.yuandian.dataflow.rpc.QueueState> QueueMap = 1; */ + @java.lang.Override public com.yuandian.dataflow.rpc.Scheduler.QueueState getQueueMapOrDefault( int key, @@ -212,6 +223,7 @@ public final class Scheduler { /** * map<int32, .com.yuandian.dataflow.rpc.QueueState> QueueMap = 1; */ + @java.lang.Override public com.yuandian.dataflow.rpc.Scheduler.QueueState getQueueMapOrThrow( int key) { @@ -278,11 +290,10 @@ public final class Scheduler { } com.yuandian.dataflow.rpc.Scheduler.State other = (com.yuandian.dataflow.rpc.Scheduler.State) obj; - boolean result = true; - result = result && internalGetQueueMap().equals( - other.internalGetQueueMap()); - result = result && unknownFields.equals(other.unknownFields); - return result; + if (!internalGetQueueMap().equals( + other.internalGetQueueMap())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; } @java.lang.Override @@ -487,35 +498,35 @@ public final class Scheduler { @java.lang.Override public Builder clone() { - return (Builder) super.clone(); + return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); + return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); + return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); + return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); + return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); + return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { @@ -591,6 +602,7 @@ public final class Scheduler { * map<int32, .com.yuandian.dataflow.rpc.QueueState> QueueMap = 1; */ + @java.lang.Override public boolean containsQueueMap( int key) { @@ -599,6 +611,7 @@ public final class Scheduler { /** * Use {@link #getQueueMapMap()} instead. */ + @java.lang.Override @java.lang.Deprecated public java.util.Map getQueueMap() { return getQueueMapMap(); @@ -606,6 +619,7 @@ public final class Scheduler { /** * map<int32, .com.yuandian.dataflow.rpc.QueueState> QueueMap = 1; */ + @java.lang.Override public java.util.Map getQueueMapMap() { return internalGetQueueMap().getMap(); @@ -613,6 +627,7 @@ public final class Scheduler { /** * map<int32, .com.yuandian.dataflow.rpc.QueueState> QueueMap = 1; */ + @java.lang.Override public com.yuandian.dataflow.rpc.Scheduler.QueueState getQueueMapOrDefault( int key, @@ -625,6 +640,7 @@ public final class Scheduler { /** * map<int32, .com.yuandian.dataflow.rpc.QueueState> QueueMap = 1; */ + @java.lang.Override public com.yuandian.dataflow.rpc.Scheduler.QueueState getQueueMapOrThrow( int key) { @@ -686,7 +702,7 @@ public final class Scheduler { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); + return super.setUnknownFields(unknownFields); } @java.lang.Override @@ -742,13 +758,14 @@ public final class Scheduler { /** * int32 Size = 1; + * @return The size. */ int getSize(); } /** * Protobuf type {@code com.yuandian.dataflow.rpc.QueueState} */ - public static final class QueueState extends + public static final class QueueState extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.yuandian.dataflow.rpc.QueueState) QueueStateOrBuilder { @@ -758,7 +775,13 @@ public final class Scheduler { super(builder); } private QueueState() { - size_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new QueueState(); } @java.lang.Override @@ -774,7 +797,6 @@ public final class Scheduler { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -791,7 +813,7 @@ public final class Scheduler { break; } default: { - if (!parseUnknownFieldProto3( + if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -826,7 +848,9 @@ public final class Scheduler { private int size_; /** * int32 Size = 1; + * @return The size. */ + @java.lang.Override public int getSize() { return size_; } @@ -876,11 +900,10 @@ public final class Scheduler { } com.yuandian.dataflow.rpc.Scheduler.QueueState other = (com.yuandian.dataflow.rpc.Scheduler.QueueState) obj; - boolean result = true; - result = result && (getSize() - == other.getSize()); - result = result && unknownFields.equals(other.unknownFields); - return result; + if (getSize() + != other.getSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; } @java.lang.Override @@ -1060,35 +1083,35 @@ public final class Scheduler { @java.lang.Override public Builder clone() { - return (Builder) super.clone(); + return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); + return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); + return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); + return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); + return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); + return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { @@ -1137,12 +1160,16 @@ public final class Scheduler { private int size_ ; /** * int32 Size = 1; + * @return The size. */ + @java.lang.Override public int getSize() { return size_; } /** * int32 Size = 1; + * @param value The size to set. + * @return This builder for chaining. */ public Builder setSize(int value) { @@ -1152,6 +1179,7 @@ public final class Scheduler { } /** * int32 Size = 1; + * @return This builder for chaining. */ public Builder clearSize() { @@ -1162,7 +1190,7 @@ public final class Scheduler { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); + return super.setUnknownFields(unknownFields); } @java.lang.Override @@ -1218,28 +1246,32 @@ public final class Scheduler { /** * int32 Code = 1; + * @return The code. */ int getCode(); /** * string Message = 2; + * @return The message. */ java.lang.String getMessage(); /** * string Message = 2; + * @return The bytes for message. */ com.google.protobuf.ByteString getMessageBytes(); /** * bytes Data = 3; + * @return The data. */ com.google.protobuf.ByteString getData(); } /** * Protobuf type {@code com.yuandian.dataflow.rpc.Response} */ - public static final class Response extends + public static final class Response extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.yuandian.dataflow.rpc.Response) ResponseOrBuilder { @@ -1249,11 +1281,17 @@ public final class Scheduler { super(builder); } private Response() { - code_ = 0; message_ = ""; data_ = com.google.protobuf.ByteString.EMPTY; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Response(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { @@ -1267,7 +1305,6 @@ public final class Scheduler { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -1295,7 +1332,7 @@ public final class Scheduler { break; } default: { - if (!parseUnknownFieldProto3( + if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -1330,7 +1367,9 @@ public final class Scheduler { private int code_; /** * int32 Code = 1; + * @return The code. */ + @java.lang.Override public int getCode() { return code_; } @@ -1339,7 +1378,9 @@ public final class Scheduler { private volatile java.lang.Object message_; /** * string Message = 2; + * @return The message. */ + @java.lang.Override public java.lang.String getMessage() { java.lang.Object ref = message_; if (ref instanceof java.lang.String) { @@ -1354,7 +1395,9 @@ public final class Scheduler { } /** * string Message = 2; + * @return The bytes for message. */ + @java.lang.Override public com.google.protobuf.ByteString getMessageBytes() { java.lang.Object ref = message_; @@ -1373,7 +1416,9 @@ public final class Scheduler { private com.google.protobuf.ByteString data_; /** * bytes Data = 3; + * @return The data. */ + @java.lang.Override public com.google.protobuf.ByteString getData() { return data_; } @@ -1436,15 +1481,14 @@ public final class Scheduler { } com.yuandian.dataflow.rpc.Scheduler.Response other = (com.yuandian.dataflow.rpc.Scheduler.Response) obj; - boolean result = true; - result = result && (getCode() - == other.getCode()); - result = result && getMessage() - .equals(other.getMessage()); - result = result && getData() - .equals(other.getData()); - result = result && unknownFields.equals(other.unknownFields); - return result; + if (getCode() + != other.getCode()) return false; + if (!getMessage() + .equals(other.getMessage())) return false; + if (!getData() + .equals(other.getData())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; } @java.lang.Override @@ -1634,35 +1678,35 @@ public final class Scheduler { @java.lang.Override public Builder clone() { - return (Builder) super.clone(); + return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); + return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); + return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); + return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); + return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); + return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { @@ -1718,12 +1762,16 @@ public final class Scheduler { private int code_ ; /** * int32 Code = 1; + * @return The code. */ + @java.lang.Override public int getCode() { return code_; } /** * int32 Code = 1; + * @param value The code to set. + * @return This builder for chaining. */ public Builder setCode(int value) { @@ -1733,6 +1781,7 @@ public final class Scheduler { } /** * int32 Code = 1; + * @return This builder for chaining. */ public Builder clearCode() { @@ -1744,6 +1793,7 @@ public final class Scheduler { private java.lang.Object message_ = ""; /** * string Message = 2; + * @return The message. */ public java.lang.String getMessage() { java.lang.Object ref = message_; @@ -1759,6 +1809,7 @@ public final class Scheduler { } /** * string Message = 2; + * @return The bytes for message. */ public com.google.protobuf.ByteString getMessageBytes() { @@ -1775,6 +1826,8 @@ public final class Scheduler { } /** * string Message = 2; + * @param value The message to set. + * @return This builder for chaining. */ public Builder setMessage( java.lang.String value) { @@ -1788,6 +1841,7 @@ public final class Scheduler { } /** * string Message = 2; + * @return This builder for chaining. */ public Builder clearMessage() { @@ -1797,6 +1851,8 @@ public final class Scheduler { } /** * string Message = 2; + * @param value The bytes for message to set. + * @return This builder for chaining. */ public Builder setMessageBytes( com.google.protobuf.ByteString value) { @@ -1813,12 +1869,16 @@ public final class Scheduler { private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; /** * bytes Data = 3; + * @return The data. */ + @java.lang.Override public com.google.protobuf.ByteString getData() { return data_; } /** * bytes Data = 3; + * @param value The data to set. + * @return This builder for chaining. */ public Builder setData(com.google.protobuf.ByteString value) { if (value == null) { @@ -1831,6 +1891,7 @@ public final class Scheduler { } /** * bytes Data = 3; + * @return This builder for chaining. */ public Builder clearData() { @@ -1841,7 +1902,7 @@ public final class Scheduler { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); + return super.setUnknownFields(unknownFields); } @java.lang.Override @@ -1920,8 +1981,7 @@ public final class Scheduler { descriptor; static { java.lang.String[] descriptorData = { - "\n7src/main/java/com/yuandian/dataflow/rp" + - "c/scheduler.proto\022\031com.yuandian.dataflow" + + "\n\017scheduler.proto\022\031com.yuandian.dataflow" + ".rpc\"\241\001\n\005State\022@\n\010QueueMap\030\001 \003(\0132..com.y" + "uandian.dataflow.rpc.State.QueueMapEntry" + "\032V\n\rQueueMapEntry\022\013\n\003key\030\001 \001(\005\0224\n\005value\030" + @@ -1930,20 +1990,12 @@ public final class Scheduler { "Response\022\014\n\004Code\030\001 \001(\005\022\017\n\007Message\030\002 \001(\t\022" + "\014\n\004Data\030\003 \001(\0142[\n\010DataFlow\022O\n\006Update\022 .co" + "m.yuandian.dataflow.rpc.State\032#.com.yuan" + - "dian.dataflow.rpc.Responseb\006proto3" + "dian.dataflow.rpc.ResponseB\002P\000b\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_com_yuandian_dataflow_rpc_State_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_com_yuandian_dataflow_rpc_State_fieldAccessorTable = new diff --git a/src/main/java/com/yuandian/dataflow/rpc/scheduler.proto b/src/main/proto/scheduler.proto similarity index 87% rename from src/main/java/com/yuandian/dataflow/rpc/scheduler.proto rename to src/main/proto/scheduler.proto index c0d6ef6..d96bc51 100644 --- a/src/main/java/com/yuandian/dataflow/rpc/scheduler.proto +++ b/src/main/proto/scheduler.proto @@ -4,7 +4,7 @@ package com.yuandian.dataflow.rpc; // option java_package = "com.yuandian.dataflow.rpc"; // option java_outer_classname = "com.yuandian.dataflow.rpc"; - +option java_multiple_files = false;//以非外部类模式生成 service DataFlow { rpc Update (State) returns (Response);