+ implements akka.stream.remote.StreamRefContainers.SourceRefOrBuilder {
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_SourceRef_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_SourceRef_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.SourceRef.class, akka.stream.remote.StreamRefContainers.SourceRef.Builder.class);
+ }
+
+ // Construct using akka.stream.remote.StreamRefContainers.SourceRef.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getOriginRefFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (originRefBuilder_ == null) {
+ originRef_ = akka.stream.remote.StreamRefContainers.ActorRef.getDefaultInstance();
+ } else {
+ originRefBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public akka.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return akka.stream.remote.StreamRefContainers.internal_static_SourceRef_descriptor;
+ }
+
+ public akka.stream.remote.StreamRefContainers.SourceRef getDefaultInstanceForType() {
+ return akka.stream.remote.StreamRefContainers.SourceRef.getDefaultInstance();
+ }
+
+ public akka.stream.remote.StreamRefContainers.SourceRef build() {
+ akka.stream.remote.StreamRefContainers.SourceRef result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public akka.stream.remote.StreamRefContainers.SourceRef buildPartial() {
+ akka.stream.remote.StreamRefContainers.SourceRef result = new akka.stream.remote.StreamRefContainers.SourceRef(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (originRefBuilder_ == null) {
+ result.originRef_ = originRef_;
+ } else {
+ result.originRef_ = originRefBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(akka.protobuf.Message other) {
+ if (other instanceof akka.stream.remote.StreamRefContainers.SourceRef) {
+ return mergeFrom((akka.stream.remote.StreamRefContainers.SourceRef)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(akka.stream.remote.StreamRefContainers.SourceRef other) {
+ if (other == akka.stream.remote.StreamRefContainers.SourceRef.getDefaultInstance()) return this;
+ if (other.hasOriginRef()) {
+ mergeOriginRef(other.getOriginRef());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasOriginRef()) {
+
+ return false;
+ }
+ if (!getOriginRef().isInitialized()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ akka.stream.remote.StreamRefContainers.SourceRef parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (akka.stream.remote.StreamRefContainers.SourceRef) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required .ActorRef originRef = 1;
+ private akka.stream.remote.StreamRefContainers.ActorRef originRef_ = akka.stream.remote.StreamRefContainers.ActorRef.getDefaultInstance();
+ private akka.protobuf.SingleFieldBuilder<
+ akka.stream.remote.StreamRefContainers.ActorRef, akka.stream.remote.StreamRefContainers.ActorRef.Builder, akka.stream.remote.StreamRefContainers.ActorRefOrBuilder> originRefBuilder_;
+ /**
+ * required .ActorRef originRef = 1;
+ *
+ *
+ * FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ * FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+ *
+ */
+ public boolean hasOriginRef() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required .ActorRef originRef = 1;
+ *
+ *
+ * FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ * FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+ *
+ */
+ public akka.stream.remote.StreamRefContainers.ActorRef getOriginRef() {
+ if (originRefBuilder_ == null) {
+ return originRef_;
+ } else {
+ return originRefBuilder_.getMessage();
+ }
+ }
+ /**
+ * required .ActorRef originRef = 1;
+ *
+ *
+ * FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ * FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+ *
+ */
+ public Builder setOriginRef(akka.stream.remote.StreamRefContainers.ActorRef value) {
+ if (originRefBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ originRef_ = value;
+ onChanged();
+ } else {
+ originRefBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * required .ActorRef originRef = 1;
+ *
+ *
+ * FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ * FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+ *
+ */
+ public Builder setOriginRef(
+ akka.stream.remote.StreamRefContainers.ActorRef.Builder builderForValue) {
+ if (originRefBuilder_ == null) {
+ originRef_ = builderForValue.build();
+ onChanged();
+ } else {
+ originRefBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * required .ActorRef originRef = 1;
+ *
+ *
+ * FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ * FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+ *
+ */
+ public Builder mergeOriginRef(akka.stream.remote.StreamRefContainers.ActorRef value) {
+ if (originRefBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ originRef_ != akka.stream.remote.StreamRefContainers.ActorRef.getDefaultInstance()) {
+ originRef_ =
+ akka.stream.remote.StreamRefContainers.ActorRef.newBuilder(originRef_).mergeFrom(value).buildPartial();
+ } else {
+ originRef_ = value;
+ }
+ onChanged();
+ } else {
+ originRefBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * required .ActorRef originRef = 1;
+ *
+ *
+ * FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ * FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+ *
+ */
+ public Builder clearOriginRef() {
+ if (originRefBuilder_ == null) {
+ originRef_ = akka.stream.remote.StreamRefContainers.ActorRef.getDefaultInstance();
+ onChanged();
+ } else {
+ originRefBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * required .ActorRef originRef = 1;
+ *
+ *
+ * FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ * FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+ *
+ */
+ public akka.stream.remote.StreamRefContainers.ActorRef.Builder getOriginRefBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getOriginRefFieldBuilder().getBuilder();
+ }
+ /**
+ * required .ActorRef originRef = 1;
+ *
+ *
+ * FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ * FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+ *
+ */
+ public akka.stream.remote.StreamRefContainers.ActorRefOrBuilder getOriginRefOrBuilder() {
+ if (originRefBuilder_ != null) {
+ return originRefBuilder_.getMessageOrBuilder();
+ } else {
+ return originRef_;
+ }
+ }
+ /**
+ * required .ActorRef originRef = 1;
+ *
+ *
+ * FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ * FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+ *
+ */
+ private akka.protobuf.SingleFieldBuilder<
+ akka.stream.remote.StreamRefContainers.ActorRef, akka.stream.remote.StreamRefContainers.ActorRef.Builder, akka.stream.remote.StreamRefContainers.ActorRefOrBuilder>
+ getOriginRefFieldBuilder() {
+ if (originRefBuilder_ == null) {
+ originRefBuilder_ = new akka.protobuf.SingleFieldBuilder<
+ akka.stream.remote.StreamRefContainers.ActorRef, akka.stream.remote.StreamRefContainers.ActorRef.Builder, akka.stream.remote.StreamRefContainers.ActorRefOrBuilder>(
+ originRef_,
+ getParentForChildren(),
+ isClean());
+ originRef_ = null;
+ }
+ return originRefBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:SourceRef)
+ }
+
+ static {
+ defaultInstance = new SourceRef(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:SourceRef)
+ }
+
+ public interface ActorRefOrBuilder
+ extends akka.protobuf.MessageOrBuilder {
+
+ // required string path = 1;
+ /**
+ * required string path = 1;
+ */
+ boolean hasPath();
+ /**
+ * required string path = 1;
+ */
+ java.lang.String getPath();
+ /**
+ * required string path = 1;
+ */
+ akka.protobuf.ByteString
+ getPathBytes();
+ }
+ /**
+ * Protobuf type {@code ActorRef}
+ */
+ public static final class ActorRef extends
+ akka.protobuf.GeneratedMessage
+ implements ActorRefOrBuilder {
+ // Use ActorRef.newBuilder() to construct.
+ private ActorRef(akka.protobuf.GeneratedMessage.Builder> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private ActorRef(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final ActorRef defaultInstance;
+ public static ActorRef getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public ActorRef getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final akka.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final akka.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private ActorRef(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ akka.protobuf.UnknownFieldSet.Builder unknownFields =
+ akka.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;
+ path_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new akka.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_ActorRef_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_ActorRef_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.ActorRef.class, akka.stream.remote.StreamRefContainers.ActorRef.Builder.class);
+ }
+
+ public static akka.protobuf.Parser PARSER =
+ new akka.protobuf.AbstractParser() {
+ public ActorRef parsePartialFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return new ActorRef(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public akka.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string path = 1;
+ public static final int PATH_FIELD_NUMBER = 1;
+ private java.lang.Object path_;
+ /**
+ * required string path = 1;
+ */
+ public boolean hasPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required string path = 1;
+ */
+ public java.lang.String getPath() {
+ java.lang.Object ref = path_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ akka.protobuf.ByteString bs =
+ (akka.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ path_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * required string path = 1;
+ */
+ public akka.protobuf.ByteString
+ getPathBytes() {
+ java.lang.Object ref = path_;
+ if (ref instanceof java.lang.String) {
+ akka.protobuf.ByteString b =
+ akka.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ path_ = b;
+ return b;
+ } else {
+ return (akka.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ path_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasPath()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(akka.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getPathBytes());
+ }
+ 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 += akka.protobuf.CodedOutputStream
+ .computeBytesSize(1, getPathBytes());
+ }
+ 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.stream.remote.StreamRefContainers.ActorRef parseFrom(
+ akka.protobuf.ByteString data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.ActorRef parseFrom(
+ akka.protobuf.ByteString data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.ActorRef parseFrom(byte[] data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.ActorRef parseFrom(
+ byte[] data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.ActorRef parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.ActorRef parseFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.ActorRef parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.ActorRef parseDelimitedFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.ActorRef parseFrom(
+ akka.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.ActorRef parseFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.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.stream.remote.StreamRefContainers.ActorRef prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code ActorRef}
+ */
+ public static final class Builder extends
+ akka.protobuf.GeneratedMessage.Builder
+ implements akka.stream.remote.StreamRefContainers.ActorRefOrBuilder {
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_ActorRef_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_ActorRef_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.ActorRef.class, akka.stream.remote.StreamRefContainers.ActorRef.Builder.class);
+ }
+
+ // Construct using akka.stream.remote.StreamRefContainers.ActorRef.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ path_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public akka.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return akka.stream.remote.StreamRefContainers.internal_static_ActorRef_descriptor;
+ }
+
+ public akka.stream.remote.StreamRefContainers.ActorRef getDefaultInstanceForType() {
+ return akka.stream.remote.StreamRefContainers.ActorRef.getDefaultInstance();
+ }
+
+ public akka.stream.remote.StreamRefContainers.ActorRef build() {
+ akka.stream.remote.StreamRefContainers.ActorRef result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public akka.stream.remote.StreamRefContainers.ActorRef buildPartial() {
+ akka.stream.remote.StreamRefContainers.ActorRef result = new akka.stream.remote.StreamRefContainers.ActorRef(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.path_ = path_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(akka.protobuf.Message other) {
+ if (other instanceof akka.stream.remote.StreamRefContainers.ActorRef) {
+ return mergeFrom((akka.stream.remote.StreamRefContainers.ActorRef)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(akka.stream.remote.StreamRefContainers.ActorRef other) {
+ if (other == akka.stream.remote.StreamRefContainers.ActorRef.getDefaultInstance()) return this;
+ if (other.hasPath()) {
+ bitField0_ |= 0x00000001;
+ path_ = other.path_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasPath()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ akka.stream.remote.StreamRefContainers.ActorRef parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (akka.stream.remote.StreamRefContainers.ActorRef) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string path = 1;
+ private java.lang.Object path_ = "";
+ /**
+ * required string path = 1;
+ */
+ public boolean hasPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required string path = 1;
+ */
+ public java.lang.String getPath() {
+ java.lang.Object ref = path_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((akka.protobuf.ByteString) ref)
+ .toStringUtf8();
+ path_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * required string path = 1;
+ */
+ public akka.protobuf.ByteString
+ getPathBytes() {
+ java.lang.Object ref = path_;
+ if (ref instanceof String) {
+ akka.protobuf.ByteString b =
+ akka.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ path_ = b;
+ return b;
+ } else {
+ return (akka.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * required string path = 1;
+ */
+ public Builder setPath(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ path_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required string path = 1;
+ */
+ public Builder clearPath() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ path_ = getDefaultInstance().getPath();
+ onChanged();
+ return this;
+ }
+ /**
+ * required string path = 1;
+ */
+ public Builder setPathBytes(
+ akka.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ path_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:ActorRef)
+ }
+
+ static {
+ defaultInstance = new ActorRef(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:ActorRef)
+ }
+
+ public interface OptionOrBuilder
+ extends akka.protobuf.MessageOrBuilder {
+
+ // optional .Payload value = 1;
+ /**
+ * optional .Payload value = 1;
+ */
+ boolean hasValue();
+ /**
+ * optional .Payload value = 1;
+ */
+ akka.stream.remote.StreamRefContainers.Payload getValue();
+ /**
+ * optional .Payload value = 1;
+ */
+ akka.stream.remote.StreamRefContainers.PayloadOrBuilder getValueOrBuilder();
+ }
+ /**
+ * Protobuf type {@code Option}
+ */
+ public static final class Option extends
+ akka.protobuf.GeneratedMessage
+ implements OptionOrBuilder {
+ // Use Option.newBuilder() to construct.
+ private Option(akka.protobuf.GeneratedMessage.Builder> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Option(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Option defaultInstance;
+ public static Option getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Option getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final akka.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final akka.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Option(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ akka.protobuf.UnknownFieldSet.Builder unknownFields =
+ akka.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.stream.remote.StreamRefContainers.Payload.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = value_.toBuilder();
+ }
+ value_ = input.readMessage(akka.stream.remote.StreamRefContainers.Payload.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(value_);
+ value_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ }
+ }
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new akka.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Option_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Option_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.Option.class, akka.stream.remote.StreamRefContainers.Option.Builder.class);
+ }
+
+ public static akka.protobuf.Parser PARSER =
+ new akka.protobuf.AbstractParser () {
+ public Option parsePartialFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return new Option(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public akka.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional .Payload value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private akka.stream.remote.StreamRefContainers.Payload value_;
+ /**
+ * optional .Payload value = 1;
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ public akka.stream.remote.StreamRefContainers.Payload getValue() {
+ return value_;
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ public akka.stream.remote.StreamRefContainers.PayloadOrBuilder getValueOrBuilder() {
+ return value_;
+ }
+
+ private void initFields() {
+ value_ = akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (hasValue()) {
+ if (!getValue().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(akka.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, value_);
+ }
+ 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 += akka.protobuf.CodedOutputStream
+ .computeMessageSize(1, value_);
+ }
+ 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.stream.remote.StreamRefContainers.Option parseFrom(
+ akka.protobuf.ByteString data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.Option parseFrom(
+ akka.protobuf.ByteString data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.Option parseFrom(byte[] data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.Option parseFrom(
+ byte[] data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.Option parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.Option parseFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.Option parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.Option parseDelimitedFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.Option parseFrom(
+ akka.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.Option parseFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.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.stream.remote.StreamRefContainers.Option prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code Option}
+ */
+ public static final class Builder extends
+ akka.protobuf.GeneratedMessage.Builder
+ implements akka.stream.remote.StreamRefContainers.OptionOrBuilder {
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Option_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Option_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.Option.class, akka.stream.remote.StreamRefContainers.Option.Builder.class);
+ }
+
+ // Construct using akka.stream.remote.StreamRefContainers.Option.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getValueFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (valueBuilder_ == null) {
+ value_ = akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance();
+ } else {
+ valueBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public akka.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Option_descriptor;
+ }
+
+ public akka.stream.remote.StreamRefContainers.Option getDefaultInstanceForType() {
+ return akka.stream.remote.StreamRefContainers.Option.getDefaultInstance();
+ }
+
+ public akka.stream.remote.StreamRefContainers.Option build() {
+ akka.stream.remote.StreamRefContainers.Option result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public akka.stream.remote.StreamRefContainers.Option buildPartial() {
+ akka.stream.remote.StreamRefContainers.Option result = new akka.stream.remote.StreamRefContainers.Option(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (valueBuilder_ == null) {
+ result.value_ = value_;
+ } else {
+ result.value_ = valueBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(akka.protobuf.Message other) {
+ if (other instanceof akka.stream.remote.StreamRefContainers.Option) {
+ return mergeFrom((akka.stream.remote.StreamRefContainers.Option)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(akka.stream.remote.StreamRefContainers.Option other) {
+ if (other == akka.stream.remote.StreamRefContainers.Option.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ mergeValue(other.getValue());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (hasValue()) {
+ if (!getValue().isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ akka.stream.remote.StreamRefContainers.Option parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (akka.stream.remote.StreamRefContainers.Option) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional .Payload value = 1;
+ private akka.stream.remote.StreamRefContainers.Payload value_ = akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance();
+ private akka.protobuf.SingleFieldBuilder<
+ akka.stream.remote.StreamRefContainers.Payload, akka.stream.remote.StreamRefContainers.Payload.Builder, akka.stream.remote.StreamRefContainers.PayloadOrBuilder> valueBuilder_;
+ /**
+ * optional .Payload value = 1;
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ public akka.stream.remote.StreamRefContainers.Payload getValue() {
+ if (valueBuilder_ == null) {
+ return value_;
+ } else {
+ return valueBuilder_.getMessage();
+ }
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ public Builder setValue(akka.stream.remote.StreamRefContainers.Payload value) {
+ if (valueBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ value_ = value;
+ onChanged();
+ } else {
+ valueBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ public Builder setValue(
+ akka.stream.remote.StreamRefContainers.Payload.Builder builderForValue) {
+ if (valueBuilder_ == null) {
+ value_ = builderForValue.build();
+ onChanged();
+ } else {
+ valueBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ public Builder mergeValue(akka.stream.remote.StreamRefContainers.Payload value) {
+ if (valueBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ value_ != akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance()) {
+ value_ =
+ akka.stream.remote.StreamRefContainers.Payload.newBuilder(value_).mergeFrom(value).buildPartial();
+ } else {
+ value_ = value;
+ }
+ onChanged();
+ } else {
+ valueBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ public Builder clearValue() {
+ if (valueBuilder_ == null) {
+ value_ = akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance();
+ onChanged();
+ } else {
+ valueBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ public akka.stream.remote.StreamRefContainers.Payload.Builder getValueBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getValueFieldBuilder().getBuilder();
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ public akka.stream.remote.StreamRefContainers.PayloadOrBuilder getValueOrBuilder() {
+ if (valueBuilder_ != null) {
+ return valueBuilder_.getMessageOrBuilder();
+ } else {
+ return value_;
+ }
+ }
+ /**
+ * optional .Payload value = 1;
+ */
+ private akka.protobuf.SingleFieldBuilder<
+ akka.stream.remote.StreamRefContainers.Payload, akka.stream.remote.StreamRefContainers.Payload.Builder, akka.stream.remote.StreamRefContainers.PayloadOrBuilder>
+ getValueFieldBuilder() {
+ if (valueBuilder_ == null) {
+ valueBuilder_ = new akka.protobuf.SingleFieldBuilder<
+ akka.stream.remote.StreamRefContainers.Payload, akka.stream.remote.StreamRefContainers.Payload.Builder, akka.stream.remote.StreamRefContainers.PayloadOrBuilder>(
+ value_,
+ getParentForChildren(),
+ isClean());
+ value_ = null;
+ }
+ return valueBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:Option)
+ }
+
+ static {
+ defaultInstance = new Option(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:Option)
+ }
+
+ public interface PayloadOrBuilder
+ extends akka.protobuf.MessageOrBuilder {
+
+ // required bytes enclosedMessage = 1;
+ /**
+ * required bytes enclosedMessage = 1;
+ */
+ boolean hasEnclosedMessage();
+ /**
+ * required bytes enclosedMessage = 1;
+ */
+ akka.protobuf.ByteString getEnclosedMessage();
+
+ // required int32 serializerId = 2;
+ /**
+ * required int32 serializerId = 2;
+ */
+ boolean hasSerializerId();
+ /**
+ * required int32 serializerId = 2;
+ */
+ int getSerializerId();
+
+ // optional bytes messageManifest = 4;
+ /**
+ * optional bytes messageManifest = 4;
+ */
+ boolean hasMessageManifest();
+ /**
+ * optional bytes messageManifest = 4;
+ */
+ akka.protobuf.ByteString getMessageManifest();
+ }
+ /**
+ * Protobuf type {@code Payload}
+ */
+ public static final class Payload extends
+ akka.protobuf.GeneratedMessage
+ implements PayloadOrBuilder {
+ // Use Payload.newBuilder() to construct.
+ private Payload(akka.protobuf.GeneratedMessage.Builder> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Payload(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Payload defaultInstance;
+ public static Payload getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Payload getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final akka.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final akka.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Payload(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ akka.protobuf.UnknownFieldSet.Builder unknownFields =
+ akka.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;
+ enclosedMessage_ = input.readBytes();
+ break;
+ }
+ case 16: {
+ bitField0_ |= 0x00000002;
+ serializerId_ = input.readInt32();
+ break;
+ }
+ case 34: {
+ bitField0_ |= 0x00000004;
+ messageManifest_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new akka.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Payload_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Payload_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.Payload.class, akka.stream.remote.StreamRefContainers.Payload.Builder.class);
+ }
+
+ public static akka.protobuf.Parser PARSER =
+ new akka.protobuf.AbstractParser() {
+ public Payload parsePartialFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return new Payload(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public akka.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required bytes enclosedMessage = 1;
+ public static final int ENCLOSEDMESSAGE_FIELD_NUMBER = 1;
+ private akka.protobuf.ByteString enclosedMessage_;
+ /**
+ * required bytes enclosedMessage = 1;
+ */
+ public boolean hasEnclosedMessage() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required bytes enclosedMessage = 1;
+ */
+ public akka.protobuf.ByteString getEnclosedMessage() {
+ return enclosedMessage_;
+ }
+
+ // required int32 serializerId = 2;
+ public static final int SERIALIZERID_FIELD_NUMBER = 2;
+ private int serializerId_;
+ /**
+ * required int32 serializerId = 2;
+ */
+ public boolean hasSerializerId() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * required int32 serializerId = 2;
+ */
+ public int getSerializerId() {
+ return serializerId_;
+ }
+
+ // optional bytes messageManifest = 4;
+ public static final int MESSAGEMANIFEST_FIELD_NUMBER = 4;
+ private akka.protobuf.ByteString messageManifest_;
+ /**
+ * optional bytes messageManifest = 4;
+ */
+ public boolean hasMessageManifest() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * optional bytes messageManifest = 4;
+ */
+ public akka.protobuf.ByteString getMessageManifest() {
+ return messageManifest_;
+ }
+
+ private void initFields() {
+ enclosedMessage_ = akka.protobuf.ByteString.EMPTY;
+ serializerId_ = 0;
+ messageManifest_ = akka.protobuf.ByteString.EMPTY;
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasEnclosedMessage()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasSerializerId()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(akka.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, enclosedMessage_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeInt32(2, serializerId_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeBytes(4, messageManifest_);
+ }
+ 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 += akka.protobuf.CodedOutputStream
+ .computeBytesSize(1, enclosedMessage_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += akka.protobuf.CodedOutputStream
+ .computeInt32Size(2, serializerId_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += akka.protobuf.CodedOutputStream
+ .computeBytesSize(4, messageManifest_);
+ }
+ 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.stream.remote.StreamRefContainers.Payload parseFrom(
+ akka.protobuf.ByteString data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.Payload parseFrom(
+ akka.protobuf.ByteString data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.Payload parseFrom(byte[] data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.Payload parseFrom(
+ byte[] data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.Payload parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.Payload parseFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.Payload parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.Payload parseDelimitedFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.Payload parseFrom(
+ akka.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.Payload parseFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.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.stream.remote.StreamRefContainers.Payload prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code Payload}
+ */
+ public static final class Builder extends
+ akka.protobuf.GeneratedMessage.Builder
+ implements akka.stream.remote.StreamRefContainers.PayloadOrBuilder {
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Payload_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Payload_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.Payload.class, akka.stream.remote.StreamRefContainers.Payload.Builder.class);
+ }
+
+ // Construct using akka.stream.remote.StreamRefContainers.Payload.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ enclosedMessage_ = akka.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ serializerId_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ messageManifest_ = akka.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public akka.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return akka.stream.remote.StreamRefContainers.internal_static_Payload_descriptor;
+ }
+
+ public akka.stream.remote.StreamRefContainers.Payload getDefaultInstanceForType() {
+ return akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance();
+ }
+
+ public akka.stream.remote.StreamRefContainers.Payload build() {
+ akka.stream.remote.StreamRefContainers.Payload result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public akka.stream.remote.StreamRefContainers.Payload buildPartial() {
+ akka.stream.remote.StreamRefContainers.Payload result = new akka.stream.remote.StreamRefContainers.Payload(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.enclosedMessage_ = enclosedMessage_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.serializerId_ = serializerId_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ result.messageManifest_ = messageManifest_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(akka.protobuf.Message other) {
+ if (other instanceof akka.stream.remote.StreamRefContainers.Payload) {
+ return mergeFrom((akka.stream.remote.StreamRefContainers.Payload)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(akka.stream.remote.StreamRefContainers.Payload other) {
+ if (other == akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance()) return this;
+ if (other.hasEnclosedMessage()) {
+ setEnclosedMessage(other.getEnclosedMessage());
+ }
+ if (other.hasSerializerId()) {
+ setSerializerId(other.getSerializerId());
+ }
+ if (other.hasMessageManifest()) {
+ setMessageManifest(other.getMessageManifest());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasEnclosedMessage()) {
+
+ return false;
+ }
+ if (!hasSerializerId()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ akka.stream.remote.StreamRefContainers.Payload parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (akka.stream.remote.StreamRefContainers.Payload) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required bytes enclosedMessage = 1;
+ private akka.protobuf.ByteString enclosedMessage_ = akka.protobuf.ByteString.EMPTY;
+ /**
+ * required bytes enclosedMessage = 1;
+ */
+ public boolean hasEnclosedMessage() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required bytes enclosedMessage = 1;
+ */
+ public akka.protobuf.ByteString getEnclosedMessage() {
+ return enclosedMessage_;
+ }
+ /**
+ * required bytes enclosedMessage = 1;
+ */
+ public Builder setEnclosedMessage(akka.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ enclosedMessage_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required bytes enclosedMessage = 1;
+ */
+ public Builder clearEnclosedMessage() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ enclosedMessage_ = getDefaultInstance().getEnclosedMessage();
+ onChanged();
+ return this;
+ }
+
+ // required int32 serializerId = 2;
+ private int serializerId_ ;
+ /**
+ * required int32 serializerId = 2;
+ */
+ public boolean hasSerializerId() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * required int32 serializerId = 2;
+ */
+ public int getSerializerId() {
+ return serializerId_;
+ }
+ /**
+ * required int32 serializerId = 2;
+ */
+ public Builder setSerializerId(int value) {
+ bitField0_ |= 0x00000002;
+ serializerId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required int32 serializerId = 2;
+ */
+ public Builder clearSerializerId() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ serializerId_ = 0;
+ onChanged();
+ return this;
+ }
+
+ // optional bytes messageManifest = 4;
+ private akka.protobuf.ByteString messageManifest_ = akka.protobuf.ByteString.EMPTY;
+ /**
+ * optional bytes messageManifest = 4;
+ */
+ public boolean hasMessageManifest() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * optional bytes messageManifest = 4;
+ */
+ public akka.protobuf.ByteString getMessageManifest() {
+ return messageManifest_;
+ }
+ /**
+ * optional bytes messageManifest = 4;
+ */
+ public Builder setMessageManifest(akka.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ messageManifest_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * optional bytes messageManifest = 4;
+ */
+ public Builder clearMessageManifest() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ messageManifest_ = getDefaultInstance().getMessageManifest();
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:Payload)
+ }
+
+ static {
+ defaultInstance = new Payload(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:Payload)
+ }
+
+ public interface CumulativeDemandOrBuilder
+ extends akka.protobuf.MessageOrBuilder {
+
+ // required int64 seqNr = 1;
+ /**
+ * required int64 seqNr = 1;
+ */
+ boolean hasSeqNr();
+ /**
+ * required int64 seqNr = 1;
+ */
+ long getSeqNr();
+ }
+ /**
+ * Protobuf type {@code CumulativeDemand}
+ */
+ public static final class CumulativeDemand extends
+ akka.protobuf.GeneratedMessage
+ implements CumulativeDemandOrBuilder {
+ // Use CumulativeDemand.newBuilder() to construct.
+ private CumulativeDemand(akka.protobuf.GeneratedMessage.Builder> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private CumulativeDemand(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final CumulativeDemand defaultInstance;
+ public static CumulativeDemand getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public CumulativeDemand getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final akka.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final akka.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private CumulativeDemand(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ akka.protobuf.UnknownFieldSet.Builder unknownFields =
+ akka.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 8: {
+ bitField0_ |= 0x00000001;
+ seqNr_ = input.readInt64();
+ break;
+ }
+ }
+ }
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new akka.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_CumulativeDemand_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_CumulativeDemand_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.CumulativeDemand.class, akka.stream.remote.StreamRefContainers.CumulativeDemand.Builder.class);
+ }
+
+ public static akka.protobuf.Parser PARSER =
+ new akka.protobuf.AbstractParser() {
+ public CumulativeDemand parsePartialFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return new CumulativeDemand(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public akka.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required int64 seqNr = 1;
+ public static final int SEQNR_FIELD_NUMBER = 1;
+ private long seqNr_;
+ /**
+ * required int64 seqNr = 1;
+ */
+ public boolean hasSeqNr() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public long getSeqNr() {
+ return seqNr_;
+ }
+
+ private void initFields() {
+ seqNr_ = 0L;
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasSeqNr()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(akka.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeInt64(1, seqNr_);
+ }
+ 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 += akka.protobuf.CodedOutputStream
+ .computeInt64Size(1, seqNr_);
+ }
+ 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.stream.remote.StreamRefContainers.CumulativeDemand parseFrom(
+ akka.protobuf.ByteString data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.CumulativeDemand parseFrom(
+ akka.protobuf.ByteString data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.CumulativeDemand parseFrom(byte[] data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.CumulativeDemand parseFrom(
+ byte[] data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.CumulativeDemand parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.CumulativeDemand parseFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.CumulativeDemand parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.CumulativeDemand parseDelimitedFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.CumulativeDemand parseFrom(
+ akka.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.CumulativeDemand parseFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.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.stream.remote.StreamRefContainers.CumulativeDemand prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code CumulativeDemand}
+ */
+ public static final class Builder extends
+ akka.protobuf.GeneratedMessage.Builder
+ implements akka.stream.remote.StreamRefContainers.CumulativeDemandOrBuilder {
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_CumulativeDemand_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_CumulativeDemand_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.CumulativeDemand.class, akka.stream.remote.StreamRefContainers.CumulativeDemand.Builder.class);
+ }
+
+ // Construct using akka.stream.remote.StreamRefContainers.CumulativeDemand.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ seqNr_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public akka.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return akka.stream.remote.StreamRefContainers.internal_static_CumulativeDemand_descriptor;
+ }
+
+ public akka.stream.remote.StreamRefContainers.CumulativeDemand getDefaultInstanceForType() {
+ return akka.stream.remote.StreamRefContainers.CumulativeDemand.getDefaultInstance();
+ }
+
+ public akka.stream.remote.StreamRefContainers.CumulativeDemand build() {
+ akka.stream.remote.StreamRefContainers.CumulativeDemand result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public akka.stream.remote.StreamRefContainers.CumulativeDemand buildPartial() {
+ akka.stream.remote.StreamRefContainers.CumulativeDemand result = new akka.stream.remote.StreamRefContainers.CumulativeDemand(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.seqNr_ = seqNr_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(akka.protobuf.Message other) {
+ if (other instanceof akka.stream.remote.StreamRefContainers.CumulativeDemand) {
+ return mergeFrom((akka.stream.remote.StreamRefContainers.CumulativeDemand)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(akka.stream.remote.StreamRefContainers.CumulativeDemand other) {
+ if (other == akka.stream.remote.StreamRefContainers.CumulativeDemand.getDefaultInstance()) return this;
+ if (other.hasSeqNr()) {
+ setSeqNr(other.getSeqNr());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasSeqNr()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ akka.stream.remote.StreamRefContainers.CumulativeDemand parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (akka.stream.remote.StreamRefContainers.CumulativeDemand) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required int64 seqNr = 1;
+ private long seqNr_ ;
+ /**
+ * required int64 seqNr = 1;
+ */
+ public boolean hasSeqNr() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public long getSeqNr() {
+ return seqNr_;
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public Builder setSeqNr(long value) {
+ bitField0_ |= 0x00000001;
+ seqNr_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public Builder clearSeqNr() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ seqNr_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:CumulativeDemand)
+ }
+
+ static {
+ defaultInstance = new CumulativeDemand(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:CumulativeDemand)
+ }
+
+ public interface SequencedOnNextOrBuilder
+ extends akka.protobuf.MessageOrBuilder {
+
+ // required int64 seqNr = 1;
+ /**
+ * required int64 seqNr = 1;
+ */
+ boolean hasSeqNr();
+ /**
+ * required int64 seqNr = 1;
+ */
+ long getSeqNr();
+
+ // required .Payload payload = 2;
+ /**
+ * required .Payload payload = 2;
+ */
+ boolean hasPayload();
+ /**
+ * required .Payload payload = 2;
+ */
+ akka.stream.remote.StreamRefContainers.Payload getPayload();
+ /**
+ * required .Payload payload = 2;
+ */
+ akka.stream.remote.StreamRefContainers.PayloadOrBuilder getPayloadOrBuilder();
+ }
+ /**
+ * Protobuf type {@code SequencedOnNext}
+ */
+ public static final class SequencedOnNext extends
+ akka.protobuf.GeneratedMessage
+ implements SequencedOnNextOrBuilder {
+ // Use SequencedOnNext.newBuilder() to construct.
+ private SequencedOnNext(akka.protobuf.GeneratedMessage.Builder> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private SequencedOnNext(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final SequencedOnNext defaultInstance;
+ public static SequencedOnNext getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public SequencedOnNext getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final akka.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final akka.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private SequencedOnNext(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ akka.protobuf.UnknownFieldSet.Builder unknownFields =
+ akka.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 8: {
+ bitField0_ |= 0x00000001;
+ seqNr_ = input.readInt64();
+ break;
+ }
+ case 18: {
+ akka.stream.remote.StreamRefContainers.Payload.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = payload_.toBuilder();
+ }
+ payload_ = input.readMessage(akka.stream.remote.StreamRefContainers.Payload.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(payload_);
+ payload_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ }
+ }
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new akka.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_SequencedOnNext_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_SequencedOnNext_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.SequencedOnNext.class, akka.stream.remote.StreamRefContainers.SequencedOnNext.Builder.class);
+ }
+
+ public static akka.protobuf.Parser PARSER =
+ new akka.protobuf.AbstractParser() {
+ public SequencedOnNext parsePartialFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return new SequencedOnNext(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public akka.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required int64 seqNr = 1;
+ public static final int SEQNR_FIELD_NUMBER = 1;
+ private long seqNr_;
+ /**
+ * required int64 seqNr = 1;
+ */
+ public boolean hasSeqNr() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public long getSeqNr() {
+ return seqNr_;
+ }
+
+ // required .Payload payload = 2;
+ public static final int PAYLOAD_FIELD_NUMBER = 2;
+ private akka.stream.remote.StreamRefContainers.Payload payload_;
+ /**
+ * required .Payload payload = 2;
+ */
+ public boolean hasPayload() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ public akka.stream.remote.StreamRefContainers.Payload getPayload() {
+ return payload_;
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ public akka.stream.remote.StreamRefContainers.PayloadOrBuilder getPayloadOrBuilder() {
+ return payload_;
+ }
+
+ private void initFields() {
+ seqNr_ = 0L;
+ payload_ = akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasSeqNr()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasPayload()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getPayload().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(akka.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeInt64(1, seqNr_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, payload_);
+ }
+ 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 += akka.protobuf.CodedOutputStream
+ .computeInt64Size(1, seqNr_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += akka.protobuf.CodedOutputStream
+ .computeMessageSize(2, payload_);
+ }
+ 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.stream.remote.StreamRefContainers.SequencedOnNext parseFrom(
+ akka.protobuf.ByteString data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.SequencedOnNext parseFrom(
+ akka.protobuf.ByteString data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.SequencedOnNext parseFrom(byte[] data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.SequencedOnNext parseFrom(
+ byte[] data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.SequencedOnNext parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.SequencedOnNext parseFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.SequencedOnNext parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.SequencedOnNext parseDelimitedFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.SequencedOnNext parseFrom(
+ akka.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.SequencedOnNext parseFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.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.stream.remote.StreamRefContainers.SequencedOnNext prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code SequencedOnNext}
+ */
+ public static final class Builder extends
+ akka.protobuf.GeneratedMessage.Builder
+ implements akka.stream.remote.StreamRefContainers.SequencedOnNextOrBuilder {
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_SequencedOnNext_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_SequencedOnNext_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.SequencedOnNext.class, akka.stream.remote.StreamRefContainers.SequencedOnNext.Builder.class);
+ }
+
+ // Construct using akka.stream.remote.StreamRefContainers.SequencedOnNext.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getPayloadFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ seqNr_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (payloadBuilder_ == null) {
+ payload_ = akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance();
+ } else {
+ payloadBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public akka.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return akka.stream.remote.StreamRefContainers.internal_static_SequencedOnNext_descriptor;
+ }
+
+ public akka.stream.remote.StreamRefContainers.SequencedOnNext getDefaultInstanceForType() {
+ return akka.stream.remote.StreamRefContainers.SequencedOnNext.getDefaultInstance();
+ }
+
+ public akka.stream.remote.StreamRefContainers.SequencedOnNext build() {
+ akka.stream.remote.StreamRefContainers.SequencedOnNext result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public akka.stream.remote.StreamRefContainers.SequencedOnNext buildPartial() {
+ akka.stream.remote.StreamRefContainers.SequencedOnNext result = new akka.stream.remote.StreamRefContainers.SequencedOnNext(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.seqNr_ = seqNr_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ if (payloadBuilder_ == null) {
+ result.payload_ = payload_;
+ } else {
+ result.payload_ = payloadBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(akka.protobuf.Message other) {
+ if (other instanceof akka.stream.remote.StreamRefContainers.SequencedOnNext) {
+ return mergeFrom((akka.stream.remote.StreamRefContainers.SequencedOnNext)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(akka.stream.remote.StreamRefContainers.SequencedOnNext other) {
+ if (other == akka.stream.remote.StreamRefContainers.SequencedOnNext.getDefaultInstance()) return this;
+ if (other.hasSeqNr()) {
+ setSeqNr(other.getSeqNr());
+ }
+ if (other.hasPayload()) {
+ mergePayload(other.getPayload());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasSeqNr()) {
+
+ return false;
+ }
+ if (!hasPayload()) {
+
+ return false;
+ }
+ if (!getPayload().isInitialized()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ akka.stream.remote.StreamRefContainers.SequencedOnNext parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (akka.stream.remote.StreamRefContainers.SequencedOnNext) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required int64 seqNr = 1;
+ private long seqNr_ ;
+ /**
+ * required int64 seqNr = 1;
+ */
+ public boolean hasSeqNr() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public long getSeqNr() {
+ return seqNr_;
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public Builder setSeqNr(long value) {
+ bitField0_ |= 0x00000001;
+ seqNr_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public Builder clearSeqNr() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ seqNr_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ // required .Payload payload = 2;
+ private akka.stream.remote.StreamRefContainers.Payload payload_ = akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance();
+ private akka.protobuf.SingleFieldBuilder<
+ akka.stream.remote.StreamRefContainers.Payload, akka.stream.remote.StreamRefContainers.Payload.Builder, akka.stream.remote.StreamRefContainers.PayloadOrBuilder> payloadBuilder_;
+ /**
+ * required .Payload payload = 2;
+ */
+ public boolean hasPayload() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ public akka.stream.remote.StreamRefContainers.Payload getPayload() {
+ if (payloadBuilder_ == null) {
+ return payload_;
+ } else {
+ return payloadBuilder_.getMessage();
+ }
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ public Builder setPayload(akka.stream.remote.StreamRefContainers.Payload value) {
+ if (payloadBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ payload_ = value;
+ onChanged();
+ } else {
+ payloadBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ public Builder setPayload(
+ akka.stream.remote.StreamRefContainers.Payload.Builder builderForValue) {
+ if (payloadBuilder_ == null) {
+ payload_ = builderForValue.build();
+ onChanged();
+ } else {
+ payloadBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ public Builder mergePayload(akka.stream.remote.StreamRefContainers.Payload value) {
+ if (payloadBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ payload_ != akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance()) {
+ payload_ =
+ akka.stream.remote.StreamRefContainers.Payload.newBuilder(payload_).mergeFrom(value).buildPartial();
+ } else {
+ payload_ = value;
+ }
+ onChanged();
+ } else {
+ payloadBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ public Builder clearPayload() {
+ if (payloadBuilder_ == null) {
+ payload_ = akka.stream.remote.StreamRefContainers.Payload.getDefaultInstance();
+ onChanged();
+ } else {
+ payloadBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ public akka.stream.remote.StreamRefContainers.Payload.Builder getPayloadBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getPayloadFieldBuilder().getBuilder();
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ public akka.stream.remote.StreamRefContainers.PayloadOrBuilder getPayloadOrBuilder() {
+ if (payloadBuilder_ != null) {
+ return payloadBuilder_.getMessageOrBuilder();
+ } else {
+ return payload_;
+ }
+ }
+ /**
+ * required .Payload payload = 2;
+ */
+ private akka.protobuf.SingleFieldBuilder<
+ akka.stream.remote.StreamRefContainers.Payload, akka.stream.remote.StreamRefContainers.Payload.Builder, akka.stream.remote.StreamRefContainers.PayloadOrBuilder>
+ getPayloadFieldBuilder() {
+ if (payloadBuilder_ == null) {
+ payloadBuilder_ = new akka.protobuf.SingleFieldBuilder<
+ akka.stream.remote.StreamRefContainers.Payload, akka.stream.remote.StreamRefContainers.Payload.Builder, akka.stream.remote.StreamRefContainers.PayloadOrBuilder>(
+ payload_,
+ getParentForChildren(),
+ isClean());
+ payload_ = null;
+ }
+ return payloadBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:SequencedOnNext)
+ }
+
+ static {
+ defaultInstance = new SequencedOnNext(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:SequencedOnNext)
+ }
+
+ public interface RemoteSinkFailureOrBuilder
+ extends akka.protobuf.MessageOrBuilder {
+
+ // optional bytes cause = 1;
+ /**
+ * optional bytes cause = 1;
+ */
+ boolean hasCause();
+ /**
+ * optional bytes cause = 1;
+ */
+ akka.protobuf.ByteString getCause();
+ }
+ /**
+ * Protobuf type {@code RemoteSinkFailure}
+ */
+ public static final class RemoteSinkFailure extends
+ akka.protobuf.GeneratedMessage
+ implements RemoteSinkFailureOrBuilder {
+ // Use RemoteSinkFailure.newBuilder() to construct.
+ private RemoteSinkFailure(akka.protobuf.GeneratedMessage.Builder> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private RemoteSinkFailure(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final RemoteSinkFailure defaultInstance;
+ public static RemoteSinkFailure getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public RemoteSinkFailure getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final akka.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final akka.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private RemoteSinkFailure(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ akka.protobuf.UnknownFieldSet.Builder unknownFields =
+ akka.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;
+ cause_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new akka.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkFailure_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkFailure_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.RemoteSinkFailure.class, akka.stream.remote.StreamRefContainers.RemoteSinkFailure.Builder.class);
+ }
+
+ public static akka.protobuf.Parser PARSER =
+ new akka.protobuf.AbstractParser() {
+ public RemoteSinkFailure parsePartialFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return new RemoteSinkFailure(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public akka.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional bytes cause = 1;
+ public static final int CAUSE_FIELD_NUMBER = 1;
+ private akka.protobuf.ByteString cause_;
+ /**
+ * optional bytes cause = 1;
+ */
+ public boolean hasCause() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * optional bytes cause = 1;
+ */
+ public akka.protobuf.ByteString getCause() {
+ return cause_;
+ }
+
+ private void initFields() {
+ cause_ = akka.protobuf.ByteString.EMPTY;
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(akka.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, cause_);
+ }
+ 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 += akka.protobuf.CodedOutputStream
+ .computeBytesSize(1, cause_);
+ }
+ 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.stream.remote.StreamRefContainers.RemoteSinkFailure parseFrom(
+ akka.protobuf.ByteString data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkFailure parseFrom(
+ akka.protobuf.ByteString data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkFailure parseFrom(byte[] data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkFailure parseFrom(
+ byte[] data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkFailure parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkFailure parseFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkFailure parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkFailure parseDelimitedFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkFailure parseFrom(
+ akka.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkFailure parseFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.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.stream.remote.StreamRefContainers.RemoteSinkFailure prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code RemoteSinkFailure}
+ */
+ public static final class Builder extends
+ akka.protobuf.GeneratedMessage.Builder
+ implements akka.stream.remote.StreamRefContainers.RemoteSinkFailureOrBuilder {
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkFailure_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkFailure_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.RemoteSinkFailure.class, akka.stream.remote.StreamRefContainers.RemoteSinkFailure.Builder.class);
+ }
+
+ // Construct using akka.stream.remote.StreamRefContainers.RemoteSinkFailure.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ cause_ = akka.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public akka.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkFailure_descriptor;
+ }
+
+ public akka.stream.remote.StreamRefContainers.RemoteSinkFailure getDefaultInstanceForType() {
+ return akka.stream.remote.StreamRefContainers.RemoteSinkFailure.getDefaultInstance();
+ }
+
+ public akka.stream.remote.StreamRefContainers.RemoteSinkFailure build() {
+ akka.stream.remote.StreamRefContainers.RemoteSinkFailure result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public akka.stream.remote.StreamRefContainers.RemoteSinkFailure buildPartial() {
+ akka.stream.remote.StreamRefContainers.RemoteSinkFailure result = new akka.stream.remote.StreamRefContainers.RemoteSinkFailure(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.cause_ = cause_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(akka.protobuf.Message other) {
+ if (other instanceof akka.stream.remote.StreamRefContainers.RemoteSinkFailure) {
+ return mergeFrom((akka.stream.remote.StreamRefContainers.RemoteSinkFailure)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(akka.stream.remote.StreamRefContainers.RemoteSinkFailure other) {
+ if (other == akka.stream.remote.StreamRefContainers.RemoteSinkFailure.getDefaultInstance()) return this;
+ if (other.hasCause()) {
+ setCause(other.getCause());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ return true;
+ }
+
+ public Builder mergeFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ akka.stream.remote.StreamRefContainers.RemoteSinkFailure parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (akka.stream.remote.StreamRefContainers.RemoteSinkFailure) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional bytes cause = 1;
+ private akka.protobuf.ByteString cause_ = akka.protobuf.ByteString.EMPTY;
+ /**
+ * optional bytes cause = 1;
+ */
+ public boolean hasCause() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * optional bytes cause = 1;
+ */
+ public akka.protobuf.ByteString getCause() {
+ return cause_;
+ }
+ /**
+ * optional bytes cause = 1;
+ */
+ public Builder setCause(akka.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ cause_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * optional bytes cause = 1;
+ */
+ public Builder clearCause() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ cause_ = getDefaultInstance().getCause();
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:RemoteSinkFailure)
+ }
+
+ static {
+ defaultInstance = new RemoteSinkFailure(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:RemoteSinkFailure)
+ }
+
+ public interface RemoteSinkCompletedOrBuilder
+ extends akka.protobuf.MessageOrBuilder {
+
+ // required int64 seqNr = 1;
+ /**
+ * required int64 seqNr = 1;
+ */
+ boolean hasSeqNr();
+ /**
+ * required int64 seqNr = 1;
+ */
+ long getSeqNr();
+ }
+ /**
+ * Protobuf type {@code RemoteSinkCompleted}
+ */
+ public static final class RemoteSinkCompleted extends
+ akka.protobuf.GeneratedMessage
+ implements RemoteSinkCompletedOrBuilder {
+ // Use RemoteSinkCompleted.newBuilder() to construct.
+ private RemoteSinkCompleted(akka.protobuf.GeneratedMessage.Builder> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private RemoteSinkCompleted(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final RemoteSinkCompleted defaultInstance;
+ public static RemoteSinkCompleted getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public RemoteSinkCompleted getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final akka.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final akka.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private RemoteSinkCompleted(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ akka.protobuf.UnknownFieldSet.Builder unknownFields =
+ akka.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 8: {
+ bitField0_ |= 0x00000001;
+ seqNr_ = input.readInt64();
+ break;
+ }
+ }
+ }
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new akka.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkCompleted_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkCompleted_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.RemoteSinkCompleted.class, akka.stream.remote.StreamRefContainers.RemoteSinkCompleted.Builder.class);
+ }
+
+ public static akka.protobuf.Parser PARSER =
+ new akka.protobuf.AbstractParser() {
+ public RemoteSinkCompleted parsePartialFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return new RemoteSinkCompleted(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public akka.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required int64 seqNr = 1;
+ public static final int SEQNR_FIELD_NUMBER = 1;
+ private long seqNr_;
+ /**
+ * required int64 seqNr = 1;
+ */
+ public boolean hasSeqNr() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public long getSeqNr() {
+ return seqNr_;
+ }
+
+ private void initFields() {
+ seqNr_ = 0L;
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasSeqNr()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(akka.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeInt64(1, seqNr_);
+ }
+ 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 += akka.protobuf.CodedOutputStream
+ .computeInt64Size(1, seqNr_);
+ }
+ 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.stream.remote.StreamRefContainers.RemoteSinkCompleted parseFrom(
+ akka.protobuf.ByteString data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parseFrom(
+ akka.protobuf.ByteString data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parseFrom(byte[] data)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parseFrom(
+ byte[] data,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws akka.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parseFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parseDelimitedFrom(
+ java.io.InputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parseFrom(
+ akka.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parseFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.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.stream.remote.StreamRefContainers.RemoteSinkCompleted prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code RemoteSinkCompleted}
+ */
+ public static final class Builder extends
+ akka.protobuf.GeneratedMessage.Builder
+ implements akka.stream.remote.StreamRefContainers.RemoteSinkCompletedOrBuilder {
+ public static final akka.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkCompleted_descriptor;
+ }
+
+ protected akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkCompleted_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ akka.stream.remote.StreamRefContainers.RemoteSinkCompleted.class, akka.stream.remote.StreamRefContainers.RemoteSinkCompleted.Builder.class);
+ }
+
+ // Construct using akka.stream.remote.StreamRefContainers.RemoteSinkCompleted.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ akka.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ seqNr_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public akka.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return akka.stream.remote.StreamRefContainers.internal_static_RemoteSinkCompleted_descriptor;
+ }
+
+ public akka.stream.remote.StreamRefContainers.RemoteSinkCompleted getDefaultInstanceForType() {
+ return akka.stream.remote.StreamRefContainers.RemoteSinkCompleted.getDefaultInstance();
+ }
+
+ public akka.stream.remote.StreamRefContainers.RemoteSinkCompleted build() {
+ akka.stream.remote.StreamRefContainers.RemoteSinkCompleted result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public akka.stream.remote.StreamRefContainers.RemoteSinkCompleted buildPartial() {
+ akka.stream.remote.StreamRefContainers.RemoteSinkCompleted result = new akka.stream.remote.StreamRefContainers.RemoteSinkCompleted(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.seqNr_ = seqNr_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(akka.protobuf.Message other) {
+ if (other instanceof akka.stream.remote.StreamRefContainers.RemoteSinkCompleted) {
+ return mergeFrom((akka.stream.remote.StreamRefContainers.RemoteSinkCompleted)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(akka.stream.remote.StreamRefContainers.RemoteSinkCompleted other) {
+ if (other == akka.stream.remote.StreamRefContainers.RemoteSinkCompleted.getDefaultInstance()) return this;
+ if (other.hasSeqNr()) {
+ setSeqNr(other.getSeqNr());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasSeqNr()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ akka.protobuf.CodedInputStream input,
+ akka.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ akka.stream.remote.StreamRefContainers.RemoteSinkCompleted parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (akka.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (akka.stream.remote.StreamRefContainers.RemoteSinkCompleted) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required int64 seqNr = 1;
+ private long seqNr_ ;
+ /**
+ * required int64 seqNr = 1;
+ */
+ public boolean hasSeqNr() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public long getSeqNr() {
+ return seqNr_;
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public Builder setSeqNr(long value) {
+ bitField0_ |= 0x00000001;
+ seqNr_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required int64 seqNr = 1;
+ */
+ public Builder clearSeqNr() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ seqNr_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:RemoteSinkCompleted)
+ }
+
+ static {
+ defaultInstance = new RemoteSinkCompleted(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:RemoteSinkCompleted)
+ }
+
+ private static akka.protobuf.Descriptors.Descriptor
+ internal_static_SinkRef_descriptor;
+ private static
+ akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_SinkRef_fieldAccessorTable;
+ private static akka.protobuf.Descriptors.Descriptor
+ internal_static_SourceRef_descriptor;
+ private static
+ akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_SourceRef_fieldAccessorTable;
+ private static akka.protobuf.Descriptors.Descriptor
+ internal_static_ActorRef_descriptor;
+ private static
+ akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_ActorRef_fieldAccessorTable;
+ private static akka.protobuf.Descriptors.Descriptor
+ internal_static_Option_descriptor;
+ private static
+ akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_Option_fieldAccessorTable;
+ private static akka.protobuf.Descriptors.Descriptor
+ internal_static_Payload_descriptor;
+ private static
+ akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_Payload_fieldAccessorTable;
+ private static akka.protobuf.Descriptors.Descriptor
+ internal_static_CumulativeDemand_descriptor;
+ private static
+ akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_CumulativeDemand_fieldAccessorTable;
+ private static akka.protobuf.Descriptors.Descriptor
+ internal_static_SequencedOnNext_descriptor;
+ private static
+ akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_SequencedOnNext_fieldAccessorTable;
+ private static akka.protobuf.Descriptors.Descriptor
+ internal_static_RemoteSinkFailure_descriptor;
+ private static
+ akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_RemoteSinkFailure_fieldAccessorTable;
+ private static akka.protobuf.Descriptors.Descriptor
+ internal_static_RemoteSinkCompleted_descriptor;
+ private static
+ akka.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_RemoteSinkCompleted_fieldAccessorTable;
+
+ public static akka.protobuf.Descriptors.FileDescriptor
+ getDescriptor() {
+ return descriptor;
+ }
+ private static akka.protobuf.Descriptors.FileDescriptor
+ descriptor;
+ static {
+ java.lang.String[] descriptorData = {
+ "\n\031StreamRefContainers.proto\">\n\007SinkRef\022\034" +
+ "\n\ttargetRef\030\001 \002(\0132\t.ActorRef\022\025\n\rinitialD" +
+ "emand\030\002 \001(\003\")\n\tSourceRef\022\034\n\toriginRef\030\001 " +
+ "\002(\0132\t.ActorRef\"\030\n\010ActorRef\022\014\n\004path\030\001 \002(\t" +
+ "\"!\n\006Option\022\027\n\005value\030\001 \001(\0132\010.Payload\"Q\n\007P" +
+ "ayload\022\027\n\017enclosedMessage\030\001 \002(\014\022\024\n\014seria" +
+ "lizerId\030\002 \002(\005\022\027\n\017messageManifest\030\004 \001(\014\"!" +
+ "\n\020CumulativeDemand\022\r\n\005seqNr\030\001 \002(\003\";\n\017Seq" +
+ "uencedOnNext\022\r\n\005seqNr\030\001 \002(\003\022\031\n\007payload\030\002" +
+ " \002(\0132\010.Payload\"\"\n\021RemoteSinkFailure\022\r\n\005c",
+ "ause\030\001 \001(\014\"$\n\023RemoteSinkCompleted\022\r\n\005seq" +
+ "Nr\030\001 \002(\003B\026\n\022akka.stream.remoteH\001"
+ };
+ akka.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
+ new akka.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
+ public akka.protobuf.ExtensionRegistry assignDescriptors(
+ akka.protobuf.Descriptors.FileDescriptor root) {
+ descriptor = root;
+ internal_static_SinkRef_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_SinkRef_fieldAccessorTable = new
+ akka.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_SinkRef_descriptor,
+ new java.lang.String[] { "TargetRef", "InitialDemand", });
+ internal_static_SourceRef_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_SourceRef_fieldAccessorTable = new
+ akka.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_SourceRef_descriptor,
+ new java.lang.String[] { "OriginRef", });
+ internal_static_ActorRef_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_ActorRef_fieldAccessorTable = new
+ akka.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_ActorRef_descriptor,
+ new java.lang.String[] { "Path", });
+ internal_static_Option_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_Option_fieldAccessorTable = new
+ akka.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_Option_descriptor,
+ new java.lang.String[] { "Value", });
+ internal_static_Payload_descriptor =
+ getDescriptor().getMessageTypes().get(4);
+ internal_static_Payload_fieldAccessorTable = new
+ akka.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_Payload_descriptor,
+ new java.lang.String[] { "EnclosedMessage", "SerializerId", "MessageManifest", });
+ internal_static_CumulativeDemand_descriptor =
+ getDescriptor().getMessageTypes().get(5);
+ internal_static_CumulativeDemand_fieldAccessorTable = new
+ akka.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_CumulativeDemand_descriptor,
+ new java.lang.String[] { "SeqNr", });
+ internal_static_SequencedOnNext_descriptor =
+ getDescriptor().getMessageTypes().get(6);
+ internal_static_SequencedOnNext_fieldAccessorTable = new
+ akka.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_SequencedOnNext_descriptor,
+ new java.lang.String[] { "SeqNr", "Payload", });
+ internal_static_RemoteSinkFailure_descriptor =
+ getDescriptor().getMessageTypes().get(7);
+ internal_static_RemoteSinkFailure_fieldAccessorTable = new
+ akka.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_RemoteSinkFailure_descriptor,
+ new java.lang.String[] { "Cause", });
+ internal_static_RemoteSinkCompleted_descriptor =
+ getDescriptor().getMessageTypes().get(8);
+ internal_static_RemoteSinkCompleted_fieldAccessorTable = new
+ akka.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_RemoteSinkCompleted_descriptor,
+ new java.lang.String[] { "SeqNr", });
+ return null;
+ }
+ };
+ akka.protobuf.Descriptors.FileDescriptor
+ .internalBuildGeneratedFileFrom(descriptorData,
+ new akka.protobuf.Descriptors.FileDescriptor[] {
+ }, assigner);
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
diff --git a/akka-stream/src/main/protobuf/StreamRefContainers.proto b/akka-stream/src/main/protobuf/StreamRefContainers.proto
new file mode 100644
index 0000000000..7f4c5d0ad6
--- /dev/null
+++ b/akka-stream/src/main/protobuf/StreamRefContainers.proto
@@ -0,0 +1,56 @@
+/**
+ * Copyright (C) 2009-2017 Lightbend Inc.
+ */
+
+option java_package = "akka.stream.remote";
+option optimize_for = SPEED;
+
+/*************************************************
+ StreamRefs (SourceRef / SinkRef) related formats
+**************************************************/
+
+// TODO make explicit types for SinkRef/SourceRef as they can carry initial settings (initial demand etc)
+
+message SinkRef {
+ required ActorRef targetRef = 1;
+ optional int64 initialDemand = 2;
+}
+
+message SourceRef {
+ required ActorRef originRef = 1;
+ // FIXME: it's basically SinkRef since we just ommit the optional initial demand...
+ // FIXME: could it be that all those passable refs should be expressed internally as a StreamRef?
+}
+
+message ActorRef {
+ required string path = 1;
+}
+
+message Option {
+ optional Payload value = 1;
+}
+
+message Payload {
+ required bytes enclosedMessage = 1;
+ required int32 serializerId = 2;
+ optional bytes messageManifest = 4;
+}
+
+// stream refs protocol
+
+message CumulativeDemand {
+ required int64 seqNr = 1;
+}
+
+message SequencedOnNext {
+ required int64 seqNr = 1;
+ required Payload payload = 2;
+}
+
+message RemoteSinkFailure {
+ optional bytes cause = 1;
+}
+
+message RemoteSinkCompleted {
+ required int64 seqNr = 1;
+}
diff --git a/akka-stream/src/main/resources/reference.conf b/akka-stream/src/main/resources/reference.conf
index 747f4120dc..a79854df7b 100644
--- a/akka-stream/src/main/resources/reference.conf
+++ b/akka-stream/src/main/resources/reference.conf
@@ -34,13 +34,13 @@ akka {
# for cancelation (see `akka.stream.subscription-timeout.mode`)
timeout = 5s
}
-
+
# Enable additional troubleshooting logging at DEBUG log level
debug-logging = off
# Maximum number of elements emitted in batch if downstream signals large demand
output-burst-limit = 1000
-
+
# Enable automatic fusing of all graphs that are run. For short-lived streams
# this may cause an initial runtime overhead, but most of the time fusing is
# desirable since it reduces the number of Actors that are created.
@@ -98,12 +98,57 @@ akka {
fixed-pool-size = 16
}
}
+
+ # configure defaults for SourceRef and SinkRef
+ stream-refs {
+ # Default initial demand to be sent along with a SinkRef.
+ #
+ # The receiving side will be prepared to buffer as much as that many elements,
+ # and the sending side can assume to safely send as many elements without receiving
+ # an demand message before.
+ initial-demand = 4
+
+ # Demand is signalled by sending a cumulative demand message ("requesting messages until the n-th sequence number)
+ # Using a cumulative demand model allows us to re-deliver the demand message in case of message loss (which should
+ # be very rare in any case, yet possible -- mostly under connection break-down and re-establishment).
+ #
+ # The semantics of handling and updating the demand however are in-line with what Reactive Streams dictates.
+ #
+ # In normal operation, demand is signalled in response to arriving elements, however if no new elements arrive
+ # within `demand-redelivery-interval` a re-delivery of the demand will be triggered, assuming that it may have gotten lost.
+ demand-redelivery-interval = 500 ms
+
+ # Idle timeout, after which both sides of the stream-ref will terminate.
+ # Notice that demand-redelivery works as a keep-alive, and if a remote Sink keeps receiving the demand re-deliveries,
+ # it knows the other side is still alive and will not terminate. The other-side though will eventually decide, by its
+ # idle-timeout that "did not get any signal from the remote, over idle-timeout, so will terminate" and that termination
+ # would be signalled back to the remote Sink.
+ idle-timeout = 5 seconds
+ }
+
}
# configure overrides to ssl-configuration here (to be used by akka-streams, and akka-http – i.e. when serving https connections)
ssl-config {
protocol = "TLSv1.2"
}
+
+ actor {
+
+ serializers {
+ akka-stream-refs = "akka.stream.remote.serialization.StreamRefSerializer"
+ }
+
+ serialization-bindings {
+ "akka.stream.remote.scaladsl.SinkRef" = akka-stream-refs
+ "akka.stream.remote.scaladsl.SourceRef" = akka-stream-refs
+ "akka.stream.remote.StreamRefs$Protocol" = akka-stream-refs
+ }
+
+ serialization-identifiers {
+ "akka.stream.remote.serialization.StreamRefSerializer" = 30
+ }
+ }
}
# ssl configuration
diff --git a/akka-stream/src/main/scala/akka/stream/remote/StreamRefs.scala b/akka-stream/src/main/scala/akka/stream/remote/StreamRefs.scala
new file mode 100644
index 0000000000..a1f31701ca
--- /dev/null
+++ b/akka-stream/src/main/scala/akka/stream/remote/StreamRefs.scala
@@ -0,0 +1,67 @@
+/**
+ * Copyright (C) 2014-2017 Lightbend Inc.
+ */
+package akka.stream.remote
+
+import akka.actor.{ ActorRef, DeadLetterSuppression }
+import akka.annotation.InternalApi
+import akka.stream.impl.ReactiveStreamsCompliance
+
+/** INTERNAL API: Protocol messages used by the various stream -ref implementations. */
+@InternalApi
+private[akka] object StreamRefs {
+
+ @InternalApi
+ sealed trait Protocol
+
+ /**
+ * Sequenced `Subscriber#onNext` equivalent.
+ * The receiving end of these messages MUST fail the stream if it observes gaps in the sequence,
+ * as these messages will not be re-delivered.
+ *
+ * Sequence numbers start from `0`.
+ */
+ @InternalApi
+ final case class SequencedOnNext[T](seqNr: Long, payload: T) extends StreamRefs.Protocol {
+ if (payload == null) throw ReactiveStreamsCompliance.elementMustNotBeNullException
+ }
+
+ /** Sent to a the receiver side of a SinkRef, once the sending side of the SinkRef gets signalled a Failure. */
+ @InternalApi
+ final case class RemoteSinkFailure(msg: String) extends StreamRefs.Protocol
+
+ /** Sent to a the receiver side of a SinkRef, once the sending side of the SinkRef gets signalled a completion. */
+ @InternalApi
+ final case class RemoteSinkCompleted(seqNr: Long) extends StreamRefs.Protocol
+
+ /**
+ * Cumulative demand, equivalent to sequence numbering all events in a stream. *
+ * This message may be re-delivered.
+ */
+ @InternalApi
+ final case class CumulativeDemand(seqNr: Long) extends StreamRefs.Protocol with DeadLetterSuppression {
+ if (seqNr <= 0) throw ReactiveStreamsCompliance.numberOfElementsInRequestMustBePositiveException
+ }
+
+ // --- exceptions ---
+
+ final case class RemoteStreamRefActorTerminatedException(msg: String) extends RuntimeException(msg)
+ final case class RemoteStreamRefFailedException(msg: String) extends RuntimeException(msg)
+ final case class InvalidSequenceNumberException(expectedSeqNr: Long, gotSeqNr: Long, msg: String)
+ extends IllegalStateException(s"$msg (expected: $expectedSeqNr, got: $gotSeqNr)")
+
+ /**
+ * Stream refs establish a connection between a local and remote actor, representing the origin and remote sides
+ * of a stream. Each such actor refers to the other side as its "partner". We make sure that no other actor than
+ * the initial partner can send demand/messages to the other side accidentally.
+ *
+ * This exception is thrown when a message is recived from a non-partner actor,
+ * which could mean a bug or some actively malicient behaviour from the other side.
+ *
+ * This is not meant as a security feature, but rather as plain sanity-check.
+ */
+ final case class InvalidPartnerActorException(expectedRef: ActorRef, gotRef: ActorRef, msg: String)
+ extends IllegalStateException(s"$msg (expected: $expectedRef, got: $gotRef)")
+
+}
+
diff --git a/akka-stream/src/main/scala/akka/stream/remote/impl/StreamRefsMaster.scala b/akka-stream/src/main/scala/akka/stream/remote/impl/StreamRefsMaster.scala
new file mode 100644
index 0000000000..38a61bccf6
--- /dev/null
+++ b/akka-stream/src/main/scala/akka/stream/remote/impl/StreamRefsMaster.scala
@@ -0,0 +1,61 @@
+/**
+ * Copyright (C) 2014-2017 Lightbend Inc.
+ */
+package akka.stream.remote.impl
+
+import akka.actor.{ Actor, ActorRef, ActorSystem, ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider, Props }
+import akka.stream.ActorMaterializerHelper
+import akka.stream.impl.SeqActorName
+import akka.stream.remote.impl.StreamRefsMasterActor.AllocatePusherToRemoteSink
+import akka.stream.remote.scaladsl.{ SinkRef, StreamRefSettings }
+
+object StreamRefsMaster extends ExtensionId[StreamRefsMaster] with ExtensionIdProvider {
+
+ override def createExtension(system: ExtendedActorSystem): StreamRefsMaster =
+ new StreamRefsMaster(system)
+
+ override def lookup(): StreamRefsMaster.type = this
+
+ override def get(system: ActorSystem): StreamRefsMaster = super.get(system)
+}
+
+/** INTERNAL API */
+private[stream] final class StreamRefsMaster(system: ExtendedActorSystem) extends Extension {
+
+ val settings: StreamRefSettings = new StreamRefSettings(system.settings.config)
+
+ private[this] val sourceRefOriginSinkNames = SeqActorName("SourceRefOriginSink") // "local origin"
+ private[this] val sourceRefNames = SeqActorName("SourceRef") // "remote receiver"
+
+ private[this] val sinkRefTargetSourceNames = SeqActorName("SinkRefTargetSource") // "local target"
+ private[this] val sinkRefNames = SeqActorName("SinkRef") // "remote sender"
+
+ // TODO do we need it? perhaps for reaping?
+ // system.systemActorOf(StreamRefsMasterActor.props(), "streamRefsMaster")
+
+ def nextSinkRefTargetSourceName(): String =
+ sinkRefTargetSourceNames.next()
+
+ def nextSinkRefName(): String =
+ sinkRefNames.next()
+
+ def nextSourceRefOriginSinkName(): String =
+ sourceRefOriginSinkNames.next()
+
+ def nextSourceRefName(): String =
+ sourceRefNames.next()
+
+}
+
+object StreamRefsMasterActor {
+ def props(): Props = Props(new StreamRefsMasterActor())
+
+ final case class AllocatePusherToRemoteSink(stageRef: ActorRef)
+}
+
+class StreamRefsMasterActor extends Actor {
+ override def receive: Receive = {
+ case AllocatePusherToRemoteSink(stageRef) ⇒
+ // context.actorOf()
+ }
+}
diff --git a/akka-stream/src/main/scala/akka/stream/remote/scaladsl/SinkRef.scala b/akka-stream/src/main/scala/akka/stream/remote/scaladsl/SinkRef.scala
new file mode 100644
index 0000000000..8f4455028b
--- /dev/null
+++ b/akka-stream/src/main/scala/akka/stream/remote/scaladsl/SinkRef.scala
@@ -0,0 +1,274 @@
+/**
+ * Copyright (C) 2014-2017 Lightbend Inc.
+ */
+package akka.stream.remote.scaladsl
+
+import java.util.Queue
+
+import akka.actor.{ ActorRef, Terminated }
+import akka.event.Logging
+import akka.stream._
+import akka.stream.actor.{ MaxInFlightRequestStrategy, RequestStrategy, WatermarkRequestStrategy }
+import akka.stream.impl.FixedSizeBuffer
+import akka.stream.remote.StreamRefs
+import akka.stream.remote.impl.StreamRefsMaster
+import akka.stream.scaladsl.Source
+import akka.stream.stage._
+import akka.util.ByteString
+
+import scala.concurrent.{ Future, Promise }
+
+object SinkRef {
+ def source[T](): Source[T, Future[SinkRef[T]]] =
+ Source.fromGraph(new SinkRefTargetSource[T]()) // TODO settings?
+
+ def bulkTransferSource(port: Int = -1): Source[ByteString, SinkRef[ByteString]] = {
+ ???
+ }
+}
+
+/**
+ * This stage can only handle a single "sender" (it does not merge values);
+ * The first that pushes is assumed the one we are to trust
+ */
+final class SinkRefTargetSource[T]() extends GraphStageWithMaterializedValue[SourceShape[T], Future[SinkRef[T]]] {
+ val out: Outlet[T] = Outlet[T](s"${Logging.simpleName(getClass)}.out")
+ override def shape = SourceShape.of(out)
+
+ override def createLogicAndMaterializedValue(inheritedAttributes: Attributes) = {
+ val promise = Promise[SinkRef[T]]()
+
+ val logic = new TimerGraphStageLogic(shape) with StageLogging with OutHandler {
+ private[this] lazy val streamRefsMaster = StreamRefsMaster(ActorMaterializerHelper.downcast(materializer).system)
+ private[this] lazy val settings = streamRefsMaster.settings
+
+ private[this] var self: GraphStageLogic.StageActor = _
+ private[this] lazy val selfActorName = streamRefsMaster.nextSinkRefTargetSourceName()
+ private[this] implicit def selfSender: ActorRef = self.ref
+
+ // demand management ---
+ private val highDemandWatermark = 16
+
+ private var expectingSeqNr: Long = 0L
+ private var localCumulativeDemand: Long = 0L // initialized in preStart with settings.initialDemand
+
+ private val receiveBuffer = FixedSizeBuffer[T](highDemandWatermark)
+
+ // TODO configurable?
+ // Request strategies talk in terms of Request(n), which we need to translate to cumulative demand
+ // TODO the MaxInFlightRequestStrategy is likely better for this use case, yet was a bit weird to use so this one for now
+ private val requestStrategy: RequestStrategy = WatermarkRequestStrategy(highWatermark = highDemandWatermark)
+ // end of demand management ---
+
+ private var remotePartner: ActorRef = _
+
+ override def preStart(): Unit = {
+ localCumulativeDemand = settings.initialDemand.toLong
+
+ self = getStageActor(initialReceive, name = selfActorName)
+ log.warning("Allocated receiver: {}", self.ref)
+
+ promise.success(new SinkRef(self.ref, settings.initialDemand))
+ }
+
+ override def onPull(): Unit = {
+ tryPush()
+ triggerCumulativeDemand()
+ }
+
+ def triggerCumulativeDemand(): Unit =
+ if (remotePartner ne null) {
+ val remainingRequested = java.lang.Long.min(highDemandWatermark, localCumulativeDemand - expectingSeqNr).toInt
+ val addDemand = requestStrategy.requestDemand(remainingRequested)
+
+ // only if demand has increased we shoot it right away
+ // otherwise it's the same demand level, so it'd be triggered via redelivery anyway
+ if (addDemand > 0) {
+ localCumulativeDemand += addDemand
+ val demand = StreamRefs.CumulativeDemand(localCumulativeDemand)
+
+ log.warning("[{}] Demanding until [{}] (+{})", selfActorName, localCumulativeDemand, addDemand)
+ remotePartner ! demand
+ scheduleDemandRedelivery()
+ }
+ }
+
+ val DemandRedeliveryTimerKey = "DemandRedeliveryTimerKey"
+ def scheduleDemandRedelivery() = scheduleOnce(DemandRedeliveryTimerKey, settings.demandRedeliveryInterval)
+ override protected def onTimer(timerKey: Any): Unit = timerKey match {
+ case DemandRedeliveryTimerKey ⇒
+ log.debug("[{}] Scheduled re-delivery of demand until [{}]", selfActorName, localCumulativeDemand)
+ remotePartner ! StreamRefs.CumulativeDemand(localCumulativeDemand)
+ scheduleDemandRedelivery()
+ }
+
+ lazy val initialReceive: ((ActorRef, Any)) ⇒ Unit = {
+ case (sender, msg @ StreamRefs.SequencedOnNext(seqNr, payload)) ⇒
+ observeAndValidateSender(sender, "Illegal sender in SequencedOnNext")
+ observeAndValidateSequenceNr(seqNr, "Illegal sequence nr in SequencedOnNext")
+ log.warning("Received seq {} from {}", msg, sender)
+
+ triggerCumulativeDemand()
+ tryPush(payload)
+
+ case (sender, StreamRefs.RemoteSinkCompleted(seqNr)) ⇒
+ observeAndValidateSender(sender, "Illegal sender in RemoteSinkCompleted")
+ observeAndValidateSequenceNr(seqNr, "Illegal sequence nr in RemoteSinkCompleted")
+ log.debug("The remote Sink has completed, completing this source as well...")
+
+ self.unwatch(sender)
+ completeStage()
+
+ case (sender, StreamRefs.RemoteSinkFailure(reason)) ⇒
+ observeAndValidateSender(sender, "Illegal sender in RemoteSinkFailure")
+ log.debug("The remote Sink has failed, failing (reason: {})", reason)
+
+ self.unwatch(sender)
+ failStage(StreamRefs.RemoteStreamRefActorTerminatedException(s"Remote Sink failed, reason: $reason"))
+ }
+
+ def tryPush(): Unit =
+ if (isAvailable(out) && receiveBuffer.nonEmpty) {
+ val elem = receiveBuffer.dequeue()
+ log.warning(s"PUSHING SIGNALED ${elem} (capacity: ${receiveBuffer.used}/${receiveBuffer.capacity})")
+ push(out, elem)
+ }
+ def tryPush(payload: Any): Unit =
+ if (isAvailable(out)) {
+ if (receiveBuffer.nonEmpty) {
+ val elem = receiveBuffer.dequeue()
+ push(out, elem)
+ receiveBuffer.enqueue(payload.asInstanceOf[T])
+ log.warning(s"PUSHING SIGNALED ${elem} BUFFERING payload" + payload + s"(capacity: ${receiveBuffer.used}/${receiveBuffer.capacity})")
+ } else {
+ push(out, payload.asInstanceOf[T])
+ log.warning(s"PUSHING DIRECTLY ${payload}")
+ }
+ } else {
+ receiveBuffer.enqueue(payload.asInstanceOf[T])
+ log.warning("PUSHING BUFFERING payload" + payload + s"(capacity: ${receiveBuffer.used}/${receiveBuffer.capacity})")
+ }
+
+ @throws[StreamRefs.InvalidPartnerActorException]
+ def observeAndValidateSender(sender: ActorRef, msg: String): Unit =
+ if (remotePartner == null) {
+ log.debug("Received first message from {}, assuming it to be the remote partner for this stage", sender)
+ remotePartner = sender
+ self.watch(sender)
+ } else if (sender != remotePartner) {
+ throw StreamRefs.InvalidPartnerActorException(sender, remotePartner, msg)
+ }
+
+ @throws[StreamRefs.InvalidSequenceNumberException]
+ def observeAndValidateSequenceNr(seqNr: Long, msg: String): Unit =
+ if (isInvalidSequenceNr(seqNr)) {
+ throw StreamRefs.InvalidSequenceNumberException(expectingSeqNr, seqNr, msg)
+ } else {
+ expectingSeqNr += 1
+ }
+ def isInvalidSequenceNr(seqNr: Long): Boolean =
+ seqNr != expectingSeqNr
+
+ setHandler(out, this)
+ }
+ (logic, promise.future) // FIXME we'd want to expose just the ref!
+ }
+
+ override def toString: String =
+ s"${Logging.simpleName(getClass)}()}"
+}
+
+/**
+ * The "handed out" side of a SinkRef. It powers a Source on the other side.
+ * TODO naming!??!?!!?!?!?!
+ *
+ * Do not create this instance directly, but use `SinkRef` factories, to run/setup its targetRef
+ */
+final class SinkRef[In] private[akka] ( // TODO is it more of a SourceRefSink?
+ private[akka] val targetRef: ActorRef,
+ private[akka] val initialDemand: Long
+) extends GraphStage[SinkShape[In]] with Serializable { stage ⇒
+ import akka.stream.remote.StreamRefs._
+
+ val in = Inlet[In](s"${Logging.simpleName(getClass)}($targetRef).in")
+ override def shape: SinkShape[In] = SinkShape.of(in)
+
+ override def createLogic(inheritedAttributes: Attributes) = new GraphStageLogic(shape) with StageLogging with InHandler {
+
+ private[this] lazy val streamRefsMaster = StreamRefsMaster(ActorMaterializerHelper.downcast(materializer).system)
+ private[this] lazy val selfActorName = streamRefsMaster.nextSinkRefName()
+
+ // we assume that there is at least SOME buffer space
+ private[this] var remoteCumulativeDemandReceived = initialDemand
+
+ // FIXME this one will be sent over remoting so we have to be able to make that work
+ private[this] var remoteCumulativeDemandConsumed = 0L
+ private[this] var self: GraphStageLogic.StageActor = _
+ implicit def selfSender: ActorRef = self.ref
+
+ override def preStart(): Unit = {
+ self = getStageActor(initialReceive, selfActorName)
+ self.watch(targetRef)
+
+ log.warning("Created SinkRef, pointing to remote Sink receiver: {}, local worker: {}", targetRef, self)
+
+ pull(in)
+ }
+
+ lazy val initialReceive: ((ActorRef, Any)) ⇒ Unit = {
+ case (_, Terminated(`targetRef`)) ⇒
+ failStage(failRemoteTerminated())
+
+ case (sender, CumulativeDemand(d)) ⇒
+ validatePartnerRef(sender)
+
+ if (remoteCumulativeDemandReceived < d) {
+ remoteCumulativeDemandReceived = d
+ log.warning("Received cumulative demand [{}], consumable demand: [{}]", CumulativeDemand(d), remoteCumulativeDemandReceived - remoteCumulativeDemandConsumed)
+ }
+ tryPull()
+ }
+
+ override def onPush(): Unit = {
+ val elem = grabSequenced(in)
+ targetRef ! elem
+ log.warning("Sending sequenced: {} to {}", elem, targetRef)
+ tryPull()
+ }
+
+ private def tryPull() =
+ if (remoteCumulativeDemandConsumed < remoteCumulativeDemandReceived && !hasBeenPulled(in))
+ pull(in)
+
+ private def grabSequenced[T](in: Inlet[T]): SequencedOnNext[T] = {
+ val onNext = SequencedOnNext(remoteCumulativeDemandConsumed, grab(in))
+ remoteCumulativeDemandConsumed += 1
+ onNext
+ }
+
+ override def onUpstreamFailure(ex: Throwable): Unit = {
+ targetRef ! StreamRefs.RemoteSinkFailure(ex.getMessage) // TODO yes / no? At least the message I guess
+ self.unwatch(targetRef)
+ super.onUpstreamFailure(ex)
+ }
+
+ override def onUpstreamFinish(): Unit = {
+ targetRef ! StreamRefs.RemoteSinkCompleted(remoteCumulativeDemandConsumed)
+ self.unwatch(targetRef)
+ super.onUpstreamFinish()
+ }
+
+ setHandler(in, this)
+ }
+
+ private def validatePartnerRef(ref: ActorRef) = {
+ if (ref != targetRef) throw new RuntimeException("Got demand from weird actor! Not the one I trust hmmmm!!!")
+ }
+
+ private def failRemoteTerminated() = {
+ RemoteStreamRefActorTerminatedException(s"Remote target receiver of data ${targetRef} terminated. Local stream terminating, message loss (on remote side) may have happened.")
+ }
+
+ override def toString = s"${Logging.simpleName(getClass)}($targetRef)"
+
+}
diff --git a/akka-stream/src/main/scala/akka/stream/remote/scaladsl/SourceRef.scala b/akka-stream/src/main/scala/akka/stream/remote/scaladsl/SourceRef.scala
new file mode 100644
index 0000000000..934f6ca03c
--- /dev/null
+++ b/akka-stream/src/main/scala/akka/stream/remote/scaladsl/SourceRef.scala
@@ -0,0 +1,289 @@
+/**
+ * Copyright (C) 2014-2017 Lightbend Inc.
+ */
+package akka.stream.remote.scaladsl
+
+import akka.NotUsed
+import akka.actor.ActorRef
+import akka.event.Logging
+import akka.stream._
+import akka.stream.actor.{ RequestStrategy, WatermarkRequestStrategy }
+import akka.stream.impl.FixedSizeBuffer
+import akka.stream.remote.StreamRefs
+import akka.stream.remote.StreamRefs.{ CumulativeDemand, SequencedOnNext }
+import akka.stream.remote.impl.StreamRefsMaster
+import akka.stream.scaladsl.{ FlowOps, Sink, Source }
+import akka.stream.stage._
+import akka.util.ByteString
+
+import scala.concurrent.{ Future, Promise }
+
+// FIXME IMPLEMENT THIS
+object SourceRef {
+ def sink[T](): Graph[SinkShape[T], Future[SourceRef[T]]] =
+ Sink.fromGraph(new SourceRefOriginSink[T]())
+
+ def bulkTransfer[T](): Graph[SinkShape[ByteString], SourceRef[ByteString]] = ???
+}
+
+final class SourceRefOriginSink[T]() extends GraphStageWithMaterializedValue[SinkShape[T], Future[SourceRef[T]]] {
+ val in: Inlet[T] = Inlet[T](s"${Logging.simpleName(getClass)}.in")
+ override def shape: SinkShape[T] = SinkShape.of(in)
+
+ override def createLogicAndMaterializedValue(inheritedAttributes: Attributes): (GraphStageLogic, Future[SourceRef[T]]) = {
+ val promise = Promise[SourceRef[T]]
+
+ val logic = new TimerGraphStageLogic(shape) with InHandler with StageLogging {
+ private[this] lazy val streamRefsMaster = StreamRefsMaster(ActorMaterializerHelper.downcast(materializer).system)
+ private[this] lazy val settings = streamRefsMaster.settings
+
+ private[this] var remotePartner: ActorRef = _
+
+ private[this] var self: GraphStageLogic.StageActor = _
+ private[this] lazy val selfActorName = streamRefsMaster.nextSinkRefTargetSourceName()
+ private[this] implicit def selfSender: ActorRef = self.ref
+
+ // demand management ---
+ private var remoteCumulativeDemandReceived: Long = 0L
+ private var remoteCumulativeDemandConsumed: Long = 0L
+ // end of demand management ---
+
+ override def preStart(): Unit = {
+ self = getStageActor(initialReceive, selfActorName)
+ log.warning("Allocated receiver: {}", self.ref)
+
+ promise.success(new SourceRef(self.ref))
+ }
+
+ lazy val initialReceive: ((ActorRef, Any)) ⇒ Unit = {
+ case (sender, msg @ StreamRefs.CumulativeDemand(demand)) ⇒
+ observeAndValidateSender(sender, "Illegal sender in CumulativeDemand")
+
+ if (demand > remoteCumulativeDemandReceived) {
+ remoteCumulativeDemandReceived = demand
+ log.warning("Received cumulative demand [{}], consumable demand: [{}]", msg,
+ remoteCumulativeDemandReceived - remoteCumulativeDemandConsumed)
+ }
+
+ tryPull()
+ }
+
+ def tryPull(): Unit =
+ if (remoteCumulativeDemandConsumed < remoteCumulativeDemandReceived && !hasBeenPulled(in))
+ pull(in)
+
+ private def grabSequenced(in: Inlet[T]): SequencedOnNext[T] = {
+ val onNext = SequencedOnNext(remoteCumulativeDemandConsumed, grab(in))
+ remoteCumulativeDemandConsumed += 1
+ onNext
+ }
+
+ override def onPush(): Unit = {
+ val elem = grabSequenced(in)
+ remotePartner ! elem
+ log.warning("Sending sequenced: {} to {}", elem, remotePartner)
+ tryPull()
+ }
+
+ @throws[StreamRefs.InvalidPartnerActorException]
+ def observeAndValidateSender(sender: ActorRef, msg: String): Unit =
+ if (remotePartner == null) {
+ log.debug("Received first message from {}, assuming it to be the remote partner for this stage", sender)
+ remotePartner = sender
+ self.watch(sender)
+ } else if (sender != remotePartner) {
+ throw StreamRefs.InvalidPartnerActorException(sender, remotePartner, msg)
+ }
+
+ // @throws[StreamRefs.InvalidSequenceNumberException]
+ // def observeAndValidateSequenceNr(seqNr: Long, msg: String): Unit =
+ // if (isInvalidSequenceNr(seqNr)) {
+ // throw StreamRefs.InvalidSequenceNumberException(expectingSeqNr, seqNr, msg)
+ // } else {
+ // expectingSeqNr += 1
+ // }
+ // def isInvalidSequenceNr(seqNr: Long): Boolean =
+ // seqNr != expectingSeqNr
+
+ override def onUpstreamFailure(ex: Throwable): Unit = {
+ remotePartner ! StreamRefs.RemoteSinkFailure(ex.getMessage) // TODO yes / no? At least the message I guess
+ self.unwatch(remotePartner)
+ super.onUpstreamFailure(ex)
+ }
+
+ override def onUpstreamFinish(): Unit = {
+ remotePartner ! StreamRefs.RemoteSinkCompleted(remoteCumulativeDemandConsumed)
+ self.unwatch(remotePartner)
+ super.onUpstreamFinish()
+ }
+
+ setHandler(in, this)
+ }
+
+ (logic, promise.future)
+ }
+
+}
+
+///// ------------------------------------ FIXME THIS IS A VERBATIM COPY -----------------------------------
+///// ------------------------------------ FIXME THIS IS A VERBATIM COPY -----------------------------------
+///// ------------------------------------ FIXME THIS IS A VERBATIM COPY -----------------------------------
+///// ------------------------------------ FIXME THIS IS A VERBATIM COPY -----------------------------------
+/**
+ * This stage can only handle a single "sender" (it does not merge values);
+ * The first that pushes is assumed the one we are to trust
+ */
+// FIXME this is basically SinkRefTargetSource
+final class SourceRef[T](private[akka] val originRef: ActorRef) extends GraphStageWithMaterializedValue[SourceShape[T], Future[SinkRef[T]]] {
+ val out: Outlet[T] = Outlet[T](s"${Logging.simpleName(getClass)}.out")
+ override def shape = SourceShape.of(out)
+
+ override def createLogicAndMaterializedValue(inheritedAttributes: Attributes) = {
+ val promise = Promise[SinkRef[T]]()
+
+ val logic = new TimerGraphStageLogic(shape) with StageLogging with OutHandler {
+ private[this] lazy val streamRefsMaster = StreamRefsMaster(ActorMaterializerHelper.downcast(materializer).system)
+ private[this] lazy val settings = streamRefsMaster.settings
+
+ private[this] var self: GraphStageLogic.StageActor = _
+ private[this] lazy val selfActorName = streamRefsMaster.nextSinkRefTargetSourceName()
+ private[this] implicit def selfSender: ActorRef = self.ref
+
+ // demand management ---
+ private val highDemandWatermark = 16
+
+ private var expectingSeqNr: Long = 0L
+ private var localCumulativeDemand: Long = 0L // initialized in preStart with settings.initialDemand
+
+ private val receiveBuffer = FixedSizeBuffer[T](highDemandWatermark)
+
+ // TODO configurable?
+ // Request strategies talk in terms of Request(n), which we need to translate to cumulative demand
+ // TODO the MaxInFlightRequestStrategy is likely better for this use case, yet was a bit weird to use so this one for now
+ private val requestStrategy: RequestStrategy = WatermarkRequestStrategy(highWatermark = highDemandWatermark)
+ // end of demand management ---
+
+ // TODO we could basically use the other impl... and just pass null as originRef since it'd be obtained from other side...
+ private var remotePartner: ActorRef = originRef
+
+ override def preStart(): Unit = {
+ localCumulativeDemand = settings.initialDemand.toLong
+
+ self = getStageActor(initialReceive, name = selfActorName)
+ log.warning("Allocated receiver: {}", self.ref)
+
+ promise.success(new SinkRef(self.ref, settings.initialDemand))
+ }
+
+ override def onPull(): Unit = {
+ tryPush()
+ triggerCumulativeDemand()
+ }
+
+ def triggerCumulativeDemand(): Unit =
+ if (remotePartner ne null) {
+ val remainingRequested = java.lang.Long.min(highDemandWatermark, localCumulativeDemand - expectingSeqNr).toInt
+ val addDemand = requestStrategy.requestDemand(remainingRequested)
+
+ // only if demand has increased we shoot it right away
+ // otherwise it's the same demand level, so it'd be triggered via redelivery anyway
+ if (addDemand > 0) {
+ localCumulativeDemand += addDemand
+ val demand = StreamRefs.CumulativeDemand(localCumulativeDemand)
+
+ log.warning("[{}] Demanding until [{}] (+{})", selfActorName, localCumulativeDemand, addDemand)
+ remotePartner ! demand
+ scheduleDemandRedelivery()
+ }
+ }
+
+ val DemandRedeliveryTimerKey = "DemandRedeliveryTimerKey"
+ def scheduleDemandRedelivery() = scheduleOnce(DemandRedeliveryTimerKey, settings.demandRedeliveryInterval)
+ override protected def onTimer(timerKey: Any): Unit = timerKey match {
+ case DemandRedeliveryTimerKey ⇒
+ log.debug("[{}] Scheduled re-delivery of demand until [{}]", selfActorName, localCumulativeDemand)
+ remotePartner ! StreamRefs.CumulativeDemand(localCumulativeDemand)
+ scheduleDemandRedelivery()
+ }
+
+ lazy val initialReceive: ((ActorRef, Any)) ⇒ Unit = {
+ case (sender, msg @ StreamRefs.SequencedOnNext(seqNr, payload)) ⇒
+ observeAndValidateSender(sender, "Illegal sender in SequencedOnNext")
+ observeAndValidateSequenceNr(seqNr, "Illegal sequence nr in SequencedOnNext")
+ log.warning("Received seq {} from {}", msg, sender)
+
+ triggerCumulativeDemand()
+ tryPush(payload)
+
+ case (sender, StreamRefs.RemoteSinkCompleted(seqNr)) ⇒
+ observeAndValidateSender(sender, "Illegal sender in RemoteSinkCompleted")
+ observeAndValidateSequenceNr(seqNr, "Illegal sequence nr in RemoteSinkCompleted")
+ log.debug("The remote Sink has completed, completing this source as well...")
+
+ self.unwatch(sender)
+ completeStage()
+
+ case (sender, StreamRefs.RemoteSinkFailure(reason)) ⇒
+ observeAndValidateSender(sender, "Illegal sender in RemoteSinkFailure")
+ log.debug("The remote Sink has failed, failing (reason: {})", reason)
+
+ self.unwatch(sender)
+ failStage(StreamRefs.RemoteStreamRefActorTerminatedException(s"Remote Sink failed, reason: $reason"))
+ }
+
+ def tryPush(): Unit =
+ if (isAvailable(out) && receiveBuffer.nonEmpty) {
+ val elem = receiveBuffer.dequeue()
+ log.warning(s"PUSHING SIGNALED ${elem} (capacity: ${receiveBuffer.used}/${receiveBuffer.capacity})")
+ push(out, elem)
+ }
+ def tryPush(payload: Any): Unit =
+ if (isAvailable(out)) {
+ if (receiveBuffer.nonEmpty) {
+ val elem = receiveBuffer.dequeue()
+ push(out, elem)
+ receiveBuffer.enqueue(payload.asInstanceOf[T])
+ log.warning(s"PUSHING SIGNALED ${elem} BUFFERING payload" + payload + s"(capacity: ${receiveBuffer.used}/${receiveBuffer.capacity})")
+ } else {
+ push(out, payload.asInstanceOf[T])
+ log.warning(s"PUSHING DIRECTLY ${payload}")
+ }
+ } else {
+ receiveBuffer.enqueue(payload.asInstanceOf[T])
+ log.warning("PUSHING BUFFERING payload" + payload + s"(capacity: ${receiveBuffer.used}/${receiveBuffer.capacity})")
+ }
+
+ @throws[StreamRefs.InvalidPartnerActorException]
+ def observeAndValidateSender(sender: ActorRef, msg: String): Unit =
+ if (remotePartner == null) {
+ log.debug("Received first message from {}, assuming it to be the remote partner for this stage", sender)
+ remotePartner = sender
+ self.watch(sender)
+ } else if (sender != remotePartner) {
+ throw StreamRefs.InvalidPartnerActorException(sender, remotePartner, msg)
+ }
+
+ @throws[StreamRefs.InvalidSequenceNumberException]
+ def observeAndValidateSequenceNr(seqNr: Long, msg: String): Unit =
+ if (isInvalidSequenceNr(seqNr)) {
+ throw StreamRefs.InvalidSequenceNumberException(expectingSeqNr, seqNr, msg)
+ } else {
+ expectingSeqNr += 1
+ }
+ def isInvalidSequenceNr(seqNr: Long): Boolean =
+ seqNr != expectingSeqNr
+
+ setHandler(out, this)
+ }
+ (logic, promise.future) // FIXME we'd want to expose just the ref!
+ }
+
+ override def toString: String =
+ s"${Logging.simpleName(getClass)}($originRef)}"
+}
+
+///// ------------------------------------ FIXME END OF THIS IS A VERBATIM COPY ----------------------------
+///// ------------------------------------ FIXME END OF THIS IS A VERBATIM COPY ----------------------------
+///// ------------------------------------ FIXME END OF THIS IS A VERBATIM COPY ----------------------------
+///// ------------------------------------ FIXME END OF THIS IS A VERBATIM COPY ----------------------------
+///// ------------------------------------ FIXME END OF THIS IS A VERBATIM COPY ----------------------------
diff --git a/akka-stream/src/main/scala/akka/stream/remote/scaladsl/StreamRefSettings.scala b/akka-stream/src/main/scala/akka/stream/remote/scaladsl/StreamRefSettings.scala
new file mode 100644
index 0000000000..d3f0a9f2c8
--- /dev/null
+++ b/akka-stream/src/main/scala/akka/stream/remote/scaladsl/StreamRefSettings.scala
@@ -0,0 +1,19 @@
+/**
+ * Copyright (C) 2014-2017 Lightbend Inc.
+ */
+package akka.stream.remote.scaladsl
+
+import java.util.concurrent.TimeUnit
+
+import scala.concurrent.duration._
+import com.typesafe.config.Config
+
+final class StreamRefSettings(config: Config) {
+ private val c = config.getConfig("akka.stream.stream-refs")
+
+ val initialDemand = c.getInt("initial-demand")
+
+ val demandRedeliveryInterval = c.getDuration("demand-redelivery-interval", TimeUnit.MILLISECONDS).millis
+
+ val idleTimeout = c.getDuration("idle-timeout", TimeUnit.MILLISECONDS).millis
+}
diff --git a/akka-stream/src/main/scala/akka/stream/remote/serialization/StreamRefSerializer.scala b/akka-stream/src/main/scala/akka/stream/remote/serialization/StreamRefSerializer.scala
new file mode 100644
index 0000000000..cbae2e55d4
--- /dev/null
+++ b/akka-stream/src/main/scala/akka/stream/remote/serialization/StreamRefSerializer.scala
@@ -0,0 +1,160 @@
+/**
+ * Copyright (C) 2009-2017 Lightbend Inc.
+ */
+package akka.stream.remote.serialization
+
+import akka.actor.ExtendedActorSystem
+import akka.protobuf.ByteString
+import akka.serialization.{ BaseSerializer, Serialization, SerializationExtension, SerializerWithStringManifest }
+import akka.stream.remote.scaladsl.{ SinkRef, SourceRef }
+import akka.stream.remote.{ StreamRefContainers, StreamRefs }
+
+final class StreamRefSerializer(val system: ExtendedActorSystem) extends SerializerWithStringManifest
+ with BaseSerializer {
+
+ private[this] lazy val serialization = SerializationExtension(system)
+
+ private[this] val SequencedOnNextManifest = "A"
+ private[this] val CumulativeDemandManifest = "B"
+ private[this] val RemoteSinkFailureManifest = "C"
+ private[this] val RemoteSinkCompletedManifest = "D"
+ private[this] val SourceRefManifest = "E"
+ private[this] val SinkRefManifest = "F"
+
+ override def manifest(o: AnyRef): String = o match {
+ // protocol
+ case _: StreamRefs.SequencedOnNext[_] ⇒ SequencedOnNextManifest
+ case _: StreamRefs.CumulativeDemand ⇒ CumulativeDemandManifest
+ case _: StreamRefs.RemoteSinkFailure ⇒ RemoteSinkFailureManifest
+ case _: StreamRefs.RemoteSinkCompleted ⇒ RemoteSinkCompletedManifest
+ // refs
+ case _: SourceRef[_] ⇒ SourceRefManifest
+ case _: SinkRef[_] ⇒ SinkRefManifest
+ }
+
+ override def toBinary(o: AnyRef): Array[Byte] = o match {
+ // protocol
+ case o: StreamRefs.SequencedOnNext[_] ⇒ serializeSequencedOnNext(o).toByteArray
+ case d: StreamRefs.CumulativeDemand ⇒ serializeCumulativeDemand(d).toByteArray
+ case d: StreamRefs.RemoteSinkFailure ⇒ serializeRemoteSinkFailure(d).toByteArray
+ case d: StreamRefs.RemoteSinkCompleted ⇒ serializeRemoteSinkCompleted(d).toByteArray
+ // refs
+ case ref: SinkRef[_] ⇒ serializeSinkRef(ref).toByteArray
+ case ref: SourceRef[_] ⇒ serializeSourceRef(ref).toByteArray
+ }
+
+ override def fromBinary(bytes: Array[Byte], manifest: String): AnyRef = manifest match {
+ // protocol
+ case SequencedOnNextManifest ⇒ deserializeSequencedOnNext(bytes)
+ case CumulativeDemandManifest ⇒ deserializeCumulativeDemand(bytes)
+ case RemoteSinkCompletedManifest ⇒ deserializeRemoteSinkCompleted(bytes)
+ case RemoteSinkFailureManifest ⇒ deserializeRemoteSinkFailure(bytes)
+ // refs
+ case SinkRefManifest ⇒ deserializeSinkRef(bytes)
+ case SourceRefManifest ⇒ deserializeSourceRef(bytes)
+ }
+
+ // -----
+
+ private def serializeCumulativeDemand(d: StreamRefs.CumulativeDemand): StreamRefContainers.CumulativeDemand = {
+ StreamRefContainers.CumulativeDemand.newBuilder()
+ .setSeqNr(d.seqNr)
+ .build()
+ }
+
+ private def serializeRemoteSinkFailure(d: StreamRefs.RemoteSinkFailure): StreamRefContainers.RemoteSinkFailure = {
+ StreamRefContainers.RemoteSinkFailure.newBuilder()
+ .setCause(ByteString.copyFrom(d.msg.getBytes))
+ .build()
+ }
+
+ private def serializeRemoteSinkCompleted(d: StreamRefs.RemoteSinkCompleted): StreamRefContainers.RemoteSinkCompleted = {
+ StreamRefContainers.RemoteSinkCompleted.newBuilder()
+ .setSeqNr(d.seqNr)
+ .build()
+ }
+
+ private def serializeSequencedOnNext(o: StreamRefs.SequencedOnNext[_]) = {
+ val p = o.payload.asInstanceOf[AnyRef]
+ val msgSerializer = serialization.findSerializerFor(p)
+
+ val payloadBuilder = StreamRefContainers.Payload.newBuilder()
+ .setEnclosedMessage(ByteString.copyFrom(msgSerializer.toBinary(p)))
+ .setSerializerId(msgSerializer.identifier)
+
+ msgSerializer match {
+ case ser2: SerializerWithStringManifest ⇒
+ val manifest = ser2.manifest(p)
+ if (manifest != "")
+ payloadBuilder.setMessageManifest(ByteString.copyFromUtf8(manifest))
+ case _ ⇒
+ if (msgSerializer.includeManifest)
+ payloadBuilder.setMessageManifest(ByteString.copyFromUtf8(p.getClass.getName))
+ }
+
+ StreamRefContainers.SequencedOnNext.newBuilder()
+ .setSeqNr(o.seqNr)
+ .setPayload(payloadBuilder.build())
+ .build()
+ }
+
+ private def serializeSinkRef(sink: SinkRef[_]): StreamRefContainers.SinkRef = {
+ val actorRef = StreamRefContainers.ActorRef.newBuilder()
+ .setPath(Serialization.serializedActorPath(sink.targetRef))
+
+ StreamRefContainers.SinkRef.newBuilder()
+ .setInitialDemand(sink.initialDemand)
+ .setTargetRef(actorRef)
+ .build()
+ }
+
+ private def serializeSourceRef(source: SourceRef[_]): StreamRefContainers.SourceRef = {
+ val actorRef = StreamRefContainers.ActorRef.newBuilder()
+ .setPath(Serialization.serializedActorPath(source.originRef))
+
+ StreamRefContainers.SourceRef.newBuilder()
+ .setOriginRef(actorRef)
+ .build()
+ }
+
+ // ----------
+
+ private def deserializeSinkRef(bytes: Array[Byte]): SinkRef[Any] = {
+ val ref = StreamRefContainers.SinkRef.parseFrom(bytes)
+ val targetRef = serialization.system.provider.resolveActorRef(ref.getTargetRef.getPath)
+
+ new SinkRef[Any](targetRef, ref.getInitialDemand)
+ }
+
+ private def deserializeSourceRef(bytes: Array[Byte]): SourceRef[Any] = {
+ val ref = StreamRefContainers.SourceRef.parseFrom(bytes)
+ val targetRef = serialization.system.provider.resolveActorRef(ref.getOriginRef.getPath)
+
+ new SourceRef[Any](targetRef)
+ }
+
+ private def deserializeSequencedOnNext(bytes: Array[Byte]): AnyRef = {
+ val o = StreamRefContainers.SequencedOnNext.parseFrom(bytes)
+ val p = o.getPayload
+ val payload = serialization.deserialize(
+ p.getEnclosedMessage.toByteArray,
+ p.getSerializerId,
+ p.getMessageManifest.toStringUtf8
+ )
+ StreamRefs.SequencedOnNext(o.getSeqNr, payload.get)
+ }
+
+ private def deserializeCumulativeDemand(bytes: Array[Byte]): StreamRefs.CumulativeDemand = {
+ val d = StreamRefContainers.CumulativeDemand.parseFrom(bytes)
+ StreamRefs.CumulativeDemand(d.getSeqNr)
+ }
+ private def deserializeRemoteSinkCompleted(bytes: Array[Byte]): StreamRefs.RemoteSinkCompleted = {
+ val d = StreamRefContainers.RemoteSinkCompleted.parseFrom(bytes)
+ StreamRefs.RemoteSinkCompleted(d.getSeqNr)
+ }
+ private def deserializeRemoteSinkFailure(bytes: Array[Byte]): AnyRef = {
+ val d = StreamRefContainers.RemoteSinkFailure.parseFrom(bytes)
+ StreamRefs.RemoteSinkFailure(d.getCause.toStringUtf8)
+ }
+
+}
diff --git a/akka-stream/src/main/scala/akka/stream/stage/GraphStage.scala b/akka-stream/src/main/scala/akka/stream/stage/GraphStage.scala
index 3e0c26c78f..4b79749cd6 100644
--- a/akka-stream/src/main/scala/akka/stream/stage/GraphStage.scala
+++ b/akka-stream/src/main/scala/akka/stream/stage/GraphStage.scala
@@ -177,11 +177,14 @@ object GraphStageLogic {
/**
* Minimal actor to work with other actors and watch them in a synchronous ways
+ *
+ * @param name leave empty to use plain auto generated names
*/
final class StageActor(
materializer: ActorMaterializer,
getAsyncCallback: StageActorRef.Receive ⇒ AsyncCallback[(ActorRef, Any)],
- initialReceive: StageActorRef.Receive) {
+ initialReceive: StageActorRef.Receive,
+ name: String) {
private val callback = getAsyncCallback(internalReceive)
private def cell = materializer.supervisor match {
@@ -191,14 +194,13 @@ object GraphStageLogic {
throw new IllegalStateException(s"Stream supervisor must be a local actor, was [${unknown.getClass.getName}]")
}
- private val functionRef: FunctionRef = {
- cell.addFunctionRef {
+ private val functionRef: FunctionRef =
+ cell.addFunctionRef({
case (_, m @ (PoisonPill | Kill)) ⇒
materializer.logger.warning("{} message sent to StageActor({}) will be ignored, since it is not a real Actor." +
"Use a custom message type to communicate with it instead.", m, functionRef.path)
case pair ⇒ callback.invoke(pair)
- }
- }
+ }, name)
/**
* The ActorRef by which this StageActor can be contacted from the outside.
@@ -1162,12 +1164,38 @@ abstract class GraphStageLogic private[stream] (val inCount: Int, val outCount:
*/
// FIXME: I don't like the Pair allocation :(
@ApiMayChange
- final protected def getStageActor(receive: ((ActorRef, Any)) ⇒ Unit): StageActor = {
+ final protected def getStageActor(receive: ((ActorRef, Any)) ⇒ Unit): StageActor =
+ getStageActor(receive, name = "")
+
+ /**
+ * Initialize a named [[StageActorRef]] which can be used to interact with from the outside world "as-if" an [[Actor]].
+ * The messages are looped through the [[getAsyncCallback]] mechanism of [[GraphStage]] so they are safe to modify
+ * internal state of this stage.
+ *
+ * This method must (the earliest) be called after the [[GraphStageLogic]] constructor has finished running,
+ * for example from the [[preStart]] callback the graph stage logic provides.
+ *
+ * Created [[StageActorRef]] to get messages and watch other actors in synchronous way.
+ *
+ * The [[StageActorRef]]'s lifecycle is bound to the Stage, in other words when the Stage is finished,
+ * the Actor will be terminated as well. The entity backing the [[StageActorRef]] is not a real Actor,
+ * but the [[GraphStageLogic]] itself, therefore it does not react to [[PoisonPill]].
+ *
+ * @param receive callback that will be called upon receiving of a message by this special Actor
+ * @param name to be used in the Actor's name. An empty String will cause the usual auto generated name to be used
+ * @return minimal actor with watch method
+ */
+ @ApiMayChange
+ final protected def getStageActor(receive: ((ActorRef, Any)) ⇒ Unit, name: String): StageActor = {
_stageActor match {
case null ⇒
val actorMaterializer = ActorMaterializerHelper.downcast(interpreter.materializer)
- _stageActor = new StageActor(actorMaterializer, getAsyncCallback, receive)
+ _stageActor = new StageActor(actorMaterializer, getAsyncCallback, receive, name)
_stageActor
+ case existing if name != "" && existing.ref.path.name != name ⇒
+ throw new IllegalArgumentException(s"Illegal name argument ($name) in getStageActor! " +
+ s"It is not legal to change the name of the allocated stage actor. " +
+ s"The existing Actor is named [${existing.ref.path.name}], and must remain such throughout all getStageActor calls.")
case existing ⇒
existing.become(receive)
existing
diff --git a/build.sbt b/build.sbt
index 774fbace4a..daac3b402d 100644
--- a/build.sbt
+++ b/build.sbt
@@ -323,10 +323,11 @@ lazy val slf4j = akkaModule("akka-slf4j")
.settings(OSGi.slf4j)
lazy val stream = akkaModule("akka-stream")
- .dependsOn(actor)
+ .dependsOn(actor, protobuf)
.settings(Dependencies.stream)
.settings(AutomaticModuleName.settings("akka.stream"))
.settings(OSGi.stream)
+ .settings(Protobuf.settings)
.enablePlugins(BoilerplatePlugin)
lazy val streamTestkit = akkaModule("akka-stream-testkit")
@@ -337,7 +338,7 @@ lazy val streamTestkit = akkaModule("akka-stream-testkit")
.disablePlugins(MimaPlugin)
lazy val streamTests = akkaModule("akka-stream-tests")
- .dependsOn(streamTestkit % "test->test", stream)
+ .dependsOn(streamTestkit % "test->test", remote % "test->test", stream)
.settings(Dependencies.streamTests)
.enablePlugins(NoPublish)
.disablePlugins(MimaPlugin, WhiteSourcePlugin)