Use protobuf3 for internal serialization (#27366)

* Only load akka protobuf serializer if protobuf on the classpath
This commit is contained in:
Christopher Batey 2019-08-15 16:43:19 +01:00 committed by Patrik Nordwall
parent bbff92ade6
commit 6c13949aec
77 changed files with 59524 additions and 36063 deletions

View file

@ -255,13 +255,13 @@ All wire protocol changes that may concern rolling upgrades should be documented
## Protobuf
Akka includes a shaded version of protobuf `2.5.0` that is used for internal communication. To generate files
Akka includes a shaded version of protobuf `3.9.0` that is used for internal communication. To generate files
run `protobufGenerate`. The generated files are put in the `src/main/java` of each project and need to be commited.
The generated files are automatically transformed to use the shaded version of protobuf.
Generation depends on protoc `2.5.0` being on the path. Old versions of
Generation depends on protoc `3.9.0` being on the path. Old versions of
protoc can be downloaded from the [protobuf release page](https://github.com/protocolbuffers/protobuf/releases) and built from
source or downloaded from [maven central](http://repo1.maven.org/maven2/com/google/protobuf/protoc/2.5.0/). See
source or downloaded from [maven central](http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.9.0/). See
[Protobuf.scala](https://github.com/akka/akka/blob/master/project/Protobuf.scala) for details of how to override
the settings for generation.

View file

@ -434,7 +434,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
private[akka] val bindings: immutable.Seq[ClassSerializer] = {
val fromConfig = for {
(className: String, alias: String) <- settings.SerializationBindings
if alias != "none" && checkGoogleProtobuf(className)
if alias != "none" && checkGoogleProtobuf(className) && checkAkkaProtobuf(className)
} yield (system.dynamicAccess.getClassFor[Any](className).get, serializers(alias))
val fromSettings = serializerDetails.flatMap { detail =>
@ -469,8 +469,14 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
// i.e. com.google.protobuf dependency has been added in the application project.
// The reason for this special case is for backwards compatibility so that we still can
// include "com.google.protobuf.GeneratedMessage" = proto in configured serialization-bindings.
private def checkGoogleProtobuf(className: String): Boolean =
(!className.startsWith("com.google.protobuf") || system.dynamicAccess.getClassFor[Any](className).isSuccess)
private def checkGoogleProtobuf(className: String): Boolean = checkClass("com.google.protobuf", className)
// akka-protobuf is now not a dependency of remote so only load if user has explicitly added it
// remove in 2.7
private def checkAkkaProtobuf(className: String): Boolean = checkClass("akka.protobuf", className)
private def checkClass(prefix: String, className: String): Boolean =
!className.startsWith(prefix) || system.dynamicAccess.getClassFor[Any](className).isSuccess
/**
* Sort so that subtypes always precede their supertypes, but without

View file

@ -0,0 +1,6 @@
# Upgrade to protobuf 3
ProblemFilters.exclude[Problem]("akka.cluster.metrics.protobuf.msg.ClusterMetricsMessages*")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.cluster.metrics.protobuf.MessageSerializer.compress")
ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("akka.cluster.metrics.protobuf.msg.ClusterMetricsMessages#NodeMetrics#MetricOrBuilder.getDefaultInstanceForType")

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.cluster.metrics.protobuf.msg";
option optimize_for = SPEED;

View file

@ -13,7 +13,7 @@ import akka.cluster.metrics.protobuf.msg.{ ClusterMetricsMessages => cm }
import akka.cluster.metrics._
import akka.serialization.{ BaseSerializer, SerializationExtension, SerializerWithStringManifest, Serializers }
import akka.util.ClassLoaderObjectInputStream
import akka.protobuf.{ ByteString, MessageLite }
import akka.protobufv3.internal.{ ByteString, MessageLite }
import akka.util.ccompat._
import scala.annotation.tailrec

View file

@ -10,12 +10,18 @@ package akka.cluster.sharding.typed.internal.protobuf;
public final class ShardingMessages {
private ShardingMessages() {}
public static void registerAllExtensions(
akka.protobuf.ExtensionRegistry registry) {
akka.protobufv3.internal.ExtensionRegistryLite registry) {
}
public interface ShardingEnvelopeOrBuilder
extends akka.protobuf.MessageOrBuilder {
// required string entityId = 1;
public static void registerAllExtensions(
akka.protobufv3.internal.ExtensionRegistry registry) {
registerAllExtensions(
(akka.protobufv3.internal.ExtensionRegistryLite) registry);
}
public interface ShardingEnvelopeOrBuilder extends
// @@protoc_insertion_point(interface_extends:akka.cluster.sharding.typed.ShardingEnvelope)
akka.protobufv3.internal.MessageOrBuilder {
/**
* <code>required string entityId = 1;</code>
*/
@ -27,10 +33,9 @@ public final class ShardingMessages {
/**
* <code>required string entityId = 1;</code>
*/
akka.protobuf.ByteString
akka.protobufv3.internal.ByteString
getEntityIdBytes();
// required .Payload message = 2;
/**
* <code>required .Payload message = 2;</code>
*/
@ -47,39 +52,42 @@ public final class ShardingMessages {
/**
* Protobuf type {@code akka.cluster.sharding.typed.ShardingEnvelope}
*/
public static final class ShardingEnvelope extends
akka.protobuf.GeneratedMessage
implements ShardingEnvelopeOrBuilder {
public static final class ShardingEnvelope extends
akka.protobufv3.internal.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:akka.cluster.sharding.typed.ShardingEnvelope)
ShardingEnvelopeOrBuilder {
private static final long serialVersionUID = 0L;
// Use ShardingEnvelope.newBuilder() to construct.
private ShardingEnvelope(akka.protobuf.GeneratedMessage.Builder<?> builder) {
private ShardingEnvelope(akka.protobufv3.internal.GeneratedMessageV3.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ShardingEnvelope(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ShardingEnvelope defaultInstance;
public static ShardingEnvelope getDefaultInstance() {
return defaultInstance;
private ShardingEnvelope() {
entityId_ = "";
}
public ShardingEnvelope getDefaultInstanceForType() {
return defaultInstance;
}
private final akka.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final akka.protobuf.UnknownFieldSet
getUnknownFields() {
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
akka.protobufv3.internal.GeneratedMessageV3.UnusedPrivateParameter unused) {
return new ShardingEnvelope();
}
@java.lang.Override
public final akka.protobufv3.internal.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ShardingEnvelope(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
initFields();
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
akka.protobuf.UnknownFieldSet.Builder unknownFields =
akka.protobuf.UnknownFieldSet.newBuilder();
akka.protobufv3.internal.UnknownFieldSet.Builder unknownFields =
akka.protobufv3.internal.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
@ -88,21 +96,15 @@ public final class ShardingMessages {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
akka.protobufv3.internal.ByteString bs = input.readBytes();
bitField0_ |= 0x00000001;
entityId_ = input.readBytes();
entityId_ = bs;
break;
}
case 18: {
akka.remote.ContainerFormats.Payload.Builder subBuilder = null;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
if (((bitField0_ & 0x00000002) != 0)) {
subBuilder = message_.toBuilder();
}
message_ = input.readMessage(akka.remote.ContainerFormats.Payload.PARSER, extensionRegistry);
@ -113,54 +115,46 @@ public final class ShardingMessages {
bitField0_ |= 0x00000002;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (akka.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new akka.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
throw new akka.protobufv3.internal.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final akka.protobuf.Descriptors.Descriptor
public static final akka.protobufv3.internal.Descriptors.Descriptor
getDescriptor() {
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
@java.lang.Override
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_fieldAccessorTable
.ensureFieldAccessorsInitialized(
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.class, akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.Builder.class);
}
public static akka.protobuf.Parser<ShardingEnvelope> PARSER =
new akka.protobuf.AbstractParser<ShardingEnvelope>() {
public ShardingEnvelope parsePartialFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
return new ShardingEnvelope(input, extensionRegistry);
}
};
@java.lang.Override
public akka.protobuf.Parser<ShardingEnvelope> getParserForType() {
return PARSER;
}
private int bitField0_;
// required string entityId = 1;
public static final int ENTITYID_FIELD_NUMBER = 1;
private java.lang.Object entityId_;
private volatile java.lang.Object entityId_;
/**
* <code>required string entityId = 1;</code>
*/
public boolean hasEntityId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>required string entityId = 1;</code>
@ -170,8 +164,8 @@ public final class ShardingMessages {
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
akka.protobuf.ByteString bs =
(akka.protobuf.ByteString) ref;
akka.protobufv3.internal.ByteString bs =
(akka.protobufv3.internal.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
entityId_ = s;
@ -182,50 +176,47 @@ public final class ShardingMessages {
/**
* <code>required string entityId = 1;</code>
*/
public akka.protobuf.ByteString
public akka.protobufv3.internal.ByteString
getEntityIdBytes() {
java.lang.Object ref = entityId_;
if (ref instanceof java.lang.String) {
akka.protobuf.ByteString b =
akka.protobuf.ByteString.copyFromUtf8(
akka.protobufv3.internal.ByteString b =
akka.protobufv3.internal.ByteString.copyFromUtf8(
(java.lang.String) ref);
entityId_ = b;
return b;
} else {
return (akka.protobuf.ByteString) ref;
return (akka.protobufv3.internal.ByteString) ref;
}
}
// required .Payload message = 2;
public static final int MESSAGE_FIELD_NUMBER = 2;
private akka.remote.ContainerFormats.Payload message_;
/**
* <code>required .Payload message = 2;</code>
*/
public boolean hasMessage() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>required .Payload message = 2;</code>
*/
public akka.remote.ContainerFormats.Payload getMessage() {
return message_;
return message_ == null ? akka.remote.ContainerFormats.Payload.getDefaultInstance() : message_;
}
/**
* <code>required .Payload message = 2;</code>
*/
public akka.remote.ContainerFormats.PayloadOrBuilder getMessageOrBuilder() {
return message_;
return message_ == null ? akka.remote.ContainerFormats.Payload.getDefaultInstance() : message_;
}
private void initFields() {
entityId_ = "";
message_ = akka.remote.ContainerFormats.Payload.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasEntityId()) {
memoizedIsInitialized = 0;
@ -243,107 +234,167 @@ public final class ShardingMessages {
return true;
}
public void writeTo(akka.protobuf.CodedOutputStream output)
@java.lang.Override
public void writeTo(akka.protobufv3.internal.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getEntityIdBytes());
if (((bitField0_ & 0x00000001) != 0)) {
akka.protobufv3.internal.GeneratedMessageV3.writeString(output, 1, entityId_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeMessage(2, message_);
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(2, getMessage());
}
getUnknownFields().writeTo(output);
unknownFields.writeTo(output);
}
private int memoizedSerializedSize = -1;
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSerializedSize;
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += akka.protobuf.CodedOutputStream
.computeBytesSize(1, getEntityIdBytes());
if (((bitField0_ & 0x00000001) != 0)) {
size += akka.protobufv3.internal.GeneratedMessageV3.computeStringSize(1, entityId_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += akka.protobuf.CodedOutputStream
.computeMessageSize(2, message_);
if (((bitField0_ & 0x00000002) != 0)) {
size += akka.protobufv3.internal.CodedOutputStream
.computeMessageSize(2, getMessage());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
size += unknownFields.getSerializedSize();
memoizedSize = 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 boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope)) {
return super.equals(obj);
}
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope other = (akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope) obj;
if (hasEntityId() != other.hasEntityId()) return false;
if (hasEntityId()) {
if (!getEntityId()
.equals(other.getEntityId())) return false;
}
if (hasMessage() != other.hasMessage()) return false;
if (hasMessage()) {
if (!getMessage()
.equals(other.getMessage())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasEntityId()) {
hash = (37 * hash) + ENTITYID_FIELD_NUMBER;
hash = (53 * hash) + getEntityId().hashCode();
}
if (hasMessage()) {
hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
hash = (53 * hash) + getMessage().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobuf.ByteString data)
throws akka.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobuf.ByteString data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobufv3.internal.ByteString data)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobufv3.internal.ByteString data,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(byte[] data)
throws akka.protobuf.InvalidProtocolBufferException {
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
byte[] data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseDelimitedFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobuf.CodedInputStream input)
akka.protobufv3.internal.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parseFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope prototype) {
return newBuilder().mergeFrom(prototype);
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
akka.protobuf.GeneratedMessage.BuilderParent parent) {
akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
@ -351,14 +402,16 @@ public final class ShardingMessages {
* Protobuf type {@code akka.cluster.sharding.typed.ShardingEnvelope}
*/
public static final class Builder extends
akka.protobuf.GeneratedMessage.Builder<Builder>
implements akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelopeOrBuilder {
public static final akka.protobuf.Descriptors.Descriptor
akka.protobufv3.internal.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:akka.cluster.sharding.typed.ShardingEnvelope)
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelopeOrBuilder {
public static final akka.protobufv3.internal.Descriptors.Descriptor
getDescriptor() {
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
@java.lang.Override
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_fieldAccessorTable
.ensureFieldAccessorsInitialized(
@ -371,25 +424,23 @@ public final class ShardingMessages {
}
private Builder(
akka.protobuf.GeneratedMessage.BuilderParent parent) {
akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
if (akka.protobufv3.internal.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getMessageFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
@java.lang.Override
public Builder clear() {
super.clear();
entityId_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
if (messageBuilder_ == null) {
message_ = akka.remote.ContainerFormats.Payload.getDefaultInstance();
message_ = null;
} else {
messageBuilder_.clear();
}
@ -397,19 +448,18 @@ public final class ShardingMessages {
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public akka.protobuf.Descriptors.Descriptor
@java.lang.Override
public akka.protobufv3.internal.Descriptors.Descriptor
getDescriptorForType() {
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor;
}
@java.lang.Override
public akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope getDefaultInstanceForType() {
return akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope.getDefaultInstance();
}
@java.lang.Override
public akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope build() {
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope result = buildPartial();
if (!result.isInitialized()) {
@ -418,28 +468,62 @@ public final class ShardingMessages {
return result;
}
@java.lang.Override
public akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope buildPartial() {
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope result = new akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
if (((from_bitField0_ & 0x00000001) != 0)) {
to_bitField0_ |= 0x00000001;
}
result.entityId_ = entityId_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
if (((from_bitField0_ & 0x00000002) != 0)) {
if (messageBuilder_ == null) {
result.message_ = message_;
} else {
result.message_ = messageBuilder_.build();
}
to_bitField0_ |= 0x00000002;
}
if (messageBuilder_ == null) {
result.message_ = message_;
} else {
result.message_ = messageBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(akka.protobuf.Message other) {
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
akka.protobufv3.internal.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(akka.protobufv3.internal.Message other) {
if (other instanceof akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope) {
return mergeFrom((akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope)other);
} else {
@ -458,36 +542,36 @@ public final class ShardingMessages {
if (other.hasMessage()) {
mergeMessage(other.getMessage());
}
this.mergeUnknownFields(other.getUnknownFields());
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
if (!hasEntityId()) {
return false;
}
if (!hasMessage()) {
return false;
}
if (!getMessage().isInitialized()) {
return false;
}
return true;
}
@java.lang.Override
public Builder mergeFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (akka.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
parsedMessage = (akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope) e.getUnfinishedMessage();
throw e;
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
@ -497,13 +581,12 @@ public final class ShardingMessages {
}
private int bitField0_;
// required string entityId = 1;
private java.lang.Object entityId_ = "";
/**
* <code>required string entityId = 1;</code>
*/
public boolean hasEntityId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>required string entityId = 1;</code>
@ -511,9 +594,12 @@ public final class ShardingMessages {
public java.lang.String getEntityId() {
java.lang.Object ref = entityId_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((akka.protobuf.ByteString) ref)
.toStringUtf8();
entityId_ = s;
akka.protobufv3.internal.ByteString bs =
(akka.protobufv3.internal.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
entityId_ = s;
}
return s;
} else {
return (java.lang.String) ref;
@ -522,17 +608,17 @@ public final class ShardingMessages {
/**
* <code>required string entityId = 1;</code>
*/
public akka.protobuf.ByteString
public akka.protobufv3.internal.ByteString
getEntityIdBytes() {
java.lang.Object ref = entityId_;
if (ref instanceof String) {
akka.protobuf.ByteString b =
akka.protobuf.ByteString.copyFromUtf8(
akka.protobufv3.internal.ByteString b =
akka.protobufv3.internal.ByteString.copyFromUtf8(
(java.lang.String) ref);
entityId_ = b;
return b;
} else {
return (akka.protobuf.ByteString) ref;
return (akka.protobufv3.internal.ByteString) ref;
}
}
/**
@ -561,7 +647,7 @@ public final class ShardingMessages {
* <code>required string entityId = 1;</code>
*/
public Builder setEntityIdBytes(
akka.protobuf.ByteString value) {
akka.protobufv3.internal.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
@ -571,22 +657,21 @@ public final class ShardingMessages {
return this;
}
// required .Payload message = 2;
private akka.remote.ContainerFormats.Payload message_ = akka.remote.ContainerFormats.Payload.getDefaultInstance();
private akka.protobuf.SingleFieldBuilder<
private akka.remote.ContainerFormats.Payload message_;
private akka.protobufv3.internal.SingleFieldBuilderV3<
akka.remote.ContainerFormats.Payload, akka.remote.ContainerFormats.Payload.Builder, akka.remote.ContainerFormats.PayloadOrBuilder> messageBuilder_;
/**
* <code>required .Payload message = 2;</code>
*/
public boolean hasMessage() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>required .Payload message = 2;</code>
*/
public akka.remote.ContainerFormats.Payload getMessage() {
if (messageBuilder_ == null) {
return message_;
return message_ == null ? akka.remote.ContainerFormats.Payload.getDefaultInstance() : message_;
} else {
return messageBuilder_.getMessage();
}
@ -626,7 +711,8 @@ public final class ShardingMessages {
*/
public Builder mergeMessage(akka.remote.ContainerFormats.Payload value) {
if (messageBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002) &&
if (((bitField0_ & 0x00000002) != 0) &&
message_ != null &&
message_ != akka.remote.ContainerFormats.Payload.getDefaultInstance()) {
message_ =
akka.remote.ContainerFormats.Payload.newBuilder(message_).mergeFrom(value).buildPartial();
@ -645,7 +731,7 @@ public final class ShardingMessages {
*/
public Builder clearMessage() {
if (messageBuilder_ == null) {
message_ = akka.remote.ContainerFormats.Payload.getDefaultInstance();
message_ = null;
onChanged();
} else {
messageBuilder_.clear();
@ -668,48 +754,90 @@ public final class ShardingMessages {
if (messageBuilder_ != null) {
return messageBuilder_.getMessageOrBuilder();
} else {
return message_;
return message_ == null ?
akka.remote.ContainerFormats.Payload.getDefaultInstance() : message_;
}
}
/**
* <code>required .Payload message = 2;</code>
*/
private akka.protobuf.SingleFieldBuilder<
private akka.protobufv3.internal.SingleFieldBuilderV3<
akka.remote.ContainerFormats.Payload, akka.remote.ContainerFormats.Payload.Builder, akka.remote.ContainerFormats.PayloadOrBuilder>
getMessageFieldBuilder() {
if (messageBuilder_ == null) {
messageBuilder_ = new akka.protobuf.SingleFieldBuilder<
messageBuilder_ = new akka.protobufv3.internal.SingleFieldBuilderV3<
akka.remote.ContainerFormats.Payload, akka.remote.ContainerFormats.Payload.Builder, akka.remote.ContainerFormats.PayloadOrBuilder>(
message_,
getMessage(),
getParentForChildren(),
isClean());
message_ = null;
}
return messageBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:akka.cluster.sharding.typed.ShardingEnvelope)
}
// @@protoc_insertion_point(class_scope:akka.cluster.sharding.typed.ShardingEnvelope)
private static final akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope DEFAULT_INSTANCE;
static {
defaultInstance = new ShardingEnvelope(true);
defaultInstance.initFields();
DEFAULT_INSTANCE = new akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope();
}
public static akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final akka.protobufv3.internal.Parser<ShardingEnvelope>
PARSER = new akka.protobufv3.internal.AbstractParser<ShardingEnvelope>() {
@java.lang.Override
public ShardingEnvelope parsePartialFrom(
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return new ShardingEnvelope(input, extensionRegistry);
}
};
public static akka.protobufv3.internal.Parser<ShardingEnvelope> parser() {
return PARSER;
}
@java.lang.Override
public akka.protobufv3.internal.Parser<ShardingEnvelope> getParserForType() {
return PARSER;
}
@java.lang.Override
public akka.cluster.sharding.typed.internal.protobuf.ShardingMessages.ShardingEnvelope getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
// @@protoc_insertion_point(class_scope:akka.cluster.sharding.typed.ShardingEnvelope)
}
private static akka.protobuf.Descriptors.Descriptor
private static final akka.protobufv3.internal.Descriptors.Descriptor
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor;
private static
akka.protobuf.GeneratedMessage.FieldAccessorTable
private static final
akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_fieldAccessorTable;
public static akka.protobuf.Descriptors.FileDescriptor
public static akka.protobufv3.internal.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static akka.protobuf.Descriptors.FileDescriptor
private static akka.protobufv3.internal.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
@ -719,25 +847,18 @@ public final class ShardingMessages {
"essage\030\002 \002(\0132\010.PayloadB1\n-akka.cluster.s" +
"harding.typed.internal.protobufH\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_akka_cluster_sharding_typed_ShardingEnvelope_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_fieldAccessorTable = new
akka.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor,
new java.lang.String[] { "EntityId", "Message", });
return null;
}
};
akka.protobuf.Descriptors.FileDescriptor
descriptor = akka.protobufv3.internal.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new akka.protobuf.Descriptors.FileDescriptor[] {
new akka.protobufv3.internal.Descriptors.FileDescriptor[] {
akka.remote.ContainerFormats.getDescriptor(),
}, assigner);
});
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_fieldAccessorTable = new
akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable(
internal_static_akka_cluster_sharding_typed_ShardingEnvelope_descriptor,
new java.lang.String[] { "EntityId", "Message", });
akka.remote.ContainerFormats.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)

View file

@ -2,6 +2,8 @@
* Copyright (C) 2014-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
package akka.cluster.sharding.typed;
option java_package = "akka.cluster.sharding.typed.internal.protobuf";

View file

@ -17,3 +17,6 @@ ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.cluster.sharding.prot
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.cluster.sharding.protobuf.msg.ClusterShardingMessages#ShardRegionStatsOrBuilder.getFailed")
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.cluster.sharding.protobuf.msg.ClusterShardingMessages#ShardRegionStatsOrBuilder.getFailedBytes")
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.cluster.sharding.protobuf.msg.ClusterShardingMessages#ShardRegionStatsOrBuilder.getFailedCount")
# Upgrade to protobuf 3
ProblemFilters.exclude[Problem]("akka.cluster.sharding.protobuf.msg.*")

View file

@ -2,6 +2,8 @@
* Copyright (C) 2015-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.cluster.sharding.protobuf.msg";
option optimize_for = SPEED;

View file

@ -22,7 +22,7 @@ import akka.cluster.sharding.protobuf.msg.{ ClusterShardingMessages => sm }
import akka.serialization.BaseSerializer
import akka.serialization.Serialization
import akka.serialization.SerializerWithStringManifest
import akka.protobuf.MessageLite
import akka.protobufv3.internal.MessageLite
import akka.util.ccompat._
import java.io.NotSerializableException

View file

@ -54,7 +54,7 @@ abstract class ClusterShardingRememberEntitiesSpecConfig(val mode: String) exten
commonConfig(
ConfigFactory
.parseString(s"""
akka.loglevel = INFO
akka.loglevel = DEBUG
akka.actor.provider = "cluster"
akka.cluster.auto-down-unreachable-after = 0s
akka.remote.log-remote-lifecycle-events = off

View file

@ -10,17 +10,23 @@ package akka.cluster.client.protobuf.msg;
public final class ClusterClientMessages {
private ClusterClientMessages() {}
public static void registerAllExtensions(
akka.protobuf.ExtensionRegistry registry) {
akka.protobufv3.internal.ExtensionRegistryLite registry) {
}
public interface ContactsOrBuilder
extends akka.protobuf.MessageOrBuilder {
// repeated string contactPoints = 1;
public static void registerAllExtensions(
akka.protobufv3.internal.ExtensionRegistry registry) {
registerAllExtensions(
(akka.protobufv3.internal.ExtensionRegistryLite) registry);
}
public interface ContactsOrBuilder extends
// @@protoc_insertion_point(interface_extends:Contacts)
akka.protobufv3.internal.MessageOrBuilder {
/**
* <code>repeated string contactPoints = 1;</code>
*/
java.util.List<java.lang.String>
getContactPointsList();
getContactPointsList();
/**
* <code>repeated string contactPoints = 1;</code>
*/
@ -32,45 +38,48 @@ public final class ClusterClientMessages {
/**
* <code>repeated string contactPoints = 1;</code>
*/
akka.protobuf.ByteString
akka.protobufv3.internal.ByteString
getContactPointsBytes(int index);
}
/**
* Protobuf type {@code Contacts}
*/
public static final class Contacts extends
akka.protobuf.GeneratedMessage
implements ContactsOrBuilder {
public static final class Contacts extends
akka.protobufv3.internal.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:Contacts)
ContactsOrBuilder {
private static final long serialVersionUID = 0L;
// Use Contacts.newBuilder() to construct.
private Contacts(akka.protobuf.GeneratedMessage.Builder<?> builder) {
private Contacts(akka.protobufv3.internal.GeneratedMessageV3.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Contacts(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Contacts defaultInstance;
public static Contacts getDefaultInstance() {
return defaultInstance;
private Contacts() {
contactPoints_ = akka.protobufv3.internal.LazyStringArrayList.EMPTY;
}
public Contacts getDefaultInstanceForType() {
return defaultInstance;
}
private final akka.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final akka.protobuf.UnknownFieldSet
getUnknownFields() {
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
akka.protobufv3.internal.GeneratedMessageV3.UnusedPrivateParameter unused) {
return new Contacts();
}
@java.lang.Override
public final akka.protobufv3.internal.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Contacts(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
initFields();
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
akka.protobuf.UnknownFieldSet.Builder unknownFields =
akka.protobuf.UnknownFieldSet.newBuilder();
akka.protobufv3.internal.UnknownFieldSet.Builder unknownFields =
akka.protobufv3.internal.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
@ -79,70 +88,56 @@ public final class ClusterClientMessages {
case 0:
done = true;
break;
case 10: {
akka.protobufv3.internal.ByteString bs = input.readBytes();
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
contactPoints_ = new akka.protobufv3.internal.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
contactPoints_.add(bs);
break;
}
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
contactPoints_ = new akka.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
contactPoints_.add(input.readBytes());
break;
}
}
}
} catch (akka.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new akka.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
throw new akka.protobufv3.internal.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
contactPoints_ = new akka.protobuf.UnmodifiableLazyStringList(contactPoints_);
if (((mutable_bitField0_ & 0x00000001) != 0)) {
contactPoints_ = contactPoints_.getUnmodifiableView();
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final akka.protobuf.Descriptors.Descriptor
public static final akka.protobufv3.internal.Descriptors.Descriptor
getDescriptor() {
return akka.cluster.client.protobuf.msg.ClusterClientMessages.internal_static_Contacts_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
@java.lang.Override
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.cluster.client.protobuf.msg.ClusterClientMessages.internal_static_Contacts_fieldAccessorTable
.ensureFieldAccessorsInitialized(
akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts.class, akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts.Builder.class);
}
public static akka.protobuf.Parser<Contacts> PARSER =
new akka.protobuf.AbstractParser<Contacts>() {
public Contacts parsePartialFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
return new Contacts(input, extensionRegistry);
}
};
@java.lang.Override
public akka.protobuf.Parser<Contacts> getParserForType() {
return PARSER;
}
// repeated string contactPoints = 1;
public static final int CONTACTPOINTS_FIELD_NUMBER = 1;
private akka.protobuf.LazyStringList contactPoints_;
private akka.protobufv3.internal.LazyStringList contactPoints_;
/**
* <code>repeated string contactPoints = 1;</code>
*/
public java.util.List<java.lang.String>
public akka.protobufv3.internal.ProtocolStringList
getContactPointsList() {
return contactPoints_;
}
@ -161,122 +156,169 @@ public final class ClusterClientMessages {
/**
* <code>repeated string contactPoints = 1;</code>
*/
public akka.protobuf.ByteString
public akka.protobufv3.internal.ByteString
getContactPointsBytes(int index) {
return contactPoints_.getByteString(index);
}
private void initFields() {
contactPoints_ = akka.protobuf.LazyStringArrayList.EMPTY;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(akka.protobuf.CodedOutputStream output)
@java.lang.Override
public void writeTo(akka.protobufv3.internal.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < contactPoints_.size(); i++) {
output.writeBytes(1, contactPoints_.getByteString(i));
akka.protobufv3.internal.GeneratedMessageV3.writeString(output, 1, contactPoints_.getRaw(i));
}
getUnknownFields().writeTo(output);
unknownFields.writeTo(output);
}
private int memoizedSerializedSize = -1;
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSerializedSize;
int size = memoizedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < contactPoints_.size(); i++) {
dataSize += akka.protobuf.CodedOutputStream
.computeBytesSizeNoTag(contactPoints_.getByteString(i));
dataSize += computeStringSizeNoTag(contactPoints_.getRaw(i));
}
size += dataSize;
size += 1 * getContactPointsList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
size += unknownFields.getSerializedSize();
memoizedSize = 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 boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts)) {
return super.equals(obj);
}
akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts other = (akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts) obj;
if (!getContactPointsList()
.equals(other.getContactPointsList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getContactPointsCount() > 0) {
hash = (37 * hash) + CONTACTPOINTS_FIELD_NUMBER;
hash = (53 * hash) + getContactPointsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(
akka.protobuf.ByteString data)
throws akka.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(
akka.protobuf.ByteString data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(
akka.protobufv3.internal.ByteString data)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(
akka.protobufv3.internal.ByteString data,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(byte[] data)
throws akka.protobuf.InvalidProtocolBufferException {
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(
byte[] data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseDelimitedFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(
akka.protobuf.CodedInputStream input)
akka.protobufv3.internal.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parseFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts prototype) {
return newBuilder().mergeFrom(prototype);
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
akka.protobuf.GeneratedMessage.BuilderParent parent) {
akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
@ -284,14 +326,16 @@ public final class ClusterClientMessages {
* Protobuf type {@code Contacts}
*/
public static final class Builder extends
akka.protobuf.GeneratedMessage.Builder<Builder>
implements akka.cluster.client.protobuf.msg.ClusterClientMessages.ContactsOrBuilder {
public static final akka.protobuf.Descriptors.Descriptor
akka.protobufv3.internal.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:Contacts)
akka.cluster.client.protobuf.msg.ClusterClientMessages.ContactsOrBuilder {
public static final akka.protobufv3.internal.Descriptors.Descriptor
getDescriptor() {
return akka.cluster.client.protobuf.msg.ClusterClientMessages.internal_static_Contacts_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
@java.lang.Override
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.cluster.client.protobuf.msg.ClusterClientMessages.internal_static_Contacts_fieldAccessorTable
.ensureFieldAccessorsInitialized(
@ -304,38 +348,35 @@ public final class ClusterClientMessages {
}
private Builder(
akka.protobuf.GeneratedMessage.BuilderParent parent) {
akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
if (akka.protobufv3.internal.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
@java.lang.Override
public Builder clear() {
super.clear();
contactPoints_ = akka.protobuf.LazyStringArrayList.EMPTY;
contactPoints_ = akka.protobufv3.internal.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public akka.protobuf.Descriptors.Descriptor
@java.lang.Override
public akka.protobufv3.internal.Descriptors.Descriptor
getDescriptorForType() {
return akka.cluster.client.protobuf.msg.ClusterClientMessages.internal_static_Contacts_descriptor;
}
@java.lang.Override
public akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts getDefaultInstanceForType() {
return akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts.getDefaultInstance();
}
@java.lang.Override
public akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts build() {
akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts result = buildPartial();
if (!result.isInitialized()) {
@ -344,12 +385,12 @@ public final class ClusterClientMessages {
return result;
}
@java.lang.Override
public akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts buildPartial() {
akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts result = new akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
contactPoints_ = new akka.protobuf.UnmodifiableLazyStringList(
contactPoints_);
if (((bitField0_ & 0x00000001) != 0)) {
contactPoints_ = contactPoints_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.contactPoints_ = contactPoints_;
@ -357,7 +398,40 @@ public final class ClusterClientMessages {
return result;
}
public Builder mergeFrom(akka.protobuf.Message other) {
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
akka.protobufv3.internal.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(akka.protobufv3.internal.Message other) {
if (other instanceof akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts) {
return mergeFrom((akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts)other);
} else {
@ -378,24 +452,27 @@ public final class ClusterClientMessages {
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (akka.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
parsedMessage = (akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts) e.getUnfinishedMessage();
throw e;
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
@ -405,20 +482,19 @@ public final class ClusterClientMessages {
}
private int bitField0_;
// repeated string contactPoints = 1;
private akka.protobuf.LazyStringList contactPoints_ = akka.protobuf.LazyStringArrayList.EMPTY;
private akka.protobufv3.internal.LazyStringList contactPoints_ = akka.protobufv3.internal.LazyStringArrayList.EMPTY;
private void ensureContactPointsIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
contactPoints_ = new akka.protobuf.LazyStringArrayList(contactPoints_);
if (!((bitField0_ & 0x00000001) != 0)) {
contactPoints_ = new akka.protobufv3.internal.LazyStringArrayList(contactPoints_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated string contactPoints = 1;</code>
*/
public java.util.List<java.lang.String>
public akka.protobufv3.internal.ProtocolStringList
getContactPointsList() {
return java.util.Collections.unmodifiableList(contactPoints_);
return contactPoints_.getUnmodifiableView();
}
/**
* <code>repeated string contactPoints = 1;</code>
@ -435,7 +511,7 @@ public final class ClusterClientMessages {
/**
* <code>repeated string contactPoints = 1;</code>
*/
public akka.protobuf.ByteString
public akka.protobufv3.internal.ByteString
getContactPointsBytes(int index) {
return contactPoints_.getByteString(index);
}
@ -471,7 +547,8 @@ public final class ClusterClientMessages {
public Builder addAllContactPoints(
java.lang.Iterable<java.lang.String> values) {
ensureContactPointsIsMutable();
super.addAll(values, contactPoints_);
akka.protobufv3.internal.AbstractMessageLite.Builder.addAll(
values, contactPoints_);
onChanged();
return this;
}
@ -479,7 +556,7 @@ public final class ClusterClientMessages {
* <code>repeated string contactPoints = 1;</code>
*/
public Builder clearContactPoints() {
contactPoints_ = akka.protobuf.LazyStringArrayList.EMPTY;
contactPoints_ = akka.protobufv3.internal.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
@ -488,7 +565,7 @@ public final class ClusterClientMessages {
* <code>repeated string contactPoints = 1;</code>
*/
public Builder addContactPointsBytes(
akka.protobuf.ByteString value) {
akka.protobufv3.internal.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
@ -497,29 +574,70 @@ public final class ClusterClientMessages {
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:Contacts)
}
// @@protoc_insertion_point(class_scope:Contacts)
private static final akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts DEFAULT_INSTANCE;
static {
defaultInstance = new Contacts(true);
defaultInstance.initFields();
DEFAULT_INSTANCE = new akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts();
}
public static akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final akka.protobufv3.internal.Parser<Contacts>
PARSER = new akka.protobufv3.internal.AbstractParser<Contacts>() {
@java.lang.Override
public Contacts parsePartialFrom(
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return new Contacts(input, extensionRegistry);
}
};
public static akka.protobufv3.internal.Parser<Contacts> parser() {
return PARSER;
}
@java.lang.Override
public akka.protobufv3.internal.Parser<Contacts> getParserForType() {
return PARSER;
}
@java.lang.Override
public akka.cluster.client.protobuf.msg.ClusterClientMessages.Contacts getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
// @@protoc_insertion_point(class_scope:Contacts)
}
private static akka.protobuf.Descriptors.Descriptor
private static final akka.protobufv3.internal.Descriptors.Descriptor
internal_static_Contacts_descriptor;
private static
akka.protobuf.GeneratedMessage.FieldAccessorTable
private static final
akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internal_static_Contacts_fieldAccessorTable;
public static akka.protobuf.Descriptors.FileDescriptor
public static akka.protobufv3.internal.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static akka.protobuf.Descriptors.FileDescriptor
private static akka.protobufv3.internal.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
@ -527,24 +645,16 @@ public final class ClusterClientMessages {
"s\022\025\n\rcontactPoints\030\001 \003(\tB$\n akka.cluster" +
".client.protobuf.msgH\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_Contacts_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_Contacts_fieldAccessorTable = new
akka.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_Contacts_descriptor,
new java.lang.String[] { "ContactPoints", });
return null;
}
};
akka.protobuf.Descriptors.FileDescriptor
descriptor = akka.protobufv3.internal.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new akka.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
new akka.protobufv3.internal.Descriptors.FileDescriptor[] {
});
internal_static_Contacts_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_Contacts_fieldAccessorTable = new
akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable(
internal_static_Contacts_descriptor,
new java.lang.String[] { "ContactPoints", });
}
// @@protoc_insertion_point(outer_class_scope)

View file

@ -0,0 +1,3 @@
# Protobuf 3
ProblemFilters.exclude[Problem]("akka.cluster.client.protobuf.msg.*")
ProblemFilters.exclude[Problem]("akka.cluster.pubsub.protobuf.msg.*")

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.cluster.client.protobuf.msg";
option optimize_for = SPEED;

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.cluster.pubsub.protobuf.msg";
option optimize_for = SPEED;

View file

@ -7,7 +7,7 @@ package akka.cluster.pubsub.protobuf
import akka.serialization._
import akka.actor.{ Address, ExtendedActorSystem }
import java.io.{ ByteArrayInputStream, ByteArrayOutputStream }
import akka.protobuf.{ ByteString, MessageLite }
import akka.protobufv3.internal.{ ByteString, MessageLite }
import java.util.zip.GZIPOutputStream
import java.util.zip.GZIPInputStream
import scala.annotation.tailrec

View file

@ -10,12 +10,18 @@ package akka.cluster.typed.internal.protobuf;
public final class ClusterMessages {
private ClusterMessages() {}
public static void registerAllExtensions(
akka.protobuf.ExtensionRegistry registry) {
akka.protobufv3.internal.ExtensionRegistryLite registry) {
}
public interface ReceptionistEntryOrBuilder
extends akka.protobuf.MessageOrBuilder {
// required string actorRef = 1;
public static void registerAllExtensions(
akka.protobufv3.internal.ExtensionRegistry registry) {
registerAllExtensions(
(akka.protobufv3.internal.ExtensionRegistryLite) registry);
}
public interface ReceptionistEntryOrBuilder extends
// @@protoc_insertion_point(interface_extends:akka.cluster.typed.ReceptionistEntry)
akka.protobufv3.internal.MessageOrBuilder {
/**
* <code>required string actorRef = 1;</code>
*/
@ -27,10 +33,9 @@ public final class ClusterMessages {
/**
* <code>required string actorRef = 1;</code>
*/
akka.protobuf.ByteString
akka.protobufv3.internal.ByteString
getActorRefBytes();
// required uint64 systemUid = 2;
/**
* <code>required uint64 systemUid = 2;</code>
*/
@ -43,39 +48,42 @@ public final class ClusterMessages {
/**
* Protobuf type {@code akka.cluster.typed.ReceptionistEntry}
*/
public static final class ReceptionistEntry extends
akka.protobuf.GeneratedMessage
implements ReceptionistEntryOrBuilder {
public static final class ReceptionistEntry extends
akka.protobufv3.internal.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:akka.cluster.typed.ReceptionistEntry)
ReceptionistEntryOrBuilder {
private static final long serialVersionUID = 0L;
// Use ReceptionistEntry.newBuilder() to construct.
private ReceptionistEntry(akka.protobuf.GeneratedMessage.Builder<?> builder) {
private ReceptionistEntry(akka.protobufv3.internal.GeneratedMessageV3.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private ReceptionistEntry(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ReceptionistEntry defaultInstance;
public static ReceptionistEntry getDefaultInstance() {
return defaultInstance;
private ReceptionistEntry() {
actorRef_ = "";
}
public ReceptionistEntry getDefaultInstanceForType() {
return defaultInstance;
}
private final akka.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final akka.protobuf.UnknownFieldSet
getUnknownFields() {
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
akka.protobufv3.internal.GeneratedMessageV3.UnusedPrivateParameter unused) {
return new ReceptionistEntry();
}
@java.lang.Override
public final akka.protobufv3.internal.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ReceptionistEntry(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
initFields();
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
akka.protobuf.UnknownFieldSet.Builder unknownFields =
akka.protobuf.UnknownFieldSet.newBuilder();
akka.protobufv3.internal.UnknownFieldSet.Builder unknownFields =
akka.protobufv3.internal.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
@ -84,16 +92,10 @@ public final class ClusterMessages {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
akka.protobufv3.internal.ByteString bs = input.readBytes();
bitField0_ |= 0x00000001;
actorRef_ = input.readBytes();
actorRef_ = bs;
break;
}
case 16: {
@ -101,54 +103,46 @@ public final class ClusterMessages {
systemUid_ = input.readUInt64();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (akka.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new akka.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
throw new akka.protobufv3.internal.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final akka.protobuf.Descriptors.Descriptor
public static final akka.protobufv3.internal.Descriptors.Descriptor
getDescriptor() {
return akka.cluster.typed.internal.protobuf.ClusterMessages.internal_static_akka_cluster_typed_ReceptionistEntry_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
@java.lang.Override
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.cluster.typed.internal.protobuf.ClusterMessages.internal_static_akka_cluster_typed_ReceptionistEntry_fieldAccessorTable
.ensureFieldAccessorsInitialized(
akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry.class, akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry.Builder.class);
}
public static akka.protobuf.Parser<ReceptionistEntry> PARSER =
new akka.protobuf.AbstractParser<ReceptionistEntry>() {
public ReceptionistEntry parsePartialFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
return new ReceptionistEntry(input, extensionRegistry);
}
};
@java.lang.Override
public akka.protobuf.Parser<ReceptionistEntry> getParserForType() {
return PARSER;
}
private int bitField0_;
// required string actorRef = 1;
public static final int ACTORREF_FIELD_NUMBER = 1;
private java.lang.Object actorRef_;
private volatile java.lang.Object actorRef_;
/**
* <code>required string actorRef = 1;</code>
*/
public boolean hasActorRef() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>required string actorRef = 1;</code>
@ -158,8 +152,8 @@ public final class ClusterMessages {
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
akka.protobuf.ByteString bs =
(akka.protobuf.ByteString) ref;
akka.protobufv3.internal.ByteString bs =
(akka.protobufv3.internal.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
actorRef_ = s;
@ -170,28 +164,27 @@ public final class ClusterMessages {
/**
* <code>required string actorRef = 1;</code>
*/
public akka.protobuf.ByteString
public akka.protobufv3.internal.ByteString
getActorRefBytes() {
java.lang.Object ref = actorRef_;
if (ref instanceof java.lang.String) {
akka.protobuf.ByteString b =
akka.protobuf.ByteString.copyFromUtf8(
akka.protobufv3.internal.ByteString b =
akka.protobufv3.internal.ByteString.copyFromUtf8(
(java.lang.String) ref);
actorRef_ = b;
return b;
} else {
return (akka.protobuf.ByteString) ref;
return (akka.protobufv3.internal.ByteString) ref;
}
}
// required uint64 systemUid = 2;
public static final int SYSTEMUID_FIELD_NUMBER = 2;
private long systemUid_;
/**
* <code>required uint64 systemUid = 2;</code>
*/
public boolean hasSystemUid() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>required uint64 systemUid = 2;</code>
@ -200,14 +193,12 @@ public final class ClusterMessages {
return systemUid_;
}
private void initFields() {
actorRef_ = "";
systemUid_ = 0L;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasActorRef()) {
memoizedIsInitialized = 0;
@ -221,107 +212,168 @@ public final class ClusterMessages {
return true;
}
public void writeTo(akka.protobuf.CodedOutputStream output)
@java.lang.Override
public void writeTo(akka.protobufv3.internal.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getActorRefBytes());
if (((bitField0_ & 0x00000001) != 0)) {
akka.protobufv3.internal.GeneratedMessageV3.writeString(output, 1, actorRef_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
if (((bitField0_ & 0x00000002) != 0)) {
output.writeUInt64(2, systemUid_);
}
getUnknownFields().writeTo(output);
unknownFields.writeTo(output);
}
private int memoizedSerializedSize = -1;
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSerializedSize;
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += akka.protobuf.CodedOutputStream
.computeBytesSize(1, getActorRefBytes());
if (((bitField0_ & 0x00000001) != 0)) {
size += akka.protobufv3.internal.GeneratedMessageV3.computeStringSize(1, actorRef_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += akka.protobuf.CodedOutputStream
if (((bitField0_ & 0x00000002) != 0)) {
size += akka.protobufv3.internal.CodedOutputStream
.computeUInt64Size(2, systemUid_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
size += unknownFields.getSerializedSize();
memoizedSize = 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 boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry)) {
return super.equals(obj);
}
akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry other = (akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry) obj;
if (hasActorRef() != other.hasActorRef()) return false;
if (hasActorRef()) {
if (!getActorRef()
.equals(other.getActorRef())) return false;
}
if (hasSystemUid() != other.hasSystemUid()) return false;
if (hasSystemUid()) {
if (getSystemUid()
!= other.getSystemUid()) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasActorRef()) {
hash = (37 * hash) + ACTORREF_FIELD_NUMBER;
hash = (53 * hash) + getActorRef().hashCode();
}
if (hasSystemUid()) {
hash = (37 * hash) + SYSTEMUID_FIELD_NUMBER;
hash = (53 * hash) + akka.protobufv3.internal.Internal.hashLong(
getSystemUid());
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(
akka.protobuf.ByteString data)
throws akka.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(
akka.protobuf.ByteString data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(
akka.protobufv3.internal.ByteString data)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(
akka.protobufv3.internal.ByteString data,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(byte[] data)
throws akka.protobuf.InvalidProtocolBufferException {
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(
byte[] data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseDelimitedFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(
akka.protobuf.CodedInputStream input)
akka.protobufv3.internal.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parseFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry prototype) {
return newBuilder().mergeFrom(prototype);
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
akka.protobuf.GeneratedMessage.BuilderParent parent) {
akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
@ -329,14 +381,16 @@ public final class ClusterMessages {
* Protobuf type {@code akka.cluster.typed.ReceptionistEntry}
*/
public static final class Builder extends
akka.protobuf.GeneratedMessage.Builder<Builder>
implements akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntryOrBuilder {
public static final akka.protobuf.Descriptors.Descriptor
akka.protobufv3.internal.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:akka.cluster.typed.ReceptionistEntry)
akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntryOrBuilder {
public static final akka.protobufv3.internal.Descriptors.Descriptor
getDescriptor() {
return akka.cluster.typed.internal.protobuf.ClusterMessages.internal_static_akka_cluster_typed_ReceptionistEntry_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
@java.lang.Override
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.cluster.typed.internal.protobuf.ClusterMessages.internal_static_akka_cluster_typed_ReceptionistEntry_fieldAccessorTable
.ensureFieldAccessorsInitialized(
@ -349,18 +403,16 @@ public final class ClusterMessages {
}
private Builder(
akka.protobuf.GeneratedMessage.BuilderParent parent) {
akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
if (akka.protobufv3.internal.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
@java.lang.Override
public Builder clear() {
super.clear();
actorRef_ = "";
@ -370,19 +422,18 @@ public final class ClusterMessages {
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public akka.protobuf.Descriptors.Descriptor
@java.lang.Override
public akka.protobufv3.internal.Descriptors.Descriptor
getDescriptorForType() {
return akka.cluster.typed.internal.protobuf.ClusterMessages.internal_static_akka_cluster_typed_ReceptionistEntry_descriptor;
}
@java.lang.Override
public akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry getDefaultInstanceForType() {
return akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry.getDefaultInstance();
}
@java.lang.Override
public akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry build() {
akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry result = buildPartial();
if (!result.isInitialized()) {
@ -391,24 +442,58 @@ public final class ClusterMessages {
return result;
}
@java.lang.Override
public akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry buildPartial() {
akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry result = new akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
if (((from_bitField0_ & 0x00000001) != 0)) {
to_bitField0_ |= 0x00000001;
}
result.actorRef_ = actorRef_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
if (((from_bitField0_ & 0x00000002) != 0)) {
result.systemUid_ = systemUid_;
to_bitField0_ |= 0x00000002;
}
result.systemUid_ = systemUid_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(akka.protobuf.Message other) {
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
akka.protobufv3.internal.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(akka.protobufv3.internal.Message other) {
if (other instanceof akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry) {
return mergeFrom((akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry)other);
} else {
@ -427,32 +512,33 @@ public final class ClusterMessages {
if (other.hasSystemUid()) {
setSystemUid(other.getSystemUid());
}
this.mergeUnknownFields(other.getUnknownFields());
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
if (!hasActorRef()) {
return false;
}
if (!hasSystemUid()) {
return false;
}
return true;
}
@java.lang.Override
public Builder mergeFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (akka.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
parsedMessage = (akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry) e.getUnfinishedMessage();
throw e;
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
@ -462,13 +548,12 @@ public final class ClusterMessages {
}
private int bitField0_;
// required string actorRef = 1;
private java.lang.Object actorRef_ = "";
/**
* <code>required string actorRef = 1;</code>
*/
public boolean hasActorRef() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>required string actorRef = 1;</code>
@ -476,9 +561,12 @@ public final class ClusterMessages {
public java.lang.String getActorRef() {
java.lang.Object ref = actorRef_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((akka.protobuf.ByteString) ref)
.toStringUtf8();
actorRef_ = s;
akka.protobufv3.internal.ByteString bs =
(akka.protobufv3.internal.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
actorRef_ = s;
}
return s;
} else {
return (java.lang.String) ref;
@ -487,17 +575,17 @@ public final class ClusterMessages {
/**
* <code>required string actorRef = 1;</code>
*/
public akka.protobuf.ByteString
public akka.protobufv3.internal.ByteString
getActorRefBytes() {
java.lang.Object ref = actorRef_;
if (ref instanceof String) {
akka.protobuf.ByteString b =
akka.protobuf.ByteString.copyFromUtf8(
akka.protobufv3.internal.ByteString b =
akka.protobufv3.internal.ByteString.copyFromUtf8(
(java.lang.String) ref);
actorRef_ = b;
return b;
} else {
return (akka.protobuf.ByteString) ref;
return (akka.protobufv3.internal.ByteString) ref;
}
}
/**
@ -526,7 +614,7 @@ public final class ClusterMessages {
* <code>required string actorRef = 1;</code>
*/
public Builder setActorRefBytes(
akka.protobuf.ByteString value) {
akka.protobufv3.internal.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
@ -536,13 +624,12 @@ public final class ClusterMessages {
return this;
}
// required uint64 systemUid = 2;
private long systemUid_ ;
/**
* <code>required uint64 systemUid = 2;</code>
*/
public boolean hasSystemUid() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>required uint64 systemUid = 2;</code>
@ -568,29 +655,70 @@ public final class ClusterMessages {
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:akka.cluster.typed.ReceptionistEntry)
}
// @@protoc_insertion_point(class_scope:akka.cluster.typed.ReceptionistEntry)
private static final akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry DEFAULT_INSTANCE;
static {
defaultInstance = new ReceptionistEntry(true);
defaultInstance.initFields();
DEFAULT_INSTANCE = new akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry();
}
public static akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final akka.protobufv3.internal.Parser<ReceptionistEntry>
PARSER = new akka.protobufv3.internal.AbstractParser<ReceptionistEntry>() {
@java.lang.Override
public ReceptionistEntry parsePartialFrom(
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return new ReceptionistEntry(input, extensionRegistry);
}
};
public static akka.protobufv3.internal.Parser<ReceptionistEntry> parser() {
return PARSER;
}
@java.lang.Override
public akka.protobufv3.internal.Parser<ReceptionistEntry> getParserForType() {
return PARSER;
}
@java.lang.Override
public akka.cluster.typed.internal.protobuf.ClusterMessages.ReceptionistEntry getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
// @@protoc_insertion_point(class_scope:akka.cluster.typed.ReceptionistEntry)
}
private static akka.protobuf.Descriptors.Descriptor
private static final akka.protobufv3.internal.Descriptors.Descriptor
internal_static_akka_cluster_typed_ReceptionistEntry_descriptor;
private static
akka.protobuf.GeneratedMessage.FieldAccessorTable
private static final
akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internal_static_akka_cluster_typed_ReceptionistEntry_fieldAccessorTable;
public static akka.protobuf.Descriptors.FileDescriptor
public static akka.protobufv3.internal.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static akka.protobuf.Descriptors.FileDescriptor
private static akka.protobufv3.internal.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
@ -599,24 +727,16 @@ public final class ClusterMessages {
"(\t\022\021\n\tsystemUid\030\002 \002(\004B(\n$akka.cluster.ty" +
"ped.internal.protobufH\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_akka_cluster_typed_ReceptionistEntry_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_akka_cluster_typed_ReceptionistEntry_fieldAccessorTable = new
akka.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_akka_cluster_typed_ReceptionistEntry_descriptor,
new java.lang.String[] { "ActorRef", "SystemUid", });
return null;
}
};
akka.protobuf.Descriptors.FileDescriptor
descriptor = akka.protobufv3.internal.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new akka.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
new akka.protobufv3.internal.Descriptors.FileDescriptor[] {
});
internal_static_akka_cluster_typed_ReceptionistEntry_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_akka_cluster_typed_ReceptionistEntry_fieldAccessorTable = new
akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable(
internal_static_akka_cluster_typed_ReceptionistEntry_descriptor,
new java.lang.String[] { "ActorRef", "SystemUid", });
}
// @@protoc_insertion_point(outer_class_scope)

View file

@ -2,6 +2,8 @@
* Copyright (C) 2014-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
package akka.cluster.typed;
option java_package = "akka.cluster.typed.internal.protobuf";

View file

@ -19,4 +19,6 @@ ProblemFilters.exclude[MissingTypesProblem]("akka.cluster.protobuf.msg.ClusterMe
ProblemFilters.exclude[MissingTypesProblem]("akka.cluster.protobuf.msg.ClusterMessages$ConfigCheck$Builder")
ProblemFilters.exclude[MissingTypesProblem]("akka.cluster.protobuf.msg.ClusterMessages$ConfigCheck")
# Upgrade to protobuf 3
ProblemFilters.exclude[Problem]("akka.cluster.protobuf.msg.ClusterMessages*")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.cluster.protobuf.ClusterMessageSerializer.compress")

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.cluster.protobuf.msg";
option optimize_for = SPEED;

View file

@ -11,7 +11,7 @@ import akka.actor.{ Address, ExtendedActorSystem }
import akka.cluster._
import akka.cluster.protobuf.msg.{ ClusterMessages => cm }
import akka.serialization._
import akka.protobuf.{ ByteString, MessageLite }
import akka.protobufv3.internal.{ ByteString, MessageLite }
import scala.annotation.tailrec
import scala.collection.immutable
@ -273,7 +273,7 @@ final class ClusterMessageSerializer(val system: ExtendedActorSystem)
InternalClusterAction.InitJoinAck(addressFromProto(i.getAddress), configCheck)
} catch {
case _: akka.protobuf.InvalidProtocolBufferException =>
case _: akka.protobufv3.internal.InvalidProtocolBufferException =>
// nodes previous to 2.5.9 sends just an address
InternalClusterAction.InitJoinAck(addressFromBinary(bytes), UncheckedConfig)
}

View file

@ -0,0 +1,2 @@
# Upgrade to protobuf 3
ProblemFilters.exclude[Problem]("akka.cluster.ddata.protobuf.*")

View file

@ -2,6 +2,8 @@
* Copyright (C) 2014-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
package akka.cluster.ddata;
option java_package = "akka.cluster.ddata.protobuf.msg";

View file

@ -2,6 +2,8 @@
* Copyright (C) 2014-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
package akka.cluster.ddata;
option java_package = "akka.cluster.ddata.protobuf.msg";

View file

@ -8,12 +8,11 @@ import java.{ util, lang => jl }
import java.util.ArrayList
import java.util.Collections
import java.util.Comparator
import java.util.TreeSet
import scala.annotation.tailrec
import akka.util.ccompat.JavaConverters._
import scala.collection.immutable
import scala.collection.immutable
import akka.actor.ExtendedActorSystem
import akka.cluster.ddata._
import akka.cluster.ddata.Replicator.Internal._
@ -21,14 +20,15 @@ import akka.cluster.ddata.protobuf.msg.{ ReplicatedDataMessages => rd }
import akka.cluster.ddata.protobuf.msg.{ ReplicatorMessages => dm }
import akka.serialization.SerializerWithStringManifest
import akka.serialization.BaseSerializer
import akka.protobuf.{ ByteString, GeneratedMessage }
import akka.protobufv3.internal.{ ByteString, GeneratedMessageV3 }
import akka.util.ByteString.UTF_8
import java.io.NotSerializableException
import java.util
import com.github.ghik.silencer.silent
import akka.actor.ActorRef
import akka.cluster.ddata.protobuf.msg.ReplicatorMessages.OtherMessage
import akka.protobufv3.internal.GeneratedMessageV3
import akka.serialization.Serialization
import akka.util.ccompat._
@ -37,7 +37,7 @@ private object ReplicatedDataSerializer {
/*
* Generic superclass to allow to compare Entry types used in protobuf.
*/
abstract class KeyComparator[A <: GeneratedMessage] extends Comparator[A] {
abstract class KeyComparator[A <: GeneratedMessageV3] extends Comparator[A] {
/**
* Get the key from the entry. The key may be a String, Int, Long, or OtherMessage
@ -95,14 +95,16 @@ private object ReplicatedDataSerializer {
}
sealed trait ProtoMapEntryWriter[
Entry <: GeneratedMessage, EntryBuilder <: GeneratedMessage.Builder[EntryBuilder], Value <: GeneratedMessage] {
Entry <: GeneratedMessageV3,
EntryBuilder <: GeneratedMessageV3.Builder[EntryBuilder],
Value <: GeneratedMessageV3] {
def setStringKey(builder: EntryBuilder, key: String, value: Value): Entry
def setLongKey(builder: EntryBuilder, key: Long, value: Value): Entry
def setIntKey(builder: EntryBuilder, key: Int, value: Value): Entry
def setOtherKey(builder: EntryBuilder, key: dm.OtherMessage, value: Value): Entry
}
sealed trait ProtoMapEntryReader[Entry <: GeneratedMessage, A <: GeneratedMessage] {
sealed trait ProtoMapEntryReader[Entry <: GeneratedMessageV3, A <: GeneratedMessageV3] {
def hasStringKey(entry: Entry): Boolean
def getStringKey(entry: Entry): String
def hasIntKey(entry: Entry): Boolean
@ -659,16 +661,16 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
private def getEntries[
IKey,
IValue,
EntryBuilder <: GeneratedMessage.Builder[EntryBuilder],
PEntry <: GeneratedMessage,
PValue <: GeneratedMessage](
EntryBuilder <: GeneratedMessageV3.Builder[EntryBuilder],
PEntry <: GeneratedMessageV3,
PValue <: GeneratedMessageV3](
input: Map[IKey, IValue],
createBuilder: () => EntryBuilder,
valueConverter: IValue => PValue)(
implicit comparator: Comparator[PEntry],
eh: ProtoMapEntryWriter[PEntry, EntryBuilder, PValue]): java.lang.Iterable[PEntry] = {
// The resulting Iterable needs to be ordered deterministically in order to create same signature upon serializing same data
val protoEntries = new TreeSet[PEntry](comparator)
val protoEntries = new util.TreeSet[PEntry](comparator)
input.foreach {
case (key: String, value) => protoEntries.add(eh.setStringKey(createBuilder(), key, valueConverter(value)))
case (key: Int, value) => protoEntries.add(eh.setIntKey(createBuilder(), key, valueConverter(value)))
@ -689,7 +691,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
def ormapFromBinary(bytes: Array[Byte]): ORMap[Any, ReplicatedData] =
ormapFromProto(rd.ORMap.parseFrom(decompress(bytes)))
def mapTypeFromProto[PEntry <: GeneratedMessage, A <: GeneratedMessage, B <: ReplicatedData](
def mapTypeFromProto[PEntry <: GeneratedMessageV3, A <: GeneratedMessageV3, B <: ReplicatedData](
input: util.List[PEntry],
valueCreator: A => B)(implicit eh: ProtoMapEntryReader[PEntry, A]): Map[Any, B] = {
input.asScala.map { entry =>
@ -710,7 +712,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
new ORMap(keys = orsetFromProto(ormap.getKeys), entries, ORMap.VanillaORMapTag)
}
def singleMapEntryFromProto[PEntry <: GeneratedMessage, A <: GeneratedMessage, B <: ReplicatedData](
def singleMapEntryFromProto[PEntry <: GeneratedMessageV3, A <: GeneratedMessageV3, B <: ReplicatedData](
input: util.List[PEntry],
valueCreator: A => B)(implicit eh: ProtoMapEntryReader[PEntry, A]): Map[Any, B] = {
val map = mapTypeFromProto(input, valueCreator)
@ -721,7 +723,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
map
}
def singleKeyEntryFromProto[PEntry <: GeneratedMessage, A <: GeneratedMessage](entryOption: Option[PEntry])(
def singleKeyEntryFromProto[PEntry <: GeneratedMessageV3, A <: GeneratedMessageV3](entryOption: Option[PEntry])(
implicit eh: ProtoMapEntryReader[PEntry, A]): Any =
entryOption match {
case Some(entry) =>

View file

@ -21,7 +21,7 @@ import akka.serialization.Serialization
import akka.serialization.SerializerWithStringManifest
import akka.serialization.BaseSerializer
import akka.util.{ ByteString => AkkaByteString }
import akka.protobuf.ByteString
import akka.protobufv3.internal.ByteString
import akka.cluster.ddata.Key.KeyR
import java.util.concurrent.atomic.AtomicInteger
import scala.annotation.tailrec

View file

@ -17,8 +17,8 @@ import akka.actor.ExtendedActorSystem
import akka.cluster.UniqueAddress
import akka.cluster.ddata.protobuf.msg.{ ReplicatorMessages => dm }
import akka.serialization._
import akka.protobuf.ByteString
import akka.protobuf.MessageLite
import akka.protobufv3.internal.ByteString
import akka.protobufv3.internal.MessageLite
import akka.cluster.ddata.VersionVector
import akka.util.ccompat._

View file

@ -7,7 +7,6 @@ package akka.cluster.ddata
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.util.control.NoStackTrace
import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.ActorSystem
@ -18,12 +17,13 @@ import akka.remote.testkit.MultiNodeConfig
import akka.remote.testkit.MultiNodeSpec
import akka.testkit._
import com.typesafe.config.ConfigFactory
import org.scalatest.CancelAfterFailure
final case class DurableDataSpecConfig(writeBehind: Boolean) extends MultiNodeConfig {
val first = role("first")
val second = role("second")
commonConfig(ConfigFactory.parseString(s"""
commonConfig(ConfigFactory.parseString(s"""akka.loglevel = DEBUG
akka.actor.provider = "akka.cluster.ClusterActorRefProvider"
akka.log-dead-letters-during-shutdown = off
akka.cluster.distributed-data.durable.keys = ["durable*"]
@ -46,7 +46,7 @@ object DurableDataSpec {
def receive = {
case LoadAll =>
if (failLoad)
throw new LoadFailed("failed to load durable distributed-data") with NoStackTrace
throw new LoadFailed("TestDurableStore: failed to load durable distributed-data") with NoStackTrace
else
sender() ! LoadAllCompleted
@ -74,7 +74,9 @@ class DurableDataWriteBehindSpecMultiJvmNode2 extends DurableDataSpec(DurableDat
abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
extends MultiNodeSpec(multiNodeConfig)
with STMultiNodeSpec
with ImplicitSender {
with ImplicitSender
with CancelAfterFailure {
import DurableDataSpec._
import Replicator._
import multiNodeConfig._
@ -207,6 +209,8 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
val r = newReplicator()
runOn(first) {
// FIXME
log.debug("sending message with sender: {}", implicitly[ActorRef])
r ! Update(KeyC, ORSet.empty[String], WriteLocal)(_ :+ myself.name)
expectMsg(UpdateSuccess(KeyC, None))
}
@ -224,8 +228,7 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
system.stop(r)
expectTerminated(r)
var r2: ActorRef = null
awaitAssert { r2 = newReplicator() } // try until name is free
val r2 = awaitAssert { newReplicator() } // try until name is free
awaitAssert {
r2 ! GetKeyIds
expectMsgType[GetKeyIdsResult].keyIds should !==(Set.empty[String])
@ -308,7 +311,10 @@ abstract class DurableDataSpec(multiNodeConfig: DurableDataSpecConfig)
}
}
system.log.info("Setup complete")
enterBarrierAfterTestStep()
system.log.info("All setup complete")
}
"stop Replicator if Load fails" in {

View file

@ -2,6 +2,8 @@
* Copyright (C) 2014-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
package docs.persistence;
//#protobuf-read-optional-proto

View file

@ -2,6 +2,8 @@
* Copyright (C) 2014-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
package docs.ddata;
//#twophaseset

View file

@ -13,7 +13,7 @@ import spray.json.JsObject;
import akka.persistence.journal.EventAdapter;
import akka.persistence.journal.EventSeq;
import akka.protobuf.InvalidProtocolBufferException;
import akka.protobufv3.internal.InvalidProtocolBufferException;
import akka.serialization.SerializerWithStringManifest;
public class PersistenceSchemaEvolutionDocTest {

View file

@ -0,0 +1,3 @@
# Protobuf 3
ProblemFilters.exclude[Problem]("akka.remote.testconductor.TestConductorProtocol*")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.remote.testconductor.ProtobufDecoder.this")

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.remote.testconductor";
option optimize_for = SPEED;

View file

@ -20,7 +20,7 @@ import akka.event.Logging
import akka.util.Helpers
import org.jboss.netty.handler.codec.oneone.{ OneToOneDecoder, OneToOneEncoder }
import org.jboss.netty.channel.ChannelHandlerContext
import akka.protobuf.Message
import akka.protobufv3.internal.Message
import org.jboss.netty.buffer.ChannelBuffer
/**

View file

@ -10,3 +10,6 @@ ProblemFilters.exclude[DirectMissingMethodProblem]("akka.persistence.fsm.Persist
ProblemFilters.exclude[IncompatibleResultTypeProblem]("akka.persistence.fsm.PersistentFSM#Timer.copy$default$3")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.persistence.fsm.PersistentFSM#Timer.this")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.persistence.fsm.PersistentFSM#Timer.copy")
# Upgrade to protobuf 3
ProblemFilters.exclude[Problem]("akka.persistence.serialization.MessageFormats*")

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.persistence.serialization";
option optimize_for = SPEED;

View file

@ -10,8 +10,7 @@ import akka.persistence._
import akka.persistence.fsm.PersistentFSM.{ PersistentFSMSnapshot, StateChangeEvent }
import akka.persistence.serialization.{ MessageFormats => mf }
import akka.serialization._
import akka.protobuf._
import akka.protobufv3.internal.ByteString
import scala.collection.immutable
import scala.collection.immutable.VectorBuilder
import scala.concurrent.duration

View file

@ -7,7 +7,7 @@ package akka.remote.artery
import akka.actor.ExtendedActorSystem
import akka.serialization.SerializerWithStringManifest
import akka.remote.artery.protobuf.{ TestMessages => proto }
import akka.protobuf.ByteString
import akka.protobufv3.internal.ByteString
object TestMessage {
final case class Item(id: Long, name: String)

View file

@ -2,6 +2,8 @@
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.remote.artery.protobuf";
message TestMessage {

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -33,6 +33,10 @@ ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.remote.artery.Inbound
# #22333 Disable Java serialization
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.serialization.ThrowableSupport.stackTraceElementBuilder")
# Upgrade to protobuf 3
ProblemFilters.exclude[Problem]("akka.remote.serialization.ArteryMessageSerializer*")
ProblemFilters.exclude[Problem]("akka.remote.*Formats*")
# #27455 Bind to arbitrary port in Artery TCP
ProblemFilters.exclude[IncompatibleResultTypeProblem]("akka.remote.artery.*.runInboundStreams")
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.remote.artery.*.runInboundStreams")

View file

@ -2,6 +2,8 @@
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.remote";
option optimize_for = SPEED;

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.remote";
option optimize_for = SPEED;

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.remote";
option optimize_for = SPEED;

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.remote";
option optimize_for = SPEED;

View file

@ -35,8 +35,14 @@ akka {
# Since akka.protobuf.Message does not extend Serializable but
# GeneratedMessage does, need to use the more specific one here in order
# to avoid ambiguity.
# This is only loaded if akka-protobuf is on the classpath
# It should not be used and users should migrate to using the protobuf classes
# directly
# Remove in 2.7
"akka.protobuf.GeneratedMessage" = proto
"akka.protobufv3.internal.GeneratedMessageV3" = proto
# Since com.google.protobuf.Message does not extend Serializable but
# GeneratedMessage does, need to use the more specific one here in order
# to avoid ambiguity.

View file

@ -5,7 +5,7 @@
package akka.remote
import akka.remote.WireFormats._
import akka.protobuf.ByteString
import akka.protobufv3.internal.ByteString
import akka.actor.ExtendedActorSystem
import akka.annotation.InternalApi
import akka.remote.artery.{ EnvelopeBuffer, HeaderBuilder, OutboundEnvelope }

View file

@ -7,7 +7,7 @@ package akka.remote.serialization
import java.io.NotSerializableException
import akka.actor.{ ActorRef, Address, ExtendedActorSystem }
import akka.protobuf.MessageLite
import akka.protobufv3.internal.MessageLite
import akka.remote.RemoteWatcher.ArteryHeartbeatRsp
import akka.remote.artery.OutboundHandshake.{ HandshakeReq, HandshakeRsp }
import akka.remote.artery.compress.CompressionProtocol._

View file

@ -7,7 +7,7 @@ package akka.remote.serialization
import scala.collection.immutable
import akka.serialization.{ BaseSerializer, SerializationExtension, SerializerWithStringManifest }
import akka.protobuf.ByteString
import akka.protobufv3.internal.ByteString
import akka.actor.{ Deploy, ExtendedActorSystem, NoScopeGiven, Props, Scope }
import akka.remote.DaemonMsgCreate
import akka.remote.WireFormats.{ DaemonMsgCreateData, DeployData, PropsData }

View file

@ -5,7 +5,7 @@
package akka.remote.serialization
import scala.collection.immutable
import akka.protobuf.ByteString
import akka.protobufv3.internal.ByteString
import akka.actor.ActorSelectionMessage
import akka.actor.ExtendedActorSystem
import akka.actor.SelectChildName

View file

@ -8,7 +8,7 @@ import akka.actor.ExtendedActorSystem
import akka.event.Logging
import akka.remote.ContainerFormats
import akka.serialization.{ SerializationExtension, Serializers }
import akka.protobuf.ByteString
import akka.protobufv3.internal.ByteString
import akka.serialization.DisabledJavaSerializer
/**

View file

@ -9,8 +9,8 @@ import akka.actor.{ ActorRef, Address, AddressFromURIString, InternalActorRef }
import akka.remote.WireFormats._
import akka.remote._
import akka.util.ByteString
import akka.protobuf.InvalidProtocolBufferException
import akka.protobuf.{ ByteString => PByteString }
import akka.protobufv3.internal.InvalidProtocolBufferException
import akka.protobufv3.internal.{ ByteString => PByteString }
import akka.util.OptionVal
import com.github.ghik.silencer.silent

View file

@ -10,12 +10,18 @@ package akka.remote;
public final class ProtobufProtocol {
private ProtobufProtocol() {}
public static void registerAllExtensions(
akka.protobuf.ExtensionRegistry registry) {
akka.protobufv3.internal.ExtensionRegistryLite registry) {
}
public interface MyMessageOrBuilder
extends akka.protobuf.MessageOrBuilder {
// required uint64 id = 1;
public static void registerAllExtensions(
akka.protobufv3.internal.ExtensionRegistry registry) {
registerAllExtensions(
(akka.protobufv3.internal.ExtensionRegistryLite) registry);
}
public interface MyMessageOrBuilder extends
// @@protoc_insertion_point(interface_extends:MyMessage)
akka.protobufv3.internal.MessageOrBuilder {
/**
* <code>required uint64 id = 1;</code>
*/
@ -25,7 +31,6 @@ public final class ProtobufProtocol {
*/
long getId();
// required string name = 2;
/**
* <code>required string name = 2;</code>
*/
@ -37,10 +42,9 @@ public final class ProtobufProtocol {
/**
* <code>required string name = 2;</code>
*/
akka.protobuf.ByteString
akka.protobufv3.internal.ByteString
getNameBytes();
// required bool status = 3;
/**
* <code>required bool status = 3;</code>
*/
@ -53,39 +57,42 @@ public final class ProtobufProtocol {
/**
* Protobuf type {@code MyMessage}
*/
public static final class MyMessage extends
akka.protobuf.GeneratedMessage
implements MyMessageOrBuilder {
public static final class MyMessage extends
akka.protobufv3.internal.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:MyMessage)
MyMessageOrBuilder {
private static final long serialVersionUID = 0L;
// Use MyMessage.newBuilder() to construct.
private MyMessage(akka.protobuf.GeneratedMessage.Builder<?> builder) {
private MyMessage(akka.protobufv3.internal.GeneratedMessageV3.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private MyMessage(boolean noInit) { this.unknownFields = akka.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final MyMessage defaultInstance;
public static MyMessage getDefaultInstance() {
return defaultInstance;
private MyMessage() {
name_ = "";
}
public MyMessage getDefaultInstanceForType() {
return defaultInstance;
}
private final akka.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final akka.protobuf.UnknownFieldSet
getUnknownFields() {
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
akka.protobufv3.internal.GeneratedMessageV3.UnusedPrivateParameter unused) {
return new MyMessage();
}
@java.lang.Override
public final akka.protobufv3.internal.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MyMessage(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
initFields();
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
akka.protobuf.UnknownFieldSet.Builder unknownFields =
akka.protobuf.UnknownFieldSet.newBuilder();
akka.protobufv3.internal.UnknownFieldSet.Builder unknownFields =
akka.protobufv3.internal.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
@ -94,21 +101,15 @@ public final class ProtobufProtocol {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
id_ = input.readUInt64();
break;
}
case 18: {
akka.protobufv3.internal.ByteString bs = input.readBytes();
bitField0_ |= 0x00000002;
name_ = input.readBytes();
name_ = bs;
break;
}
case 24: {
@ -116,54 +117,46 @@ public final class ProtobufProtocol {
status_ = input.readBool();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (akka.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new akka.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
throw new akka.protobufv3.internal.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final akka.protobuf.Descriptors.Descriptor
public static final akka.protobufv3.internal.Descriptors.Descriptor
getDescriptor() {
return akka.remote.ProtobufProtocol.internal_static_MyMessage_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
@java.lang.Override
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.remote.ProtobufProtocol.internal_static_MyMessage_fieldAccessorTable
.ensureFieldAccessorsInitialized(
akka.remote.ProtobufProtocol.MyMessage.class, akka.remote.ProtobufProtocol.MyMessage.Builder.class);
}
public static akka.protobuf.Parser<MyMessage> PARSER =
new akka.protobuf.AbstractParser<MyMessage>() {
public MyMessage parsePartialFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
return new MyMessage(input, extensionRegistry);
}
};
@java.lang.Override
public akka.protobuf.Parser<MyMessage> getParserForType() {
return PARSER;
}
private int bitField0_;
// required uint64 id = 1;
public static final int ID_FIELD_NUMBER = 1;
private long id_;
/**
* <code>required uint64 id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>required uint64 id = 1;</code>
@ -172,14 +165,13 @@ public final class ProtobufProtocol {
return id_;
}
// required string name = 2;
public static final int NAME_FIELD_NUMBER = 2;
private java.lang.Object name_;
private volatile java.lang.Object name_;
/**
* <code>required string name = 2;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>required string name = 2;</code>
@ -189,8 +181,8 @@ public final class ProtobufProtocol {
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
akka.protobuf.ByteString bs =
(akka.protobuf.ByteString) ref;
akka.protobufv3.internal.ByteString bs =
(akka.protobufv3.internal.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
name_ = s;
@ -201,28 +193,27 @@ public final class ProtobufProtocol {
/**
* <code>required string name = 2;</code>
*/
public akka.protobuf.ByteString
public akka.protobufv3.internal.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
akka.protobuf.ByteString b =
akka.protobuf.ByteString.copyFromUtf8(
akka.protobufv3.internal.ByteString b =
akka.protobufv3.internal.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (akka.protobuf.ByteString) ref;
return (akka.protobufv3.internal.ByteString) ref;
}
}
// required bool status = 3;
public static final int STATUS_FIELD_NUMBER = 3;
private boolean status_;
/**
* <code>required bool status = 3;</code>
*/
public boolean hasStatus() {
return ((bitField0_ & 0x00000004) == 0x00000004);
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <code>required bool status = 3;</code>
@ -231,15 +222,12 @@ public final class ProtobufProtocol {
return status_;
}
private void initFields() {
id_ = 0L;
name_ = "";
status_ = false;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasId()) {
memoizedIsInitialized = 0;
@ -257,114 +245,185 @@ public final class ProtobufProtocol {
return true;
}
public void writeTo(akka.protobuf.CodedOutputStream output)
@java.lang.Override
public void writeTo(akka.protobufv3.internal.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeUInt64(1, id_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getNameBytes());
if (((bitField0_ & 0x00000002) != 0)) {
akka.protobufv3.internal.GeneratedMessageV3.writeString(output, 2, name_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
if (((bitField0_ & 0x00000004) != 0)) {
output.writeBool(3, status_);
}
getUnknownFields().writeTo(output);
unknownFields.writeTo(output);
}
private int memoizedSerializedSize = -1;
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSerializedSize;
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += akka.protobuf.CodedOutputStream
if (((bitField0_ & 0x00000001) != 0)) {
size += akka.protobufv3.internal.CodedOutputStream
.computeUInt64Size(1, id_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += akka.protobuf.CodedOutputStream
.computeBytesSize(2, getNameBytes());
if (((bitField0_ & 0x00000002) != 0)) {
size += akka.protobufv3.internal.GeneratedMessageV3.computeStringSize(2, name_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += akka.protobuf.CodedOutputStream
if (((bitField0_ & 0x00000004) != 0)) {
size += akka.protobufv3.internal.CodedOutputStream
.computeBoolSize(3, status_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
size += unknownFields.getSerializedSize();
memoizedSize = 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 boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof akka.remote.ProtobufProtocol.MyMessage)) {
return super.equals(obj);
}
akka.remote.ProtobufProtocol.MyMessage other = (akka.remote.ProtobufProtocol.MyMessage) obj;
if (hasId() != other.hasId()) return false;
if (hasId()) {
if (getId()
!= other.getId()) return false;
}
if (hasName() != other.hasName()) return false;
if (hasName()) {
if (!getName()
.equals(other.getName())) return false;
}
if (hasStatus() != other.hasStatus()) return false;
if (hasStatus()) {
if (getStatus()
!= other.getStatus()) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasId()) {
hash = (37 * hash) + ID_FIELD_NUMBER;
hash = (53 * hash) + akka.protobufv3.internal.Internal.hashLong(
getId());
}
if (hasName()) {
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
}
if (hasStatus()) {
hash = (37 * hash) + STATUS_FIELD_NUMBER;
hash = (53 * hash) + akka.protobufv3.internal.Internal.hashBoolean(
getStatus());
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(
akka.protobuf.ByteString data)
throws akka.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(
akka.protobuf.ByteString data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(
akka.protobufv3.internal.ByteString data)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(
akka.protobufv3.internal.ByteString data,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(byte[] data)
throws akka.protobuf.InvalidProtocolBufferException {
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(
byte[] data,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
throws akka.protobuf.InvalidProtocolBufferException {
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static akka.remote.ProtobufProtocol.MyMessage parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static akka.remote.ProtobufProtocol.MyMessage parseDelimitedFrom(
java.io.InputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(
akka.protobuf.CodedInputStream input)
akka.protobufv3.internal.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static akka.remote.ProtobufProtocol.MyMessage parseFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
return akka.protobufv3.internal.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(akka.remote.ProtobufProtocol.MyMessage prototype) {
return newBuilder().mergeFrom(prototype);
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(akka.remote.ProtobufProtocol.MyMessage prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
akka.protobuf.GeneratedMessage.BuilderParent parent) {
akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
@ -372,14 +431,16 @@ public final class ProtobufProtocol {
* Protobuf type {@code MyMessage}
*/
public static final class Builder extends
akka.protobuf.GeneratedMessage.Builder<Builder>
implements akka.remote.ProtobufProtocol.MyMessageOrBuilder {
public static final akka.protobuf.Descriptors.Descriptor
akka.protobufv3.internal.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:MyMessage)
akka.remote.ProtobufProtocol.MyMessageOrBuilder {
public static final akka.protobufv3.internal.Descriptors.Descriptor
getDescriptor() {
return akka.remote.ProtobufProtocol.internal_static_MyMessage_descriptor;
}
protected akka.protobuf.GeneratedMessage.FieldAccessorTable
@java.lang.Override
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.remote.ProtobufProtocol.internal_static_MyMessage_fieldAccessorTable
.ensureFieldAccessorsInitialized(
@ -392,18 +453,16 @@ public final class ProtobufProtocol {
}
private Builder(
akka.protobuf.GeneratedMessage.BuilderParent parent) {
akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (akka.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
if (akka.protobufv3.internal.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
@java.lang.Override
public Builder clear() {
super.clear();
id_ = 0L;
@ -415,19 +474,18 @@ public final class ProtobufProtocol {
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public akka.protobuf.Descriptors.Descriptor
@java.lang.Override
public akka.protobufv3.internal.Descriptors.Descriptor
getDescriptorForType() {
return akka.remote.ProtobufProtocol.internal_static_MyMessage_descriptor;
}
@java.lang.Override
public akka.remote.ProtobufProtocol.MyMessage getDefaultInstanceForType() {
return akka.remote.ProtobufProtocol.MyMessage.getDefaultInstance();
}
@java.lang.Override
public akka.remote.ProtobufProtocol.MyMessage build() {
akka.remote.ProtobufProtocol.MyMessage result = buildPartial();
if (!result.isInitialized()) {
@ -436,28 +494,62 @@ public final class ProtobufProtocol {
return result;
}
@java.lang.Override
public akka.remote.ProtobufProtocol.MyMessage buildPartial() {
akka.remote.ProtobufProtocol.MyMessage result = new akka.remote.ProtobufProtocol.MyMessage(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
if (((from_bitField0_ & 0x00000001) != 0)) {
result.id_ = id_;
to_bitField0_ |= 0x00000001;
}
result.id_ = id_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
if (((from_bitField0_ & 0x00000002) != 0)) {
to_bitField0_ |= 0x00000002;
}
result.name_ = name_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
if (((from_bitField0_ & 0x00000004) != 0)) {
result.status_ = status_;
to_bitField0_ |= 0x00000004;
}
result.status_ = status_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(akka.protobuf.Message other) {
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
akka.protobufv3.internal.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(akka.protobufv3.internal.Message other) {
if (other instanceof akka.remote.ProtobufProtocol.MyMessage) {
return mergeFrom((akka.remote.ProtobufProtocol.MyMessage)other);
} else {
@ -479,36 +571,36 @@ public final class ProtobufProtocol {
if (other.hasStatus()) {
setStatus(other.getStatus());
}
this.mergeUnknownFields(other.getUnknownFields());
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
if (!hasId()) {
return false;
}
if (!hasName()) {
return false;
}
if (!hasStatus()) {
return false;
}
return true;
}
@java.lang.Override
public Builder mergeFrom(
akka.protobuf.CodedInputStream input,
akka.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
akka.remote.ProtobufProtocol.MyMessage parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (akka.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
parsedMessage = (akka.remote.ProtobufProtocol.MyMessage) e.getUnfinishedMessage();
throw e;
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
@ -518,13 +610,12 @@ public final class ProtobufProtocol {
}
private int bitField0_;
// required uint64 id = 1;
private long id_ ;
/**
* <code>required uint64 id = 1;</code>
*/
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>required uint64 id = 1;</code>
@ -551,13 +642,12 @@ public final class ProtobufProtocol {
return this;
}
// required string name = 2;
private java.lang.Object name_ = "";
/**
* <code>required string name = 2;</code>
*/
public boolean hasName() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>required string name = 2;</code>
@ -565,9 +655,12 @@ public final class ProtobufProtocol {
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((akka.protobuf.ByteString) ref)
.toStringUtf8();
name_ = s;
akka.protobufv3.internal.ByteString bs =
(akka.protobufv3.internal.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
name_ = s;
}
return s;
} else {
return (java.lang.String) ref;
@ -576,17 +669,17 @@ public final class ProtobufProtocol {
/**
* <code>required string name = 2;</code>
*/
public akka.protobuf.ByteString
public akka.protobufv3.internal.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
akka.protobuf.ByteString b =
akka.protobuf.ByteString.copyFromUtf8(
akka.protobufv3.internal.ByteString b =
akka.protobufv3.internal.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (akka.protobuf.ByteString) ref;
return (akka.protobufv3.internal.ByteString) ref;
}
}
/**
@ -615,7 +708,7 @@ public final class ProtobufProtocol {
* <code>required string name = 2;</code>
*/
public Builder setNameBytes(
akka.protobuf.ByteString value) {
akka.protobufv3.internal.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
@ -625,13 +718,12 @@ public final class ProtobufProtocol {
return this;
}
// required bool status = 3;
private boolean status_ ;
/**
* <code>required bool status = 3;</code>
*/
public boolean hasStatus() {
return ((bitField0_ & 0x00000004) == 0x00000004);
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <code>required bool status = 3;</code>
@ -657,29 +749,70 @@ public final class ProtobufProtocol {
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:MyMessage)
}
// @@protoc_insertion_point(class_scope:MyMessage)
private static final akka.remote.ProtobufProtocol.MyMessage DEFAULT_INSTANCE;
static {
defaultInstance = new MyMessage(true);
defaultInstance.initFields();
DEFAULT_INSTANCE = new akka.remote.ProtobufProtocol.MyMessage();
}
public static akka.remote.ProtobufProtocol.MyMessage getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final akka.protobufv3.internal.Parser<MyMessage>
PARSER = new akka.protobufv3.internal.AbstractParser<MyMessage>() {
@java.lang.Override
public MyMessage parsePartialFrom(
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return new MyMessage(input, extensionRegistry);
}
};
public static akka.protobufv3.internal.Parser<MyMessage> parser() {
return PARSER;
}
@java.lang.Override
public akka.protobufv3.internal.Parser<MyMessage> getParserForType() {
return PARSER;
}
@java.lang.Override
public akka.remote.ProtobufProtocol.MyMessage getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
// @@protoc_insertion_point(class_scope:MyMessage)
}
private static akka.protobuf.Descriptors.Descriptor
private static final akka.protobufv3.internal.Descriptors.Descriptor
internal_static_MyMessage_descriptor;
private static
akka.protobuf.GeneratedMessage.FieldAccessorTable
private static final
akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internal_static_MyMessage_fieldAccessorTable;
public static akka.protobuf.Descriptors.FileDescriptor
public static akka.protobufv3.internal.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static akka.protobuf.Descriptors.FileDescriptor
private static akka.protobufv3.internal.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
@ -687,24 +820,16 @@ public final class ProtobufProtocol {
"\002id\030\001 \002(\004\022\014\n\004name\030\002 \002(\t\022\016\n\006status\030\003 \002(\010B" +
"\r\n\013akka.remote"
};
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_MyMessage_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_MyMessage_fieldAccessorTable = new
akka.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_MyMessage_descriptor,
new java.lang.String[] { "Id", "Name", "Status", });
return null;
}
};
akka.protobuf.Descriptors.FileDescriptor
descriptor = akka.protobufv3.internal.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new akka.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
new akka.protobufv3.internal.Descriptors.FileDescriptor[] {
});
internal_static_MyMessage_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_MyMessage_fieldAccessorTable = new
akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable(
internal_static_MyMessage_descriptor,
new java.lang.String[] { "Id", "Name", "Status", });
}
// @@protoc_insertion_point(outer_class_scope)

View file

@ -10,21 +10,22 @@ package akka.remote.protobuf.v3;
public final class ProtobufProtocolV3 {
private ProtobufProtocolV3() {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
public static void registerAllExtensions(
akka.protobufv3.internal.ExtensionRegistryLite registry) {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
public static void registerAllExtensions(akka.protobufv3.internal.ExtensionRegistry registry) {
registerAllExtensions((akka.protobufv3.internal.ExtensionRegistryLite) registry);
}
public interface MyMessageV3OrBuilder
extends
// @@protoc_insertion_point(interface_extends:MyMessageV3)
com.google.protobuf.MessageOrBuilder {
akka.protobufv3.internal.MessageOrBuilder {
/** <code>string query = 1;</code> */
java.lang.String getQuery();
/** <code>string query = 1;</code> */
com.google.protobuf.ByteString getQueryBytes();
akka.protobufv3.internal.ByteString getQueryBytes();
/** <code>int32 page_number = 2;</code> */
int getPageNumber();
@ -33,13 +34,13 @@ public final class ProtobufProtocolV3 {
int getResultPerPage();
}
/** Protobuf type {@code MyMessageV3} */
public static final class MyMessageV3 extends com.google.protobuf.GeneratedMessageV3
public static final class MyMessageV3 extends akka.protobufv3.internal.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:MyMessageV3)
MyMessageV3OrBuilder {
private static final long serialVersionUID = 0L;
// Use MyMessageV3.newBuilder() to construct.
private MyMessageV3(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
private MyMessageV3(akka.protobufv3.internal.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
@ -49,25 +50,26 @@ public final class ProtobufProtocolV3 {
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
protected java.lang.Object newInstance(
akka.protobufv3.internal.GeneratedMessageV3.UnusedPrivateParameter unused) {
return new MyMessageV3();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
public final akka.protobufv3.internal.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private MyMessageV3(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
akka.protobufv3.internal.UnknownFieldSet.Builder unknownFields =
akka.protobufv3.internal.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
@ -102,22 +104,23 @@ public final class ProtobufProtocolV3 {
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
throw new akka.protobufv3.internal.InvalidProtocolBufferException(e)
.setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
public static final akka.protobufv3.internal.Descriptors.Descriptor getDescriptor() {
return akka.remote.protobuf.v3.ProtobufProtocolV3.internal_static_MyMessageV3_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.remote.protobuf.v3.ProtobufProtocolV3
.internal_static_MyMessageV3_fieldAccessorTable.ensureFieldAccessorsInitialized(
@ -133,22 +136,22 @@ public final class ProtobufProtocolV3 {
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
akka.protobufv3.internal.ByteString bs = (akka.protobufv3.internal.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
query_ = s;
return s;
}
}
/** <code>string query = 1;</code> */
public com.google.protobuf.ByteString getQueryBytes() {
public akka.protobufv3.internal.ByteString getQueryBytes() {
java.lang.Object ref = query_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
akka.protobufv3.internal.ByteString b =
akka.protobufv3.internal.ByteString.copyFromUtf8((java.lang.String) ref);
query_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
return (akka.protobufv3.internal.ByteString) ref;
}
}
@ -179,9 +182,10 @@ public final class ProtobufProtocolV3 {
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
public void writeTo(akka.protobufv3.internal.CodedOutputStream output)
throws java.io.IOException {
if (!getQueryBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_);
akka.protobufv3.internal.GeneratedMessageV3.writeString(output, 1, query_);
}
if (pageNumber_ != 0) {
output.writeInt32(2, pageNumber_);
@ -199,13 +203,13 @@ public final class ProtobufProtocolV3 {
size = 0;
if (!getQueryBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_);
size += akka.protobufv3.internal.GeneratedMessageV3.computeStringSize(1, query_);
}
if (pageNumber_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageNumber_);
size += akka.protobufv3.internal.CodedOutputStream.computeInt32Size(2, pageNumber_);
}
if (resultPerPage_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, resultPerPage_);
size += akka.protobufv3.internal.CodedOutputStream.computeInt32Size(3, resultPerPage_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
@ -249,74 +253,75 @@ public final class ProtobufProtocolV3 {
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data) throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
java.nio.ByteBuffer data, akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
akka.protobufv3.internal.ByteString data)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
akka.protobufv3.internal.ByteString data,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
byte[] data, akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
return akka.protobufv3.internal.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.io.InputStream input, akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
return akka.protobufv3.internal.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
return akka.protobufv3.internal.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.io.InputStream input, akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
return akka.protobufv3.internal.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
akka.protobufv3.internal.CodedInputStream input) throws java.io.IOException {
return akka.protobufv3.internal.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
return akka.protobufv3.internal.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@ -341,22 +346,22 @@ public final class ProtobufProtocolV3 {
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/** Protobuf type {@code MyMessageV3} */
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
extends akka.protobufv3.internal.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:MyMessageV3)
akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3OrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
public static final akka.protobufv3.internal.Descriptors.Descriptor getDescriptor() {
return akka.remote.protobuf.v3.ProtobufProtocolV3.internal_static_MyMessageV3_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
protected akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return akka.remote.protobuf.v3.ProtobufProtocolV3
.internal_static_MyMessageV3_fieldAccessorTable.ensureFieldAccessorsInitialized(
@ -369,13 +374,13 @@ public final class ProtobufProtocolV3 {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
private Builder(akka.protobufv3.internal.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
if (akka.protobufv3.internal.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
@ -391,7 +396,7 @@ public final class ProtobufProtocolV3 {
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
public akka.protobufv3.internal.Descriptors.Descriptor getDescriptorForType() {
return akka.remote.protobuf.v3.ProtobufProtocolV3.internal_static_MyMessageV3_descriptor;
}
@ -427,23 +432,23 @@ public final class ProtobufProtocolV3 {
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
akka.protobufv3.internal.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
public Builder clearField(akka.protobufv3.internal.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
public Builder clearOneof(akka.protobufv3.internal.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
akka.protobufv3.internal.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
@ -451,12 +456,12 @@ public final class ProtobufProtocolV3 {
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
akka.protobufv3.internal.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
public Builder mergeFrom(akka.protobufv3.internal.Message other) {
if (other instanceof akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3) {
return mergeFrom((akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3) other);
} else {
@ -490,13 +495,13 @@ public final class ProtobufProtocolV3 {
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3 parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
} catch (akka.protobufv3.internal.InvalidProtocolBufferException e) {
parsedMessage =
(akka.remote.protobuf.v3.ProtobufProtocolV3.MyMessageV3) e.getUnfinishedMessage();
throw e.unwrapIOException();
@ -513,7 +518,7 @@ public final class ProtobufProtocolV3 {
public java.lang.String getQuery() {
java.lang.Object ref = query_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
akka.protobufv3.internal.ByteString bs = (akka.protobufv3.internal.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
query_ = s;
return s;
@ -522,15 +527,15 @@ public final class ProtobufProtocolV3 {
}
}
/** <code>string query = 1;</code> */
public com.google.protobuf.ByteString getQueryBytes() {
public akka.protobufv3.internal.ByteString getQueryBytes() {
java.lang.Object ref = query_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
akka.protobufv3.internal.ByteString b =
akka.protobufv3.internal.ByteString.copyFromUtf8((java.lang.String) ref);
query_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
return (akka.protobufv3.internal.ByteString) ref;
}
}
/** <code>string query = 1;</code> */
@ -551,7 +556,7 @@ public final class ProtobufProtocolV3 {
return this;
}
/** <code>string query = 1;</code> */
public Builder setQueryBytes(com.google.protobuf.ByteString value) {
public Builder setQueryBytes(akka.protobufv3.internal.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
@ -604,13 +609,13 @@ public final class ProtobufProtocolV3 {
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
final akka.protobufv3.internal.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
@ -628,23 +633,23 @@ public final class ProtobufProtocolV3 {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<MyMessageV3> PARSER =
new com.google.protobuf.AbstractParser<MyMessageV3>() {
private static final akka.protobufv3.internal.Parser<MyMessageV3> PARSER =
new akka.protobufv3.internal.AbstractParser<MyMessageV3>() {
@java.lang.Override
public MyMessageV3 parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
akka.protobufv3.internal.CodedInputStream input,
akka.protobufv3.internal.ExtensionRegistryLite extensionRegistry)
throws akka.protobufv3.internal.InvalidProtocolBufferException {
return new MyMessageV3(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<MyMessageV3> parser() {
public static akka.protobufv3.internal.Parser<MyMessageV3> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<MyMessageV3> getParserForType() {
public akka.protobufv3.internal.Parser<MyMessageV3> getParserForType() {
return PARSER;
}
@ -654,16 +659,16 @@ public final class ProtobufProtocolV3 {
}
}
private static final com.google.protobuf.Descriptors.Descriptor
private static final akka.protobufv3.internal.Descriptors.Descriptor
internal_static_MyMessageV3_descriptor;
private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
private static final akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable
internal_static_MyMessageV3_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
public static akka.protobufv3.internal.Descriptors.FileDescriptor getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
private static akka.protobufv3.internal.Descriptors.FileDescriptor descriptor;
static {
java.lang.String[] descriptorData = {
@ -673,11 +678,11 @@ public final class ProtobufProtocolV3 {
+ "otobuf.v3b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
akka.protobufv3.internal.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
descriptorData, new akka.protobufv3.internal.Descriptors.FileDescriptor[] {});
internal_static_MyMessageV3_descriptor = getDescriptor().getMessageTypes().get(0);
internal_static_MyMessageV3_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
new akka.protobufv3.internal.GeneratedMessageV3.FieldAccessorTable(
internal_static_MyMessageV3_descriptor,
new java.lang.String[] {
"Query", "PageNumber", "ResultPerPage",

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.remote";
message MyMessage {

View file

@ -7,7 +7,7 @@ package akka.remote.classic.transport
import java.util.concurrent.TimeoutException
import akka.actor.Address
import akka.protobuf.{ ByteString => PByteString }
import akka.protobufv3.internal.{ ByteString => PByteString }
import akka.remote.classic.transport.AkkaProtocolSpec.TestFailureDetector
import akka.remote.transport.AkkaPduCodec.{ Associate, Disassociate, Heartbeat }
import akka.remote.transport.AssociationHandle.{

File diff suppressed because it is too large Load diff

View file

@ -154,3 +154,6 @@ ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.impl.FanoutOutpu
# #24304 stack overflow in StreamConverters
ProblemFilters.exclude[IncompatibleTemplateDefProblem]("akka.stream.impl.CollectorState")
ProblemFilters.exclude[IncompatibleTemplateDefProblem]("akka.stream.impl.ReducerState")
# Protobuf 3
ProblemFilters.exclude[Problem]("akka.stream.StreamRefMessages*")

View file

@ -2,6 +2,8 @@
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/
syntax = "proto2";
option java_package = "akka.stream";
option optimize_for = SPEED;

View file

@ -4,7 +4,7 @@
package akka.stream.serialization
import akka.protobuf.ByteString
import akka.protobufv3.internal.ByteString
import akka.actor.ExtendedActorSystem
import akka.annotation.InternalApi
import akka.serialization._

View file

@ -62,6 +62,7 @@ lazy val aggregatedProjects: Seq[ProjectReference] = List[ProjectReference](
persistenceTck,
persistenceTyped,
protobuf,
protobufV3,
remote,
remoteTests,
slf4j,
@ -75,7 +76,8 @@ lazy val aggregatedProjects: Seq[ProjectReference] = List[ProjectReference](
lazy val root = Project(id = "akka", base = file("."))
.aggregate(aggregatedProjects: _*)
.settings(rootSettings: _*)
.settings(unidocRootIgnoreProjects := Seq(remoteTests, benchJmh, benchJmhTyped, protobuf, akkaScalaNightly, docs))
.settings(
unidocRootIgnoreProjects := Seq(remoteTests, benchJmh, benchJmhTyped, protobuf, protobufV3, akkaScalaNightly, docs))
.settings(unmanagedSources in (Compile, headerCreate) := (baseDirectory.value / "project").**("*.scala").get)
.enablePlugins(CopyrightHeaderForBuild)
@ -256,7 +258,12 @@ lazy val docs = akkaModule("akka-docs")
.disablePlugins(ScalafixPlugin)
lazy val jackson = akkaModule("akka-serialization-jackson")
.dependsOn(actor, actorTyped % "optional->compile", stream % "optional->compile" ,actorTests % "test->test", testkit % "test->test")
.dependsOn(
actor,
actorTyped % "optional->compile",
stream % "optional->compile",
actorTests % "test->test",
testkit % "test->test")
.settings(Dependencies.jackson)
.settings(AutomaticModuleName.settings("akka.serialization.jackson"))
.settings(OSGi.jackson)
@ -279,7 +286,7 @@ lazy val osgi = akkaModule("akka-osgi")
.settings(parallelExecution in Test := false)
lazy val persistence = akkaModule("akka-persistence")
.dependsOn(actor, testkit % "test->test", protobuf)
.dependsOn(actor, testkit % "test->test", protobufV3)
.settings(Dependencies.persistence)
.settings(AutomaticModuleName.settings("akka.persistence"))
.settings(OSGi.persistence)
@ -295,7 +302,7 @@ lazy val persistenceQuery = akkaModule("akka-persistence-query")
.enablePlugins(ScaladocNoVerificationOfDiagrams)
lazy val persistenceShared = akkaModule("akka-persistence-shared")
.dependsOn(persistence % "test->test", testkit % "test->test", remote % "test", protobuf)
.dependsOn(persistence % "test->test", testkit % "test->test", remote % "test", protobufV3)
.settings(Dependencies.persistenceShared)
.settings(AutomaticModuleName.settings("akka.persistence.shared"))
.settings(fork in Test := true)
@ -316,20 +323,43 @@ lazy val protobuf = akkaModule("akka-protobuf")
.enablePlugins(ScaladocNoVerificationOfDiagrams)
.disablePlugins(MimaPlugin)
lazy val remote = akkaModule("akka-remote")
.dependsOn(
actor,
stream,
actorTests % "test->test",
testkit % "test->test",
streamTestkit % "test",
protobuf,
jackson % "test->test")
.settings(Dependencies.remote)
.settings(AutomaticModuleName.settings("akka.remote"))
.settings(OSGi.remote)
.settings(Protobuf.settings)
.settings(parallelExecution in Test := false)
lazy val protobufV3 = akkaModule("akka-protobuf-v3")
.settings(AutomaticModuleName.settings("akka.protobuf.v3"))
.enablePlugins(ScaladocNoVerificationOfDiagrams)
.disablePlugins(MimaPlugin)
.settings(
libraryDependencies += Dependencies.Compile.protobufRuntime,
assemblyShadeRules in assembly := Seq(
ShadeRule
.rename("com.google.protobuf.**" -> "akka.protobufv3.internal.@1")
.inLibrary(Dependencies.Compile.protobufRuntime)),
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false, includeBin = false),
autoScalaLibrary := false, // do not include scala dependency in pom
exportJars := true, // in dependent projects, use assembled and shaded jar
makePomConfiguration := makePomConfiguration.value
.withConfigurations(Vector(Compile)), // prevent original dependency to be added to pom as runtime dep
packageBin in Compile := (assembly in Compile).value, // package by running assembly
// Prevent cyclic task dependencies, see https://github.com/sbt/sbt-assembly/issues/365
fullClasspath in assembly := (managedClasspath in Runtime).value, // otherwise, there's a cyclic dependency between packageBin and assembly
test in assembly := {}, // assembly runs tests for unknown reason which introduces another cyclic dependency to packageBin via exportedJars
description := "Akka Protobuf V3 is a shaded version of the protobuf runtime. Original POM: https://github.com/protocolbuffers/protobuf/blob/v3.9.0/java/pom.xml")
lazy val remote =
akkaModule("akka-remote")
.dependsOn(
actor,
stream,
protobufV3,
protobuf % "test",
actorTests % "test->test",
testkit % "test->test",
streamTestkit % "test",
jackson % "test->test")
.settings(Dependencies.remote)
.settings(AutomaticModuleName.settings("akka.remote"))
.settings(OSGi.remote)
.settings(Protobuf.settings)
.settings(parallelExecution in Test := false)
lazy val remoteTests = akkaModule("akka-remote-tests")
.dependsOn(
@ -352,7 +382,7 @@ lazy val slf4j = akkaModule("akka-slf4j")
.settings(OSGi.slf4j)
lazy val stream = akkaModule("akka-stream")
.dependsOn(actor, protobuf)
.dependsOn(actor, protobufV3)
.settings(Dependencies.stream)
.settings(AutomaticModuleName.settings("akka.stream"))
.settings(OSGi.stream)
@ -426,7 +456,7 @@ lazy val clusterTyped = akkaModule("akka-cluster-typed")
distributedData,
persistence % "test->test",
persistenceTyped % "test->test",
protobuf,
protobufV3,
actorTestkitTyped % "test->test",
actorTypedTests % "test->test",
remoteTests % "test->test",

View file

@ -95,6 +95,8 @@ object Dependencies {
val jacksonParameterNames = "com.fasterxml.jackson.module" % "jackson-module-parameter-names" % jacksonVersion // ApacheV2
val jacksonCbor = "com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor" % jacksonVersion // ApacheV2
val protobufRuntime = "com.google.protobuf" % "protobuf-java" % "3.9.0"
object Docs {
val sprayJson = "io.spray" %% "spray-json" % "1.3.5" % "test"
val gson = "com.google.code.gson" % "gson" % "2.8.5" % "test"

View file

@ -15,8 +15,11 @@ import Keys._
object Protobuf {
val paths = SettingKey[Seq[File]]("protobuf-paths", "The paths that contain *.proto files.")
val outputPaths = SettingKey[Seq[File]]("protobuf-output-paths", "The paths where to save the generated *.java files.")
val importPath = SettingKey[Option[File]]("protobuf-import-path", "The path that contain additional *.proto files that can be imported.")
val outputPaths =
SettingKey[Seq[File]]("protobuf-output-paths", "The paths where to save the generated *.java files.")
val importPath = SettingKey[Option[File]](
"protobuf-import-path",
"The path that contain additional *.proto files that can be imported.")
val protoc = SettingKey[String]("protobuf-protoc", "The path and name of the protoc executable.")
val protocVersion = SettingKey[String]("protobuf-protoc-version", "The version of the protoc executable.")
val generate = TaskKey[Unit]("protobuf-generate", "Compile the protobuf sources and do all processing.")
@ -25,17 +28,21 @@ object Protobuf {
paths := Seq((sourceDirectory in Compile).value, (sourceDirectory in Test).value).map(_ / "protobuf"),
outputPaths := Seq((sourceDirectory in Compile).value, (sourceDirectory in Test).value).map(_ / "java"),
importPath := None,
// this keeps intellij happy for files that use the shaded protobuf
Compile / unmanagedJars ++= Seq(
baseDirectory.value / ".." / "akka-protobuf-v3" / "target" / s"akka-protobuf-v3-assembly-${version.value}.jar"),
protoc := "protoc",
protocVersion := "2.5.0",
protocVersion := "3.9.0",
generate := {
val sourceDirs = paths.value
val targetDirs = outputPaths.value
val log = streams.value.log
if (sourceDirs.size != targetDirs.size)
sys.error(s"Unbalanced number of paths and destination paths!\nPaths: $sourceDirs\nDestination Paths: $targetDirs")
sys.error(
s"Unbalanced number of paths and destination paths!\nPaths: $sourceDirs\nDestination Paths: $targetDirs")
if (sourceDirs exists (_.exists)) {
if (sourceDirs.exists(_.exists)) {
val cmd = protoc.value
checkProtocVersion(cmd, protocVersion.value, log)
@ -45,13 +52,28 @@ object Protobuf {
val targets = target.value
val cache = targets / "protoc" / "cache"
(sourceDirs zip targetDirs) map {
(sourceDirs.zip(targetDirs)).map {
case (src, dst) =>
val relative = src.relativeTo(sources).getOrElse(throw new Exception(s"path $src is not a in source tree $sources")).toString
val relative = src
.relativeTo(sources)
.getOrElse(throw new Exception(s"path $src is not a in source tree $sources"))
.toString
val tmp = targets / "protoc" / relative
IO.delete(tmp)
generate(cmd, src, tmp, log, importPath.value)
transformDirectory(tmp, dst, _ => true, transformFile(_.replace("com.google.protobuf", "akka.protobuf")), cache, log)
transformDirectory(
tmp,
dst,
_ => true,
transformFile(
_.replace("com.google.protobuf", "akka.protobufv3.internal")
// this is the one thing that protobufGenerate doesn't fully qualify and causes
// api doc generation to fail
.replace(
"UnusedPrivateParameter",
"akka.protobufv3.internal.GeneratedMessageV3.UnusedPrivateParameter")),
cache,
log)
}
}
})
@ -62,14 +84,16 @@ object Protobuf {
thunk(proc, log)
} catch {
case e: Exception =>
throw new RuntimeException("error while executing '%s' with args: %s" format (protoc, args.mkString(" ")), e)
throw new RuntimeException("error while executing '%s' with args: %s".format(protoc, args.mkString(" ")), e)
}
private def checkProtocVersion(protoc: String, protocVersion: String, log: Logger): Unit = {
val res = callProtoc(protoc, Seq("--version"), log, { (p, l) => p !! l })
val res = callProtoc(protoc, Seq("--version"), log, { (p, l) =>
p !! l
})
val version = res.split(" ").last.trim
if (version != protocVersion) {
sys.error("Wrong protoc version! Expected %s but got %s" format (protocVersion, version))
sys.error("Wrong protoc version! Expected %s but got %s".format(protocVersion, version))
}
}
@ -77,46 +101,60 @@ object Protobuf {
val protoFiles = (srcDir ** "*.proto").get
if (srcDir.exists)
if (protoFiles.isEmpty)
log.info("Skipping empty source directory %s" format srcDir)
log.info("Skipping empty source directory %s".format(srcDir))
else {
targetDir.mkdirs()
log.info("Generating %d protobuf files from %s to %s".format(protoFiles.size, srcDir, targetDir))
protoFiles.foreach { proto => log.info("Compiling %s" format proto) }
protoFiles.foreach { proto =>
log.info("Compiling %s".format(proto))
}
val protoPathArg = importPath match {
case None => Nil
case None => Nil
case Some(p) => Seq("--proto_path", p.absolutePath)
}
val exitCode = callProtoc(protoc, Seq("-I" + srcDir.absolutePath, "--java_out=%s" format targetDir.absolutePath) ++
protoPathArg ++ protoFiles.map(_.absolutePath), log, { (p, l) => p ! l })
val exitCode = callProtoc(
protoc,
Seq("-I" + srcDir.absolutePath, "--java_out=%s".format(targetDir.absolutePath)) ++
protoPathArg ++ protoFiles.map(_.absolutePath),
log, { (p, l) =>
p ! l
})
if (exitCode != 0)
sys.error("protoc returned exit code: %d" format exitCode)
sys.error("protoc returned exit code: %d".format(exitCode))
}
}
/**
* Create a transformed version of all files in a directory, given a predicate and a transform function for each file. From sbt-site
*/
private def transformDirectory(sourceDir: File, targetDir: File, transformable: File => Boolean, transform: (File, File) => Unit, cache: File, log: Logger): File = {
val runTransform = FileFunction.cached(CacheStoreFactory(cache), FilesInfo.hash, FilesInfo.exists) { (in: ChangeReport[File], out: ChangeReport[File]) =>
val map = Path.rebase(sourceDir, targetDir)
if (in.removed.nonEmpty || in.modified.nonEmpty) {
log.info("Preprocessing directory %s..." format sourceDir)
for (source <- in.removed; target <- map(source)) {
IO delete target
}
val updated = for (source <- in.modified; target <- map(source)) yield {
if (source.isFile) {
if (transformable(source)) transform(source, target)
else IO.copyFile(source, target)
private def transformDirectory(
sourceDir: File,
targetDir: File,
transformable: File => Boolean,
transform: (File, File) => Unit,
cache: File,
log: Logger): File = {
val runTransform = FileFunction.cached(CacheStoreFactory(cache), FilesInfo.hash, FilesInfo.exists) {
(in: ChangeReport[File], out: ChangeReport[File]) =>
val map = Path.rebase(sourceDir, targetDir)
if (in.removed.nonEmpty || in.modified.nonEmpty) {
log.info("Preprocessing directory %s...".format(sourceDir))
for (source <- in.removed; target <- map(source)) {
IO.delete(target)
}
target
}
log.info("Directory preprocessed: " + targetDir)
updated
} else Set.empty
val updated = for (source <- in.modified; target <- map(source)) yield {
if (source.isFile) {
if (transformable(source)) transform(source, target)
else IO.copyFile(source, target)
}
target
}
log.info("Directory preprocessed: " + targetDir)
updated
} else Set.empty
}
val sources = (sourceDir.allPaths).get.toSet
runTransform(sources)
@ -130,7 +168,9 @@ object Protobuf {
IO.reader(source) { reader =>
IO.writer(target, "", IO.defaultCharset) { writer =>
val pw = new PrintWriter(writer)
IO.foreachLine(reader) { line => pw.println(transform(line)) }
IO.foreachLine(reader) { line =>
pw.println(transform(line))
}
}
}
}