diff --git a/services/build.gradle b/services/build.gradle index b8072122d8..d94e73ad4c 100644 --- a/services/build.gradle +++ b/services/build.gradle @@ -13,7 +13,8 @@ description = "gRPC: Services" dependencies { compile project(':grpc-protobuf'), project(':grpc-stub') - testCompile project(':grpc-testing') + testCompile project(':grpc-testing'), + libraries.netty_epoll // for DomainSocketAddress signature "org.codehaus.mojo.signature:java16:1.1@signature" } diff --git a/services/src/generated/main/java/io/grpc/binarylog/BinaryLogProto.java b/services/src/generated/main/java/io/grpc/binarylog/BinaryLogProto.java new file mode 100644 index 0000000000..f493a500fa --- /dev/null +++ b/services/src/generated/main/java/io/grpc/binarylog/BinaryLogProto.java @@ -0,0 +1,133 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: io/grpc/binarylog.proto + +package io.grpc.binarylog; + +public final class BinaryLogProto { + private BinaryLogProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grpc_binarylog_v1alpha_Message_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grpc_binarylog_v1alpha_Message_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grpc_binarylog_v1alpha_Metadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grpc_binarylog_v1alpha_Metadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grpc_binarylog_v1alpha_MetadataEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grpc_binarylog_v1alpha_MetadataEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grpc_binarylog_v1alpha_Peer_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grpc_binarylog_v1alpha_Peer_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grpc_binarylog_v1alpha_Uint128_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grpc_binarylog_v1alpha_Uint128_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\027io/grpc/binarylog.proto\022\026grpc.binarylo" + + "g.v1alpha\"\224\004\n\014GrpcLogEntry\0227\n\004type\030\001 \001(\016" + + "2).grpc.binarylog.v1alpha.GrpcLogEntry.T" + + "ype\022;\n\006logger\030\002 \001(\0162+.grpc.binarylog.v1a" + + "lpha.GrpcLogEntry.Logger\0220\n\007call_id\030\003 \001(" + + "\0132\037.grpc.binarylog.v1alpha.Uint128\0224\n\010me" + + "tadata\030\004 \001(\0132 .grpc.binarylog.v1alpha.Me" + + "tadataH\000\0222\n\007message\030\005 \001(\0132\037.grpc.binaryl" + + "og.v1alpha.MessageH\000\022*\n\004peer\030\006 \001(\0132\034.grp" + + "c.binarylog.v1alpha.Peer\"\230\001\n\004Type\022\031\n\025SEN" + + "D_INITIAL_METADATA\020\000\022\032\n\026SEND_TRAILING_ME" + + "TADATA\020\001\022\020\n\014SEND_MESSAGE\020\002\022\031\n\025RECV_INITI" + + "AL_METADATA\020\003\022\032\n\026RECV_TRAILING_METADATA\020" + + "\004\022\020\n\014RECV_MESSAGE\020\005\" \n\006Logger\022\n\n\006CLIENT\020" + + "\000\022\n\n\006SERVER\020\001B\t\n\007payload\"6\n\007Message\022\r\n\005f" + + "lags\030\001 \001(\r\022\016\n\006length\030\002 \001(\r\022\014\n\004data\030\003 \001(\014" + + "\"@\n\010Metadata\0224\n\005entry\030\001 \003(\0132%.grpc.binar" + + "ylog.v1alpha.MetadataEntry\"+\n\rMetadataEn" + + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\014\"\207\001\n\004Peer" + + "\0228\n\tpeer_type\030\001 \001(\0162%.grpc.binarylog.v1a" + + "lpha.Peer.PeerType\022\014\n\004peer\030\002 \001(\014\"7\n\010Peer" + + "Type\022\r\n\tPEER_IPV4\020\000\022\r\n\tPEER_IPV6\020\001\022\r\n\tPE" + + "ER_UNIX\020\002\"$\n\007Uint128\022\014\n\004high\030\001 \001(\006\022\013\n\003lo" + + "w\030\002 \001(\006B%\n\021io.grpc.binarylogB\016BinaryLogP" + + "rotoP\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 + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_descriptor, + new java.lang.String[] { "Type", "Logger", "CallId", "Metadata", "Message", "Peer", "Payload", }); + internal_static_grpc_binarylog_v1alpha_Message_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grpc_binarylog_v1alpha_Message_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grpc_binarylog_v1alpha_Message_descriptor, + new java.lang.String[] { "Flags", "Length", "Data", }); + internal_static_grpc_binarylog_v1alpha_Metadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grpc_binarylog_v1alpha_Metadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grpc_binarylog_v1alpha_Metadata_descriptor, + new java.lang.String[] { "Entry", }); + internal_static_grpc_binarylog_v1alpha_MetadataEntry_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grpc_binarylog_v1alpha_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grpc_binarylog_v1alpha_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_grpc_binarylog_v1alpha_Peer_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_grpc_binarylog_v1alpha_Peer_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grpc_binarylog_v1alpha_Peer_descriptor, + new java.lang.String[] { "PeerType", "Peer", }); + internal_static_grpc_binarylog_v1alpha_Uint128_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_grpc_binarylog_v1alpha_Uint128_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grpc_binarylog_v1alpha_Uint128_descriptor, + new java.lang.String[] { "High", "Low", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/services/src/generated/main/java/io/grpc/binarylog/GrpcLogEntry.java b/services/src/generated/main/java/io/grpc/binarylog/GrpcLogEntry.java new file mode 100644 index 0000000000..6cd5974c61 --- /dev/null +++ b/services/src/generated/main/java/io/grpc/binarylog/GrpcLogEntry.java @@ -0,0 +1,1913 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: io/grpc/binarylog.proto + +package io.grpc.binarylog; + +/** + *
+ * Log entry we store in binary logs + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.GrpcLogEntry} + */ +public final class GrpcLogEntry extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grpc.binarylog.v1alpha.GrpcLogEntry) + GrpcLogEntryOrBuilder { +private static final long serialVersionUID = 0L; + // Use GrpcLogEntry.newBuilder() to construct. + private GrpcLogEntry(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private GrpcLogEntry() { + type_ = 0; + logger_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GrpcLogEntry( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 16: { + int rawValue = input.readEnum(); + + logger_ = rawValue; + break; + } + case 26: { + io.grpc.binarylog.Uint128.Builder subBuilder = null; + if (callId_ != null) { + subBuilder = callId_.toBuilder(); + } + callId_ = input.readMessage(io.grpc.binarylog.Uint128.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(callId_); + callId_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + io.grpc.binarylog.Metadata.Builder subBuilder = null; + if (payloadCase_ == 4) { + subBuilder = ((io.grpc.binarylog.Metadata) payload_).toBuilder(); + } + payload_ = + input.readMessage(io.grpc.binarylog.Metadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grpc.binarylog.Metadata) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 4; + break; + } + case 42: { + io.grpc.binarylog.Message.Builder subBuilder = null; + if (payloadCase_ == 5) { + subBuilder = ((io.grpc.binarylog.Message) payload_).toBuilder(); + } + payload_ = + input.readMessage(io.grpc.binarylog.Message.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grpc.binarylog.Message) payload_); + payload_ = subBuilder.buildPartial(); + } + payloadCase_ = 5; + break; + } + case 50: { + io.grpc.binarylog.Peer.Builder subBuilder = null; + if (peer_ != null) { + subBuilder = peer_.toBuilder(); + } + peer_ = input.readMessage(io.grpc.binarylog.Peer.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(peer_); + peer_ = subBuilder.buildPartial(); + } + + 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(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grpc.binarylog.GrpcLogEntry.class, io.grpc.binarylog.GrpcLogEntry.Builder.class); + } + + /** + *
+ * Enumerates the type of logs + *+ * + * Protobuf enum {@code grpc.binarylog.v1alpha.GrpcLogEntry.Type} + */ + public enum Type + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
SEND_INITIAL_METADATA = 0;
+ */
+ SEND_INITIAL_METADATA(0),
+ /**
+ * SEND_TRAILING_METADATA = 1;
+ */
+ SEND_TRAILING_METADATA(1),
+ /**
+ * SEND_MESSAGE = 2;
+ */
+ SEND_MESSAGE(2),
+ /**
+ * RECV_INITIAL_METADATA = 3;
+ */
+ RECV_INITIAL_METADATA(3),
+ /**
+ * RECV_TRAILING_METADATA = 4;
+ */
+ RECV_TRAILING_METADATA(4),
+ /**
+ * RECV_MESSAGE = 5;
+ */
+ RECV_MESSAGE(5),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ * SEND_INITIAL_METADATA = 0;
+ */
+ public static final int SEND_INITIAL_METADATA_VALUE = 0;
+ /**
+ * SEND_TRAILING_METADATA = 1;
+ */
+ public static final int SEND_TRAILING_METADATA_VALUE = 1;
+ /**
+ * SEND_MESSAGE = 2;
+ */
+ public static final int SEND_MESSAGE_VALUE = 2;
+ /**
+ * RECV_INITIAL_METADATA = 3;
+ */
+ public static final int RECV_INITIAL_METADATA_VALUE = 3;
+ /**
+ * RECV_TRAILING_METADATA = 4;
+ */
+ public static final int RECV_TRAILING_METADATA_VALUE = 4;
+ /**
+ * RECV_MESSAGE = 5;
+ */
+ public static final int RECV_MESSAGE_VALUE = 5;
+
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException(
+ "Can't get the number of an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Type valueOf(int value) {
+ return forNumber(value);
+ }
+
+ public static Type forNumber(int value) {
+ switch (value) {
+ case 0: return SEND_INITIAL_METADATA;
+ case 1: return SEND_TRAILING_METADATA;
+ case 2: return SEND_MESSAGE;
+ case 3: return RECV_INITIAL_METADATA;
+ case 4: return RECV_TRAILING_METADATA;
+ case 5: return RECV_MESSAGE;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap+ * Enumerates the entity that generates the log entry + *+ * + * Protobuf enum {@code grpc.binarylog.v1alpha.GrpcLogEntry.Logger} + */ + public enum Logger + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
CLIENT = 0;
+ */
+ CLIENT(0),
+ /**
+ * SERVER = 1;
+ */
+ SERVER(1),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ * CLIENT = 0;
+ */
+ public static final int CLIENT_VALUE = 0;
+ /**
+ * SERVER = 1;
+ */
+ public static final int SERVER_VALUE = 1;
+
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException(
+ "Can't get the number of an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static Logger valueOf(int value) {
+ return forNumber(value);
+ }
+
+ public static Logger forNumber(int value) {
+ switch (value) {
+ case 0: return CLIENT;
+ case 1: return SERVER;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap+ * One of the above Type enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Type type = 1;
+ */
+ public int getTypeValue() {
+ return type_;
+ }
+ /**
+ * + * One of the above Type enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Type type = 1;
+ */
+ public io.grpc.binarylog.GrpcLogEntry.Type getType() {
+ io.grpc.binarylog.GrpcLogEntry.Type result = io.grpc.binarylog.GrpcLogEntry.Type.valueOf(type_);
+ return result == null ? io.grpc.binarylog.GrpcLogEntry.Type.UNRECOGNIZED : result;
+ }
+
+ public static final int LOGGER_FIELD_NUMBER = 2;
+ private int logger_;
+ /**
+ * + * One of the above Logger enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Logger logger = 2;
+ */
+ public int getLoggerValue() {
+ return logger_;
+ }
+ /**
+ * + * One of the above Logger enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Logger logger = 2;
+ */
+ public io.grpc.binarylog.GrpcLogEntry.Logger getLogger() {
+ io.grpc.binarylog.GrpcLogEntry.Logger result = io.grpc.binarylog.GrpcLogEntry.Logger.valueOf(logger_);
+ return result == null ? io.grpc.binarylog.GrpcLogEntry.Logger.UNRECOGNIZED : result;
+ }
+
+ public static final int CALL_ID_FIELD_NUMBER = 3;
+ private io.grpc.binarylog.Uint128 callId_;
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public boolean hasCallId() {
+ return callId_ != null;
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public io.grpc.binarylog.Uint128 getCallId() {
+ return callId_ == null ? io.grpc.binarylog.Uint128.getDefaultInstance() : callId_;
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public io.grpc.binarylog.Uint128OrBuilder getCallIdOrBuilder() {
+ return getCallId();
+ }
+
+ public static final int METADATA_FIELD_NUMBER = 4;
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public boolean hasMetadata() {
+ return payloadCase_ == 4;
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public io.grpc.binarylog.Metadata getMetadata() {
+ if (payloadCase_ == 4) {
+ return (io.grpc.binarylog.Metadata) payload_;
+ }
+ return io.grpc.binarylog.Metadata.getDefaultInstance();
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public io.grpc.binarylog.MetadataOrBuilder getMetadataOrBuilder() {
+ if (payloadCase_ == 4) {
+ return (io.grpc.binarylog.Metadata) payload_;
+ }
+ return io.grpc.binarylog.Metadata.getDefaultInstance();
+ }
+
+ public static final int MESSAGE_FIELD_NUMBER = 5;
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public boolean hasMessage() {
+ return payloadCase_ == 5;
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public io.grpc.binarylog.Message getMessage() {
+ if (payloadCase_ == 5) {
+ return (io.grpc.binarylog.Message) payload_;
+ }
+ return io.grpc.binarylog.Message.getDefaultInstance();
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public io.grpc.binarylog.MessageOrBuilder getMessageOrBuilder() {
+ if (payloadCase_ == 5) {
+ return (io.grpc.binarylog.Message) payload_;
+ }
+ return io.grpc.binarylog.Message.getDefaultInstance();
+ }
+
+ public static final int PEER_FIELD_NUMBER = 6;
+ private io.grpc.binarylog.Peer peer_;
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public boolean hasPeer() {
+ return peer_ != null;
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public io.grpc.binarylog.Peer getPeer() {
+ return peer_ == null ? io.grpc.binarylog.Peer.getDefaultInstance() : peer_;
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public io.grpc.binarylog.PeerOrBuilder getPeerOrBuilder() {
+ return getPeer();
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (type_ != io.grpc.binarylog.GrpcLogEntry.Type.SEND_INITIAL_METADATA.getNumber()) {
+ output.writeEnum(1, type_);
+ }
+ if (logger_ != io.grpc.binarylog.GrpcLogEntry.Logger.CLIENT.getNumber()) {
+ output.writeEnum(2, logger_);
+ }
+ if (callId_ != null) {
+ output.writeMessage(3, getCallId());
+ }
+ if (payloadCase_ == 4) {
+ output.writeMessage(4, (io.grpc.binarylog.Metadata) payload_);
+ }
+ if (payloadCase_ == 5) {
+ output.writeMessage(5, (io.grpc.binarylog.Message) payload_);
+ }
+ if (peer_ != null) {
+ output.writeMessage(6, getPeer());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (type_ != io.grpc.binarylog.GrpcLogEntry.Type.SEND_INITIAL_METADATA.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(1, type_);
+ }
+ if (logger_ != io.grpc.binarylog.GrpcLogEntry.Logger.CLIENT.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(2, logger_);
+ }
+ if (callId_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getCallId());
+ }
+ if (payloadCase_ == 4) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, (io.grpc.binarylog.Metadata) payload_);
+ }
+ if (payloadCase_ == 5) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(5, (io.grpc.binarylog.Message) payload_);
+ }
+ if (peer_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(6, getPeer());
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof io.grpc.binarylog.GrpcLogEntry)) {
+ return super.equals(obj);
+ }
+ io.grpc.binarylog.GrpcLogEntry other = (io.grpc.binarylog.GrpcLogEntry) obj;
+
+ boolean result = true;
+ result = result && type_ == other.type_;
+ result = result && logger_ == other.logger_;
+ result = result && (hasCallId() == other.hasCallId());
+ if (hasCallId()) {
+ result = result && getCallId()
+ .equals(other.getCallId());
+ }
+ result = result && (hasPeer() == other.hasPeer());
+ if (hasPeer()) {
+ result = result && getPeer()
+ .equals(other.getPeer());
+ }
+ result = result && getPayloadCase().equals(
+ other.getPayloadCase());
+ if (!result) return false;
+ switch (payloadCase_) {
+ case 4:
+ result = result && getMetadata()
+ .equals(other.getMetadata());
+ break;
+ case 5:
+ result = result && getMessage()
+ .equals(other.getMessage());
+ break;
+ case 0:
+ default:
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + TYPE_FIELD_NUMBER;
+ hash = (53 * hash) + type_;
+ hash = (37 * hash) + LOGGER_FIELD_NUMBER;
+ hash = (53 * hash) + logger_;
+ if (hasCallId()) {
+ hash = (37 * hash) + CALL_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getCallId().hashCode();
+ }
+ if (hasPeer()) {
+ hash = (37 * hash) + PEER_FIELD_NUMBER;
+ hash = (53 * hash) + getPeer().hashCode();
+ }
+ switch (payloadCase_) {
+ case 4:
+ hash = (37 * hash) + METADATA_FIELD_NUMBER;
+ hash = (53 * hash) + getMetadata().hashCode();
+ break;
+ case 5:
+ hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
+ hash = (53 * hash) + getMessage().hashCode();
+ break;
+ case 0:
+ default:
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.GrpcLogEntry parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(io.grpc.binarylog.GrpcLogEntry prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * Log entry we store in binary logs + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.GrpcLogEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * One of the above Type enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Type type = 1;
+ */
+ public int getTypeValue() {
+ return type_;
+ }
+ /**
+ * + * One of the above Type enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Type type = 1;
+ */
+ public Builder setTypeValue(int value) {
+ type_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * One of the above Type enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Type type = 1;
+ */
+ public io.grpc.binarylog.GrpcLogEntry.Type getType() {
+ io.grpc.binarylog.GrpcLogEntry.Type result = io.grpc.binarylog.GrpcLogEntry.Type.valueOf(type_);
+ return result == null ? io.grpc.binarylog.GrpcLogEntry.Type.UNRECOGNIZED : result;
+ }
+ /**
+ * + * One of the above Type enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Type type = 1;
+ */
+ public Builder setType(io.grpc.binarylog.GrpcLogEntry.Type value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ type_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * One of the above Type enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Type type = 1;
+ */
+ public Builder clearType() {
+
+ type_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private int logger_ = 0;
+ /**
+ * + * One of the above Logger enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Logger logger = 2;
+ */
+ public int getLoggerValue() {
+ return logger_;
+ }
+ /**
+ * + * One of the above Logger enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Logger logger = 2;
+ */
+ public Builder setLoggerValue(int value) {
+ logger_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * One of the above Logger enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Logger logger = 2;
+ */
+ public io.grpc.binarylog.GrpcLogEntry.Logger getLogger() {
+ io.grpc.binarylog.GrpcLogEntry.Logger result = io.grpc.binarylog.GrpcLogEntry.Logger.valueOf(logger_);
+ return result == null ? io.grpc.binarylog.GrpcLogEntry.Logger.UNRECOGNIZED : result;
+ }
+ /**
+ * + * One of the above Logger enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Logger logger = 2;
+ */
+ public Builder setLogger(io.grpc.binarylog.GrpcLogEntry.Logger value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ logger_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * One of the above Logger enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Logger logger = 2;
+ */
+ public Builder clearLogger() {
+
+ logger_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private io.grpc.binarylog.Uint128 callId_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Uint128, io.grpc.binarylog.Uint128.Builder, io.grpc.binarylog.Uint128OrBuilder> callIdBuilder_;
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public boolean hasCallId() {
+ return callIdBuilder_ != null || callId_ != null;
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public io.grpc.binarylog.Uint128 getCallId() {
+ if (callIdBuilder_ == null) {
+ return callId_ == null ? io.grpc.binarylog.Uint128.getDefaultInstance() : callId_;
+ } else {
+ return callIdBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public Builder setCallId(io.grpc.binarylog.Uint128 value) {
+ if (callIdBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ callId_ = value;
+ onChanged();
+ } else {
+ callIdBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public Builder setCallId(
+ io.grpc.binarylog.Uint128.Builder builderForValue) {
+ if (callIdBuilder_ == null) {
+ callId_ = builderForValue.build();
+ onChanged();
+ } else {
+ callIdBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public Builder mergeCallId(io.grpc.binarylog.Uint128 value) {
+ if (callIdBuilder_ == null) {
+ if (callId_ != null) {
+ callId_ =
+ io.grpc.binarylog.Uint128.newBuilder(callId_).mergeFrom(value).buildPartial();
+ } else {
+ callId_ = value;
+ }
+ onChanged();
+ } else {
+ callIdBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public Builder clearCallId() {
+ if (callIdBuilder_ == null) {
+ callId_ = null;
+ onChanged();
+ } else {
+ callId_ = null;
+ callIdBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public io.grpc.binarylog.Uint128.Builder getCallIdBuilder() {
+
+ onChanged();
+ return getCallIdFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ public io.grpc.binarylog.Uint128OrBuilder getCallIdOrBuilder() {
+ if (callIdBuilder_ != null) {
+ return callIdBuilder_.getMessageOrBuilder();
+ } else {
+ return callId_ == null ?
+ io.grpc.binarylog.Uint128.getDefaultInstance() : callId_;
+ }
+ }
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Uint128, io.grpc.binarylog.Uint128.Builder, io.grpc.binarylog.Uint128OrBuilder>
+ getCallIdFieldBuilder() {
+ if (callIdBuilder_ == null) {
+ callIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Uint128, io.grpc.binarylog.Uint128.Builder, io.grpc.binarylog.Uint128OrBuilder>(
+ getCallId(),
+ getParentForChildren(),
+ isClean());
+ callId_ = null;
+ }
+ return callIdBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Metadata, io.grpc.binarylog.Metadata.Builder, io.grpc.binarylog.MetadataOrBuilder> metadataBuilder_;
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public boolean hasMetadata() {
+ return payloadCase_ == 4;
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public io.grpc.binarylog.Metadata getMetadata() {
+ if (metadataBuilder_ == null) {
+ if (payloadCase_ == 4) {
+ return (io.grpc.binarylog.Metadata) payload_;
+ }
+ return io.grpc.binarylog.Metadata.getDefaultInstance();
+ } else {
+ if (payloadCase_ == 4) {
+ return metadataBuilder_.getMessage();
+ }
+ return io.grpc.binarylog.Metadata.getDefaultInstance();
+ }
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public Builder setMetadata(io.grpc.binarylog.Metadata value) {
+ if (metadataBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ payload_ = value;
+ onChanged();
+ } else {
+ metadataBuilder_.setMessage(value);
+ }
+ payloadCase_ = 4;
+ return this;
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public Builder setMetadata(
+ io.grpc.binarylog.Metadata.Builder builderForValue) {
+ if (metadataBuilder_ == null) {
+ payload_ = builderForValue.build();
+ onChanged();
+ } else {
+ metadataBuilder_.setMessage(builderForValue.build());
+ }
+ payloadCase_ = 4;
+ return this;
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public Builder mergeMetadata(io.grpc.binarylog.Metadata value) {
+ if (metadataBuilder_ == null) {
+ if (payloadCase_ == 4 &&
+ payload_ != io.grpc.binarylog.Metadata.getDefaultInstance()) {
+ payload_ = io.grpc.binarylog.Metadata.newBuilder((io.grpc.binarylog.Metadata) payload_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ payload_ = value;
+ }
+ onChanged();
+ } else {
+ if (payloadCase_ == 4) {
+ metadataBuilder_.mergeFrom(value);
+ }
+ metadataBuilder_.setMessage(value);
+ }
+ payloadCase_ = 4;
+ return this;
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public Builder clearMetadata() {
+ if (metadataBuilder_ == null) {
+ if (payloadCase_ == 4) {
+ payloadCase_ = 0;
+ payload_ = null;
+ onChanged();
+ }
+ } else {
+ if (payloadCase_ == 4) {
+ payloadCase_ = 0;
+ payload_ = null;
+ }
+ metadataBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public io.grpc.binarylog.Metadata.Builder getMetadataBuilder() {
+ return getMetadataFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ public io.grpc.binarylog.MetadataOrBuilder getMetadataOrBuilder() {
+ if ((payloadCase_ == 4) && (metadataBuilder_ != null)) {
+ return metadataBuilder_.getMessageOrBuilder();
+ } else {
+ if (payloadCase_ == 4) {
+ return (io.grpc.binarylog.Metadata) payload_;
+ }
+ return io.grpc.binarylog.Metadata.getDefaultInstance();
+ }
+ }
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Metadata, io.grpc.binarylog.Metadata.Builder, io.grpc.binarylog.MetadataOrBuilder>
+ getMetadataFieldBuilder() {
+ if (metadataBuilder_ == null) {
+ if (!(payloadCase_ == 4)) {
+ payload_ = io.grpc.binarylog.Metadata.getDefaultInstance();
+ }
+ metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Metadata, io.grpc.binarylog.Metadata.Builder, io.grpc.binarylog.MetadataOrBuilder>(
+ (io.grpc.binarylog.Metadata) payload_,
+ getParentForChildren(),
+ isClean());
+ payload_ = null;
+ }
+ payloadCase_ = 4;
+ onChanged();;
+ return metadataBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Message, io.grpc.binarylog.Message.Builder, io.grpc.binarylog.MessageOrBuilder> messageBuilder_;
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public boolean hasMessage() {
+ return payloadCase_ == 5;
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public io.grpc.binarylog.Message getMessage() {
+ if (messageBuilder_ == null) {
+ if (payloadCase_ == 5) {
+ return (io.grpc.binarylog.Message) payload_;
+ }
+ return io.grpc.binarylog.Message.getDefaultInstance();
+ } else {
+ if (payloadCase_ == 5) {
+ return messageBuilder_.getMessage();
+ }
+ return io.grpc.binarylog.Message.getDefaultInstance();
+ }
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public Builder setMessage(io.grpc.binarylog.Message value) {
+ if (messageBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ payload_ = value;
+ onChanged();
+ } else {
+ messageBuilder_.setMessage(value);
+ }
+ payloadCase_ = 5;
+ return this;
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public Builder setMessage(
+ io.grpc.binarylog.Message.Builder builderForValue) {
+ if (messageBuilder_ == null) {
+ payload_ = builderForValue.build();
+ onChanged();
+ } else {
+ messageBuilder_.setMessage(builderForValue.build());
+ }
+ payloadCase_ = 5;
+ return this;
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public Builder mergeMessage(io.grpc.binarylog.Message value) {
+ if (messageBuilder_ == null) {
+ if (payloadCase_ == 5 &&
+ payload_ != io.grpc.binarylog.Message.getDefaultInstance()) {
+ payload_ = io.grpc.binarylog.Message.newBuilder((io.grpc.binarylog.Message) payload_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ payload_ = value;
+ }
+ onChanged();
+ } else {
+ if (payloadCase_ == 5) {
+ messageBuilder_.mergeFrom(value);
+ }
+ messageBuilder_.setMessage(value);
+ }
+ payloadCase_ = 5;
+ return this;
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public Builder clearMessage() {
+ if (messageBuilder_ == null) {
+ if (payloadCase_ == 5) {
+ payloadCase_ = 0;
+ payload_ = null;
+ onChanged();
+ }
+ } else {
+ if (payloadCase_ == 5) {
+ payloadCase_ = 0;
+ payload_ = null;
+ }
+ messageBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public io.grpc.binarylog.Message.Builder getMessageBuilder() {
+ return getMessageFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ public io.grpc.binarylog.MessageOrBuilder getMessageOrBuilder() {
+ if ((payloadCase_ == 5) && (messageBuilder_ != null)) {
+ return messageBuilder_.getMessageOrBuilder();
+ } else {
+ if (payloadCase_ == 5) {
+ return (io.grpc.binarylog.Message) payload_;
+ }
+ return io.grpc.binarylog.Message.getDefaultInstance();
+ }
+ }
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Message, io.grpc.binarylog.Message.Builder, io.grpc.binarylog.MessageOrBuilder>
+ getMessageFieldBuilder() {
+ if (messageBuilder_ == null) {
+ if (!(payloadCase_ == 5)) {
+ payload_ = io.grpc.binarylog.Message.getDefaultInstance();
+ }
+ messageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Message, io.grpc.binarylog.Message.Builder, io.grpc.binarylog.MessageOrBuilder>(
+ (io.grpc.binarylog.Message) payload_,
+ getParentForChildren(),
+ isClean());
+ payload_ = null;
+ }
+ payloadCase_ = 5;
+ onChanged();;
+ return messageBuilder_;
+ }
+
+ private io.grpc.binarylog.Peer peer_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Peer, io.grpc.binarylog.Peer.Builder, io.grpc.binarylog.PeerOrBuilder> peerBuilder_;
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public boolean hasPeer() {
+ return peerBuilder_ != null || peer_ != null;
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public io.grpc.binarylog.Peer getPeer() {
+ if (peerBuilder_ == null) {
+ return peer_ == null ? io.grpc.binarylog.Peer.getDefaultInstance() : peer_;
+ } else {
+ return peerBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public Builder setPeer(io.grpc.binarylog.Peer value) {
+ if (peerBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ peer_ = value;
+ onChanged();
+ } else {
+ peerBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public Builder setPeer(
+ io.grpc.binarylog.Peer.Builder builderForValue) {
+ if (peerBuilder_ == null) {
+ peer_ = builderForValue.build();
+ onChanged();
+ } else {
+ peerBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public Builder mergePeer(io.grpc.binarylog.Peer value) {
+ if (peerBuilder_ == null) {
+ if (peer_ != null) {
+ peer_ =
+ io.grpc.binarylog.Peer.newBuilder(peer_).mergeFrom(value).buildPartial();
+ } else {
+ peer_ = value;
+ }
+ onChanged();
+ } else {
+ peerBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public Builder clearPeer() {
+ if (peerBuilder_ == null) {
+ peer_ = null;
+ onChanged();
+ } else {
+ peer_ = null;
+ peerBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public io.grpc.binarylog.Peer.Builder getPeerBuilder() {
+
+ onChanged();
+ return getPeerFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ public io.grpc.binarylog.PeerOrBuilder getPeerOrBuilder() {
+ if (peerBuilder_ != null) {
+ return peerBuilder_.getMessageOrBuilder();
+ } else {
+ return peer_ == null ?
+ io.grpc.binarylog.Peer.getDefaultInstance() : peer_;
+ }
+ }
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Peer, io.grpc.binarylog.Peer.Builder, io.grpc.binarylog.PeerOrBuilder>
+ getPeerFieldBuilder() {
+ if (peerBuilder_ == null) {
+ peerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ io.grpc.binarylog.Peer, io.grpc.binarylog.Peer.Builder, io.grpc.binarylog.PeerOrBuilder>(
+ getPeer(),
+ getParentForChildren(),
+ isClean());
+ peer_ = null;
+ }
+ return peerBuilder_;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:grpc.binarylog.v1alpha.GrpcLogEntry)
+ }
+
+ // @@protoc_insertion_point(class_scope:grpc.binarylog.v1alpha.GrpcLogEntry)
+ private static final io.grpc.binarylog.GrpcLogEntry DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new io.grpc.binarylog.GrpcLogEntry();
+ }
+
+ public static io.grpc.binarylog.GrpcLogEntry getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * One of the above Type enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Type type = 1;
+ */
+ int getTypeValue();
+ /**
+ * + * One of the above Type enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Type type = 1;
+ */
+ io.grpc.binarylog.GrpcLogEntry.Type getType();
+
+ /**
+ * + * One of the above Logger enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Logger logger = 2;
+ */
+ int getLoggerValue();
+ /**
+ * + * One of the above Logger enum + *+ * + *
.grpc.binarylog.v1alpha.GrpcLogEntry.Logger logger = 2;
+ */
+ io.grpc.binarylog.GrpcLogEntry.Logger getLogger();
+
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ boolean hasCallId();
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ io.grpc.binarylog.Uint128 getCallId();
+ /**
+ * + * Uniquely identifies a call. Each call may have several log entries, they + * will share the same call_id. 128 bits split into 2 64-bit parts. + *+ * + *
.grpc.binarylog.v1alpha.Uint128 call_id = 3;
+ */
+ io.grpc.binarylog.Uint128OrBuilder getCallIdOrBuilder();
+
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ boolean hasMetadata();
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ io.grpc.binarylog.Metadata getMetadata();
+ /**
+ * + * Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA + *+ * + *
.grpc.binarylog.v1alpha.Metadata metadata = 4;
+ */
+ io.grpc.binarylog.MetadataOrBuilder getMetadataOrBuilder();
+
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ boolean hasMessage();
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ io.grpc.binarylog.Message getMessage();
+ /**
+ * + * Used by REQUEST and RESPONSE + *+ * + *
.grpc.binarylog.v1alpha.Message message = 5;
+ */
+ io.grpc.binarylog.MessageOrBuilder getMessageOrBuilder();
+
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ boolean hasPeer();
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ io.grpc.binarylog.Peer getPeer();
+ /**
+ * + * Peer address information, will only be recorded in SEND_INITIAL_METADATA + * and RECV_INITIAL_METADATA entries. + *+ * + *
.grpc.binarylog.v1alpha.Peer peer = 6;
+ */
+ io.grpc.binarylog.PeerOrBuilder getPeerOrBuilder();
+
+ public io.grpc.binarylog.GrpcLogEntry.PayloadCase getPayloadCase();
+}
diff --git a/services/src/generated/main/java/io/grpc/binarylog/Message.java b/services/src/generated/main/java/io/grpc/binarylog/Message.java
new file mode 100644
index 0000000000..1f5bdddca3
--- /dev/null
+++ b/services/src/generated/main/java/io/grpc/binarylog/Message.java
@@ -0,0 +1,646 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: io/grpc/binarylog.proto
+
+package io.grpc.binarylog;
+
+/**
+ * + * Message payload, used by REQUEST and RESPONSE + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.Message} + */ +public final class Message extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grpc.binarylog.v1alpha.Message) + MessageOrBuilder { +private static final long serialVersionUID = 0L; + // Use Message.newBuilder() to construct. + private Message(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private Message() { + flags_ = 0; + length_ = 0; + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Message( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + flags_ = input.readUInt32(); + break; + } + case 16: { + + length_ = input.readUInt32(); + break; + } + case 26: { + + data_ = input.readBytes(); + 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(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_Message_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grpc.binarylog.Message.class, io.grpc.binarylog.Message.Builder.class); + } + + public static final int FLAGS_FIELD_NUMBER = 1; + private int flags_; + /** + *
+ * This flag is currently used to indicate whether the payload is compressed, + * it may contain other semantics in the future. Value of 1 indicates that the + * binary octet sequence of Message is compressed using the mechanism declared + * by the Message-Encoding header. A value of 0 indicates that no encoding of + * Message bytes has occurred. + *+ * + *
uint32 flags = 1;
+ */
+ public int getFlags() {
+ return flags_;
+ }
+
+ public static final int LENGTH_FIELD_NUMBER = 2;
+ private int length_;
+ /**
+ * + * Length of the message. It may not be the same as the length of the + * data field, as the logging payload can be truncated or omitted. + *+ * + *
uint32 length = 2;
+ */
+ public int getLength() {
+ return length_;
+ }
+
+ public static final int DATA_FIELD_NUMBER = 3;
+ private com.google.protobuf.ByteString data_;
+ /**
+ * + * Binary payload, post compression (depends on the flags field), may be + * truncated or omitted. + *+ * + *
bytes data = 3;
+ */
+ public com.google.protobuf.ByteString getData() {
+ return data_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (flags_ != 0) {
+ output.writeUInt32(1, flags_);
+ }
+ if (length_ != 0) {
+ output.writeUInt32(2, length_);
+ }
+ if (!data_.isEmpty()) {
+ output.writeBytes(3, data_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (flags_ != 0) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(1, flags_);
+ }
+ if (length_ != 0) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(2, length_);
+ }
+ if (!data_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(3, data_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof io.grpc.binarylog.Message)) {
+ return super.equals(obj);
+ }
+ io.grpc.binarylog.Message other = (io.grpc.binarylog.Message) obj;
+
+ boolean result = true;
+ result = result && (getFlags()
+ == other.getFlags());
+ result = result && (getLength()
+ == other.getLength());
+ result = result && getData()
+ .equals(other.getData());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + FLAGS_FIELD_NUMBER;
+ hash = (53 * hash) + getFlags();
+ hash = (37 * hash) + LENGTH_FIELD_NUMBER;
+ hash = (53 * hash) + getLength();
+ hash = (37 * hash) + DATA_FIELD_NUMBER;
+ hash = (53 * hash) + getData().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static io.grpc.binarylog.Message parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Message parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Message parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Message parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Message parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Message parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Message parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Message parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Message parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Message parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Message parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Message parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(io.grpc.binarylog.Message prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * Message payload, used by REQUEST and RESPONSE + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.Message} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * This flag is currently used to indicate whether the payload is compressed, + * it may contain other semantics in the future. Value of 1 indicates that the + * binary octet sequence of Message is compressed using the mechanism declared + * by the Message-Encoding header. A value of 0 indicates that no encoding of + * Message bytes has occurred. + *+ * + *
uint32 flags = 1;
+ */
+ public int getFlags() {
+ return flags_;
+ }
+ /**
+ * + * This flag is currently used to indicate whether the payload is compressed, + * it may contain other semantics in the future. Value of 1 indicates that the + * binary octet sequence of Message is compressed using the mechanism declared + * by the Message-Encoding header. A value of 0 indicates that no encoding of + * Message bytes has occurred. + *+ * + *
uint32 flags = 1;
+ */
+ public Builder setFlags(int value) {
+
+ flags_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * This flag is currently used to indicate whether the payload is compressed, + * it may contain other semantics in the future. Value of 1 indicates that the + * binary octet sequence of Message is compressed using the mechanism declared + * by the Message-Encoding header. A value of 0 indicates that no encoding of + * Message bytes has occurred. + *+ * + *
uint32 flags = 1;
+ */
+ public Builder clearFlags() {
+
+ flags_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private int length_ ;
+ /**
+ * + * Length of the message. It may not be the same as the length of the + * data field, as the logging payload can be truncated or omitted. + *+ * + *
uint32 length = 2;
+ */
+ public int getLength() {
+ return length_;
+ }
+ /**
+ * + * Length of the message. It may not be the same as the length of the + * data field, as the logging payload can be truncated or omitted. + *+ * + *
uint32 length = 2;
+ */
+ public Builder setLength(int value) {
+
+ length_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Length of the message. It may not be the same as the length of the + * data field, as the logging payload can be truncated or omitted. + *+ * + *
uint32 length = 2;
+ */
+ public Builder clearLength() {
+
+ length_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * + * Binary payload, post compression (depends on the flags field), may be + * truncated or omitted. + *+ * + *
bytes data = 3;
+ */
+ public com.google.protobuf.ByteString getData() {
+ return data_;
+ }
+ /**
+ * + * Binary payload, post compression (depends on the flags field), may be + * truncated or omitted. + *+ * + *
bytes data = 3;
+ */
+ public Builder setData(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ data_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Binary payload, post compression (depends on the flags field), may be + * truncated or omitted. + *+ * + *
bytes data = 3;
+ */
+ public Builder clearData() {
+
+ data_ = getDefaultInstance().getData();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:grpc.binarylog.v1alpha.Message)
+ }
+
+ // @@protoc_insertion_point(class_scope:grpc.binarylog.v1alpha.Message)
+ private static final io.grpc.binarylog.Message DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new io.grpc.binarylog.Message();
+ }
+
+ public static io.grpc.binarylog.Message getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * This flag is currently used to indicate whether the payload is compressed, + * it may contain other semantics in the future. Value of 1 indicates that the + * binary octet sequence of Message is compressed using the mechanism declared + * by the Message-Encoding header. A value of 0 indicates that no encoding of + * Message bytes has occurred. + *+ * + *
uint32 flags = 1;
+ */
+ int getFlags();
+
+ /**
+ * + * Length of the message. It may not be the same as the length of the + * data field, as the logging payload can be truncated or omitted. + *+ * + *
uint32 length = 2;
+ */
+ int getLength();
+
+ /**
+ * + * Binary payload, post compression (depends on the flags field), may be + * truncated or omitted. + *+ * + *
bytes data = 3;
+ */
+ com.google.protobuf.ByteString getData();
+}
diff --git a/services/src/generated/main/java/io/grpc/binarylog/Metadata.java b/services/src/generated/main/java/io/grpc/binarylog/Metadata.java
new file mode 100644
index 0000000000..c1875a71df
--- /dev/null
+++ b/services/src/generated/main/java/io/grpc/binarylog/Metadata.java
@@ -0,0 +1,748 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: io/grpc/binarylog.proto
+
+package io.grpc.binarylog;
+
+/**
+ * + * A list of metadata pairs, used in the payload of CLIENT_INIT_METADATA, + * SERVER_INIT_METADATA and TRAILING_METADATA + * Implementations may omit some entries to honor the header limits + * of GRPC_BINARY_LOG_CONFIG. Implementations can choose which entries are logged. + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.Metadata} + */ +public final class Metadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grpc.binarylog.v1alpha.Metadata) + MetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private Metadata() { + entry_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Metadata( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + entry_ = new java.util.ArrayList
repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public java.util.Listrepeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public java.util.List extends io.grpc.binarylog.MetadataEntryOrBuilder>
+ getEntryOrBuilderList() {
+ return entry_;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public int getEntryCount() {
+ return entry_.size();
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public io.grpc.binarylog.MetadataEntry getEntry(int index) {
+ return entry_.get(index);
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public io.grpc.binarylog.MetadataEntryOrBuilder getEntryOrBuilder(
+ int index) {
+ return entry_.get(index);
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ for (int i = 0; i < entry_.size(); i++) {
+ output.writeMessage(1, entry_.get(i));
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < entry_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, entry_.get(i));
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof io.grpc.binarylog.Metadata)) {
+ return super.equals(obj);
+ }
+ io.grpc.binarylog.Metadata other = (io.grpc.binarylog.Metadata) obj;
+
+ boolean result = true;
+ result = result && getEntryList()
+ .equals(other.getEntryList());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (getEntryCount() > 0) {
+ hash = (37 * hash) + ENTRY_FIELD_NUMBER;
+ hash = (53 * hash) + getEntryList().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static io.grpc.binarylog.Metadata parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Metadata parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Metadata parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Metadata parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Metadata parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Metadata parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Metadata parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Metadata parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Metadata parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Metadata parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Metadata parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Metadata parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(io.grpc.binarylog.Metadata prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * A list of metadata pairs, used in the payload of CLIENT_INIT_METADATA, + * SERVER_INIT_METADATA and TRAILING_METADATA + * Implementations may omit some entries to honor the header limits + * of GRPC_BINARY_LOG_CONFIG. Implementations can choose which entries are logged. + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.Metadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public java.util.Listrepeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public int getEntryCount() {
+ if (entryBuilder_ == null) {
+ return entry_.size();
+ } else {
+ return entryBuilder_.getCount();
+ }
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public io.grpc.binarylog.MetadataEntry getEntry(int index) {
+ if (entryBuilder_ == null) {
+ return entry_.get(index);
+ } else {
+ return entryBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public Builder setEntry(
+ int index, io.grpc.binarylog.MetadataEntry value) {
+ if (entryBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureEntryIsMutable();
+ entry_.set(index, value);
+ onChanged();
+ } else {
+ entryBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public Builder setEntry(
+ int index, io.grpc.binarylog.MetadataEntry.Builder builderForValue) {
+ if (entryBuilder_ == null) {
+ ensureEntryIsMutable();
+ entry_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ entryBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public Builder addEntry(io.grpc.binarylog.MetadataEntry value) {
+ if (entryBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureEntryIsMutable();
+ entry_.add(value);
+ onChanged();
+ } else {
+ entryBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public Builder addEntry(
+ int index, io.grpc.binarylog.MetadataEntry value) {
+ if (entryBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureEntryIsMutable();
+ entry_.add(index, value);
+ onChanged();
+ } else {
+ entryBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public Builder addEntry(
+ io.grpc.binarylog.MetadataEntry.Builder builderForValue) {
+ if (entryBuilder_ == null) {
+ ensureEntryIsMutable();
+ entry_.add(builderForValue.build());
+ onChanged();
+ } else {
+ entryBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public Builder addEntry(
+ int index, io.grpc.binarylog.MetadataEntry.Builder builderForValue) {
+ if (entryBuilder_ == null) {
+ ensureEntryIsMutable();
+ entry_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ entryBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public Builder addAllEntry(
+ java.lang.Iterable extends io.grpc.binarylog.MetadataEntry> values) {
+ if (entryBuilder_ == null) {
+ ensureEntryIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, entry_);
+ onChanged();
+ } else {
+ entryBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public Builder clearEntry() {
+ if (entryBuilder_ == null) {
+ entry_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ entryBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public Builder removeEntry(int index) {
+ if (entryBuilder_ == null) {
+ ensureEntryIsMutable();
+ entry_.remove(index);
+ onChanged();
+ } else {
+ entryBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public io.grpc.binarylog.MetadataEntry.Builder getEntryBuilder(
+ int index) {
+ return getEntryFieldBuilder().getBuilder(index);
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public io.grpc.binarylog.MetadataEntryOrBuilder getEntryOrBuilder(
+ int index) {
+ if (entryBuilder_ == null) {
+ return entry_.get(index); } else {
+ return entryBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public java.util.List extends io.grpc.binarylog.MetadataEntryOrBuilder>
+ getEntryOrBuilderList() {
+ if (entryBuilder_ != null) {
+ return entryBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(entry_);
+ }
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public io.grpc.binarylog.MetadataEntry.Builder addEntryBuilder() {
+ return getEntryFieldBuilder().addBuilder(
+ io.grpc.binarylog.MetadataEntry.getDefaultInstance());
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public io.grpc.binarylog.MetadataEntry.Builder addEntryBuilder(
+ int index) {
+ return getEntryFieldBuilder().addBuilder(
+ index, io.grpc.binarylog.MetadataEntry.getDefaultInstance());
+ }
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ public java.util.List+ * A metadata key value pair + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.MetadataEntry} + */ +public final class MetadataEntry extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grpc.binarylog.v1alpha.MetadataEntry) + MetadataEntryOrBuilder { +private static final long serialVersionUID = 0L; + // Use MetadataEntry.newBuilder() to construct. + private MetadataEntry(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private MetadataEntry() { + key_ = ""; + value_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private MetadataEntry( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + + value_ = input.readBytes(); + 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(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_MetadataEntry_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_MetadataEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grpc.binarylog.MetadataEntry.class, io.grpc.binarylog.MetadataEntry.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + *
string key = 1;
+ */
+ public java.lang.String getKey() {
+ java.lang.Object ref = key_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ key_ = s;
+ return s;
+ }
+ }
+ /**
+ * string key = 1;
+ */
+ public com.google.protobuf.ByteString
+ getKeyBytes() {
+ java.lang.Object ref = key_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ key_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int VALUE_FIELD_NUMBER = 2;
+ private com.google.protobuf.ByteString value_;
+ /**
+ * bytes value = 2;
+ */
+ public com.google.protobuf.ByteString getValue() {
+ return value_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (!getKeyBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_);
+ }
+ if (!value_.isEmpty()) {
+ output.writeBytes(2, value_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getKeyBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_);
+ }
+ if (!value_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, value_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof io.grpc.binarylog.MetadataEntry)) {
+ return super.equals(obj);
+ }
+ io.grpc.binarylog.MetadataEntry other = (io.grpc.binarylog.MetadataEntry) obj;
+
+ boolean result = true;
+ result = result && getKey()
+ .equals(other.getKey());
+ result = result && getValue()
+ .equals(other.getValue());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + KEY_FIELD_NUMBER;
+ hash = (53 * hash) + getKey().hashCode();
+ hash = (37 * hash) + VALUE_FIELD_NUMBER;
+ hash = (53 * hash) + getValue().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static io.grpc.binarylog.MetadataEntry parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.MetadataEntry parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(io.grpc.binarylog.MetadataEntry prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * A metadata key value pair + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.MetadataEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
string key = 1;
+ */
+ public java.lang.String getKey() {
+ java.lang.Object ref = key_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ key_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * string key = 1;
+ */
+ public com.google.protobuf.ByteString
+ getKeyBytes() {
+ java.lang.Object ref = key_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ key_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * string key = 1;
+ */
+ public Builder setKey(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ key_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * string key = 1;
+ */
+ public Builder clearKey() {
+
+ key_ = getDefaultInstance().getKey();
+ onChanged();
+ return this;
+ }
+ /**
+ * string key = 1;
+ */
+ public Builder setKeyBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ key_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * bytes value = 2;
+ */
+ public com.google.protobuf.ByteString getValue() {
+ return value_;
+ }
+ /**
+ * bytes value = 2;
+ */
+ public Builder setValue(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * bytes value = 2;
+ */
+ public Builder clearValue() {
+
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:grpc.binarylog.v1alpha.MetadataEntry)
+ }
+
+ // @@protoc_insertion_point(class_scope:grpc.binarylog.v1alpha.MetadataEntry)
+ private static final io.grpc.binarylog.MetadataEntry DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new io.grpc.binarylog.MetadataEntry();
+ }
+
+ public static io.grpc.binarylog.MetadataEntry getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parserstring key = 1;
+ */
+ java.lang.String getKey();
+ /**
+ * string key = 1;
+ */
+ com.google.protobuf.ByteString
+ getKeyBytes();
+
+ /**
+ * bytes value = 2;
+ */
+ com.google.protobuf.ByteString getValue();
+}
diff --git a/services/src/generated/main/java/io/grpc/binarylog/MetadataOrBuilder.java b/services/src/generated/main/java/io/grpc/binarylog/MetadataOrBuilder.java
new file mode 100644
index 0000000000..296e90cdbd
--- /dev/null
+++ b/services/src/generated/main/java/io/grpc/binarylog/MetadataOrBuilder.java
@@ -0,0 +1,33 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: io/grpc/binarylog.proto
+
+package io.grpc.binarylog;
+
+public interface MetadataOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:grpc.binarylog.v1alpha.Metadata)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ java.util.Listrepeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ io.grpc.binarylog.MetadataEntry getEntry(int index);
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ int getEntryCount();
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ java.util.List extends io.grpc.binarylog.MetadataEntryOrBuilder>
+ getEntryOrBuilderList();
+ /**
+ * repeated .grpc.binarylog.v1alpha.MetadataEntry entry = 1;
+ */
+ io.grpc.binarylog.MetadataEntryOrBuilder getEntryOrBuilder(
+ int index);
+}
diff --git a/services/src/generated/main/java/io/grpc/binarylog/Peer.java b/services/src/generated/main/java/io/grpc/binarylog/Peer.java
new file mode 100644
index 0000000000..549b61946a
--- /dev/null
+++ b/services/src/generated/main/java/io/grpc/binarylog/Peer.java
@@ -0,0 +1,688 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: io/grpc/binarylog.proto
+
+package io.grpc.binarylog;
+
+/**
+ * + * Peer information + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.Peer} + */ +public final class Peer extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grpc.binarylog.v1alpha.Peer) + PeerOrBuilder { +private static final long serialVersionUID = 0L; + // Use Peer.newBuilder() to construct. + private Peer(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private Peer() { + peerType_ = 0; + peer_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Peer( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + + peerType_ = rawValue; + break; + } + case 18: { + + peer_ = input.readBytes(); + 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(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_Peer_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_Peer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grpc.binarylog.Peer.class, io.grpc.binarylog.Peer.Builder.class); + } + + /** + * Protobuf enum {@code grpc.binarylog.v1alpha.Peer.PeerType} + */ + public enum PeerType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+ * peer is struct sockaddr_in + *+ * + *
PEER_IPV4 = 0;
+ */
+ PEER_IPV4(0),
+ /**
+ * + * peer is struct sockaddr_in6 + *+ * + *
PEER_IPV6 = 1;
+ */
+ PEER_IPV6(1),
+ /**
+ * + * peer is struct sockaddr_un + *+ * + *
PEER_UNIX = 2;
+ */
+ PEER_UNIX(2),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ * + * peer is struct sockaddr_in + *+ * + *
PEER_IPV4 = 0;
+ */
+ public static final int PEER_IPV4_VALUE = 0;
+ /**
+ * + * peer is struct sockaddr_in6 + *+ * + *
PEER_IPV6 = 1;
+ */
+ public static final int PEER_IPV6_VALUE = 1;
+ /**
+ * + * peer is struct sockaddr_un + *+ * + *
PEER_UNIX = 2;
+ */
+ public static final int PEER_UNIX_VALUE = 2;
+
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException(
+ "Can't get the number of an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static PeerType valueOf(int value) {
+ return forNumber(value);
+ }
+
+ public static PeerType forNumber(int value) {
+ switch (value) {
+ case 0: return PEER_IPV4;
+ case 1: return PEER_IPV6;
+ case 2: return PEER_UNIX;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap.grpc.binarylog.v1alpha.Peer.PeerType peer_type = 1;
+ */
+ public int getPeerTypeValue() {
+ return peerType_;
+ }
+ /**
+ * .grpc.binarylog.v1alpha.Peer.PeerType peer_type = 1;
+ */
+ public io.grpc.binarylog.Peer.PeerType getPeerType() {
+ io.grpc.binarylog.Peer.PeerType result = io.grpc.binarylog.Peer.PeerType.valueOf(peerType_);
+ return result == null ? io.grpc.binarylog.Peer.PeerType.UNRECOGNIZED : result;
+ }
+
+ public static final int PEER_FIELD_NUMBER = 2;
+ private com.google.protobuf.ByteString peer_;
+ /**
+ * + * value depends on peer_type + *+ * + *
bytes peer = 2;
+ */
+ public com.google.protobuf.ByteString getPeer() {
+ return peer_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (peerType_ != io.grpc.binarylog.Peer.PeerType.PEER_IPV4.getNumber()) {
+ output.writeEnum(1, peerType_);
+ }
+ if (!peer_.isEmpty()) {
+ output.writeBytes(2, peer_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (peerType_ != io.grpc.binarylog.Peer.PeerType.PEER_IPV4.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(1, peerType_);
+ }
+ if (!peer_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, peer_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof io.grpc.binarylog.Peer)) {
+ return super.equals(obj);
+ }
+ io.grpc.binarylog.Peer other = (io.grpc.binarylog.Peer) obj;
+
+ boolean result = true;
+ result = result && peerType_ == other.peerType_;
+ result = result && getPeer()
+ .equals(other.getPeer());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + PEER_TYPE_FIELD_NUMBER;
+ hash = (53 * hash) + peerType_;
+ hash = (37 * hash) + PEER_FIELD_NUMBER;
+ hash = (53 * hash) + getPeer().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static io.grpc.binarylog.Peer parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Peer parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Peer parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Peer parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Peer parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Peer parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Peer parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Peer parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Peer parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Peer parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Peer parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Peer parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(io.grpc.binarylog.Peer prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * Peer information + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.Peer} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
.grpc.binarylog.v1alpha.Peer.PeerType peer_type = 1;
+ */
+ public int getPeerTypeValue() {
+ return peerType_;
+ }
+ /**
+ * .grpc.binarylog.v1alpha.Peer.PeerType peer_type = 1;
+ */
+ public Builder setPeerTypeValue(int value) {
+ peerType_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * .grpc.binarylog.v1alpha.Peer.PeerType peer_type = 1;
+ */
+ public io.grpc.binarylog.Peer.PeerType getPeerType() {
+ io.grpc.binarylog.Peer.PeerType result = io.grpc.binarylog.Peer.PeerType.valueOf(peerType_);
+ return result == null ? io.grpc.binarylog.Peer.PeerType.UNRECOGNIZED : result;
+ }
+ /**
+ * .grpc.binarylog.v1alpha.Peer.PeerType peer_type = 1;
+ */
+ public Builder setPeerType(io.grpc.binarylog.Peer.PeerType value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ peerType_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * .grpc.binarylog.v1alpha.Peer.PeerType peer_type = 1;
+ */
+ public Builder clearPeerType() {
+
+ peerType_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString peer_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * + * value depends on peer_type + *+ * + *
bytes peer = 2;
+ */
+ public com.google.protobuf.ByteString getPeer() {
+ return peer_;
+ }
+ /**
+ * + * value depends on peer_type + *+ * + *
bytes peer = 2;
+ */
+ public Builder setPeer(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ peer_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * value depends on peer_type + *+ * + *
bytes peer = 2;
+ */
+ public Builder clearPeer() {
+
+ peer_ = getDefaultInstance().getPeer();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:grpc.binarylog.v1alpha.Peer)
+ }
+
+ // @@protoc_insertion_point(class_scope:grpc.binarylog.v1alpha.Peer)
+ private static final io.grpc.binarylog.Peer DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new io.grpc.binarylog.Peer();
+ }
+
+ public static io.grpc.binarylog.Peer getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser.grpc.binarylog.v1alpha.Peer.PeerType peer_type = 1;
+ */
+ int getPeerTypeValue();
+ /**
+ * .grpc.binarylog.v1alpha.Peer.PeerType peer_type = 1;
+ */
+ io.grpc.binarylog.Peer.PeerType getPeerType();
+
+ /**
+ * + * value depends on peer_type + *+ * + *
bytes peer = 2;
+ */
+ com.google.protobuf.ByteString getPeer();
+}
diff --git a/services/src/generated/main/java/io/grpc/binarylog/Uint128.java b/services/src/generated/main/java/io/grpc/binarylog/Uint128.java
new file mode 100644
index 0000000000..1c0a940a96
--- /dev/null
+++ b/services/src/generated/main/java/io/grpc/binarylog/Uint128.java
@@ -0,0 +1,515 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: io/grpc/binarylog.proto
+
+package io.grpc.binarylog;
+
+/**
+ * + * Used to record call_id. + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.Uint128} + */ +public final class Uint128 extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grpc.binarylog.v1alpha.Uint128) + Uint128OrBuilder { +private static final long serialVersionUID = 0L; + // Use Uint128.newBuilder() to construct. + private Uint128(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private Uint128() { + high_ = 0L; + low_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Uint128( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 9: { + + high_ = input.readFixed64(); + break; + } + case 17: { + + low_ = input.readFixed64(); + 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(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_Uint128_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grpc.binarylog.BinaryLogProto.internal_static_grpc_binarylog_v1alpha_Uint128_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grpc.binarylog.Uint128.class, io.grpc.binarylog.Uint128.Builder.class); + } + + public static final int HIGH_FIELD_NUMBER = 1; + private long high_; + /** + *
fixed64 high = 1;
+ */
+ public long getHigh() {
+ return high_;
+ }
+
+ public static final int LOW_FIELD_NUMBER = 2;
+ private long low_;
+ /**
+ * fixed64 low = 2;
+ */
+ public long getLow() {
+ return low_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (high_ != 0L) {
+ output.writeFixed64(1, high_);
+ }
+ if (low_ != 0L) {
+ output.writeFixed64(2, low_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (high_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeFixed64Size(1, high_);
+ }
+ if (low_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeFixed64Size(2, low_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof io.grpc.binarylog.Uint128)) {
+ return super.equals(obj);
+ }
+ io.grpc.binarylog.Uint128 other = (io.grpc.binarylog.Uint128) obj;
+
+ boolean result = true;
+ result = result && (getHigh()
+ == other.getHigh());
+ result = result && (getLow()
+ == other.getLow());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + HIGH_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getHigh());
+ hash = (37 * hash) + LOW_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getLow());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static io.grpc.binarylog.Uint128 parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Uint128 parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Uint128 parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Uint128 parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Uint128 parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static io.grpc.binarylog.Uint128 parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Uint128 parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Uint128 parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Uint128 parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Uint128 parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static io.grpc.binarylog.Uint128 parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static io.grpc.binarylog.Uint128 parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(io.grpc.binarylog.Uint128 prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * + * Used to record call_id. + *+ * + * Protobuf type {@code grpc.binarylog.v1alpha.Uint128} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
fixed64 high = 1;
+ */
+ public long getHigh() {
+ return high_;
+ }
+ /**
+ * fixed64 high = 1;
+ */
+ public Builder setHigh(long value) {
+
+ high_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * fixed64 high = 1;
+ */
+ public Builder clearHigh() {
+
+ high_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private long low_ ;
+ /**
+ * fixed64 low = 2;
+ */
+ public long getLow() {
+ return low_;
+ }
+ /**
+ * fixed64 low = 2;
+ */
+ public Builder setLow(long value) {
+
+ low_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * fixed64 low = 2;
+ */
+ public Builder clearLow() {
+
+ low_ = 0L;
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:grpc.binarylog.v1alpha.Uint128)
+ }
+
+ // @@protoc_insertion_point(class_scope:grpc.binarylog.v1alpha.Uint128)
+ private static final io.grpc.binarylog.Uint128 DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new io.grpc.binarylog.Uint128();
+ }
+
+ public static io.grpc.binarylog.Uint128 getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parserfixed64 high = 1;
+ */
+ long getHigh();
+
+ /**
+ * fixed64 low = 2;
+ */
+ long getLow();
+}
diff --git a/services/src/main/java/io/grpc/services/BinaryLog.java b/services/src/main/java/io/grpc/services/BinaryLog.java
index 07b9dc7021..f974e18f15 100644
--- a/services/src/main/java/io/grpc/services/BinaryLog.java
+++ b/services/src/main/java/io/grpc/services/BinaryLog.java
@@ -19,7 +19,24 @@ package io.grpc.services;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
+import com.google.common.primitives.Bytes;
+import com.google.protobuf.ByteString;
+import io.grpc.InternalMetadata;
+import io.grpc.Metadata;
import io.grpc.MethodDescriptor;
+import io.grpc.binarylog.Message;
+import io.grpc.binarylog.Metadata.Builder;
+import io.grpc.binarylog.MetadataEntry;
+import io.grpc.binarylog.Peer;
+import io.grpc.binarylog.Peer.PeerType;
+import io.grpc.binarylog.Uint128;
+import java.net.Inet4Address;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -34,6 +51,10 @@ import javax.annotation.Nullable;
*/
final class BinaryLog {
private static final Logger logger = Logger.getLogger(BinaryLog.class.getName());
+ private static final int IP_PORT_BYTES = 2;
+ private static final int IP_PORT_UPPER_MASK = 0xff00;
+ private static final int IP_PORT_LOWER_MASK = 0xff;
+
private final int maxHeaderBytes;
private final int maxMessageBytes;
@@ -244,4 +265,101 @@ final class BinaryLog {
return null;
}
}
+
+ /**
+ * Returns a {@link Uint128} by interpreting the first 8 bytes as the high int64 and the second
+ * 8 bytes as the low int64.
+ */
+ // TODO(zpencer): verify int64 representation with other gRPC languages
+ static Uint128 callIdToProto(byte[] bytes) {
+ Preconditions.checkArgument(bytes.length == 16);
+ ByteBuffer bb = ByteBuffer.wrap(bytes);
+ long high = bb.getLong();
+ long low = bb.getLong();
+ return Uint128.newBuilder().setHigh(high).setLow(low).build();
+ }
+
+ @VisibleForTesting
+ // TODO(zpencer): the binlog design does not specify how to actually express the peer bytes
+ static Peer socketToProto(SocketAddress address) {
+ PeerType peerType = null;
+ byte[] peerAddress = null;
+
+ if (address instanceof InetSocketAddress) {
+ InetAddress inetAddress = ((InetSocketAddress) address).getAddress();
+ if (inetAddress instanceof Inet4Address) {
+ peerType = PeerType.PEER_IPV4;
+ } else if (inetAddress instanceof Inet6Address) {
+ peerType = PeerType.PEER_IPV6;
+ } else {
+ logger.log(Level.SEVERE, "unknown type of InetSocketAddress: {}", address);
+ }
+ int port = ((InetSocketAddress) address).getPort();
+ byte[] portBytes = new byte[IP_PORT_BYTES];
+ portBytes[0] = (byte) (port & IP_PORT_UPPER_MASK);
+ portBytes[1] = (byte) (port & IP_PORT_LOWER_MASK);
+ peerAddress = Bytes.concat(inetAddress.getAddress(), portBytes);
+ } else if (address.getClass().getName().equals("io.netty.channel.unix.DomainSocketAddress")) {
+ // To avoid a compile time dependency on grpc-netty, we check against the runtime class name.
+ peerType = PeerType.PEER_UNIX;
+ // DomainSocketAddress.toString() is equivalent to DomainSocketAdddress.path()
+ peerAddress = address.toString().getBytes(Charset.defaultCharset());
+ }
+ Peer.Builder builder = Peer.newBuilder();
+ if (peerType != null) {
+ builder.setPeerType(peerType);
+ }
+ if (peerAddress != null) {
+ builder.setPeer(ByteString.copyFrom(peerAddress));
+ }
+ return builder.build();
+ }
+
+ @VisibleForTesting
+ static io.grpc.binarylog.Metadata metadataToProto(Metadata metadata, int maxHeaderBytes) {
+ Preconditions.checkState(maxHeaderBytes >= 0);
+ Builder builder = io.grpc.binarylog.Metadata.newBuilder();
+ if (maxHeaderBytes > 0) {
+ byte[][] serialized = InternalMetadata.serialize(metadata);
+ int written = 0;
+ // This code is tightly coupled with Metadata's implementation
+ for (int i = 0; i < serialized.length && written < maxHeaderBytes; i += 2) {
+ byte[] key = serialized[i];
+ byte[] value = serialized[i + 1];
+ if (written + key.length + value.length <= maxHeaderBytes) {
+ builder.addEntry(
+ MetadataEntry
+ .newBuilder()
+ .setKeyBytes(ByteString.copyFrom(key))
+ .setValue(ByteString.copyFrom(value))
+ .build());
+ written += key.length;
+ written += value.length;
+ }
+ }
+ }
+ return builder.build();
+ }
+
+ @VisibleForTesting
+ static Message messageToProto(byte[] message, boolean compressed, int maxMessageBytes) {
+ Preconditions.checkState(maxMessageBytes >= 0);
+ Message.Builder builder = Message
+ .newBuilder()
+ .setFlags(flagsForMessage(compressed))
+ .setLength(message.length);
+ if (maxMessageBytes > 0) {
+ int limit = Math.min(maxMessageBytes, message.length);
+ builder.setData(ByteString.copyFrom(message, 0, limit));
+ }
+ return builder.build();
+ }
+
+ /**
+ * Returns a flag based on the arguments.
+ */
+ @VisibleForTesting
+ static int flagsForMessage(boolean compressed) {
+ return compressed ? 1 : 0;
+ }
}
diff --git a/services/src/main/proto/io/grpc/binarylog.proto b/services/src/main/proto/io/grpc/binarylog.proto
new file mode 100644
index 0000000000..4c92291680
--- /dev/null
+++ b/services/src/main/proto/io/grpc/binarylog.proto
@@ -0,0 +1,109 @@
+// Copyright 2016, gRPC Authors
+// All rights reserved.
+//
+// Licensed 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.
+// Service exported by server reflection
+
+syntax = "proto3";
+
+package grpc.binarylog.v1alpha;
+
+option java_multiple_files = true;
+option java_package = "io.grpc.binarylog";
+option java_outer_classname = "BinaryLogProto";
+
+// Log entry we store in binary logs
+message GrpcLogEntry {
+ // Enumerates the type of logs
+ enum Type {
+ SEND_INITIAL_METADATA = 0;
+ SEND_TRAILING_METADATA = 1;
+ SEND_MESSAGE = 2;
+ RECV_INITIAL_METADATA = 3;
+ RECV_TRAILING_METADATA = 4;
+ RECV_MESSAGE = 5;
+ };
+
+ // Enumerates the entity that generates the log entry
+ enum Logger {
+ CLIENT = 0;
+ SERVER = 1;
+ }
+
+ Type type = 1; // One of the above Type enum
+ Logger logger = 2; // One of the above Logger enum
+
+ // Uniquely identifies a call. Each call may have several log entries, they
+ // will share the same call_id. 128 bits split into 2 64-bit parts.
+ Uint128 call_id = 3;
+
+ // The logger uses one of the following fields to record the payload,
+ // according to the type of the log entry.
+ oneof payload {
+ // Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA
+ Metadata metadata = 4;
+ // Used by REQUEST and RESPONSE
+ Message message = 5;
+ }
+
+ // Peer address information, will only be recorded in SEND_INITIAL_METADATA
+ // and RECV_INITIAL_METADATA entries.
+ Peer peer = 6;
+};
+
+// Message payload, used by REQUEST and RESPONSE
+message Message {
+ // This flag is currently used to indicate whether the payload is compressed,
+ // it may contain other semantics in the future. Value of 1 indicates that the
+ // binary octet sequence of Message is compressed using the mechanism declared
+ // by the Message-Encoding header. A value of 0 indicates that no encoding of
+ // Message bytes has occurred.
+ uint32 flags = 1; // TODO(zpencer): this is changed because there is no uint8
+ // Length of the message. It may not be the same as the length of the
+ // data field, as the logging payload can be truncated or omitted.
+ uint32 length = 2;
+ // Binary payload, post compression (depends on the flags field), may be
+ // truncated or omitted.
+ bytes data = 3;
+}
+
+// A list of metadata pairs, used in the payload of CLIENT_INIT_METADATA,
+// SERVER_INIT_METADATA and TRAILING_METADATA
+// Implementations may omit some entries to honor the header limits
+// of GRPC_BINARY_LOG_CONFIG. Implementations can choose which entries are logged.
+message Metadata {
+ repeated MetadataEntry entry = 1;
+}
+
+// A metadata key value pair
+message MetadataEntry {
+ string key = 1;
+ bytes value = 2;
+}
+
+// Peer information
+message Peer {
+ enum PeerType {
+ PEER_IPV4 = 0; // peer is struct sockaddr_in
+ PEER_IPV6 = 1; // peer is struct sockaddr_in6
+ PEER_UNIX = 2; // peer is struct sockaddr_un
+ };
+ PeerType peer_type = 1;
+ bytes peer = 2; // value depends on peer_type
+}
+
+// Used to record call_id.
+message Uint128 {
+ fixed64 high = 1;
+ fixed64 low = 2;
+};
diff --git a/services/src/test/java/io/grpc/services/BinaryLogTest.java b/services/src/test/java/io/grpc/services/BinaryLogTest.java
index 92eb37b4a6..a24cdac1aa 100644
--- a/services/src/test/java/io/grpc/services/BinaryLogTest.java
+++ b/services/src/test/java/io/grpc/services/BinaryLogTest.java
@@ -19,7 +19,19 @@ package io.grpc.services;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
+import com.google.common.primitives.Bytes;
+import com.google.protobuf.ByteString;
+import io.grpc.Metadata;
+import io.grpc.binarylog.Message;
+import io.grpc.binarylog.MetadataEntry;
+import io.grpc.binarylog.Peer;
+import io.grpc.binarylog.Uint128;
import io.grpc.services.BinaryLog.FactoryImpl;
+import io.netty.channel.unix.DomainSocketAddress;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.nio.charset.Charset;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -27,6 +39,7 @@ import org.junit.runners.JUnit4;
/** Tests for {@link BinaryLog}. */
@RunWith(JUnit4.class)
public final class BinaryLogTest {
+ private static final Charset US_ASCII = Charset.forName("US-ASCII");
private static final BinaryLog HEADER_FULL = new Builder().header(Integer.MAX_VALUE).build();
private static final BinaryLog HEADER_256 = new Builder().header(256).build();
private static final BinaryLog MSG_FULL = new Builder().msg(Integer.MAX_VALUE).build();
@@ -34,7 +47,51 @@ public final class BinaryLogTest {
private static final BinaryLog BOTH_256 = new Builder().header(256).msg(256).build();
private static final BinaryLog BOTH_FULL =
new Builder().header(Integer.MAX_VALUE).msg(Integer.MAX_VALUE).build();
-
+
+ private static final byte[] CALL_ID = new byte[] {
+ 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
+ 0x19, 0x10, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f };
+
+ private static final Metadata.Key