diff options
Diffstat (limited to 'kamon-core/src')
8 files changed, 3343 insertions, 10 deletions
diff --git a/kamon-core/src/main/java/akka/remote/instrumentation/TraceContextAwareWireFormats.java b/kamon-core/src/main/java/akka/remote/instrumentation/TraceContextAwareWireFormats.java new file mode 100644 index 00000000..1190cb10 --- /dev/null +++ b/kamon-core/src/main/java/akka/remote/instrumentation/TraceContextAwareWireFormats.java @@ -0,0 +1,2847 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: TraceContextAwareWireFormats.proto + +package akka.remote.instrumentation; + +public final class TraceContextAwareWireFormats { + private TraceContextAwareWireFormats() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface AckAndTraceContextAwareEnvelopeContainerOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional .AcknowledgementInfo ack = 1; + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + boolean hasAck(); + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + akka.remote.WireFormats.AcknowledgementInfo getAck(); + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + akka.remote.WireFormats.AcknowledgementInfoOrBuilder getAckOrBuilder(); + + // optional .TraceContextAwareRemoteEnvelope envelope = 2; + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + boolean hasEnvelope(); + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope getEnvelope(); + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelopeOrBuilder getEnvelopeOrBuilder(); + } + /** + * Protobuf type {@code AckAndTraceContextAwareEnvelopeContainer} + */ + public static final class AckAndTraceContextAwareEnvelopeContainer extends + com.google.protobuf.GeneratedMessage + implements AckAndTraceContextAwareEnvelopeContainerOrBuilder { + // Use AckAndTraceContextAwareEnvelopeContainer.newBuilder() to construct. + private AckAndTraceContextAwareEnvelopeContainer(com.google.protobuf.GeneratedMessage.Builder<?> builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private AckAndTraceContextAwareEnvelopeContainer(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final AckAndTraceContextAwareEnvelopeContainer defaultInstance; + public static AckAndTraceContextAwareEnvelopeContainer getDefaultInstance() { + return defaultInstance; + } + + public AckAndTraceContextAwareEnvelopeContainer getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AckAndTraceContextAwareEnvelopeContainer( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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 (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + akka.remote.WireFormats.AcknowledgementInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = ack_.toBuilder(); + } + ack_ = input.readMessage(akka.remote.WireFormats.AcknowledgementInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(ack_); + ack_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = envelope_.toBuilder(); + } + envelope_ = input.readMessage(akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(envelope_); + envelope_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_AckAndTraceContextAwareEnvelopeContainer_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_AckAndTraceContextAwareEnvelopeContainer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer.class, akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer.Builder.class); + } + + public static com.google.protobuf.Parser<AckAndTraceContextAwareEnvelopeContainer> PARSER = + new com.google.protobuf.AbstractParser<AckAndTraceContextAwareEnvelopeContainer>() { + public AckAndTraceContextAwareEnvelopeContainer parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AckAndTraceContextAwareEnvelopeContainer(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<AckAndTraceContextAwareEnvelopeContainer> getParserForType() { + return PARSER; + } + + private int bitField0_; + // optional .AcknowledgementInfo ack = 1; + public static final int ACK_FIELD_NUMBER = 1; + private akka.remote.WireFormats.AcknowledgementInfo ack_; + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public boolean hasAck() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public akka.remote.WireFormats.AcknowledgementInfo getAck() { + return ack_; + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public akka.remote.WireFormats.AcknowledgementInfoOrBuilder getAckOrBuilder() { + return ack_; + } + + // optional .TraceContextAwareRemoteEnvelope envelope = 2; + public static final int ENVELOPE_FIELD_NUMBER = 2; + private akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope envelope_; + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public boolean hasEnvelope() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope getEnvelope() { + return envelope_; + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelopeOrBuilder getEnvelopeOrBuilder() { + return envelope_; + } + + private void initFields() { + ack_ = akka.remote.WireFormats.AcknowledgementInfo.getDefaultInstance(); + envelope_ = akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (hasAck()) { + if (!getAck().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasEnvelope()) { + if (!getEnvelope().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, ack_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, envelope_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, ack_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, envelope_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code AckAndTraceContextAwareEnvelopeContainer} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> + implements akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_AckAndTraceContextAwareEnvelopeContainer_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_AckAndTraceContextAwareEnvelopeContainer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer.class, akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer.Builder.class); + } + + // Construct using akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getAckFieldBuilder(); + getEnvelopeFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (ackBuilder_ == null) { + ack_ = akka.remote.WireFormats.AcknowledgementInfo.getDefaultInstance(); + } else { + ackBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (envelopeBuilder_ == null) { + envelope_ = akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.getDefaultInstance(); + } else { + envelopeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_AckAndTraceContextAwareEnvelopeContainer_descriptor; + } + + public akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer getDefaultInstanceForType() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer.getDefaultInstance(); + } + + public akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer build() { + akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer buildPartial() { + akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer result = new akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (ackBuilder_ == null) { + result.ack_ = ack_; + } else { + result.ack_ = ackBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (envelopeBuilder_ == null) { + result.envelope_ = envelope_; + } else { + result.envelope_ = envelopeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer) { + return mergeFrom((akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer other) { + if (other == akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer.getDefaultInstance()) return this; + if (other.hasAck()) { + mergeAck(other.getAck()); + } + if (other.hasEnvelope()) { + mergeEnvelope(other.getEnvelope()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (hasAck()) { + if (!getAck().isInitialized()) { + + return false; + } + } + if (hasEnvelope()) { + if (!getEnvelope().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (akka.remote.instrumentation.TraceContextAwareWireFormats.AckAndTraceContextAwareEnvelopeContainer) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional .AcknowledgementInfo ack = 1; + private akka.remote.WireFormats.AcknowledgementInfo ack_ = akka.remote.WireFormats.AcknowledgementInfo.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.AcknowledgementInfo, akka.remote.WireFormats.AcknowledgementInfo.Builder, akka.remote.WireFormats.AcknowledgementInfoOrBuilder> ackBuilder_; + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public boolean hasAck() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public akka.remote.WireFormats.AcknowledgementInfo getAck() { + if (ackBuilder_ == null) { + return ack_; + } else { + return ackBuilder_.getMessage(); + } + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public Builder setAck(akka.remote.WireFormats.AcknowledgementInfo value) { + if (ackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ack_ = value; + onChanged(); + } else { + ackBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public Builder setAck( + akka.remote.WireFormats.AcknowledgementInfo.Builder builderForValue) { + if (ackBuilder_ == null) { + ack_ = builderForValue.build(); + onChanged(); + } else { + ackBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public Builder mergeAck(akka.remote.WireFormats.AcknowledgementInfo value) { + if (ackBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + ack_ != akka.remote.WireFormats.AcknowledgementInfo.getDefaultInstance()) { + ack_ = + akka.remote.WireFormats.AcknowledgementInfo.newBuilder(ack_).mergeFrom(value).buildPartial(); + } else { + ack_ = value; + } + onChanged(); + } else { + ackBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public Builder clearAck() { + if (ackBuilder_ == null) { + ack_ = akka.remote.WireFormats.AcknowledgementInfo.getDefaultInstance(); + onChanged(); + } else { + ackBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public akka.remote.WireFormats.AcknowledgementInfo.Builder getAckBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getAckFieldBuilder().getBuilder(); + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + public akka.remote.WireFormats.AcknowledgementInfoOrBuilder getAckOrBuilder() { + if (ackBuilder_ != null) { + return ackBuilder_.getMessageOrBuilder(); + } else { + return ack_; + } + } + /** + * <code>optional .AcknowledgementInfo ack = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.AcknowledgementInfo, akka.remote.WireFormats.AcknowledgementInfo.Builder, akka.remote.WireFormats.AcknowledgementInfoOrBuilder> + getAckFieldBuilder() { + if (ackBuilder_ == null) { + ackBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.AcknowledgementInfo, akka.remote.WireFormats.AcknowledgementInfo.Builder, akka.remote.WireFormats.AcknowledgementInfoOrBuilder>( + ack_, + getParentForChildren(), + isClean()); + ack_ = null; + } + return ackBuilder_; + } + + // optional .TraceContextAwareRemoteEnvelope envelope = 2; + private akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope envelope_ = akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope, akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.Builder, akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelopeOrBuilder> envelopeBuilder_; + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public boolean hasEnvelope() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope getEnvelope() { + if (envelopeBuilder_ == null) { + return envelope_; + } else { + return envelopeBuilder_.getMessage(); + } + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public Builder setEnvelope(akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope value) { + if (envelopeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + envelope_ = value; + onChanged(); + } else { + envelopeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public Builder setEnvelope( + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.Builder builderForValue) { + if (envelopeBuilder_ == null) { + envelope_ = builderForValue.build(); + onChanged(); + } else { + envelopeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public Builder mergeEnvelope(akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope value) { + if (envelopeBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + envelope_ != akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.getDefaultInstance()) { + envelope_ = + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.newBuilder(envelope_).mergeFrom(value).buildPartial(); + } else { + envelope_ = value; + } + onChanged(); + } else { + envelopeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public Builder clearEnvelope() { + if (envelopeBuilder_ == null) { + envelope_ = akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.getDefaultInstance(); + onChanged(); + } else { + envelopeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.Builder getEnvelopeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEnvelopeFieldBuilder().getBuilder(); + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelopeOrBuilder getEnvelopeOrBuilder() { + if (envelopeBuilder_ != null) { + return envelopeBuilder_.getMessageOrBuilder(); + } else { + return envelope_; + } + } + /** + * <code>optional .TraceContextAwareRemoteEnvelope envelope = 2;</code> + */ + private com.google.protobuf.SingleFieldBuilder< + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope, akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.Builder, akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelopeOrBuilder> + getEnvelopeFieldBuilder() { + if (envelopeBuilder_ == null) { + envelopeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope, akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.Builder, akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelopeOrBuilder>( + envelope_, + getParentForChildren(), + isClean()); + envelope_ = null; + } + return envelopeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:AckAndTraceContextAwareEnvelopeContainer) + } + + static { + defaultInstance = new AckAndTraceContextAwareEnvelopeContainer(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:AckAndTraceContextAwareEnvelopeContainer) + } + + public interface TraceContextAwareRemoteEnvelopeOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required .ActorRefData recipient = 1; + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + boolean hasRecipient(); + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + akka.remote.WireFormats.ActorRefData getRecipient(); + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + akka.remote.WireFormats.ActorRefDataOrBuilder getRecipientOrBuilder(); + + // required .SerializedMessage message = 2; + /** + * <code>required .SerializedMessage message = 2;</code> + */ + boolean hasMessage(); + /** + * <code>required .SerializedMessage message = 2;</code> + */ + akka.remote.WireFormats.SerializedMessage getMessage(); + /** + * <code>required .SerializedMessage message = 2;</code> + */ + akka.remote.WireFormats.SerializedMessageOrBuilder getMessageOrBuilder(); + + // optional .ActorRefData sender = 4; + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + boolean hasSender(); + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + akka.remote.WireFormats.ActorRefData getSender(); + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + akka.remote.WireFormats.ActorRefDataOrBuilder getSenderOrBuilder(); + + // optional fixed64 seq = 5; + /** + * <code>optional fixed64 seq = 5;</code> + */ + boolean hasSeq(); + /** + * <code>optional fixed64 seq = 5;</code> + */ + long getSeq(); + + // optional .RemoteTraceContext traceContext = 15; + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + boolean hasTraceContext(); + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext getTraceContext(); + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContextOrBuilder getTraceContextOrBuilder(); + } + /** + * Protobuf type {@code TraceContextAwareRemoteEnvelope} + */ + public static final class TraceContextAwareRemoteEnvelope extends + com.google.protobuf.GeneratedMessage + implements TraceContextAwareRemoteEnvelopeOrBuilder { + // Use TraceContextAwareRemoteEnvelope.newBuilder() to construct. + private TraceContextAwareRemoteEnvelope(com.google.protobuf.GeneratedMessage.Builder<?> builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private TraceContextAwareRemoteEnvelope(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final TraceContextAwareRemoteEnvelope defaultInstance; + public static TraceContextAwareRemoteEnvelope getDefaultInstance() { + return defaultInstance; + } + + public TraceContextAwareRemoteEnvelope getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TraceContextAwareRemoteEnvelope( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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 (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + akka.remote.WireFormats.ActorRefData.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = recipient_.toBuilder(); + } + recipient_ = input.readMessage(akka.remote.WireFormats.ActorRefData.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(recipient_); + recipient_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + akka.remote.WireFormats.SerializedMessage.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = message_.toBuilder(); + } + message_ = input.readMessage(akka.remote.WireFormats.SerializedMessage.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(message_); + message_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 34: { + akka.remote.WireFormats.ActorRefData.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = sender_.toBuilder(); + } + sender_ = input.readMessage(akka.remote.WireFormats.ActorRefData.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sender_); + sender_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 41: { + bitField0_ |= 0x00000008; + seq_ = input.readFixed64(); + break; + } + case 122: { + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = traceContext_.toBuilder(); + } + traceContext_ = input.readMessage(akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(traceContext_); + traceContext_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_TraceContextAwareRemoteEnvelope_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_TraceContextAwareRemoteEnvelope_fieldAccessorTable + .ensureFieldAccessorsInitialized( + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.class, akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.Builder.class); + } + + public static com.google.protobuf.Parser<TraceContextAwareRemoteEnvelope> PARSER = + new com.google.protobuf.AbstractParser<TraceContextAwareRemoteEnvelope>() { + public TraceContextAwareRemoteEnvelope parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TraceContextAwareRemoteEnvelope(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<TraceContextAwareRemoteEnvelope> getParserForType() { + return PARSER; + } + + private int bitField0_; + // required .ActorRefData recipient = 1; + public static final int RECIPIENT_FIELD_NUMBER = 1; + private akka.remote.WireFormats.ActorRefData recipient_; + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public boolean hasRecipient() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public akka.remote.WireFormats.ActorRefData getRecipient() { + return recipient_; + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public akka.remote.WireFormats.ActorRefDataOrBuilder getRecipientOrBuilder() { + return recipient_; + } + + // required .SerializedMessage message = 2; + public static final int MESSAGE_FIELD_NUMBER = 2; + private akka.remote.WireFormats.SerializedMessage message_; + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public akka.remote.WireFormats.SerializedMessage getMessage() { + return message_; + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public akka.remote.WireFormats.SerializedMessageOrBuilder getMessageOrBuilder() { + return message_; + } + + // optional .ActorRefData sender = 4; + public static final int SENDER_FIELD_NUMBER = 4; + private akka.remote.WireFormats.ActorRefData sender_; + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public boolean hasSender() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public akka.remote.WireFormats.ActorRefData getSender() { + return sender_; + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public akka.remote.WireFormats.ActorRefDataOrBuilder getSenderOrBuilder() { + return sender_; + } + + // optional fixed64 seq = 5; + public static final int SEQ_FIELD_NUMBER = 5; + private long seq_; + /** + * <code>optional fixed64 seq = 5;</code> + */ + public boolean hasSeq() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional fixed64 seq = 5;</code> + */ + public long getSeq() { + return seq_; + } + + // optional .RemoteTraceContext traceContext = 15; + public static final int TRACECONTEXT_FIELD_NUMBER = 15; + private akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext traceContext_; + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public boolean hasTraceContext() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext getTraceContext() { + return traceContext_; + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContextOrBuilder getTraceContextOrBuilder() { + return traceContext_; + } + + private void initFields() { + recipient_ = akka.remote.WireFormats.ActorRefData.getDefaultInstance(); + message_ = akka.remote.WireFormats.SerializedMessage.getDefaultInstance(); + sender_ = akka.remote.WireFormats.ActorRefData.getDefaultInstance(); + seq_ = 0L; + traceContext_ = akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasRecipient()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMessage()) { + memoizedIsInitialized = 0; + return false; + } + if (!getRecipient().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + if (!getMessage().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + if (hasSender()) { + if (!getSender().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasTraceContext()) { + if (!getTraceContext().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, recipient_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, message_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(4, sender_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeFixed64(5, seq_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(15, traceContext_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, recipient_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, message_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, sender_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(5, seq_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, traceContext_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code TraceContextAwareRemoteEnvelope} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> + implements akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelopeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_TraceContextAwareRemoteEnvelope_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_TraceContextAwareRemoteEnvelope_fieldAccessorTable + .ensureFieldAccessorsInitialized( + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.class, akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.Builder.class); + } + + // Construct using akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getRecipientFieldBuilder(); + getMessageFieldBuilder(); + getSenderFieldBuilder(); + getTraceContextFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (recipientBuilder_ == null) { + recipient_ = akka.remote.WireFormats.ActorRefData.getDefaultInstance(); + } else { + recipientBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (messageBuilder_ == null) { + message_ = akka.remote.WireFormats.SerializedMessage.getDefaultInstance(); + } else { + messageBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (senderBuilder_ == null) { + sender_ = akka.remote.WireFormats.ActorRefData.getDefaultInstance(); + } else { + senderBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + seq_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + if (traceContextBuilder_ == null) { + traceContext_ = akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.getDefaultInstance(); + } else { + traceContextBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_TraceContextAwareRemoteEnvelope_descriptor; + } + + public akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope getDefaultInstanceForType() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.getDefaultInstance(); + } + + public akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope build() { + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope buildPartial() { + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope result = new akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (recipientBuilder_ == null) { + result.recipient_ = recipient_; + } else { + result.recipient_ = recipientBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (messageBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = messageBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + if (senderBuilder_ == null) { + result.sender_ = sender_; + } else { + result.sender_ = senderBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.seq_ = seq_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + if (traceContextBuilder_ == null) { + result.traceContext_ = traceContext_; + } else { + result.traceContext_ = traceContextBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope) { + return mergeFrom((akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope other) { + if (other == akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope.getDefaultInstance()) return this; + if (other.hasRecipient()) { + mergeRecipient(other.getRecipient()); + } + if (other.hasMessage()) { + mergeMessage(other.getMessage()); + } + if (other.hasSender()) { + mergeSender(other.getSender()); + } + if (other.hasSeq()) { + setSeq(other.getSeq()); + } + if (other.hasTraceContext()) { + mergeTraceContext(other.getTraceContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasRecipient()) { + + return false; + } + if (!hasMessage()) { + + return false; + } + if (!getRecipient().isInitialized()) { + + return false; + } + if (!getMessage().isInitialized()) { + + return false; + } + if (hasSender()) { + if (!getSender().isInitialized()) { + + return false; + } + } + if (hasTraceContext()) { + if (!getTraceContext().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (akka.remote.instrumentation.TraceContextAwareWireFormats.TraceContextAwareRemoteEnvelope) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required .ActorRefData recipient = 1; + private akka.remote.WireFormats.ActorRefData recipient_ = akka.remote.WireFormats.ActorRefData.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.ActorRefData, akka.remote.WireFormats.ActorRefData.Builder, akka.remote.WireFormats.ActorRefDataOrBuilder> recipientBuilder_; + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public boolean hasRecipient() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public akka.remote.WireFormats.ActorRefData getRecipient() { + if (recipientBuilder_ == null) { + return recipient_; + } else { + return recipientBuilder_.getMessage(); + } + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public Builder setRecipient(akka.remote.WireFormats.ActorRefData value) { + if (recipientBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recipient_ = value; + onChanged(); + } else { + recipientBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public Builder setRecipient( + akka.remote.WireFormats.ActorRefData.Builder builderForValue) { + if (recipientBuilder_ == null) { + recipient_ = builderForValue.build(); + onChanged(); + } else { + recipientBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public Builder mergeRecipient(akka.remote.WireFormats.ActorRefData value) { + if (recipientBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + recipient_ != akka.remote.WireFormats.ActorRefData.getDefaultInstance()) { + recipient_ = + akka.remote.WireFormats.ActorRefData.newBuilder(recipient_).mergeFrom(value).buildPartial(); + } else { + recipient_ = value; + } + onChanged(); + } else { + recipientBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public Builder clearRecipient() { + if (recipientBuilder_ == null) { + recipient_ = akka.remote.WireFormats.ActorRefData.getDefaultInstance(); + onChanged(); + } else { + recipientBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public akka.remote.WireFormats.ActorRefData.Builder getRecipientBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRecipientFieldBuilder().getBuilder(); + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + public akka.remote.WireFormats.ActorRefDataOrBuilder getRecipientOrBuilder() { + if (recipientBuilder_ != null) { + return recipientBuilder_.getMessageOrBuilder(); + } else { + return recipient_; + } + } + /** + * <code>required .ActorRefData recipient = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.ActorRefData, akka.remote.WireFormats.ActorRefData.Builder, akka.remote.WireFormats.ActorRefDataOrBuilder> + getRecipientFieldBuilder() { + if (recipientBuilder_ == null) { + recipientBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.ActorRefData, akka.remote.WireFormats.ActorRefData.Builder, akka.remote.WireFormats.ActorRefDataOrBuilder>( + recipient_, + getParentForChildren(), + isClean()); + recipient_ = null; + } + return recipientBuilder_; + } + + // required .SerializedMessage message = 2; + private akka.remote.WireFormats.SerializedMessage message_ = akka.remote.WireFormats.SerializedMessage.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.SerializedMessage, akka.remote.WireFormats.SerializedMessage.Builder, akka.remote.WireFormats.SerializedMessageOrBuilder> messageBuilder_; + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public akka.remote.WireFormats.SerializedMessage getMessage() { + if (messageBuilder_ == null) { + return message_; + } else { + return messageBuilder_.getMessage(); + } + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public Builder setMessage(akka.remote.WireFormats.SerializedMessage value) { + if (messageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + messageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public Builder setMessage( + akka.remote.WireFormats.SerializedMessage.Builder builderForValue) { + if (messageBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + messageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public Builder mergeMessage(akka.remote.WireFormats.SerializedMessage value) { + if (messageBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + message_ != akka.remote.WireFormats.SerializedMessage.getDefaultInstance()) { + message_ = + akka.remote.WireFormats.SerializedMessage.newBuilder(message_).mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + messageBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public Builder clearMessage() { + if (messageBuilder_ == null) { + message_ = akka.remote.WireFormats.SerializedMessage.getDefaultInstance(); + onChanged(); + } else { + messageBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public akka.remote.WireFormats.SerializedMessage.Builder getMessageBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMessageFieldBuilder().getBuilder(); + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + public akka.remote.WireFormats.SerializedMessageOrBuilder getMessageOrBuilder() { + if (messageBuilder_ != null) { + return messageBuilder_.getMessageOrBuilder(); + } else { + return message_; + } + } + /** + * <code>required .SerializedMessage message = 2;</code> + */ + private com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.SerializedMessage, akka.remote.WireFormats.SerializedMessage.Builder, akka.remote.WireFormats.SerializedMessageOrBuilder> + getMessageFieldBuilder() { + if (messageBuilder_ == null) { + messageBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.SerializedMessage, akka.remote.WireFormats.SerializedMessage.Builder, akka.remote.WireFormats.SerializedMessageOrBuilder>( + message_, + getParentForChildren(), + isClean()); + message_ = null; + } + return messageBuilder_; + } + + // optional .ActorRefData sender = 4; + private akka.remote.WireFormats.ActorRefData sender_ = akka.remote.WireFormats.ActorRefData.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.ActorRefData, akka.remote.WireFormats.ActorRefData.Builder, akka.remote.WireFormats.ActorRefDataOrBuilder> senderBuilder_; + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public boolean hasSender() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public akka.remote.WireFormats.ActorRefData getSender() { + if (senderBuilder_ == null) { + return sender_; + } else { + return senderBuilder_.getMessage(); + } + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public Builder setSender(akka.remote.WireFormats.ActorRefData value) { + if (senderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sender_ = value; + onChanged(); + } else { + senderBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public Builder setSender( + akka.remote.WireFormats.ActorRefData.Builder builderForValue) { + if (senderBuilder_ == null) { + sender_ = builderForValue.build(); + onChanged(); + } else { + senderBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public Builder mergeSender(akka.remote.WireFormats.ActorRefData value) { + if (senderBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + sender_ != akka.remote.WireFormats.ActorRefData.getDefaultInstance()) { + sender_ = + akka.remote.WireFormats.ActorRefData.newBuilder(sender_).mergeFrom(value).buildPartial(); + } else { + sender_ = value; + } + onChanged(); + } else { + senderBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public Builder clearSender() { + if (senderBuilder_ == null) { + sender_ = akka.remote.WireFormats.ActorRefData.getDefaultInstance(); + onChanged(); + } else { + senderBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public akka.remote.WireFormats.ActorRefData.Builder getSenderBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSenderFieldBuilder().getBuilder(); + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + public akka.remote.WireFormats.ActorRefDataOrBuilder getSenderOrBuilder() { + if (senderBuilder_ != null) { + return senderBuilder_.getMessageOrBuilder(); + } else { + return sender_; + } + } + /** + * <code>optional .ActorRefData sender = 4;</code> + */ + private com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.ActorRefData, akka.remote.WireFormats.ActorRefData.Builder, akka.remote.WireFormats.ActorRefDataOrBuilder> + getSenderFieldBuilder() { + if (senderBuilder_ == null) { + senderBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.WireFormats.ActorRefData, akka.remote.WireFormats.ActorRefData.Builder, akka.remote.WireFormats.ActorRefDataOrBuilder>( + sender_, + getParentForChildren(), + isClean()); + sender_ = null; + } + return senderBuilder_; + } + + // optional fixed64 seq = 5; + private long seq_ ; + /** + * <code>optional fixed64 seq = 5;</code> + */ + public boolean hasSeq() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional fixed64 seq = 5;</code> + */ + public long getSeq() { + return seq_; + } + /** + * <code>optional fixed64 seq = 5;</code> + */ + public Builder setSeq(long value) { + bitField0_ |= 0x00000008; + seq_ = value; + onChanged(); + return this; + } + /** + * <code>optional fixed64 seq = 5;</code> + */ + public Builder clearSeq() { + bitField0_ = (bitField0_ & ~0x00000008); + seq_ = 0L; + onChanged(); + return this; + } + + // optional .RemoteTraceContext traceContext = 15; + private akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext traceContext_ = akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext, akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.Builder, akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContextOrBuilder> traceContextBuilder_; + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public boolean hasTraceContext() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext getTraceContext() { + if (traceContextBuilder_ == null) { + return traceContext_; + } else { + return traceContextBuilder_.getMessage(); + } + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public Builder setTraceContext(akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext value) { + if (traceContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + traceContext_ = value; + onChanged(); + } else { + traceContextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public Builder setTraceContext( + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.Builder builderForValue) { + if (traceContextBuilder_ == null) { + traceContext_ = builderForValue.build(); + onChanged(); + } else { + traceContextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public Builder mergeTraceContext(akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext value) { + if (traceContextBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010) && + traceContext_ != akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.getDefaultInstance()) { + traceContext_ = + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.newBuilder(traceContext_).mergeFrom(value).buildPartial(); + } else { + traceContext_ = value; + } + onChanged(); + } else { + traceContextBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public Builder clearTraceContext() { + if (traceContextBuilder_ == null) { + traceContext_ = akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.getDefaultInstance(); + onChanged(); + } else { + traceContextBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.Builder getTraceContextBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getTraceContextFieldBuilder().getBuilder(); + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + public akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContextOrBuilder getTraceContextOrBuilder() { + if (traceContextBuilder_ != null) { + return traceContextBuilder_.getMessageOrBuilder(); + } else { + return traceContext_; + } + } + /** + * <code>optional .RemoteTraceContext traceContext = 15;</code> + */ + private com.google.protobuf.SingleFieldBuilder< + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext, akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.Builder, akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContextOrBuilder> + getTraceContextFieldBuilder() { + if (traceContextBuilder_ == null) { + traceContextBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext, akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.Builder, akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContextOrBuilder>( + traceContext_, + getParentForChildren(), + isClean()); + traceContext_ = null; + } + return traceContextBuilder_; + } + + // @@protoc_insertion_point(builder_scope:TraceContextAwareRemoteEnvelope) + } + + static { + defaultInstance = new TraceContextAwareRemoteEnvelope(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:TraceContextAwareRemoteEnvelope) + } + + public interface RemoteTraceContextOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string traceName = 1; + /** + * <code>required string traceName = 1;</code> + */ + boolean hasTraceName(); + /** + * <code>required string traceName = 1;</code> + */ + java.lang.String getTraceName(); + /** + * <code>required string traceName = 1;</code> + */ + com.google.protobuf.ByteString + getTraceNameBytes(); + + // required string traceToken = 2; + /** + * <code>required string traceToken = 2;</code> + */ + boolean hasTraceToken(); + /** + * <code>required string traceToken = 2;</code> + */ + java.lang.String getTraceToken(); + /** + * <code>required string traceToken = 2;</code> + */ + com.google.protobuf.ByteString + getTraceTokenBytes(); + + // required bool isOpen = 3; + /** + * <code>required bool isOpen = 3;</code> + */ + boolean hasIsOpen(); + /** + * <code>required bool isOpen = 3;</code> + */ + boolean getIsOpen(); + + // required fixed64 startMilliTime = 4; + /** + * <code>required fixed64 startMilliTime = 4;</code> + */ + boolean hasStartMilliTime(); + /** + * <code>required fixed64 startMilliTime = 4;</code> + */ + long getStartMilliTime(); + } + /** + * Protobuf type {@code RemoteTraceContext} + */ + public static final class RemoteTraceContext extends + com.google.protobuf.GeneratedMessage + implements RemoteTraceContextOrBuilder { + // Use RemoteTraceContext.newBuilder() to construct. + private RemoteTraceContext(com.google.protobuf.GeneratedMessage.Builder<?> builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private RemoteTraceContext(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final RemoteTraceContext defaultInstance; + public static RemoteTraceContext getDefaultInstance() { + return defaultInstance; + } + + public RemoteTraceContext getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RemoteTraceContext( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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 (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + traceName_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + traceToken_ = input.readBytes(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + isOpen_ = input.readBool(); + break; + } + case 33: { + bitField0_ |= 0x00000008; + startMilliTime_ = 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.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_RemoteTraceContext_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_RemoteTraceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.class, akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.Builder.class); + } + + public static com.google.protobuf.Parser<RemoteTraceContext> PARSER = + new com.google.protobuf.AbstractParser<RemoteTraceContext>() { + public RemoteTraceContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoteTraceContext(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<RemoteTraceContext> getParserForType() { + return PARSER; + } + + private int bitField0_; + // required string traceName = 1; + public static final int TRACENAME_FIELD_NUMBER = 1; + private java.lang.Object traceName_; + /** + * <code>required string traceName = 1;</code> + */ + public boolean hasTraceName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>required string traceName = 1;</code> + */ + public java.lang.String getTraceName() { + java.lang.Object ref = traceName_; + 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(); + if (bs.isValidUtf8()) { + traceName_ = s; + } + return s; + } + } + /** + * <code>required string traceName = 1;</code> + */ + public com.google.protobuf.ByteString + getTraceNameBytes() { + java.lang.Object ref = traceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + traceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required string traceToken = 2; + public static final int TRACETOKEN_FIELD_NUMBER = 2; + private java.lang.Object traceToken_; + /** + * <code>required string traceToken = 2;</code> + */ + public boolean hasTraceToken() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>required string traceToken = 2;</code> + */ + public java.lang.String getTraceToken() { + java.lang.Object ref = traceToken_; + 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(); + if (bs.isValidUtf8()) { + traceToken_ = s; + } + return s; + } + } + /** + * <code>required string traceToken = 2;</code> + */ + public com.google.protobuf.ByteString + getTraceTokenBytes() { + java.lang.Object ref = traceToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + traceToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required bool isOpen = 3; + public static final int ISOPEN_FIELD_NUMBER = 3; + private boolean isOpen_; + /** + * <code>required bool isOpen = 3;</code> + */ + public boolean hasIsOpen() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>required bool isOpen = 3;</code> + */ + public boolean getIsOpen() { + return isOpen_; + } + + // required fixed64 startMilliTime = 4; + public static final int STARTMILLITIME_FIELD_NUMBER = 4; + private long startMilliTime_; + /** + * <code>required fixed64 startMilliTime = 4;</code> + */ + public boolean hasStartMilliTime() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>required fixed64 startMilliTime = 4;</code> + */ + public long getStartMilliTime() { + return startMilliTime_; + } + + private void initFields() { + traceName_ = ""; + traceToken_ = ""; + isOpen_ = false; + startMilliTime_ = 0L; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasTraceName()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTraceToken()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasIsOpen()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasStartMilliTime()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getTraceNameBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getTraceTokenBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(3, isOpen_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeFixed64(4, startMilliTime_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getTraceNameBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getTraceTokenBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, isOpen_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(4, startMilliTime_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code RemoteTraceContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> + implements akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_RemoteTraceContext_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_RemoteTraceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.class, akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.Builder.class); + } + + // Construct using akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + traceName_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + traceToken_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + isOpen_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + startMilliTime_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.internal_static_RemoteTraceContext_descriptor; + } + + public akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext getDefaultInstanceForType() { + return akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.getDefaultInstance(); + } + + public akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext build() { + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext buildPartial() { + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext result = new akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.traceName_ = traceName_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.traceToken_ = traceToken_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.isOpen_ = isOpen_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.startMilliTime_ = startMilliTime_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext) { + return mergeFrom((akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext other) { + if (other == akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext.getDefaultInstance()) return this; + if (other.hasTraceName()) { + bitField0_ |= 0x00000001; + traceName_ = other.traceName_; + onChanged(); + } + if (other.hasTraceToken()) { + bitField0_ |= 0x00000002; + traceToken_ = other.traceToken_; + onChanged(); + } + if (other.hasIsOpen()) { + setIsOpen(other.getIsOpen()); + } + if (other.hasStartMilliTime()) { + setStartMilliTime(other.getStartMilliTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasTraceName()) { + + return false; + } + if (!hasTraceToken()) { + + return false; + } + if (!hasIsOpen()) { + + return false; + } + if (!hasStartMilliTime()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required string traceName = 1; + private java.lang.Object traceName_ = ""; + /** + * <code>required string traceName = 1;</code> + */ + public boolean hasTraceName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>required string traceName = 1;</code> + */ + public java.lang.String getTraceName() { + java.lang.Object ref = traceName_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + traceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>required string traceName = 1;</code> + */ + public com.google.protobuf.ByteString + getTraceNameBytes() { + java.lang.Object ref = traceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + traceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>required string traceName = 1;</code> + */ + public Builder setTraceName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + traceName_ = value; + onChanged(); + return this; + } + /** + * <code>required string traceName = 1;</code> + */ + public Builder clearTraceName() { + bitField0_ = (bitField0_ & ~0x00000001); + traceName_ = getDefaultInstance().getTraceName(); + onChanged(); + return this; + } + /** + * <code>required string traceName = 1;</code> + */ + public Builder setTraceNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + traceName_ = value; + onChanged(); + return this; + } + + // required string traceToken = 2; + private java.lang.Object traceToken_ = ""; + /** + * <code>required string traceToken = 2;</code> + */ + public boolean hasTraceToken() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>required string traceToken = 2;</code> + */ + public java.lang.String getTraceToken() { + java.lang.Object ref = traceToken_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + traceToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>required string traceToken = 2;</code> + */ + public com.google.protobuf.ByteString + getTraceTokenBytes() { + java.lang.Object ref = traceToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + traceToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>required string traceToken = 2;</code> + */ + public Builder setTraceToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + traceToken_ = value; + onChanged(); + return this; + } + /** + * <code>required string traceToken = 2;</code> + */ + public Builder clearTraceToken() { + bitField0_ = (bitField0_ & ~0x00000002); + traceToken_ = getDefaultInstance().getTraceToken(); + onChanged(); + return this; + } + /** + * <code>required string traceToken = 2;</code> + */ + public Builder setTraceTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + traceToken_ = value; + onChanged(); + return this; + } + + // required bool isOpen = 3; + private boolean isOpen_ ; + /** + * <code>required bool isOpen = 3;</code> + */ + public boolean hasIsOpen() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>required bool isOpen = 3;</code> + */ + public boolean getIsOpen() { + return isOpen_; + } + /** + * <code>required bool isOpen = 3;</code> + */ + public Builder setIsOpen(boolean value) { + bitField0_ |= 0x00000004; + isOpen_ = value; + onChanged(); + return this; + } + /** + * <code>required bool isOpen = 3;</code> + */ + public Builder clearIsOpen() { + bitField0_ = (bitField0_ & ~0x00000004); + isOpen_ = false; + onChanged(); + return this; + } + + // required fixed64 startMilliTime = 4; + private long startMilliTime_ ; + /** + * <code>required fixed64 startMilliTime = 4;</code> + */ + public boolean hasStartMilliTime() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>required fixed64 startMilliTime = 4;</code> + */ + public long getStartMilliTime() { + return startMilliTime_; + } + /** + * <code>required fixed64 startMilliTime = 4;</code> + */ + public Builder setStartMilliTime(long value) { + bitField0_ |= 0x00000008; + startMilliTime_ = value; + onChanged(); + return this; + } + /** + * <code>required fixed64 startMilliTime = 4;</code> + */ + public Builder clearStartMilliTime() { + bitField0_ = (bitField0_ & ~0x00000008); + startMilliTime_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:RemoteTraceContext) + } + + static { + defaultInstance = new RemoteTraceContext(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:RemoteTraceContext) + } + + private static com.google.protobuf.Descriptors.Descriptor + internal_static_AckAndTraceContextAwareEnvelopeContainer_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_AckAndTraceContextAwareEnvelopeContainer_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_TraceContextAwareRemoteEnvelope_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_TraceContextAwareRemoteEnvelope_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_RemoteTraceContext_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RemoteTraceContext_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\"TraceContextAwareWireFormats.proto\032\021Wi" + + "reFormats.proto\"\201\001\n(AckAndTraceContextAw" + + "areEnvelopeContainer\022!\n\003ack\030\001 \001(\0132\024.Ackn" + + "owledgementInfo\0222\n\010envelope\030\002 \001(\0132 .Trac" + + "eContextAwareRemoteEnvelope\"\277\001\n\037TraceCon" + + "textAwareRemoteEnvelope\022 \n\trecipient\030\001 \002" + + "(\0132\r.ActorRefData\022#\n\007message\030\002 \002(\0132\022.Ser" + + "ializedMessage\022\035\n\006sender\030\004 \001(\0132\r.ActorRe" + + "fData\022\013\n\003seq\030\005 \001(\006\022)\n\014traceContext\030\017 \001(\013" + + "2\023.RemoteTraceContext\"c\n\022RemoteTraceCont", + "ext\022\021\n\ttraceName\030\001 \002(\t\022\022\n\ntraceToken\030\002 \002" + + "(\t\022\016\n\006isOpen\030\003 \002(\010\022\026\n\016startMilliTime\030\004 \002" + + "(\006B\037\n\033akka.remote.instrumentationH\001" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + internal_static_AckAndTraceContextAwareEnvelopeContainer_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_AckAndTraceContextAwareEnvelopeContainer_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_AckAndTraceContextAwareEnvelopeContainer_descriptor, + new java.lang.String[] { "Ack", "Envelope", }); + internal_static_TraceContextAwareRemoteEnvelope_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_TraceContextAwareRemoteEnvelope_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_TraceContextAwareRemoteEnvelope_descriptor, + new java.lang.String[] { "Recipient", "Message", "Sender", "Seq", "TraceContext", }); + internal_static_RemoteTraceContext_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_RemoteTraceContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_RemoteTraceContext_descriptor, + new java.lang.String[] { "TraceName", "TraceToken", "IsOpen", "StartMilliTime", }); + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + akka.remote.WireFormats.getDescriptor(), + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/kamon-core/src/main/protobuf/TraceContextAwareWireFormats.proto b/kamon-core/src/main/protobuf/TraceContextAwareWireFormats.proto new file mode 100644 index 00000000..d4ee21b5 --- /dev/null +++ b/kamon-core/src/main/protobuf/TraceContextAwareWireFormats.proto @@ -0,0 +1,31 @@ +import "WireFormats.proto"; + +option java_package = "akka.remote.instrumentation"; +option optimize_for = SPEED; + + +/************************************************ + * Kamon-specific additions to the protocol + ************************************************/ + +message AckAndTraceContextAwareEnvelopeContainer { + optional AcknowledgementInfo ack = 1; + optional TraceContextAwareRemoteEnvelope envelope = 2; +} + +message TraceContextAwareRemoteEnvelope { + required ActorRefData recipient = 1; + required SerializedMessage message = 2; + optional ActorRefData sender = 4; + optional fixed64 seq = 5; + + optional RemoteTraceContext traceContext = 15; +} + +message RemoteTraceContext { + required string traceName = 1; + required string traceToken = 2; + required bool isOpen = 3; + required fixed64 startMilliTime = 4; +} + diff --git a/kamon-core/src/main/protobuf/WireFormats.proto b/kamon-core/src/main/protobuf/WireFormats.proto new file mode 100644 index 00000000..98a954cc --- /dev/null +++ b/kamon-core/src/main/protobuf/WireFormats.proto @@ -0,0 +1,132 @@ +/** + * Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com> + */ + +// Extracted from https://github.com/akka/akka/blob/master/akka-remote/src/main/protobuf/WireFormats.proto + + +option java_package = "akka.remote"; +option optimize_for = SPEED; + +/****************************************** + * Remoting message formats + ******************************************/ + + +message AckAndEnvelopeContainer { + optional AcknowledgementInfo ack = 1; + optional RemoteEnvelope envelope = 2; +} + +/** + * Defines a remote message. + */ +message RemoteEnvelope { + required ActorRefData recipient = 1; + required SerializedMessage message = 2; + optional ActorRefData sender = 4; + optional fixed64 seq = 5; +} + +message AcknowledgementInfo { + required fixed64 cumulativeAck = 1; + repeated fixed64 nacks = 2; +} + +/** + * Defines a remote ActorRef that "remembers" and uses its original Actor instance + * on the original node. + */ +message ActorRefData { + required string path = 1; +} + +/** + * Defines a message. + */ +message SerializedMessage { + required bytes message = 1; + required int32 serializerId = 2; + optional bytes messageManifest = 3; +} + +/** + * Defines akka.remote.DaemonMsgCreate + */ +message DaemonMsgCreateData { + required PropsData props = 1; + required DeployData deploy = 2; + required string path = 3; + required ActorRefData supervisor = 4; +} + +/** + * Serialization of akka.actor.Props + */ +message PropsData { + required DeployData deploy = 2; + required string clazz = 3; + repeated bytes args = 4; + repeated string classes = 5; +} + +/** + * Serialization of akka.actor.Deploy + */ +message DeployData { + required string path = 1; + optional bytes config = 2; + optional bytes routerConfig = 3; + optional bytes scope = 4; + optional string dispatcher = 5; +} + + +/****************************************** + * Akka Protocol message formats + ******************************************/ + +/** + * Message format of Akka Protocol. + * Message contains either a payload or an instruction. + */ +message AkkaProtocolMessage { + optional bytes payload = 1; + optional AkkaControlMessage instruction = 2; +} + +/** + * Defines some control messages for the remoting + */ +message AkkaControlMessage { + required CommandType commandType = 1; + optional AkkaHandshakeInfo handshakeInfo = 2; +} + +message AkkaHandshakeInfo { + required AddressData origin = 1; + required fixed64 uid = 2; + optional string cookie = 3; + +} + +/** + * Defines the type of the AkkaControlMessage command type + */ +enum CommandType { + ASSOCIATE = 1; + DISASSOCIATE = 2; + HEARTBEAT = 3; + DISASSOCIATE_SHUTTING_DOWN = 4; // Remote system is going down and will not accepts new connections + DISASSOCIATE_QUARANTINED = 5; // Remote system refused the association since the current system is quarantined +} + +/** + * Defines a remote address. + */ +message AddressData { + required string system = 1; + required string hostname = 2; + required uint32 port = 3; + optional string protocol = 4; +} diff --git a/kamon-core/src/main/resources/META-INF/aop.xml b/kamon-core/src/main/resources/META-INF/aop.xml index 99360bb4..a272320f 100644 --- a/kamon-core/src/main/resources/META-INF/aop.xml +++ b/kamon-core/src/main/resources/META-INF/aop.xml @@ -14,6 +14,9 @@ <aspect name="akka.instrumentation.ActorCellInstrumentation"/> <aspect name="akka.instrumentation.ActorLoggingInstrumentation"/> + <!-- Remoting and Cluster --> + <aspect name="akka.remote.instrumentation.RemotingInstrumentation"/> + <!-- Dispatchers --> <aspect name="akka.instrumentation.DispatcherInstrumentation"/> <aspect name="akka.instrumentation.DispatcherMetricCollectionInfoIntoDispatcherMixin"/> @@ -32,6 +35,9 @@ <include within="akka..*"/> <include within="spray..*"/> <include within="kamon..*"/> + + <!-- For some weird reason ByteString produces a java.lang.VerifyError after going through the weaver. --> + <exclude within="akka.util.ByteString"/> </weaver> </aspectj>
\ No newline at end of file diff --git a/kamon-core/src/main/scala/kamon/instrumentation/akka/RemotingInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/akka/RemotingInstrumentation.scala new file mode 100644 index 00000000..341b0ee7 --- /dev/null +++ b/kamon-core/src/main/scala/kamon/instrumentation/akka/RemotingInstrumentation.scala @@ -0,0 +1,91 @@ +package akka.remote.instrumentation + +import akka.actor.{ ActorRef, Address } +import akka.dispatch.sysmsg.SystemMessage +import akka.remote.instrumentation.TraceContextAwareWireFormats.{ TraceContextAwareRemoteEnvelope, RemoteTraceContext, AckAndTraceContextAwareEnvelopeContainer } +import akka.remote.transport.AkkaPduCodec.Message +import akka.remote.{ RemoteActorRefProvider, Ack, SeqNo } +import akka.remote.WireFormats._ +import akka.util.ByteString +import kamon.trace.{ TraceContextAware, TraceRecorder } +import org.aspectj.lang.ProceedingJoinPoint +import org.aspectj.lang.annotation._ + +@Aspect +class RemotingInstrumentation { + + @Pointcut("execution(* akka.remote.transport.AkkaPduProtobufCodec$.constructMessage(..)) && args(localAddress, recipient, serializedMessage, senderOption, seqOption, ackOption)") + def constructAkkaPduMessage(localAddress: Address, recipient: ActorRef, serializedMessage: SerializedMessage, + senderOption: Option[ActorRef], seqOption: Option[SeqNo], ackOption: Option[Ack]): Unit = {} + + @Around("constructAkkaPduMessage(localAddress, recipient, serializedMessage, senderOption, seqOption, ackOption)") + def aroundSerializeRemoteMessage(pjp: ProceedingJoinPoint, localAddress: Address, recipient: ActorRef, + serializedMessage: SerializedMessage, senderOption: Option[ActorRef], seqOption: Option[SeqNo], ackOption: Option[Ack]): AnyRef = { + + val ackAndEnvelopeBuilder = AckAndTraceContextAwareEnvelopeContainer.newBuilder + val envelopeBuilder = TraceContextAwareRemoteEnvelope.newBuilder + + envelopeBuilder.setRecipient(serializeActorRef(recipient.path.address, recipient)) + senderOption foreach { ref ⇒ envelopeBuilder.setSender(serializeActorRef(localAddress, ref)) } + seqOption foreach { seq ⇒ envelopeBuilder.setSeq(seq.rawValue) } + ackOption foreach { ack ⇒ ackAndEnvelopeBuilder.setAck(ackBuilder(ack)) } + envelopeBuilder.setMessage(serializedMessage) + + // Attach the TraceContext info, if available. + TraceRecorder.currentContext.foreach { context ⇒ + envelopeBuilder.setTraceContext(RemoteTraceContext.newBuilder() + .setTraceName(context.name) + .setTraceToken(context.token) + .setIsOpen(context.isOpen) + .setStartMilliTime(context.startMilliTime) + .build()) + } + + ackAndEnvelopeBuilder.setEnvelope(envelopeBuilder) + ByteString.ByteString1C(ackAndEnvelopeBuilder.build.toByteArray) //Reuse Byte Array (naughty!) + } + + // Copied from akka.remote.transport.AkkaPduProtobufCodec because of private access. + private def ackBuilder(ack: Ack): AcknowledgementInfo.Builder = { + val ackBuilder = AcknowledgementInfo.newBuilder() + ackBuilder.setCumulativeAck(ack.cumulativeAck.rawValue) + ack.nacks foreach { nack ⇒ ackBuilder.addNacks(nack.rawValue) } + ackBuilder + } + + // Copied from akka.remote.transport.AkkaPduProtobufCodec because of private access. + private def serializeActorRef(defaultAddress: Address, ref: ActorRef): ActorRefData = { + ActorRefData.newBuilder.setPath( + if (ref.path.address.host.isDefined) ref.path.toSerializationFormat else ref.path.toSerializationFormatWithAddress(defaultAddress)).build() + } + + // Copied from akka.remote.transport.AkkaPduProtobufCodec because of private access. + private def serializeAddress(address: Address): AddressData = address match { + case Address(protocol, system, Some(host), Some(port)) ⇒ + AddressData.newBuilder + .setHostname(host) + .setPort(port) + .setSystem(system) + .setProtocol(protocol) + .build() + case _ ⇒ throw new IllegalArgumentException(s"Address [${address}] could not be serialized: host or port missing.") + } + + @Pointcut("execution(* akka.remote.transport.AkkaPduProtobufCodec$.decodeMessage(..)) && args(bs, provider, localAddress)") // && args(raw, provider, localAddress)") + def decodeRemoteMessage(bs: ByteString, provider: RemoteActorRefProvider, localAddress: Address): Unit = {} //(raw: ByteString, provider: RemoteActorRefProvider, localAddress: Address): Unit = {} + + @Around("decodeRemoteMessage(bs, provider, localAddress)") + def aroundDecodeRemoteMessage(pjp: ProceedingJoinPoint, bs: ByteString, provider: RemoteActorRefProvider, localAddress: Address): AnyRef = { + val ackAndEnvelope = AckAndTraceContextAwareEnvelopeContainer.parseFrom(bs.toArray) + + if (ackAndEnvelope.hasEnvelope && ackAndEnvelope.getEnvelope.hasTraceContext) { + val traceContext = ackAndEnvelope.getEnvelope.getTraceContext + val system = provider.guardian.underlying.system + val tc = TraceRecorder.joinRemoteTraceContext(traceContext, system) + + TraceRecorder.setContext(Some(tc)) + } + + pjp.proceed() + } +} diff --git a/kamon-core/src/main/scala/kamon/trace/TraceContext.scala b/kamon-core/src/main/scala/kamon/trace/TraceContext.scala index 9ce3cd4e..6ea30511 100644 --- a/kamon-core/src/main/scala/kamon/trace/TraceContext.scala +++ b/kamon-core/src/main/scala/kamon/trace/TraceContext.scala @@ -16,6 +16,8 @@ package kamon.trace +import java.io.ObjectStreamException + import akka.actor.ActorSystem import kamon.Kamon import kamon.metric._ @@ -32,6 +34,9 @@ trait TraceContext { def levelOfDetail: TracingLevelOfDetail def startSegment(identity: SegmentIdentity, metadata: Map[String, String]): SegmentCompletionHandle def finish(metadata: Map[String, String]) + def origin: TraceContextOrigin + def startMilliTime: Long + def isOpen: Boolean private[kamon] val traceLocalStorage: TraceLocalStorage = new TraceLocalStorage } @@ -51,7 +56,13 @@ case object OnlyMetrics extends TracingLevelOfDetail case object SimpleTrace extends TracingLevelOfDetail case object FullTrace extends TracingLevelOfDetail -trait TraceContextAware { +sealed trait TraceContextOrigin +object TraceContextOrigin { + case object Local extends TraceContextOrigin + case object Remote extends TraceContextOrigin +} + +trait TraceContextAware extends Serializable { def captureNanoTime: Long def traceContext: Option[TraceContext] } @@ -60,8 +71,20 @@ object TraceContextAware { def default: TraceContextAware = new DefaultTraceContextAware class DefaultTraceContextAware extends TraceContextAware { - val captureNanoTime = System.nanoTime() - val traceContext = TraceRecorder.currentContext + @transient val captureNanoTime = System.nanoTime() + @transient val traceContext = TraceRecorder.currentContext + + // + // Beware of this hack, it might bite us in the future! + // + // When using remoting/cluster all messages carry the TraceContext in the envelope in which they + // are sent but that doesn't apply to System Messages. We are certain that the TraceContext is + // available (if any) when the system messages are read and this will make sure that it is correctly + // captured and propagated. + @throws[ObjectStreamException] + private def readResolve: AnyRef = { + new DefaultTraceContextAware + } } } @@ -75,11 +98,15 @@ object SegmentCompletionHandleAware { class DefaultSegmentCompletionHandleAware extends DefaultTraceContextAware with SegmentCompletionHandleAware {} } -class SimpleMetricCollectionContext(@volatile private var _name: String, val token: String, metadata: Map[String, String], - val system: ActorSystem) extends TraceContext { - @volatile private var _isOpen = true +class SimpleMetricCollectionContext(traceName: String, val token: String, metadata: Map[String, String], + val origin: TraceContextOrigin, val system: ActorSystem, val startMilliTime: Long = System.currentTimeMillis, + izOpen: Boolean = true) extends TraceContext { + + @volatile private var _name = traceName + @volatile private var _isOpen = izOpen + val levelOfDetail = OnlyMetrics - val startMark = System.nanoTime() + val startNanoTime = System.nanoTime() val finishedSegments = new ConcurrentLinkedQueue[SegmentData]() val metricsExtension = Kamon(Metrics)(system) @@ -91,11 +118,20 @@ class SimpleMetricCollectionContext(@volatile private var _name: String, val tok def finish(metadata: Map[String, String]): Unit = { _isOpen = false - val finishMark = System.nanoTime() + + val elapsedNanoTime = + if (origin == TraceContextOrigin.Local) + // Everything is local, nanoTime is still the best resolution we can use. + System.nanoTime() - startNanoTime + else + // For a remote TraceContext we can only rely on the startMilliTime and we need to scale it to nanoseconds + // to be consistent with unit used for all latency measurements. + (System.currentTimeMillis() - startMilliTime) * 1000000L + val metricRecorder = metricsExtension.register(TraceMetrics(name), TraceMetrics.Factory) metricRecorder.map { traceMetrics ⇒ - traceMetrics.elapsedTime.record(finishMark - startMark) + traceMetrics.elapsedTime.record(elapsedNanoTime) drainFinishedSegments(traceMetrics) } } diff --git a/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala b/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala index 0b3118ed..bc7a0db2 100644 --- a/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala +++ b/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala @@ -16,6 +16,8 @@ package kamon.trace +import akka.remote.instrumentation.TraceContextAwareWireFormats.RemoteTraceContext + import scala.language.experimental.macros import java.util.concurrent.atomic.AtomicLong import kamon.macros.InlineTraceContextMacro @@ -40,7 +42,27 @@ object TraceRecorder { // In the future this should select between implementations. val finalToken = token.getOrElse(newToken) - new SimpleMetricCollectionContext(name, finalToken, metadata, system) + new SimpleMetricCollectionContext(name, finalToken, metadata, TraceContextOrigin.Local, system) + } + + def joinRemoteTraceContext(remoteTraceContext: RemoteTraceContext, system: ActorSystem): TraceContext = { + new SimpleMetricCollectionContext( + remoteTraceContext.getTraceName(), + remoteTraceContext.getTraceToken(), + Map.empty, + TraceContextOrigin.Remote, + system, + remoteTraceContext.getStartMilliTime(), + remoteTraceContext.getIsOpen()) + } + + def forkTraceContext(context: TraceContext, newName: String): TraceContext = { + new SimpleMetricCollectionContext( + newName, + context.token, + Map.empty, + TraceContextOrigin.Local, + context.system) } def setContext(context: Option[TraceContext]): Unit = traceContextStorage.set(context) diff --git a/kamon-core/src/test/scala/kamon/instrumentation/akka/RemotingInstrumentationSpec.scala b/kamon-core/src/test/scala/kamon/instrumentation/akka/RemotingInstrumentationSpec.scala new file mode 100644 index 00000000..bc864455 --- /dev/null +++ b/kamon-core/src/test/scala/kamon/instrumentation/akka/RemotingInstrumentationSpec.scala @@ -0,0 +1,168 @@ +package kamon.instrumentation.akka + +import akka.actor.SupervisorStrategy.Resume +import akka.actor._ +import akka.remote.RemoteScope +import akka.routing.RoundRobinGroup +import akka.testkit.{ ImplicitSender, TestKitBase } +import akka.util.Timeout +import com.typesafe.config.ConfigFactory +import kamon.trace.TraceRecorder +import org.scalatest.{ Matchers, WordSpecLike } +import akka.pattern.{ ask, pipe } +import scala.concurrent.duration._ +import scala.util.control.NonFatal + +class RemotingInstrumentationSpec extends TestKitBase with WordSpecLike with Matchers with ImplicitSender { + implicit lazy val system: ActorSystem = ActorSystem("remoting-spec-local-system", ConfigFactory.parseString( + """ + |akka { + | actor { + | provider = "akka.remote.RemoteActorRefProvider" + | } + | remote { + | enabled-transports = ["akka.remote.netty.tcp"] + | netty.tcp { + | hostname = "127.0.0.1" + | port = 2552 + | } + | } + |} + """.stripMargin)) + + val remoteSystem: ActorSystem = ActorSystem("remoting-spec-remote-system", ConfigFactory.parseString( + """ + |akka { + | actor { + | provider = "akka.remote.RemoteActorRefProvider" + | } + | remote { + | enabled-transports = ["akka.remote.netty.tcp"] + | netty.tcp { + | hostname = "127.0.0.1" + | port = 2553 + | } + | } + |} + """.stripMargin)) + + val RemoteSystemAddress = AddressFromURIString("akka.tcp://remoting-spec-remote-system@127.0.0.1:2553") + + "The Remoting instrumentation" should { + "propagate the TraceContext when creating a new remote actor" in { + TraceRecorder.withNewTraceContext("deploy-remote-actor", Some("deploy-remote-actor-1")) { + system.actorOf(TraceTokenReplier.remoteProps(Some(testActor), RemoteSystemAddress), "remote-deploy-fixture") + } + + expectMsg("name=deploy-remote-actor|token=deploy-remote-actor-1|isOpen=true") + } + + "propagate the TraceContext when sending a message to a remotely deployed actor" in { + val remoteRef = system.actorOf(TraceTokenReplier.remoteProps(None, RemoteSystemAddress), "remote-message-fixture") + + TraceRecorder.withNewTraceContext("message-remote-actor", Some("message-remote-actor-1")) { + remoteRef ! "reply-trace-token" + } + + expectMsg("name=message-remote-actor|token=message-remote-actor-1|isOpen=true") + } + + "propagate the TraceContext when pipe or ask a message to a remotely deployed actor" in { + implicit val ec = system.dispatcher + implicit val askTimeout = Timeout(10 seconds) + val remoteRef = system.actorOf(TraceTokenReplier.remoteProps(None, RemoteSystemAddress), "remote-ask-and-pipe-fixture") + + TraceRecorder.withNewTraceContext("ask-and-pipe-remote-actor", Some("ask-and-pipe-remote-actor-1")) { + (remoteRef ? "reply-trace-token") pipeTo (testActor) + } + + expectMsg("name=ask-and-pipe-remote-actor|token=ask-and-pipe-remote-actor-1|isOpen=true") + } + + "propagate the TraceContext when sending a message to an ActorSelection" in { + remoteSystem.actorOf(TraceTokenReplier.props(None), "actor-selection-target-a") + remoteSystem.actorOf(TraceTokenReplier.props(None), "actor-selection-target-b") + val selection = system.actorSelection(RemoteSystemAddress + "/user/actor-selection-target-*") + + TraceRecorder.withNewTraceContext("message-remote-actor-selection", Some("message-remote-actor-selection-1")) { + selection ! "reply-trace-token" + } + + // one for each selected actor + expectMsg("name=message-remote-actor-selection|token=message-remote-actor-selection-1|isOpen=true") + expectMsg("name=message-remote-actor-selection|token=message-remote-actor-selection-1|isOpen=true") + } + + "propagate the TraceContext a remotely supervised child fails" in { + val supervisor = system.actorOf(Props(new SupervisorOfRemote(testActor, RemoteSystemAddress))) + + TraceRecorder.withNewTraceContext("remote-supervision", Some("remote-supervision-1")) { + supervisor ! "fail" + } + + expectMsg("name=remote-supervision|token=remote-supervision-1|isOpen=true") + } + + "propagate the TraceContext when sending messages to remote routees of a router" in { + remoteSystem.actorOf(TraceTokenReplier.props(None), "remote-routee") + val router = system.actorOf(RoundRobinGroup(List(RemoteSystemAddress + "/user/actor-selection-target-*")).props(), "router") + + TraceRecorder.withNewTraceContext("remote-routee", Some("remote-routee-1")) { + router ! "reply-trace-token" + } + + expectMsg("name=remote-routee|token=remote-routee-1|isOpen=true") + } + } + +} + +class TraceTokenReplier(creationTraceContextListener: Option[ActorRef]) extends Actor with ActorLogging { + creationTraceContextListener map { recipient ⇒ + recipient ! currentTraceContextInfo + } + + def receive = { + case "fail" ⇒ + 1 / 0 + case "reply-trace-token" ⇒ + log.info("Sending back the TT: " + TraceRecorder.currentContext.map(_.token).getOrElse("unavailable")) + sender ! currentTraceContextInfo + } + + def currentTraceContextInfo: String = { + TraceRecorder.currentContext.map { context ⇒ + s"name=${context.name}|token=${context.token}|isOpen=${context.isOpen}" + }.getOrElse("unavailable") + } +} + +object TraceTokenReplier { + def props(creationTraceContextListener: Option[ActorRef]): Props = + Props(new TraceTokenReplier(creationTraceContextListener)) + + def remoteProps(creationTraceContextListener: Option[ActorRef], remoteAddress: Address): Props = { + Props(new TraceTokenReplier(creationTraceContextListener)) + .withDeploy(Deploy(scope = RemoteScope(remoteAddress))) + } +} + +class SupervisorOfRemote(traceContextListener: ActorRef, remoteAddress: Address) extends Actor { + val supervisedChild = context.actorOf(TraceTokenReplier.remoteProps(None, remoteAddress), "remotely-supervised-child") + + def receive = { + case "fail" ⇒ supervisedChild ! "fail" + } + + override def supervisorStrategy: SupervisorStrategy = OneForOneStrategy() { + case NonFatal(throwable) ⇒ + traceContextListener ! currentTraceContextInfo + Resume + } + + def currentTraceContextInfo: String = { + TraceRecorder.currentContext.map { context ⇒ + s"name=${context.name}|token=${context.token}|isOpen=${context.isOpen}" + }.getOrElse("unavailable") + } +} |