Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static Proto.Msg.UniqueAddress UniqueAddressToProto(UniqueAddress address)
 {
     return(new Proto.Msg.UniqueAddress()
     {
         Address = AddressToProto(address.Address), Uid = address.Uid
     });
 }
Exemplo n.º 3
0
        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");
        }
Exemplo n.º 4
0
 public PNCounterDictionary <TKey> PruningCleanup(UniqueAddress removedNode) =>
 new PNCounterDictionary <TKey>(_underlying.PruningCleanup(removedNode));
Exemplo n.º 5
0
 public PNCounterDictionary <TKey> Prune(UniqueAddress removedNode, UniqueAddress collapseInto) =>
 new PNCounterDictionary <TKey>(_underlying.Prune(removedNode, collapseInto));
Exemplo n.º 6
0
 IReplicatedData IRemovedNodePruning.Prune(UniqueAddress removedNode, UniqueAddress collapseInto) => Prune(removedNode, collapseInto);
Exemplo n.º 7
0
 IReplicatedData IRemovedNodePruning.PruningCleanup(UniqueAddress removedNode) => PruningCleanup(removedNode);
Exemplo n.º 8
0
 public bool NeedPruningFrom(UniqueAddress removedNode) =>
 _underlying.NeedPruningFrom(removedNode);
Exemplo n.º 9
0
 /// <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));
Exemplo n.º 10
0
 /// <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)));
Exemplo n.º 11
0
 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);
 }