From e35a51d9a244000fa3d7ac22564214c1d54800a2 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Fri, 19 Jan 2024 02:56:35 +0700 Subject: [PATCH 1/6] Separate Metrics business and wire format models --- .../Serialization/ClusterMetricMessages.cs | 6 +- .../ClusterMetricsMessageSerializer.cs | 80 +- .../Serialization/EWMA.cs | 12 +- .../Serialization/Metric.cs | 5 +- .../Serialization/MetricsGossip.cs | 7 +- .../Serialization/NodeMetrics.cs | 14 +- .../{ => Proto}/ClusterMetricsMessages.g.cs | 1002 +++++++++++++++-- .../Proto/ClusterMetricsMessages.proto | 2 +- .../Serialization/Proto/generate.bat | 2 +- 9 files changed, 985 insertions(+), 145 deletions(-) rename src/contrib/cluster/Akka.Cluster.Metrics/Serialization/{ => Proto}/ClusterMetricsMessages.g.cs (61%) diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricMessages.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricMessages.cs index cc4b77eda73..040629f7675 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricMessages.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricMessages.cs @@ -25,13 +25,17 @@ public interface IClusterMetricMessage { } /// Envelope adding a sender address to the cluster metrics gossip. /// [InternalApi] - public sealed partial class MetricsGossipEnvelope : IClusterMetricMessage, IDeadLetterSuppression + public sealed class MetricsGossipEnvelope : IClusterMetricMessage, IDeadLetterSuppression { /// /// Akka's actor address /// public Actor.Address FromAddress { get; } + public MetricsGossip Gossip { get; } + + public bool Reply { get; } + /// /// Creates new instance of /// diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricsMessageSerializer.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricsMessageSerializer.cs index 4d7f0a0ffd0..252dc2174ad 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricsMessageSerializer.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricsMessageSerializer.cs @@ -6,7 +6,6 @@ //----------------------------------------------------------------------- using System; -using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using Akka.Actor; @@ -15,7 +14,6 @@ using Akka.Serialization; using Akka.Util; using Google.Protobuf; -using Google.Protobuf.WellKnownTypes; namespace Akka.Cluster.Metrics.Serialization { @@ -130,7 +128,7 @@ public override string Manifest(object o) private byte[] AdaptiveLoadBalancingPoolToBinary(Metrics.AdaptiveLoadBalancingPool pool) { - var proto = new AdaptiveLoadBalancingPool() + var proto = new Proto.AdaptiveLoadBalancingPool() { NrOfInstances = (uint)pool.NrOfInstances, UsePoolDispatcher = pool.UsePoolDispatcher @@ -145,11 +143,11 @@ private byte[] AdaptiveLoadBalancingPoolToBinary(Metrics.AdaptiveLoadBalancingPo return proto.ToByteArray(); } - private MetricsSelector MetricsSelectorToProto(IMetricsSelector selector) + private Proto.MetricsSelector MetricsSelectorToProto(IMetricsSelector selector) { var serializer = _serialization.Value.FindSerializerFor(selector); - return new MetricsSelector() + return new Proto.MetricsSelector() { Data = ByteString.CopyFrom(serializer.ToBinary(selector)), SerializerId = (uint)serializer.Identifier, @@ -159,7 +157,7 @@ private MetricsSelector MetricsSelectorToProto(IMetricsSelector selector) private byte[] MixMetricsSelectorToBinary(Metrics.MixMetricsSelector selector) { - var proto = new MixMetricsSelector() + var proto = new Proto.MixMetricsSelector() { Selectors = { selector.Selectors.Select(MetricsSelectorToProto) } }; @@ -169,9 +167,9 @@ private byte[] MixMetricsSelectorToBinary(Metrics.MixMetricsSelector selector) /// /// Converts Akka.NET type into Protobuf serializable message /// - private AddressData AddressToProto(Actor.Address address) + private Proto.AddressData AddressToProto(Actor.Address address) { - return new AddressData() + return new Proto.AddressData() { Hostname = address.Host, Protocol = address.Protocol, @@ -185,7 +183,7 @@ private AddressData AddressToProto(Actor.Address address) /// /// /// - private Akka.Actor.Address AddressFromProto(AddressData address) + private Akka.Actor.Address AddressFromProto(Proto.AddressData address) { return new Akka.Actor.Address(address.Protocol, address.System, address.Hostname, (int)address.Port); } @@ -200,10 +198,10 @@ private int MapWithErrorMessage(IImmutableDictionary dict, T value, s private MetricsGossipEnvelope MetricsGossipEnvelopeFromBinary(byte[] bytes) { - return MetricsGossipEnvelopeFromProto(MetricsGossipEnvelope.Parser.ParseFrom(Decompress(bytes))); + return MetricsGossipEnvelopeFromProto(Proto.MetricsGossipEnvelope.Parser.ParseFrom(Decompress(bytes))); } - private MetricsGossipEnvelope MetricsGossipEnvelopeToProto(MetricsGossipEnvelope envelope) + private Proto.MetricsGossipEnvelope MetricsGossipEnvelopeToProto(MetricsGossipEnvelope envelope) { var allNodeMetrics = envelope.Gossip.Nodes; var allAddresses = allNodeMetrics.Select(m => m.Address).ToImmutableArray(); @@ -216,28 +214,32 @@ private MetricsGossipEnvelope MetricsGossipEnvelopeToProto(MetricsGossipEnvelope int MapAddress(Actor.Address address) => MapWithErrorMessage(addressMapping, address, "address"); int MapName(string name) => MapWithErrorMessage(metricNamesMapping, name, "metric name"); - Option EwmaToProto(Option ewma) - => ewma.Select(e => new NodeMetrics.Types.EWMA(e.Value, e.Alpha)); + Option EwmaToProto(Option ewma) + => ewma.Select(e => new Proto.NodeMetrics.Types.EWMA + { + Value = e.Value, + Alpha = e.Alpha + }); - NodeMetrics.Types.Number NumberToProto(AnyNumber number) + Proto.NodeMetrics.Types.Number NumberToProto(AnyNumber number) { - var proto = new NodeMetrics.Types.Number(); + var proto = new Proto.NodeMetrics.Types.Number(); switch (number.Type) { case AnyNumber.NumberType.Int: - proto.Type = NodeMetrics.Types.NumberType.Integer; + proto.Type = Proto.NodeMetrics.Types.NumberType.Integer; proto.Value32 = Convert.ToUInt32(number.LongValue); break; case AnyNumber.NumberType.Long: - proto.Type = NodeMetrics.Types.NumberType.Long; + proto.Type = Proto.NodeMetrics.Types.NumberType.Long; proto.Value64 = Convert.ToUInt64(number.LongValue); break; case AnyNumber.NumberType.Float: - proto.Type = NodeMetrics.Types.NumberType.Float; + proto.Type = Proto.NodeMetrics.Types.NumberType.Float; proto.Value32 = (uint)BitConverter.ToInt32(BitConverter.GetBytes((float)number.DoubleValue), 0); break; case AnyNumber.NumberType.Double: - proto.Type = NodeMetrics.Types.NumberType.Double; + proto.Type = Proto.NodeMetrics.Types.NumberType.Double; proto.Value64 = (ulong)BitConverter.DoubleToInt64Bits(number.DoubleValue); break; default: @@ -247,9 +249,9 @@ NodeMetrics.Types.Number NumberToProto(AnyNumber number) return proto; } - NodeMetrics.Types.Metric MetricToProto(NodeMetrics.Types.Metric m) + Proto.NodeMetrics.Types.Metric MetricToProto(NodeMetrics.Types.Metric m) { - var metric = new NodeMetrics.Types.Metric() + var metric = new Proto.NodeMetrics.Types.Metric() { NameIndex = MapName(m.Name), Number = NumberToProto(m.Value), @@ -262,9 +264,9 @@ NodeMetrics.Types.Metric MetricToProto(NodeMetrics.Types.Metric m) return metric; } - NodeMetrics NodeMetricsToProto(NodeMetrics nodeMetrics) + Proto.NodeMetrics NodeMetricsToProto(NodeMetrics nodeMetrics) { - return new NodeMetrics() + return new Proto.NodeMetrics() { AddressIndex = MapAddress(nodeMetrics.Address), Timestamp = nodeMetrics.Timestamp, @@ -274,11 +276,11 @@ NodeMetrics NodeMetricsToProto(NodeMetrics nodeMetrics) var nodeMetricsProto = allNodeMetrics.Select(NodeMetricsToProto); - return new MetricsGossipEnvelope() + return new Proto.MetricsGossipEnvelope() { From = AddressToProto(envelope.FromAddress), Reply = envelope.Reply, - Gossip = new MetricsGossip() + Gossip = new Proto.MetricsGossip() { AllAddresses = { allAddresses.Select(AddressToProto) }, AllMetricNames = { allMetricNames }, @@ -287,28 +289,28 @@ NodeMetrics NodeMetricsToProto(NodeMetrics nodeMetrics) }; } - private MetricsGossipEnvelope MetricsGossipEnvelopeFromProto(MetricsGossipEnvelope envelope) + private MetricsGossipEnvelope MetricsGossipEnvelopeFromProto(Proto.MetricsGossipEnvelope envelope) { var gossip = envelope.Gossip; var addressMapping = gossip.AllAddresses.Select(AddressFromProto).ToImmutableArray(); var metricNameMapping = gossip.AllMetricNames.ToImmutableArray(); - Option EwmaFromProto(NodeMetrics.Types.EWMA ewma) + Option EwmaFromProto(Proto.NodeMetrics.Types.EWMA ewma) => new NodeMetrics.Types.EWMA(ewma.Value, ewma.Alpha); - AnyNumber NumberFromProto(NodeMetrics.Types.Number number) + AnyNumber NumberFromProto(Proto.NodeMetrics.Types.Number number) { switch (number.Type) { - case NodeMetrics.Types.NumberType.Double: + case Proto.NodeMetrics.Types.NumberType.Double: return BitConverter.Int64BitsToDouble((long)number.Value64); - case NodeMetrics.Types.NumberType.Float: + case Proto.NodeMetrics.Types.NumberType.Float: return BitConverter.ToSingle(BitConverter.GetBytes((int)number.Value32), 0); - case NodeMetrics.Types.NumberType.Integer: + case Proto.NodeMetrics.Types.NumberType.Integer: return Convert.ToInt32(number.Value32); - case NodeMetrics.Types.NumberType.Long: + case Proto.NodeMetrics.Types.NumberType.Long: return Convert.ToInt64(number.Value64); - case NodeMetrics.Types.NumberType.Serialized: + case Proto.NodeMetrics.Types.NumberType.Serialized: // TODO: Should we somehow port this? /*val in = new ClassLoaderObjectInputStream( system.dynamicAccess.classLoader, @@ -316,13 +318,13 @@ AnyNumber NumberFromProto(NodeMetrics.Types.Number number) val obj = in.readObject in.close() obj.asInstanceOf[jl.Number]*/ - throw new NotImplementedException($"{NodeMetrics.Types.NumberType.Serialized} number type is not supported"); + throw new NotImplementedException($"{Proto.NodeMetrics.Types.NumberType.Serialized} number type is not supported"); default: throw new ArgumentOutOfRangeException(nameof(number)); } } - NodeMetrics.Types.Metric MetricFromProto(NodeMetrics.Types.Metric metric) + NodeMetrics.Types.Metric MetricFromProto(Proto.NodeMetrics.Types.Metric metric) { return new NodeMetrics.Types.Metric( metricNameMapping[metric.NameIndex], @@ -330,7 +332,7 @@ NodeMetrics.Types.Metric MetricFromProto(NodeMetrics.Types.Metric metric) metric.Ewma != null ? EwmaFromProto(metric.Ewma) : Option.None); } - NodeMetrics NodeMetricsFromProto(NodeMetrics metrics) + NodeMetrics NodeMetricsFromProto(Proto.NodeMetrics metrics) { return new NodeMetrics( addressMapping[metrics.AddressIndex], @@ -345,7 +347,7 @@ NodeMetrics NodeMetricsFromProto(NodeMetrics metrics) private Metrics.AdaptiveLoadBalancingPool AdaptiveLoadBalancingPoolFromBinary(byte[] bytes) { - var proto = AdaptiveLoadBalancingPool.Parser.ParseFrom(bytes); + var proto = Proto.AdaptiveLoadBalancingPool.Parser.ParseFrom(bytes); IMetricsSelector selector; if (proto.MetricsSelector != null) @@ -368,7 +370,7 @@ private Metrics.AdaptiveLoadBalancingPool AdaptiveLoadBalancingPoolFromBinary(by private Metrics.MixMetricsSelector MixMetricSelectorFromBinary(byte[] bytes) { - var proto = MixMetricsSelector.Parser.ParseFrom(bytes); + var proto = Proto.MixMetricsSelector.Parser.ParseFrom(bytes); return new Metrics.MixMetricsSelector(proto.Selectors.Select(s => { // should be safe because we serialized only the right subtypes of MetricsSelector @@ -376,7 +378,7 @@ private Metrics.MixMetricsSelector MixMetricSelectorFromBinary(byte[] bytes) }).ToImmutableArray()); } - private IMetricsSelector MetricSelectorFromProto(Serialization.MetricsSelector selector) + private IMetricsSelector MetricSelectorFromProto(Serialization.Proto.MetricsSelector selector) { return _serialization.Value.Deserialize(selector.Data.ToByteArray(), (int)selector.SerializerId, selector.Manifest) as IMetricsSelector; } diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/EWMA.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/EWMA.cs index 5ac32e80ef3..08493286364 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/EWMA.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/EWMA.cs @@ -31,8 +31,12 @@ public static partial class Types /// the sampled value resulting from the previous smoothing iteration. /// This value is always used as the previous EWMA to calculate the new EWMA. /// - public sealed partial class EWMA + public sealed class EWMA { + public double Value { get; } + + public double Alpha { get; } + /// /// Creates new instance of /// @@ -49,8 +53,8 @@ public EWMA(double value, double alpha) if (alpha is < 0 or > 1) throw new ArgumentException(nameof(alpha), "alpha must be between 0.0 and 1.0"); - value_ = value; - alpha_ = alpha; + Value = value; + Alpha = alpha; } /// @@ -83,7 +87,7 @@ public static double GetAlpha(TimeSpan halfLife, TimeSpan collectInterval) var halfLifeMillis = halfLife.TotalMilliseconds; if (halfLifeMillis <= 0) - throw new ArgumentException(nameof(halfLife), "halfLife must be > 0 s"); + throw new ArgumentException("halfLife must be > 0 s", nameof(halfLife)); var decayRate = logOf2 / halfLifeMillis; return 1 - Math.Exp(-decayRate * collectInterval.TotalMilliseconds); diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Metric.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Metric.cs index 5cacccabe2c..d575dcf3c77 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Metric.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Metric.cs @@ -6,10 +6,8 @@ //----------------------------------------------------------------------- using System; -using System.ComponentModel; using Akka.Annotations; using Akka.Cluster.Metrics.Helpers; -using Akka.Dispatch.SysMsg; using Akka.Util; namespace Akka.Cluster.Metrics.Serialization @@ -23,7 +21,7 @@ public static partial class Types /// /// Equality of Metric is based on its name index. /// - public sealed partial class Metric + public sealed class Metric { /// /// Metric average value @@ -79,7 +77,6 @@ public Metric(string name, AnyNumber value, Option average) Name = name; Value = value; Average = average; - ewma_ = average.HasValue ? average.Value : default(EWMA); } /// diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/MetricsGossip.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/MetricsGossip.cs index 05d77f94290..63c720a6af8 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/MetricsGossip.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/MetricsGossip.cs @@ -5,13 +5,10 @@ // //----------------------------------------------------------------------- -using System; using System.Collections.Immutable; using System.Linq; using Akka.Annotations; using Akka.Util; -using Akka.Util.Internal; -using Newtonsoft.Json; namespace Akka.Cluster.Metrics.Serialization { @@ -21,9 +18,9 @@ namespace Akka.Cluster.Metrics.Serialization /// Metrics gossip message /// [InternalApi] - public sealed partial class MetricsGossip + public sealed class MetricsGossip { - public IImmutableSet Nodes { get; private set; } = ImmutableHashSet.Empty; + public IImmutableSet Nodes { get; } /// /// Empty metrics gossip diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/NodeMetrics.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/NodeMetrics.cs index 30e8edd412e..515da25380e 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/NodeMetrics.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/NodeMetrics.cs @@ -10,7 +10,6 @@ using System.Collections.Immutable; using System.Linq; using Akka.Util; -using Google.Protobuf.Collections; namespace Akka.Cluster.Metrics.Serialization { @@ -22,7 +21,9 @@ namespace Akka.Cluster.Metrics.Serialization /// public sealed partial class NodeMetrics { - public Actor.Address Address { get; private set; } + public Actor.Address Address { get; } + public long Timestamp { get; } + public ImmutableHashSet Metrics { get; } /// /// Creates new instance of @@ -33,9 +34,8 @@ public sealed partial class NodeMetrics public NodeMetrics(Actor.Address address, long timestamp, IEnumerable metrics) { Address = address; - timestamp_ = timestamp; - metrics_ = new RepeatedField(); - metrics_.AddRange(metrics); + Timestamp = timestamp; + Metrics = metrics.ToImmutableHashSet(); } /// @@ -44,7 +44,7 @@ public NodeMetrics(Actor.Address address, long timestamp, IEnumerable= that.Timestamp) return this; // that is order @@ -58,7 +58,7 @@ public NodeMetrics Merge(NodeMetrics that) public NodeMetrics Update(NodeMetrics that) { if (!Address.Equals(that.Address)) - throw new ArgumentException(nameof(that), $"merge only allowed for same address, {Address} != {that.Address}"); + throw new ArgumentException($"merge only allowed for same address, {Address} != {that.Address}", nameof(that)); // Apply sample ordering var (latestNode, currentNode) = Timestamp >= that.Timestamp ? (this, that) : (that, this); diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricsMessages.g.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.g.cs similarity index 61% rename from src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricsMessages.g.cs rename to src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.g.cs index 7186ed70dae..949ab3c78d8 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/ClusterMetricsMessages.g.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.g.cs @@ -1,22 +1,15 @@ -//----------------------------------------------------------------------- -// -// Copyright (C) 2009-2023 Lightbend Inc. -// Copyright (C) 2013-2023 .NET Foundation -// -//----------------------------------------------------------------------- - // // Generated by the protocol buffer compiler. DO NOT EDIT! // source: ClusterMetricsMessages.proto // -#pragma warning disable 1591, 0612, 3021 +#pragma warning disable 1591, 0612, 3021, 8981 #region Designer generated code using pb = global::Google.Protobuf; using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Akka.Cluster.Metrics.Serialization { +namespace Akka.Cluster.Metrics.Serialization.Proto { /// Holder for reflection information generated from ClusterMetricsMessages.proto public static partial class ClusterMetricsMessagesReflection { @@ -53,20 +46,20 @@ static ClusterMetricsMessagesReflection() { "CRIZChF1c2VQb29sRGlzcGF0Y2hlchgEIAEoCCJHCg9NZXRyaWNzU2VsZWN0", "b3ISFAoMc2VyaWFsaXplcklkGAEgASgNEhAKCG1hbmlmZXN0GAIgASgJEgwK", "BGRhdGEYAyABKAwiOQoSTWl4TWV0cmljc1NlbGVjdG9yEiMKCXNlbGVjdG9y", - "cxgBIAMoCzIQLk1ldHJpY3NTZWxlY3RvckInSAGqAiJBa2thLkNsdXN0ZXIu", - "TWV0cmljcy5TZXJpYWxpemF0aW9uYgZwcm90bzM=")); + "cxgBIAMoCzIQLk1ldHJpY3NTZWxlY3RvckItSAGqAihBa2thLkNsdXN0ZXIu", + "TWV0cmljcy5TZXJpYWxpemF0aW9uLlByb3RvYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope), global::Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope.Parser, new[]{ "From", "Gossip", "Reply" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.MetricsGossip), global::Akka.Cluster.Metrics.Serialization.MetricsGossip.Parser, new[]{ "AllAddresses", "AllMetricNames", "NodeMetrics" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.NodeMetrics), global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Parser, new[]{ "AddressIndex", "Timestamp", "Metrics" }, null, new[]{ typeof(global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number), global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number.Parser, new[]{ "Type", "Value32", "Value64", "Serialized" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA), global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA.Parser, new[]{ "Value", "Alpha" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric), global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric.Parser, new[]{ "NameIndex", "Number", "Ewma" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.AddressData), global::Akka.Cluster.Metrics.Serialization.AddressData.Parser, new[]{ "System", "Hostname", "Port", "Protocol" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool), global::Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool.Parser, new[]{ "MetricsSelector", "NrOfInstances", "RouterDispatcher", "UsePoolDispatcher" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.MetricsSelector), global::Akka.Cluster.Metrics.Serialization.MetricsSelector.Parser, new[]{ "SerializerId", "Manifest", "Data" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.MixMetricsSelector), global::Akka.Cluster.Metrics.Serialization.MixMetricsSelector.Parser, new[]{ "Selectors" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.MetricsGossipEnvelope), global::Akka.Cluster.Metrics.Serialization.Proto.MetricsGossipEnvelope.Parser, new[]{ "From", "Gossip", "Reply" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.MetricsGossip), global::Akka.Cluster.Metrics.Serialization.Proto.MetricsGossip.Parser, new[]{ "AllAddresses", "AllMetricNames", "NodeMetrics" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics), global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Parser, new[]{ "AddressIndex", "Timestamp", "Metrics" }, null, new[]{ typeof(global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Number), global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Number.Parser, new[]{ "Type", "Value32", "Value64", "Serialized" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.EWMA), global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.EWMA.Parser, new[]{ "Value", "Alpha" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Metric), global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Metric.Parser, new[]{ "NameIndex", "Number", "Ewma" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.AddressData), global::Akka.Cluster.Metrics.Serialization.Proto.AddressData.Parser, new[]{ "System", "Hostname", "Port", "Protocol" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.AdaptiveLoadBalancingPool), global::Akka.Cluster.Metrics.Serialization.Proto.AdaptiveLoadBalancingPool.Parser, new[]{ "MetricsSelector", "NrOfInstances", "RouterDispatcher", "UsePoolDispatcher" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.MetricsSelector), global::Akka.Cluster.Metrics.Serialization.Proto.MetricsSelector.Parser, new[]{ "SerializerId", "Manifest", "Data" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Akka.Cluster.Metrics.Serialization.Proto.MixMetricsSelector), global::Akka.Cluster.Metrics.Serialization.Proto.MixMetricsSelector.Parser, new[]{ "Selectors" }, null, null, null, null) })); } #endregion @@ -77,23 +70,31 @@ static ClusterMetricsMessagesReflection() { ///* /// Metrics Gossip Envelope /// - public sealed partial class MetricsGossipEnvelope : pb::IMessage { + public sealed partial class MetricsGossipEnvelope : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MetricsGossipEnvelope()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[0]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MetricsGossipEnvelope() { OnConstruction(); } @@ -101,6 +102,7 @@ public MetricsGossipEnvelope() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MetricsGossipEnvelope(MetricsGossipEnvelope other) : this() { from_ = other.from_ != null ? other.from_.Clone() : null; gossip_ = other.gossip_ != null ? other.gossip_.Clone() : null; @@ -109,15 +111,17 @@ public MetricsGossipEnvelope(MetricsGossipEnvelope other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MetricsGossipEnvelope Clone() { return new MetricsGossipEnvelope(this); } /// Field number for the "from" field. public const int FromFieldNumber = 1; - private global::Akka.Cluster.Metrics.Serialization.AddressData from_; + private global::Akka.Cluster.Metrics.Serialization.Proto.AddressData from_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Akka.Cluster.Metrics.Serialization.AddressData From { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Akka.Cluster.Metrics.Serialization.Proto.AddressData From { get { return from_; } set { from_ = value; @@ -126,9 +130,10 @@ public MetricsGossipEnvelope Clone() { /// Field number for the "gossip" field. public const int GossipFieldNumber = 2; - private global::Akka.Cluster.Metrics.Serialization.MetricsGossip gossip_; + private global::Akka.Cluster.Metrics.Serialization.Proto.MetricsGossip gossip_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Akka.Cluster.Metrics.Serialization.MetricsGossip Gossip { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Akka.Cluster.Metrics.Serialization.Proto.MetricsGossip Gossip { get { return gossip_; } set { gossip_ = value; @@ -139,6 +144,7 @@ public MetricsGossipEnvelope Clone() { public const int ReplyFieldNumber = 3; private bool reply_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Reply { get { return reply_; } set { @@ -147,11 +153,13 @@ public bool Reply { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MetricsGossipEnvelope); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MetricsGossipEnvelope other) { if (ReferenceEquals(other, null)) { return false; @@ -166,6 +174,7 @@ public bool Equals(MetricsGossipEnvelope other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (from_ != null) hash ^= From.GetHashCode(); @@ -178,12 +187,17 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (from_ != null) { output.WriteRawTag(10); output.WriteMessage(From); @@ -199,9 +213,33 @@ public void WriteTo(pb::CodedOutputStream output) { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (from_ != null) { + output.WriteRawTag(10); + output.WriteMessage(From); + } + if (gossip_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Gossip); + } + if (Reply != false) { + output.WriteRawTag(24); + output.WriteBool(Reply); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (from_ != null) { @@ -220,19 +258,20 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MetricsGossipEnvelope other) { if (other == null) { return; } if (other.from_ != null) { if (from_ == null) { - From = new global::Akka.Cluster.Metrics.Serialization.AddressData(); + From = new global::Akka.Cluster.Metrics.Serialization.Proto.AddressData(); } From.MergeFrom(other.From); } if (other.gossip_ != null) { if (gossip_ == null) { - Gossip = new global::Akka.Cluster.Metrics.Serialization.MetricsGossip(); + Gossip = new global::Akka.Cluster.Metrics.Serialization.Proto.MetricsGossip(); } Gossip.MergeFrom(other.Gossip); } @@ -243,7 +282,11 @@ public void MergeFrom(MetricsGossipEnvelope other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -252,14 +295,14 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (from_ == null) { - From = new global::Akka.Cluster.Metrics.Serialization.AddressData(); + From = new global::Akka.Cluster.Metrics.Serialization.Proto.AddressData(); } input.ReadMessage(From); break; } case 18: { if (gossip_ == null) { - Gossip = new global::Akka.Cluster.Metrics.Serialization.MetricsGossip(); + Gossip = new global::Akka.Cluster.Metrics.Serialization.Proto.MetricsGossip(); } input.ReadMessage(Gossip); break; @@ -270,31 +313,73 @@ public void MergeFrom(pb::CodedInputStream input) { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (from_ == null) { + From = new global::Akka.Cluster.Metrics.Serialization.Proto.AddressData(); + } + input.ReadMessage(From); + break; + } + case 18: { + if (gossip_ == null) { + Gossip = new global::Akka.Cluster.Metrics.Serialization.Proto.MetricsGossip(); + } + input.ReadMessage(Gossip); + break; + } + case 24: { + Reply = input.ReadBool(); + break; + } + } + } + } + #endif + } /// ///* /// Metrics Gossip /// - public sealed partial class MetricsGossip : pb::IMessage { + public sealed partial class MetricsGossip : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MetricsGossip()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[1]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MetricsGossip() { OnConstruction(); } @@ -302,6 +387,7 @@ public MetricsGossip() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MetricsGossip(MetricsGossip other) : this() { allAddresses_ = other.allAddresses_.Clone(); allMetricNames_ = other.allMetricNames_.Clone(); @@ -310,17 +396,19 @@ public MetricsGossip(MetricsGossip other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MetricsGossip Clone() { return new MetricsGossip(this); } /// Field number for the "allAddresses" field. public const int AllAddressesFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_allAddresses_codec - = pb::FieldCodec.ForMessage(10, global::Akka.Cluster.Metrics.Serialization.AddressData.Parser); - private readonly pbc::RepeatedField allAddresses_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_allAddresses_codec + = pb::FieldCodec.ForMessage(10, global::Akka.Cluster.Metrics.Serialization.Proto.AddressData.Parser); + private readonly pbc::RepeatedField allAddresses_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField AllAddresses { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField AllAddresses { get { return allAddresses_; } } @@ -330,26 +418,30 @@ public MetricsGossip Clone() { = pb::FieldCodec.ForString(18); private readonly pbc::RepeatedField allMetricNames_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField AllMetricNames { get { return allMetricNames_; } } /// Field number for the "nodeMetrics" field. public const int NodeMetricsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_nodeMetrics_codec - = pb::FieldCodec.ForMessage(26, global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Parser); - private readonly pbc::RepeatedField nodeMetrics_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_nodeMetrics_codec + = pb::FieldCodec.ForMessage(26, global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Parser); + private readonly pbc::RepeatedField nodeMetrics_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField NodeMetrics { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField NodeMetrics { get { return nodeMetrics_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MetricsGossip); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MetricsGossip other) { if (ReferenceEquals(other, null)) { return false; @@ -364,6 +456,7 @@ public bool Equals(MetricsGossip other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= allAddresses_.GetHashCode(); @@ -376,21 +469,41 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else allAddresses_.WriteTo(output, _repeated_allAddresses_codec); allMetricNames_.WriteTo(output, _repeated_allMetricNames_codec); nodeMetrics_.WriteTo(output, _repeated_nodeMetrics_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + allAddresses_.WriteTo(ref output, _repeated_allAddresses_codec); + allMetricNames_.WriteTo(ref output, _repeated_allMetricNames_codec); + nodeMetrics_.WriteTo(ref output, _repeated_nodeMetrics_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += allAddresses_.CalculateSize(_repeated_allAddresses_codec); @@ -403,6 +516,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MetricsGossip other) { if (other == null) { return; @@ -414,7 +528,11 @@ public void MergeFrom(MetricsGossip other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -435,31 +553,67 @@ public void MergeFrom(pb::CodedInputStream input) { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + allAddresses_.AddEntriesFrom(ref input, _repeated_allAddresses_codec); + break; + } + case 18: { + allMetricNames_.AddEntriesFrom(ref input, _repeated_allMetricNames_codec); + break; + } + case 26: { + nodeMetrics_.AddEntriesFrom(ref input, _repeated_nodeMetrics_codec); + break; + } + } + } + } + #endif + } /// ///* /// Node Metrics /// - public sealed partial class NodeMetrics : pb::IMessage { + public sealed partial class NodeMetrics : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NodeMetrics()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[2]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NodeMetrics() { OnConstruction(); } @@ -467,6 +621,7 @@ public NodeMetrics() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NodeMetrics(NodeMetrics other) : this() { addressIndex_ = other.addressIndex_; timestamp_ = other.timestamp_; @@ -475,6 +630,7 @@ public NodeMetrics(NodeMetrics other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NodeMetrics Clone() { return new NodeMetrics(this); } @@ -483,6 +639,7 @@ public NodeMetrics Clone() { public const int AddressIndexFieldNumber = 1; private int addressIndex_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int AddressIndex { get { return addressIndex_; } set { @@ -494,6 +651,7 @@ public int AddressIndex { public const int TimestampFieldNumber = 2; private long timestamp_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Timestamp { get { return timestamp_; } set { @@ -503,21 +661,61 @@ public long Timestamp { /// Field number for the "metrics" field. public const int MetricsFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_metrics_codec - = pb::FieldCodec.ForMessage(26, global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric.Parser); - private readonly pbc::RepeatedField metrics_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_metrics_codec + = pb::FieldCodec.ForMessage(26, global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Metric.Parser); + private readonly pbc::RepeatedField metrics_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Metrics { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Metrics { get { return metrics_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NodeMetrics); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NodeMetrics other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (AddressIndex != other.AddressIndex) return false; + if (Timestamp != other.Timestamp) return false; + if(!metrics_.Equals(other.metrics_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (AddressIndex != 0) hash ^= AddressIndex.GetHashCode(); + if (Timestamp != 0L) hash ^= Timestamp.GetHashCode(); + hash ^= metrics_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (AddressIndex != 0) { output.WriteRawTag(8); output.WriteInt32(AddressIndex); @@ -530,9 +728,30 @@ public void WriteTo(pb::CodedOutputStream output) { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (AddressIndex != 0) { + output.WriteRawTag(8); + output.WriteInt32(AddressIndex); + } + if (Timestamp != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Timestamp); + } + metrics_.WriteTo(ref output, _repeated_metrics_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (AddressIndex != 0) { @@ -549,6 +768,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NodeMetrics other) { if (other == null) { return; @@ -564,7 +784,11 @@ public void MergeFrom(NodeMetrics other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -585,11 +809,40 @@ public void MergeFrom(pb::CodedInputStream input) { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + AddressIndex = input.ReadInt32(); + break; + } + case 16: { + Timestamp = input.ReadInt64(); + break; + } + case 26: { + metrics_.AddEntriesFrom(ref input, _repeated_metrics_codec); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the NodeMetrics message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NumberType { [pbr::OriginalName("Serialized")] Serialized = 0, @@ -599,23 +852,31 @@ public enum NumberType { [pbr::OriginalName("Long")] Long = 4, } - public sealed partial class Number : pb::IMessage { + public sealed partial class Number : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Number()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Descriptor.NestedTypes[0]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Number() { OnConstruction(); } @@ -623,6 +884,7 @@ public Number() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Number(Number other) : this() { type_ = other.type_; value32_ = other.value32_; @@ -632,15 +894,17 @@ public Number(Number other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Number Clone() { return new Number(this); } /// Field number for the "type" field. public const int TypeFieldNumber = 1; - private global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType type_ = global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType.Serialized; + private global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType type_ = global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType.Serialized; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType Type { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType Type { get { return type_; } set { type_ = value; @@ -651,6 +915,7 @@ public Number Clone() { public const int Value32FieldNumber = 2; private uint value32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint Value32 { get { return value32_; } set { @@ -662,6 +927,7 @@ public uint Value32 { public const int Value64FieldNumber = 3; private ulong value64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong Value64 { get { return value64_; } set { @@ -673,6 +939,7 @@ public ulong Value64 { public const int SerializedFieldNumber = 4; private pb::ByteString serialized_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString Serialized { get { return serialized_; } set { @@ -681,11 +948,13 @@ public ulong Value64 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Number); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Number other) { if (ReferenceEquals(other, null)) { return false; @@ -701,9 +970,10 @@ public bool Equals(Number other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (Type != global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType.Serialized) hash ^= Type.GetHashCode(); + if (Type != global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType.Serialized) hash ^= Type.GetHashCode(); if (Value32 != 0) hash ^= Value32.GetHashCode(); if (Value64 != 0UL) hash ^= Value64.GetHashCode(); if (Serialized.Length != 0) hash ^= Serialized.GetHashCode(); @@ -714,13 +984,18 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (Type != global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType.Serialized) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Type != global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType.Serialized) { output.WriteRawTag(8); output.WriteEnum((int) Type); } @@ -739,12 +1014,40 @@ public void WriteTo(pb::CodedOutputStream output) { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Type != global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType.Serialized) { + output.WriteRawTag(8); + output.WriteEnum((int) Type); + } + if (Value32 != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Value32); + } + if (Value64 != 0UL) { + output.WriteRawTag(24); + output.WriteUInt64(Value64); + } + if (Serialized.Length != 0) { + output.WriteRawTag(34); + output.WriteBytes(Serialized); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (Type != global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType.Serialized) { + if (Type != global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType.Serialized) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); } if (Value32 != 0) { @@ -763,11 +1066,12 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Number other) { if (other == null) { return; } - if (other.Type != global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType.Serialized) { + if (other.Type != global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType.Serialized) { Type = other.Type; } if (other.Value32 != 0) { @@ -783,7 +1087,11 @@ public void MergeFrom(Number other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -791,7 +1099,7 @@ public void MergeFrom(pb::CodedInputStream input) { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { - Type = (global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType) input.ReadEnum(); + Type = (global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType) input.ReadEnum(); break; } case 16: { @@ -808,27 +1116,67 @@ public void MergeFrom(pb::CodedInputStream input) { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Type = (global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.NumberType) input.ReadEnum(); + break; + } + case 16: { + Value32 = input.ReadUInt32(); + break; + } + case 24: { + Value64 = input.ReadUInt64(); + break; + } + case 34: { + Serialized = input.ReadBytes(); + break; + } + } + } + } + #endif + } - public sealed partial class EWMA : pb::IMessage { + public sealed partial class EWMA : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EWMA()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Descriptor.NestedTypes[1]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EWMA() { OnConstruction(); } @@ -836,6 +1184,7 @@ public EWMA() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EWMA(EWMA other) : this() { value_ = other.value_; alpha_ = other.alpha_; @@ -843,6 +1192,7 @@ public EWMA(EWMA other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EWMA Clone() { return new EWMA(this); } @@ -851,6 +1201,7 @@ public EWMA Clone() { public const int ValueFieldNumber = 1; private double value_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double Value { get { return value_; } set { @@ -862,6 +1213,7 @@ public double Value { public const int AlphaFieldNumber = 2; private double alpha_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double Alpha { get { return alpha_; } set { @@ -870,11 +1222,13 @@ public double Alpha { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as EWMA); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(EWMA other) { if (ReferenceEquals(other, null)) { return false; @@ -888,6 +1242,7 @@ public bool Equals(EWMA other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Value != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Value); @@ -899,12 +1254,17 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Value != 0D) { output.WriteRawTag(9); output.WriteDouble(Value); @@ -916,9 +1276,29 @@ public void WriteTo(pb::CodedOutputStream output) { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Value != 0D) { + output.WriteRawTag(9); + output.WriteDouble(Value); + } + if (Alpha != 0D) { + output.WriteRawTag(17); + output.WriteDouble(Alpha); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Value != 0D) { @@ -934,6 +1314,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(EWMA other) { if (other == null) { return; @@ -948,7 +1329,11 @@ public void MergeFrom(EWMA other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -965,27 +1350,59 @@ public void MergeFrom(pb::CodedInputStream input) { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 9: { + Value = input.ReadDouble(); + break; + } + case 17: { + Alpha = input.ReadDouble(); + break; + } + } + } } + #endif } - public sealed partial class Metric : pb::IMessage { + public sealed partial class Metric : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Metric()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Descriptor.NestedTypes[2]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Descriptor.NestedTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Metric() { OnConstruction(); } @@ -993,6 +1410,7 @@ public Metric() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Metric(Metric other) : this() { nameIndex_ = other.nameIndex_; number_ = other.number_ != null ? other.number_.Clone() : null; @@ -1001,6 +1419,7 @@ public Metric(Metric other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Metric Clone() { return new Metric(this); } @@ -1009,6 +1428,7 @@ public Metric Clone() { public const int NameIndexFieldNumber = 1; private int nameIndex_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int NameIndex { get { return nameIndex_; } set { @@ -1018,9 +1438,10 @@ public int NameIndex { /// Field number for the "number" field. public const int NumberFieldNumber = 2; - private global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number number_; + private global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Number number_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number Number { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Number Number { get { return number_; } set { number_ = value; @@ -1029,9 +1450,10 @@ public int NameIndex { /// Field number for the "ewma" field. public const int EwmaFieldNumber = 3; - private global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA ewma_; + private global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.EWMA ewma_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA Ewma { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.EWMA Ewma { get { return ewma_; } set { ewma_ = value; @@ -1039,12 +1461,51 @@ public int NameIndex { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Metric); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Metric other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NameIndex != other.NameIndex) return false; + if (!object.Equals(Number, other.Number)) return false; + if (!object.Equals(Ewma, other.Ewma)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (NameIndex != 0) hash ^= NameIndex.GetHashCode(); + if (number_ != null) hash ^= Number.GetHashCode(); + if (ewma_ != null) hash ^= Ewma.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (NameIndex != 0) { output.WriteRawTag(8); output.WriteInt32(NameIndex); @@ -1060,9 +1521,33 @@ public void WriteTo(pb::CodedOutputStream output) { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (NameIndex != 0) { + output.WriteRawTag(8); + output.WriteInt32(NameIndex); + } + if (number_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Number); + } + if (ewma_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Ewma); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (NameIndex != 0) { @@ -1081,6 +1566,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Metric other) { if (other == null) { return; @@ -1090,13 +1576,13 @@ public void MergeFrom(Metric other) { } if (other.number_ != null) { if (number_ == null) { - Number = new global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number(); + Number = new global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Number(); } Number.MergeFrom(other.Number); } if (other.ewma_ != null) { if (ewma_ == null) { - Ewma = new global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA(); + Ewma = new global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.EWMA(); } Ewma.MergeFrom(other.Ewma); } @@ -1104,7 +1590,11 @@ public void MergeFrom(Metric other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1117,22 +1607,56 @@ public void MergeFrom(pb::CodedInputStream input) { } case 18: { if (number_ == null) { - Number = new global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number(); + Number = new global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Number(); } input.ReadMessage(Number); break; } case 26: { if (ewma_ == null) { - Ewma = new global::Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA(); + Ewma = new global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.EWMA(); } input.ReadMessage(Ewma); break; } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NameIndex = input.ReadInt32(); + break; + } + case 18: { + if (number_ == null) { + Number = new global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.Number(); + } + input.ReadMessage(Number); + break; + } + case 26: { + if (ewma_ == null) { + Ewma = new global::Akka.Cluster.Metrics.Serialization.Proto.NodeMetrics.Types.EWMA(); + } + input.ReadMessage(Ewma); + break; + } + } + } + } + #endif + } } @@ -1144,23 +1668,31 @@ public void MergeFrom(pb::CodedInputStream input) { ///* /// Defines a remote address. /// - public sealed partial class AddressData : pb::IMessage { + public sealed partial class AddressData : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddressData()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[3]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AddressData() { OnConstruction(); } @@ -1168,6 +1700,7 @@ public AddressData() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AddressData(AddressData other) : this() { system_ = other.system_; hostname_ = other.hostname_; @@ -1177,6 +1710,7 @@ public AddressData(AddressData other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AddressData Clone() { return new AddressData(this); } @@ -1185,6 +1719,7 @@ public AddressData Clone() { public const int SystemFieldNumber = 1; private string system_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string System { get { return system_; } set { @@ -1196,6 +1731,7 @@ public string System { public const int HostnameFieldNumber = 2; private string hostname_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Hostname { get { return hostname_; } set { @@ -1207,6 +1743,7 @@ public string Hostname { public const int PortFieldNumber = 3; private uint port_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint Port { get { return port_; } set { @@ -1218,6 +1755,7 @@ public uint Port { public const int ProtocolFieldNumber = 4; private string protocol_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Protocol { get { return protocol_; } set { @@ -1226,11 +1764,13 @@ public string Protocol { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as AddressData); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(AddressData other) { if (ReferenceEquals(other, null)) { return false; @@ -1246,6 +1786,7 @@ public bool Equals(AddressData other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (System.Length != 0) hash ^= System.GetHashCode(); @@ -1259,12 +1800,17 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (System.Length != 0) { output.WriteRawTag(10); output.WriteString(System); @@ -1284,9 +1830,37 @@ public void WriteTo(pb::CodedOutputStream output) { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (System.Length != 0) { + output.WriteRawTag(10); + output.WriteString(System); + } + if (Hostname.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Hostname); + } + if (Port != 0) { + output.WriteRawTag(24); + output.WriteUInt32(Port); + } + if (Protocol.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Protocol); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (System.Length != 0) { @@ -1308,6 +1882,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(AddressData other) { if (other == null) { return; @@ -1328,7 +1903,11 @@ public void MergeFrom(AddressData other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1353,27 +1932,67 @@ public void MergeFrom(pb::CodedInputStream input) { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + System = input.ReadString(); + break; + } + case 18: { + Hostname = input.ReadString(); + break; + } + case 24: { + Port = input.ReadUInt32(); + break; + } + case 34: { + Protocol = input.ReadString(); + break; + } + } + } } + #endif } - public sealed partial class AdaptiveLoadBalancingPool : pb::IMessage { + public sealed partial class AdaptiveLoadBalancingPool : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AdaptiveLoadBalancingPool()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[4]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AdaptiveLoadBalancingPool() { OnConstruction(); } @@ -1381,6 +2000,7 @@ public AdaptiveLoadBalancingPool() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AdaptiveLoadBalancingPool(AdaptiveLoadBalancingPool other) : this() { metricsSelector_ = other.metricsSelector_ != null ? other.metricsSelector_.Clone() : null; nrOfInstances_ = other.nrOfInstances_; @@ -1390,18 +2010,20 @@ public AdaptiveLoadBalancingPool(AdaptiveLoadBalancingPool other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AdaptiveLoadBalancingPool Clone() { return new AdaptiveLoadBalancingPool(this); } /// Field number for the "metricsSelector" field. public const int MetricsSelectorFieldNumber = 1; - private global::Akka.Cluster.Metrics.Serialization.MetricsSelector metricsSelector_; + private global::Akka.Cluster.Metrics.Serialization.Proto.MetricsSelector metricsSelector_; /// /// omitted if default /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Akka.Cluster.Metrics.Serialization.MetricsSelector MetricsSelector { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Akka.Cluster.Metrics.Serialization.Proto.MetricsSelector MetricsSelector { get { return metricsSelector_; } set { metricsSelector_ = value; @@ -1412,6 +2034,7 @@ public AdaptiveLoadBalancingPool Clone() { public const int NrOfInstancesFieldNumber = 2; private uint nrOfInstances_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint NrOfInstances { get { return nrOfInstances_; } set { @@ -1426,6 +2049,7 @@ public uint NrOfInstances { /// omitted if default /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string RouterDispatcher { get { return routerDispatcher_; } set { @@ -1437,6 +2061,7 @@ public string RouterDispatcher { public const int UsePoolDispatcherFieldNumber = 4; private bool usePoolDispatcher_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool UsePoolDispatcher { get { return usePoolDispatcher_; } set { @@ -1445,11 +2070,13 @@ public bool UsePoolDispatcher { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as AdaptiveLoadBalancingPool); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(AdaptiveLoadBalancingPool other) { if (ReferenceEquals(other, null)) { return false; @@ -1465,6 +2092,7 @@ public bool Equals(AdaptiveLoadBalancingPool other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (metricsSelector_ != null) hash ^= MetricsSelector.GetHashCode(); @@ -1478,12 +2106,17 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (metricsSelector_ != null) { output.WriteRawTag(10); output.WriteMessage(MetricsSelector); @@ -1503,9 +2136,37 @@ public void WriteTo(pb::CodedOutputStream output) { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (metricsSelector_ != null) { + output.WriteRawTag(10); + output.WriteMessage(MetricsSelector); + } + if (NrOfInstances != 0) { + output.WriteRawTag(16); + output.WriteUInt32(NrOfInstances); + } + if (RouterDispatcher.Length != 0) { + output.WriteRawTag(26); + output.WriteString(RouterDispatcher); + } + if (UsePoolDispatcher != false) { + output.WriteRawTag(32); + output.WriteBool(UsePoolDispatcher); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (metricsSelector_ != null) { @@ -1527,13 +2188,14 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(AdaptiveLoadBalancingPool other) { if (other == null) { return; } if (other.metricsSelector_ != null) { if (metricsSelector_ == null) { - MetricsSelector = new global::Akka.Cluster.Metrics.Serialization.MetricsSelector(); + MetricsSelector = new global::Akka.Cluster.Metrics.Serialization.Proto.MetricsSelector(); } MetricsSelector.MergeFrom(other.MetricsSelector); } @@ -1550,7 +2212,11 @@ public void MergeFrom(AdaptiveLoadBalancingPool other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1559,7 +2225,7 @@ public void MergeFrom(pb::CodedInputStream input) { break; case 10: { if (metricsSelector_ == null) { - MetricsSelector = new global::Akka.Cluster.Metrics.Serialization.MetricsSelector(); + MetricsSelector = new global::Akka.Cluster.Metrics.Serialization.Proto.MetricsSelector(); } input.ReadMessage(MetricsSelector); break; @@ -1578,30 +2244,73 @@ public void MergeFrom(pb::CodedInputStream input) { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (metricsSelector_ == null) { + MetricsSelector = new global::Akka.Cluster.Metrics.Serialization.Proto.MetricsSelector(); + } + input.ReadMessage(MetricsSelector); + break; + } + case 16: { + NrOfInstances = input.ReadUInt32(); + break; + } + case 26: { + RouterDispatcher = input.ReadString(); + break; + } + case 32: { + UsePoolDispatcher = input.ReadBool(); + break; + } + } + } + } + #endif + } /// /// couldn't figure out how to import Payload /// - public sealed partial class MetricsSelector : pb::IMessage { + public sealed partial class MetricsSelector : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MetricsSelector()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[5]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MetricsSelector() { OnConstruction(); } @@ -1609,6 +2318,7 @@ public MetricsSelector() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MetricsSelector(MetricsSelector other) : this() { serializerId_ = other.serializerId_; manifest_ = other.manifest_; @@ -1617,6 +2327,7 @@ public MetricsSelector(MetricsSelector other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MetricsSelector Clone() { return new MetricsSelector(this); } @@ -1625,6 +2336,7 @@ public MetricsSelector Clone() { public const int SerializerIdFieldNumber = 1; private uint serializerId_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint SerializerId { get { return serializerId_; } set { @@ -1636,6 +2348,7 @@ public uint SerializerId { public const int ManifestFieldNumber = 2; private string manifest_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Manifest { get { return manifest_; } set { @@ -1647,6 +2360,7 @@ public string Manifest { public const int DataFieldNumber = 3; private pb::ByteString data_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString Data { get { return data_; } set { @@ -1655,11 +2369,13 @@ public string Manifest { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MetricsSelector); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MetricsSelector other) { if (ReferenceEquals(other, null)) { return false; @@ -1674,6 +2390,7 @@ public bool Equals(MetricsSelector other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (SerializerId != 0) hash ^= SerializerId.GetHashCode(); @@ -1686,12 +2403,17 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (SerializerId != 0) { output.WriteRawTag(8); output.WriteUInt32(SerializerId); @@ -1707,9 +2429,33 @@ public void WriteTo(pb::CodedOutputStream output) { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SerializerId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(SerializerId); + } + if (Manifest.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Manifest); + } + if (Data.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (SerializerId != 0) { @@ -1728,6 +2474,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MetricsSelector other) { if (other == null) { return; @@ -1745,7 +2492,11 @@ public void MergeFrom(MetricsSelector other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1766,27 +2517,63 @@ public void MergeFrom(pb::CodedInputStream input) { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + SerializerId = input.ReadUInt32(); + break; + } + case 18: { + Manifest = input.ReadString(); + break; + } + case 26: { + Data = input.ReadBytes(); + break; + } + } + } } + #endif } - public sealed partial class MixMetricsSelector : pb::IMessage { + public sealed partial class MixMetricsSelector : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MixMetricsSelector()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Akka.Cluster.Metrics.Serialization.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[6]; } + get { return global::Akka.Cluster.Metrics.Serialization.Proto.ClusterMetricsMessagesReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MixMetricsSelector() { OnConstruction(); } @@ -1794,32 +2581,37 @@ public MixMetricsSelector() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MixMetricsSelector(MixMetricsSelector other) : this() { selectors_ = other.selectors_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MixMetricsSelector Clone() { return new MixMetricsSelector(this); } /// Field number for the "selectors" field. public const int SelectorsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_selectors_codec - = pb::FieldCodec.ForMessage(10, global::Akka.Cluster.Metrics.Serialization.MetricsSelector.Parser); - private readonly pbc::RepeatedField selectors_ = new pbc::RepeatedField(); + private static readonly pb::FieldCodec _repeated_selectors_codec + = pb::FieldCodec.ForMessage(10, global::Akka.Cluster.Metrics.Serialization.Proto.MetricsSelector.Parser); + private readonly pbc::RepeatedField selectors_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Selectors { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Selectors { get { return selectors_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MixMetricsSelector); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MixMetricsSelector other) { if (ReferenceEquals(other, null)) { return false; @@ -1832,6 +2624,7 @@ public bool Equals(MixMetricsSelector other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= selectors_.GetHashCode(); @@ -1842,19 +2635,37 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else selectors_.WriteTo(output, _repeated_selectors_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + selectors_.WriteTo(ref output, _repeated_selectors_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += selectors_.CalculateSize(_repeated_selectors_codec); @@ -1865,6 +2676,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MixMetricsSelector other) { if (other == null) { return; @@ -1874,7 +2686,11 @@ public void MergeFrom(MixMetricsSelector other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1887,7 +2703,27 @@ public void MergeFrom(pb::CodedInputStream input) { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + selectors_.AddEntriesFrom(ref input, _repeated_selectors_codec); + break; + } + } + } } + #endif } diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.proto b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.proto index 86d66f3b206..bc164bb39e0 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.proto +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.proto @@ -4,7 +4,7 @@ syntax = "proto3"; -option csharp_namespace = "Akka.Cluster.Metrics.Serialization"; +option csharp_namespace = "Akka.Cluster.Metrics.Serialization.Proto"; option optimize_for = SPEED; /**************************************** diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/generate.bat b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/generate.bat index 636b5cec1e5..add96065cca 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/generate.bat +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/generate.bat @@ -1 +1 @@ -..\..\..\..\..\..\tools\Google.Protobuf.Tools\tools\windows_x64\protoc.exe --csharp_out=.. --csharp_opt=file_extension=.g.cs --proto_path=. ClusterMetricsMessages.proto \ No newline at end of file +..\..\..\..\..\..\tools\Google.Protobuf.Tools\tools\windows_x64\protoc.exe --csharp_out=. --csharp_opt=file_extension=.g.cs --proto_path=. ClusterMetricsMessages.proto \ No newline at end of file From 7275fab601aec9abd1c6254a9de106058c12eb2b Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Fri, 19 Jan 2024 03:13:13 +0700 Subject: [PATCH 2/6] Move protobuf generated file to internal --- .../Proto/ClusterMetricsMessages.g.cs | 24 +++++++++---------- .../Serialization/Proto/generate.bat | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.g.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.g.cs index 949ab3c78d8..4cf34139214 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.g.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/ClusterMetricsMessages.g.cs @@ -12,7 +12,7 @@ namespace Akka.Cluster.Metrics.Serialization.Proto { /// Holder for reflection information generated from ClusterMetricsMessages.proto - public static partial class ClusterMetricsMessagesReflection { + internal static partial class ClusterMetricsMessagesReflection { #region Descriptor /// File descriptor for ClusterMetricsMessages.proto @@ -70,7 +70,7 @@ static ClusterMetricsMessagesReflection() { ///* /// Metrics Gossip Envelope /// - public sealed partial class MetricsGossipEnvelope : pb::IMessage + internal sealed partial class MetricsGossipEnvelope : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif @@ -355,7 +355,7 @@ public void MergeFrom(pb::CodedInputStream input) { ///* /// Metrics Gossip /// - public sealed partial class MetricsGossip : pb::IMessage + internal sealed partial class MetricsGossip : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif @@ -589,7 +589,7 @@ public void MergeFrom(pb::CodedInputStream input) { ///* /// Node Metrics /// - public sealed partial class NodeMetrics : pb::IMessage + internal sealed partial class NodeMetrics : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif @@ -844,7 +844,7 @@ public void MergeFrom(pb::CodedInputStream input) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public enum NumberType { + internal enum NumberType { [pbr::OriginalName("Serialized")] Serialized = 0, [pbr::OriginalName("Double")] Double = 1, [pbr::OriginalName("Float")] Float = 2, @@ -852,7 +852,7 @@ public enum NumberType { [pbr::OriginalName("Long")] Long = 4, } - public sealed partial class Number : pb::IMessage + internal sealed partial class Number : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif @@ -1152,7 +1152,7 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class EWMA : pb::IMessage + internal sealed partial class EWMA : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif @@ -1378,7 +1378,7 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class Metric : pb::IMessage + internal sealed partial class Metric : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif @@ -1668,7 +1668,7 @@ public void MergeFrom(pb::CodedInputStream input) { ///* /// Defines a remote address. /// - public sealed partial class AddressData : pb::IMessage + internal sealed partial class AddressData : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif @@ -1968,7 +1968,7 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class AdaptiveLoadBalancingPool : pb::IMessage + internal sealed partial class AdaptiveLoadBalancingPool : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif @@ -2286,7 +2286,7 @@ public void MergeFrom(pb::CodedInputStream input) { /// /// couldn't figure out how to import Payload /// - public sealed partial class MetricsSelector : pb::IMessage + internal sealed partial class MetricsSelector : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif @@ -2549,7 +2549,7 @@ public void MergeFrom(pb::CodedInputStream input) { } - public sealed partial class MixMetricsSelector : pb::IMessage + internal sealed partial class MixMetricsSelector : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/generate.bat b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/generate.bat index add96065cca..d4b6e8b384d 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/generate.bat +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Proto/generate.bat @@ -1 +1 @@ -..\..\..\..\..\..\tools\Google.Protobuf.Tools\tools\windows_x64\protoc.exe --csharp_out=. --csharp_opt=file_extension=.g.cs --proto_path=. ClusterMetricsMessages.proto \ No newline at end of file +..\..\..\..\..\..\tools\Google.Protobuf.Tools\tools\windows_x64\protoc.exe --csharp_out=internal_access:. --csharp_opt=file_extension=.g.cs --proto_path=. ClusterMetricsMessages.proto \ No newline at end of file From e7ed8721d965f92a250b71f38e24fa21d9254d1d Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Fri, 19 Jan 2024 03:13:33 +0700 Subject: [PATCH 3/6] Update API approval list --- ....ApproveClusterMetrics.DotNet.verified.txt | 233 +----------------- ...pec.ApproveClusterMetrics.Net.verified.txt | 233 +----------------- 2 files changed, 24 insertions(+), 442 deletions(-) diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt index ed83b616959..db7618cdb1c 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt @@ -278,54 +278,6 @@ namespace Akka.Cluster.Metrics.Helpers } namespace Akka.Cluster.Metrics.Serialization { - public sealed class AdaptiveLoadBalancingPool : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int MetricsSelectorFieldNumber = 1; - public const int NrOfInstancesFieldNumber = 2; - public const int RouterDispatcherFieldNumber = 3; - public const int UsePoolDispatcherFieldNumber = 4; - public AdaptiveLoadBalancingPool() { } - public AdaptiveLoadBalancingPool(Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Akka.Cluster.Metrics.Serialization.MetricsSelector MetricsSelector { get; set; } - public uint NrOfInstances { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } - public string RouterDispatcher { get; set; } - public bool UsePoolDispatcher { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } - public sealed class AddressData : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int HostnameFieldNumber = 2; - public const int PortFieldNumber = 3; - public const int ProtocolFieldNumber = 4; - public const int SystemFieldNumber = 1; - public AddressData() { } - public AddressData(Akka.Cluster.Metrics.Serialization.AddressData other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public string Hostname { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } - public uint Port { get; set; } - public string Protocol { get; set; } - public string System { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.AddressData Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.AddressData other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.AddressData other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } public class ClusterMetricsMessageSerializer : Akka.Serialization.SerializerWithStringManifest { public ClusterMetricsMessageSerializer(Akka.Actor.ExtendedActorSystem system) { } @@ -333,180 +285,60 @@ namespace Akka.Cluster.Metrics.Serialization public override string Manifest(object o) { } public override byte[] ToBinary(object obj) { } } - public class static ClusterMetricsMessagesReflection - { - public static Google.Protobuf.Reflection.FileDescriptor Descriptor { get; } - } [Akka.Annotations.InternalApiAttribute()] public interface IClusterMetricMessage { } [Akka.Annotations.InternalApiAttribute()] - public sealed class MetricsGossip : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + public sealed class MetricsGossip { - public const int AllAddressesFieldNumber = 1; - public const int AllMetricNamesFieldNumber = 2; public static readonly Akka.Cluster.Metrics.Serialization.MetricsGossip Empty; - public const int NodeMetricsFieldNumber = 3; - public MetricsGossip() { } - public MetricsGossip(Akka.Cluster.Metrics.Serialization.MetricsGossip other) { } public MetricsGossip(System.Collections.Immutable.IImmutableSet nodes) { } - public Google.Protobuf.Collections.RepeatedField AllAddresses { get; } - public Google.Protobuf.Collections.RepeatedField AllMetricNames { get; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Google.Protobuf.Collections.RepeatedField NodeMetrics { get; } public System.Collections.Immutable.IImmutableSet Nodes { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.MetricsGossip Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.MetricsGossip other) { } public Akka.Cluster.Metrics.Serialization.MetricsGossip Filter(System.Collections.Immutable.IImmutableSet includeNodes) { } - public override int GetHashCode() { } public Akka.Cluster.Metrics.Serialization.MetricsGossip Merge(Akka.Cluster.Metrics.Serialization.MetricsGossip otherGossip) { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.MetricsGossip other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } public Akka.Util.Option NodeMetricsFor(Akka.Actor.Address address) { } public Akka.Cluster.Metrics.Serialization.MetricsGossip Remove(Akka.Actor.Address node) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } public static Akka.Cluster.Metrics.Serialization.MetricsGossip +(Akka.Cluster.Metrics.Serialization.MetricsGossip gossip, Akka.Cluster.Metrics.Serialization.NodeMetrics newNodeMetrics) { } } [Akka.Annotations.InternalApiAttribute()] - public sealed class MetricsGossipEnvelope : Akka.Cluster.Metrics.Serialization.IClusterMetricMessage, Akka.Event.IDeadLetterSuppression, Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + public sealed class MetricsGossipEnvelope : Akka.Cluster.Metrics.Serialization.IClusterMetricMessage, Akka.Event.IDeadLetterSuppression { - public const int FromFieldNumber = 1; - public const int GossipFieldNumber = 2; - public const int ReplyFieldNumber = 3; public MetricsGossipEnvelope(Akka.Actor.Address fromAddress, Akka.Cluster.Metrics.Serialization.MetricsGossip gossip, bool reply) { } - public MetricsGossipEnvelope() { } - public MetricsGossipEnvelope(Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Akka.Cluster.Metrics.Serialization.AddressData From { get; set; } public Akka.Actor.Address FromAddress { get; } - public Akka.Cluster.Metrics.Serialization.MetricsGossip Gossip { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } - public bool Reply { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } - public sealed class MetricsSelector : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int DataFieldNumber = 3; - public const int ManifestFieldNumber = 2; - public const int SerializerIdFieldNumber = 1; - public MetricsSelector() { } - public MetricsSelector(Akka.Cluster.Metrics.Serialization.MetricsSelector other) { } - public Google.Protobuf.ByteString Data { get; set; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public string Manifest { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } - public uint SerializerId { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.MetricsSelector Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.MetricsSelector other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.MetricsSelector other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } - public sealed class MixMetricsSelector : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int SelectorsFieldNumber = 1; - public MixMetricsSelector() { } - public MixMetricsSelector(Akka.Cluster.Metrics.Serialization.MixMetricsSelector other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public Google.Protobuf.Collections.RepeatedField Selectors { get; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.MixMetricsSelector Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.MixMetricsSelector other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.MixMetricsSelector other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } + public Akka.Cluster.Metrics.Serialization.MetricsGossip Gossip { get; } + public bool Reply { get; } } - public sealed class NodeMetrics : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + [Akka.Annotations.InternalApiAttribute()] + public sealed class NodeMetrics { - public const int AddressIndexFieldNumber = 1; - public const int MetricsFieldNumber = 3; - public const int TimestampFieldNumber = 2; - public NodeMetrics() { } - public NodeMetrics(Akka.Cluster.Metrics.Serialization.NodeMetrics other) { } public NodeMetrics(Akka.Actor.Address address, long timestamp, System.Collections.Generic.IEnumerable metrics) { } public Akka.Actor.Address Address { get; } - public int AddressIndex { get; set; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Google.Protobuf.Collections.RepeatedField Metrics { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public long Timestamp { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.NodeMetrics Clone() { } + public System.Collections.Immutable.ImmutableHashSet Metrics { get; } + public long Timestamp { get; } public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics other) { } public override int GetHashCode() { } public Akka.Cluster.Metrics.Serialization.NodeMetrics Merge(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.NodeMetrics other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } public Akka.Util.Option Metric(string name) { } public bool SameAs(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } - public override string ToString() { } public Akka.Cluster.Metrics.Serialization.NodeMetrics Update(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } public class static Types { - public sealed class EWMA : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + public sealed class EWMA { - public const int AlphaFieldNumber = 2; - public const int ValueFieldNumber = 1; - public EWMA() { } - public EWMA(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA other) { } public EWMA(double value, double alpha) { } - public double Alpha { get; set; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public double Value { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA other) { } + public double Alpha { get; } + public double Value { get; } public static double GetAlpha(System.TimeSpan halfLife, System.TimeSpan collectInterval) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } public static Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA +(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA current, double xn) { } } - public sealed class Metric : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + public sealed class Metric { - public const int EwmaFieldNumber = 3; - public const int NameIndexFieldNumber = 1; - public const int NumberFieldNumber = 2; - public Metric() { } - public Metric(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric other) { } public Metric(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option average) { } public Akka.Util.Option Average { get; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA Ewma { get; set; } public bool IsSmooth { get; } public string Name { get; } - public int NameIndex { get; set; } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number Number { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } public double SmoothValue { get; } public Akka.Cluster.Metrics.Helpers.AnyNumber Value { get; } public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric Add(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric latest) { } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric Clone() { } [Akka.Annotations.InternalApiAttribute()] public static Akka.Util.Either ConvertNumber(Akka.Cluster.Metrics.Helpers.AnyNumber number) { } public static Akka.Util.Option Create(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value) { } @@ -517,50 +349,9 @@ namespace Akka.Cluster.Metrics.Serialization public static bool Defined(Akka.Cluster.Metrics.Helpers.AnyNumber value) { } public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric other) { } public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } public bool SameAs(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric that) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } public static Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric +(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric m1, Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric m2) { } } - public sealed class Number : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int SerializedFieldNumber = 4; - public const int TypeFieldNumber = 1; - public const int Value32FieldNumber = 2; - public const int Value64FieldNumber = 3; - public Number() { } - public Number(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public Google.Protobuf.ByteString Serialized { get; set; } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType Type { get; set; } - public uint Value32 { get; set; } - public ulong Value64 { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } - public enum NumberType - { - [Google.Protobuf.Reflection.OriginalNameAttribute("Serialized")] - Serialized = 0, - [Google.Protobuf.Reflection.OriginalNameAttribute("Double")] - Double = 1, - [Google.Protobuf.Reflection.OriginalNameAttribute("Float")] - Float = 2, - [Google.Protobuf.Reflection.OriginalNameAttribute("Integer")] - Integer = 3, - [Google.Protobuf.Reflection.OriginalNameAttribute("Long")] - Long = 4, - } } } } \ No newline at end of file diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt index 8415e6da263..a1883f68b33 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt @@ -277,54 +277,6 @@ namespace Akka.Cluster.Metrics.Helpers } namespace Akka.Cluster.Metrics.Serialization { - public sealed class AdaptiveLoadBalancingPool : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int MetricsSelectorFieldNumber = 1; - public const int NrOfInstancesFieldNumber = 2; - public const int RouterDispatcherFieldNumber = 3; - public const int UsePoolDispatcherFieldNumber = 4; - public AdaptiveLoadBalancingPool() { } - public AdaptiveLoadBalancingPool(Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Akka.Cluster.Metrics.Serialization.MetricsSelector MetricsSelector { get; set; } - public uint NrOfInstances { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } - public string RouterDispatcher { get; set; } - public bool UsePoolDispatcher { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.AdaptiveLoadBalancingPool other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } - public sealed class AddressData : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int HostnameFieldNumber = 2; - public const int PortFieldNumber = 3; - public const int ProtocolFieldNumber = 4; - public const int SystemFieldNumber = 1; - public AddressData() { } - public AddressData(Akka.Cluster.Metrics.Serialization.AddressData other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public string Hostname { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } - public uint Port { get; set; } - public string Protocol { get; set; } - public string System { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.AddressData Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.AddressData other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.AddressData other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } public class ClusterMetricsMessageSerializer : Akka.Serialization.SerializerWithStringManifest { public ClusterMetricsMessageSerializer(Akka.Actor.ExtendedActorSystem system) { } @@ -332,180 +284,60 @@ namespace Akka.Cluster.Metrics.Serialization public override string Manifest(object o) { } public override byte[] ToBinary(object obj) { } } - public class static ClusterMetricsMessagesReflection - { - public static Google.Protobuf.Reflection.FileDescriptor Descriptor { get; } - } [Akka.Annotations.InternalApiAttribute()] public interface IClusterMetricMessage { } [Akka.Annotations.InternalApiAttribute()] - public sealed class MetricsGossip : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + public sealed class MetricsGossip { - public const int AllAddressesFieldNumber = 1; - public const int AllMetricNamesFieldNumber = 2; public static readonly Akka.Cluster.Metrics.Serialization.MetricsGossip Empty; - public const int NodeMetricsFieldNumber = 3; - public MetricsGossip() { } - public MetricsGossip(Akka.Cluster.Metrics.Serialization.MetricsGossip other) { } public MetricsGossip(System.Collections.Immutable.IImmutableSet nodes) { } - public Google.Protobuf.Collections.RepeatedField AllAddresses { get; } - public Google.Protobuf.Collections.RepeatedField AllMetricNames { get; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Google.Protobuf.Collections.RepeatedField NodeMetrics { get; } public System.Collections.Immutable.IImmutableSet Nodes { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.MetricsGossip Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.MetricsGossip other) { } public Akka.Cluster.Metrics.Serialization.MetricsGossip Filter(System.Collections.Immutable.IImmutableSet includeNodes) { } - public override int GetHashCode() { } public Akka.Cluster.Metrics.Serialization.MetricsGossip Merge(Akka.Cluster.Metrics.Serialization.MetricsGossip otherGossip) { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.MetricsGossip other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } public Akka.Util.Option NodeMetricsFor(Akka.Actor.Address address) { } public Akka.Cluster.Metrics.Serialization.MetricsGossip Remove(Akka.Actor.Address node) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } public static Akka.Cluster.Metrics.Serialization.MetricsGossip +(Akka.Cluster.Metrics.Serialization.MetricsGossip gossip, Akka.Cluster.Metrics.Serialization.NodeMetrics newNodeMetrics) { } } [Akka.Annotations.InternalApiAttribute()] - public sealed class MetricsGossipEnvelope : Akka.Cluster.Metrics.Serialization.IClusterMetricMessage, Akka.Event.IDeadLetterSuppression, Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + public sealed class MetricsGossipEnvelope : Akka.Cluster.Metrics.Serialization.IClusterMetricMessage, Akka.Event.IDeadLetterSuppression { - public const int FromFieldNumber = 1; - public const int GossipFieldNumber = 2; - public const int ReplyFieldNumber = 3; public MetricsGossipEnvelope(Akka.Actor.Address fromAddress, Akka.Cluster.Metrics.Serialization.MetricsGossip gossip, bool reply) { } - public MetricsGossipEnvelope() { } - public MetricsGossipEnvelope(Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Akka.Cluster.Metrics.Serialization.AddressData From { get; set; } public Akka.Actor.Address FromAddress { get; } - public Akka.Cluster.Metrics.Serialization.MetricsGossip Gossip { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } - public bool Reply { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.MetricsGossipEnvelope other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } - public sealed class MetricsSelector : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int DataFieldNumber = 3; - public const int ManifestFieldNumber = 2; - public const int SerializerIdFieldNumber = 1; - public MetricsSelector() { } - public MetricsSelector(Akka.Cluster.Metrics.Serialization.MetricsSelector other) { } - public Google.Protobuf.ByteString Data { get; set; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public string Manifest { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } - public uint SerializerId { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.MetricsSelector Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.MetricsSelector other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.MetricsSelector other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } - public sealed class MixMetricsSelector : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int SelectorsFieldNumber = 1; - public MixMetricsSelector() { } - public MixMetricsSelector(Akka.Cluster.Metrics.Serialization.MixMetricsSelector other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public Google.Protobuf.Collections.RepeatedField Selectors { get; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.MixMetricsSelector Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.MixMetricsSelector other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.MixMetricsSelector other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } + public Akka.Cluster.Metrics.Serialization.MetricsGossip Gossip { get; } + public bool Reply { get; } } - public sealed class NodeMetrics : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + [Akka.Annotations.InternalApiAttribute()] + public sealed class NodeMetrics { - public const int AddressIndexFieldNumber = 1; - public const int MetricsFieldNumber = 3; - public const int TimestampFieldNumber = 2; - public NodeMetrics() { } - public NodeMetrics(Akka.Cluster.Metrics.Serialization.NodeMetrics other) { } public NodeMetrics(Akka.Actor.Address address, long timestamp, System.Collections.Generic.IEnumerable metrics) { } public Akka.Actor.Address Address { get; } - public int AddressIndex { get; set; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Google.Protobuf.Collections.RepeatedField Metrics { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public long Timestamp { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.NodeMetrics Clone() { } + public System.Collections.Immutable.ImmutableHashSet Metrics { get; } + public long Timestamp { get; } public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics other) { } public override int GetHashCode() { } public Akka.Cluster.Metrics.Serialization.NodeMetrics Merge(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.NodeMetrics other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } public Akka.Util.Option Metric(string name) { } public bool SameAs(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } - public override string ToString() { } public Akka.Cluster.Metrics.Serialization.NodeMetrics Update(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } public class static Types { - public sealed class EWMA : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + public sealed class EWMA { - public const int AlphaFieldNumber = 2; - public const int ValueFieldNumber = 1; - public EWMA() { } - public EWMA(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA other) { } public EWMA(double value, double alpha) { } - public double Alpha { get; set; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public double Value { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA other) { } + public double Alpha { get; } + public double Value { get; } public static double GetAlpha(System.TimeSpan halfLife, System.TimeSpan collectInterval) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } public static Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA +(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA current, double xn) { } } - public sealed class Metric : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable + public sealed class Metric { - public const int EwmaFieldNumber = 3; - public const int NameIndexFieldNumber = 1; - public const int NumberFieldNumber = 2; - public Metric() { } - public Metric(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric other) { } public Metric(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option average) { } public Akka.Util.Option Average { get; } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA Ewma { get; set; } public bool IsSmooth { get; } public string Name { get; } - public int NameIndex { get; set; } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number Number { get; set; } - public static Google.Protobuf.MessageParser Parser { get; } public double SmoothValue { get; } public Akka.Cluster.Metrics.Helpers.AnyNumber Value { get; } public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric Add(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric latest) { } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric Clone() { } [Akka.Annotations.InternalApiAttribute()] public static Akka.Util.Either ConvertNumber(Akka.Cluster.Metrics.Helpers.AnyNumber number) { } public static Akka.Util.Option Create(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value) { } @@ -516,50 +348,9 @@ namespace Akka.Cluster.Metrics.Serialization public static bool Defined(Akka.Cluster.Metrics.Helpers.AnyNumber value) { } public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric other) { } public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } public bool SameAs(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric that) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } public static Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric +(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric m1, Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric m2) { } } - public sealed class Number : Google.Protobuf.IDeepCloneable, Google.Protobuf.IMessage, Google.Protobuf.IMessage, System.IEquatable - { - public const int SerializedFieldNumber = 4; - public const int TypeFieldNumber = 1; - public const int Value32FieldNumber = 2; - public const int Value64FieldNumber = 3; - public Number() { } - public Number(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number other) { } - public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; } - public static Google.Protobuf.MessageParser Parser { get; } - public Google.Protobuf.ByteString Serialized { get; set; } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.NumberType Type { get; set; } - public uint Value32 { get; set; } - public ulong Value64 { get; set; } - public int CalculateSize() { } - public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number Clone() { } - public override bool Equals(object other) { } - public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number other) { } - public override int GetHashCode() { } - public void MergeFrom(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Number other) { } - public void MergeFrom(Google.Protobuf.CodedInputStream input) { } - public override string ToString() { } - public void WriteTo(Google.Protobuf.CodedOutputStream output) { } - } - public enum NumberType - { - [Google.Protobuf.Reflection.OriginalNameAttribute("Serialized")] - Serialized = 0, - [Google.Protobuf.Reflection.OriginalNameAttribute("Double")] - Double = 1, - [Google.Protobuf.Reflection.OriginalNameAttribute("Float")] - Float = 2, - [Google.Protobuf.Reflection.OriginalNameAttribute("Integer")] - Integer = 3, - [Google.Protobuf.Reflection.OriginalNameAttribute("Long")] - Long = 4, - } } } } \ No newline at end of file From 53c426d816b5edb31117bfcf257fe0a6ce1689bd Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Fri, 19 Jan 2024 03:15:58 +0700 Subject: [PATCH 4/6] Fix API approval list --- .../verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt | 1 - .../verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt index db7618cdb1c..23f86698f98 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt @@ -307,7 +307,6 @@ namespace Akka.Cluster.Metrics.Serialization public Akka.Cluster.Metrics.Serialization.MetricsGossip Gossip { get; } public bool Reply { get; } } - [Akka.Annotations.InternalApiAttribute()] public sealed class NodeMetrics { public NodeMetrics(Akka.Actor.Address address, long timestamp, System.Collections.Generic.IEnumerable metrics) { } diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt index a1883f68b33..c805b8e4209 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt @@ -306,7 +306,6 @@ namespace Akka.Cluster.Metrics.Serialization public Akka.Cluster.Metrics.Serialization.MetricsGossip Gossip { get; } public bool Reply { get; } } - [Akka.Annotations.InternalApiAttribute()] public sealed class NodeMetrics { public NodeMetrics(Akka.Actor.Address address, long timestamp, System.Collections.Generic.IEnumerable metrics) { } From f1ecf930431d84f96b7e8ceed1964010d0be252c Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Fri, 19 Jan 2024 04:01:33 +0700 Subject: [PATCH 5/6] Fix equality and comparator errors --- .../Serialization/EWMA.cs | 27 +++++++++++++++-- .../Serialization/Metric.cs | 5 ++-- .../Serialization/MetricsGossip.cs | 6 ++-- .../Serialization/NodeMetrics.cs | 30 +++++++++++++++---- 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/EWMA.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/EWMA.cs index 08493286364..0b8f1c8290d 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/EWMA.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/EWMA.cs @@ -31,7 +31,7 @@ public static partial class Types /// the sampled value resulting from the previous smoothing iteration. /// This value is always used as the previous EWMA to calculate the new EWMA. /// - public sealed class EWMA + public sealed class EWMA: IEquatable { public double Value { get; } @@ -51,7 +51,7 @@ public sealed class EWMA public EWMA(double value, double alpha) { if (alpha is < 0 or > 1) - throw new ArgumentException(nameof(alpha), "alpha must be between 0.0 and 1.0"); + throw new ArgumentException("alpha must be between 0.0 and 1.0", nameof(alpha)); Value = value; Alpha = alpha; @@ -92,6 +92,29 @@ public static double GetAlpha(TimeSpan halfLife, TimeSpan collectInterval) var decayRate = logOf2 / halfLifeMillis; return 1 - Math.Exp(-decayRate * collectInterval.TotalMilliseconds); } + + public bool Equals(EWMA other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Value.Equals(other.Value) && Alpha.Equals(other.Alpha); + } + + public override bool Equals(object obj) + { + return ReferenceEquals(this, obj) || obj is EWMA other && Equals(other); + } + + public override int GetHashCode() + { + unchecked + { + var hash = 17; + hash = hash * 23 + Value.GetHashCode(); + hash = hash * 23 + Alpha.GetHashCode(); + return hash; + } + } } } } diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Metric.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Metric.cs index d575dcf3c77..48e686b3a47 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Metric.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/Metric.cs @@ -10,6 +10,7 @@ using Akka.Cluster.Metrics.Helpers; using Akka.Util; +#nullable enable namespace Akka.Cluster.Metrics.Serialization { public sealed partial class NodeMetrics @@ -21,7 +22,7 @@ public static partial class Types /// /// Equality of Metric is based on its name index. /// - public sealed class Metric + public sealed class Metric: IEquatable { /// /// Metric average value @@ -178,7 +179,7 @@ public bool Equals(Metric other) public override int GetHashCode() { - return (Name != null ? Name.GetHashCode() : 0); + return Name.GetHashCode(); } } } diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/MetricsGossip.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/MetricsGossip.cs index 63c720a6af8..cfca601f3f3 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/MetricsGossip.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/MetricsGossip.cs @@ -37,7 +37,7 @@ public MetricsGossip(IImmutableSet nodes) /// public MetricsGossip Remove(Actor.Address node) { - return new MetricsGossip(Nodes.Where(n => !n.Address.Equals(node)).ToImmutableHashSet()); + return new MetricsGossip(Nodes.Where(n => !n.Address.Equals(node)).ToImmutableHashSet(NodeMetricsComparer.Instance)); } /// @@ -45,7 +45,7 @@ public MetricsGossip Remove(Actor.Address node) /// public MetricsGossip Filter(IImmutableSet includeNodes) { - return new MetricsGossip(Nodes.Where(n => includeNodes.Contains(n.Address)).ToImmutableHashSet()); + return new MetricsGossip(Nodes.Where(n => includeNodes.Contains(n.Address)).ToImmutableHashSet(NodeMetricsComparer.Instance)); } /// @@ -74,7 +74,7 @@ public MetricsGossip Merge(MetricsGossip otherGossip) public Option NodeMetricsFor(Actor.Address address) { var node = Nodes.FirstOrDefault(m => m.Address.Equals(address)); - return node ?? Option.None; + return node is not null ? Option.Create(node) : Option.None; } } } diff --git a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/NodeMetrics.cs b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/NodeMetrics.cs index 515da25380e..0185b8761e8 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/NodeMetrics.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics/Serialization/NodeMetrics.cs @@ -11,15 +11,36 @@ using System.Linq; using Akka.Util; +#nullable enable namespace Akka.Cluster.Metrics.Serialization { + internal sealed class NodeMetricsComparer: IEqualityComparer + { + public static readonly NodeMetricsComparer Instance = new(); + + private NodeMetricsComparer() { } + public bool Equals(NodeMetrics x, NodeMetrics y) + { + if (ReferenceEquals(x, y)) return true; + if (ReferenceEquals(x, null)) return false; + if (ReferenceEquals(y, null)) return false; + if (x.GetType() != y.GetType()) return false; + return Equals(x.Address, y.Address); + } + + public int GetHashCode(NodeMetrics obj) + { + return obj.Address.GetHashCode(); + } + } + /// /// The snapshot of current sampled health metrics for any monitored process. /// Collected and gossipped at regular intervals for dynamic cluster management strategies. /// /// Equality of NodeMetrics is based on its address. /// - public sealed partial class NodeMetrics + public sealed partial class NodeMetrics: IEquatable { public Actor.Address Address { get; } public long Timestamp { get; } @@ -93,19 +114,16 @@ public NodeMetrics Update(NodeMetrics that) * just stip them from generated code and paste here, with adding Address property check */ - - public bool Equals(NodeMetrics other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return Equals(Address, other.Address); + return Address.Equals(other.Address); } - public override int GetHashCode() { - return (Address != null ? Address.GetHashCode() : 0); + return Address.GetHashCode(); } } } From f9aaf775bc7db3cfcaeb90867fb543a181e01adf Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Fri, 19 Jan 2024 04:02:56 +0700 Subject: [PATCH 6/6] Update API approval --- ....ApproveClusterMetrics.DotNet.verified.txt | 37 ++++++++++++++++--- ...pec.ApproveClusterMetrics.Net.verified.txt | 37 ++++++++++++++++--- 2 files changed, 62 insertions(+), 12 deletions(-) diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt index 23f86698f98..7d601ba6225 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.DotNet.verified.txt @@ -307,7 +307,8 @@ namespace Akka.Cluster.Metrics.Serialization public Akka.Cluster.Metrics.Serialization.MetricsGossip Gossip { get; } public bool Reply { get; } } - public sealed class NodeMetrics + [System.Runtime.CompilerServices.NullableAttribute(0)] + public sealed class NodeMetrics : System.IEquatable { public NodeMetrics(Akka.Actor.Address address, long timestamp, System.Collections.Generic.IEnumerable metrics) { } public Akka.Actor.Address Address { get; } @@ -316,22 +317,34 @@ namespace Akka.Cluster.Metrics.Serialization public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics other) { } public override int GetHashCode() { } public Akka.Cluster.Metrics.Serialization.NodeMetrics Merge(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] public Akka.Util.Option Metric(string name) { } public bool SameAs(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } public Akka.Cluster.Metrics.Serialization.NodeMetrics Update(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } public class static Types { - public sealed class EWMA + public sealed class EWMA : System.IEquatable { public EWMA(double value, double alpha) { } public double Alpha { get; } public double Value { get; } + public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA other) { } + public override bool Equals(object obj) { } public static double GetAlpha(System.TimeSpan halfLife, System.TimeSpan collectInterval) { } + public override int GetHashCode() { } public static Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA +(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA current, double xn) { } } - public sealed class Metric + [System.Runtime.CompilerServices.NullableAttribute(0)] + public sealed class Metric : System.IEquatable { - public Metric(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option average) { } + public Metric(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, [System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] Akka.Util.Option average) { } + [System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] public Akka.Util.Option Average { get; } public bool IsSmooth { get; } public string Name { get; } @@ -340,9 +353,21 @@ namespace Akka.Cluster.Metrics.Serialization public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric Add(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric latest) { } [Akka.Annotations.InternalApiAttribute()] public static Akka.Util.Either ConvertNumber(Akka.Cluster.Metrics.Helpers.AnyNumber number) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] public static Akka.Util.Option Create(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value) { } - public static Akka.Util.Option Create(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option decayFactor) { } - public static Akka.Util.Option Create(string name, Akka.Util.Try value, Akka.Util.Option decayFactor) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] + public static Akka.Util.Option Create([System.Runtime.CompilerServices.NullableAttribute(1)] string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option decayFactor) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] + public static Akka.Util.Option Create(string name, Akka.Util.Try value, [System.Runtime.CompilerServices.NullableAttribute(0)] Akka.Util.Option decayFactor) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] public static Akka.Util.Option CreateEWMA(Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option decayFactor) { } [Akka.Annotations.InternalApiAttribute()] public static bool Defined(Akka.Cluster.Metrics.Helpers.AnyNumber value) { } diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt index c805b8e4209..5d848846987 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveClusterMetrics.Net.verified.txt @@ -306,7 +306,8 @@ namespace Akka.Cluster.Metrics.Serialization public Akka.Cluster.Metrics.Serialization.MetricsGossip Gossip { get; } public bool Reply { get; } } - public sealed class NodeMetrics + [System.Runtime.CompilerServices.NullableAttribute(0)] + public sealed class NodeMetrics : System.IEquatable { public NodeMetrics(Akka.Actor.Address address, long timestamp, System.Collections.Generic.IEnumerable metrics) { } public Akka.Actor.Address Address { get; } @@ -315,22 +316,34 @@ namespace Akka.Cluster.Metrics.Serialization public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics other) { } public override int GetHashCode() { } public Akka.Cluster.Metrics.Serialization.NodeMetrics Merge(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] public Akka.Util.Option Metric(string name) { } public bool SameAs(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } public Akka.Cluster.Metrics.Serialization.NodeMetrics Update(Akka.Cluster.Metrics.Serialization.NodeMetrics that) { } public class static Types { - public sealed class EWMA + public sealed class EWMA : System.IEquatable { public EWMA(double value, double alpha) { } public double Alpha { get; } public double Value { get; } + public bool Equals(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA other) { } + public override bool Equals(object obj) { } public static double GetAlpha(System.TimeSpan halfLife, System.TimeSpan collectInterval) { } + public override int GetHashCode() { } public static Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA +(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.EWMA current, double xn) { } } - public sealed class Metric + [System.Runtime.CompilerServices.NullableAttribute(0)] + public sealed class Metric : System.IEquatable { - public Metric(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option average) { } + public Metric(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, [System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] Akka.Util.Option average) { } + [System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] public Akka.Util.Option Average { get; } public bool IsSmooth { get; } public string Name { get; } @@ -339,9 +352,21 @@ namespace Akka.Cluster.Metrics.Serialization public Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric Add(Akka.Cluster.Metrics.Serialization.NodeMetrics.Types.Metric latest) { } [Akka.Annotations.InternalApiAttribute()] public static Akka.Util.Either ConvertNumber(Akka.Cluster.Metrics.Helpers.AnyNumber number) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] public static Akka.Util.Option Create(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value) { } - public static Akka.Util.Option Create(string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option decayFactor) { } - public static Akka.Util.Option Create(string name, Akka.Util.Try value, Akka.Util.Option decayFactor) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] + public static Akka.Util.Option Create([System.Runtime.CompilerServices.NullableAttribute(1)] string name, Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option decayFactor) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] + public static Akka.Util.Option Create(string name, Akka.Util.Try value, [System.Runtime.CompilerServices.NullableAttribute(0)] Akka.Util.Option decayFactor) { } + [return: System.Runtime.CompilerServices.NullableAttribute(new byte[] { + 0, + 1})] public static Akka.Util.Option CreateEWMA(Akka.Cluster.Metrics.Helpers.AnyNumber value, Akka.Util.Option decayFactor) { } [Akka.Annotations.InternalApiAttribute()] public static bool Defined(Akka.Cluster.Metrics.Helpers.AnyNumber value) { }