private Proto.Msg.DataEnvelope.Types.PruningEntry PruningToProto(UniqueAddress addr, IPruningState pruning) { var proto = new Proto.Msg.DataEnvelope.Types.PruningEntry { RemovedAddress = SerializationSupport.UniqueAddressToProto(addr) }; switch (pruning) { case PruningPerformed performed: proto.Performed = true; proto.ObsoleteTime = performed.ObsoleteTime.Ticks; break; case PruningInitialized init: proto.Performed = false; proto.OwnerAddress = SerializationSupport.UniqueAddressToProto(init.Owner); foreach (var address in init.Seen) { proto.Seen.Add(SerializationSupport.AddressToProto(address)); } break; } return(proto); }
public static Proto.Msg.UniqueAddress UniqueAddressToProto(UniqueAddress address) { return(new Proto.Msg.UniqueAddress() { Address = AddressToProto(address.Address), Uid = address.Uid }); }
public ReplicatorMessageSerializerSpec(ITestOutputHelper output) : base(BaseConfig, "ReplicatorMessageSerializerSpec", output) { _serializer = new ReplicatorMessageSerializer((ExtendedActorSystem)Sys); // We dont have Artery implementation // _protocol = ((RemoteActorRefProvider) ((ExtendedActorSystem)Sys).Provider).RemoteSettings.Artery.Enabled _protocol = "akka.tcp"; _address1 = new UniqueAddress(new Address("akka.tcp", Sys.Name, "some.host.org", 4711), 1); _address2 = new UniqueAddress(new Address("akka.tcp", Sys.Name, "other.host.org", 4711), 2); _address3 = new UniqueAddress(new Address("akka.tcp", Sys.Name, "some.host.org", 4711), 3); _keyA = new GSetKey <string>("A"); }
public PNCounterDictionary <TKey> PruningCleanup(UniqueAddress removedNode) => new PNCounterDictionary <TKey>(_underlying.PruningCleanup(removedNode));
public PNCounterDictionary <TKey> Prune(UniqueAddress removedNode, UniqueAddress collapseInto) => new PNCounterDictionary <TKey>(_underlying.Prune(removedNode, collapseInto));
IReplicatedData IRemovedNodePruning.Prune(UniqueAddress removedNode, UniqueAddress collapseInto) => Prune(removedNode, collapseInto);
IReplicatedData IRemovedNodePruning.PruningCleanup(UniqueAddress removedNode) => PruningCleanup(removedNode);
public bool NeedPruningFrom(UniqueAddress removedNode) => _underlying.NeedPruningFrom(removedNode);
/// <summary> /// Removes an entry from the map. /// Note that if there is a conflicting update on another node the entry will /// not be removed after merge. /// </summary> public PNCounterDictionary <TKey> Remove(UniqueAddress node, TKey key) => new PNCounterDictionary <TKey>(_underlying.Remove(node, key));
/// <summary> /// Decrement the counter with the delta specified. /// If the delta is negative then it will increment instead of decrement. /// </summary> public PNCounterDictionary <TKey> Decrement(UniqueAddress node, TKey key, long delta = 1L) => new PNCounterDictionary <TKey>(_underlying.AddOrUpdate(node, key, PNCounter.Empty, old => old.Decrement(node, delta)));
public ReplicatorMessageSerializerSpec(ITestOutputHelper output) : base(BaseConfig, "ReplicatorMessageSerializerSpec", output) { _address1 = new UniqueAddress(new Address("akka.tcp", Sys.Name, "some.host.org", 4711), 1); _address2 = new UniqueAddress(new Address("akka.tcp", Sys.Name, "other.host.org", 4711), 2); _address3 = new UniqueAddress(new Address("akka.tcp", Sys.Name, "some.host.org", 4711), 3); }