Exemplo n.º 1
0
        private void Read(long storedReplicationProgress, VectorTime currentTargetVersionVector)
        {
            var replicationRead = new ReplicationRead(storedReplicationProgress + 1, settings.WriteBatchSize, settings.RemoteScanLimit, NoFilter.Instance, target.LogId, Self, currentTargetVersionVector);

            source.Acceptor.Ask(new ReplicationReadEnvelope(replicationRead, source.LogName, target.Endpoint.ApplicationName, target.Endpoint.ApplicationVersion), timeout: settings.RemoteReadTimeout)
            .PipeTo(Self, failure: error => new ReplicationReadFailure(new ReplicationReadTimeoutException(settings.RemoteReadTimeout), target.LogId));
        }
Exemplo n.º 2
0
        private bool Processing(object message)
        {
            switch (message)
            {
            case ReplicationReadEnvelope envelope:
                if (envelope.IncompatibleWith(endpoint.ApplicationName, endpoint.ApplicationVersion))
                {
                    Sender.Tell(new ReplicationReadFailure(new IncompatibleApplicationVersionException(endpoint.Id, endpoint.ApplicationVersion, envelope.TargetApplicationVersion), envelope.Payload.TargetLogId));
                }
                else
                {
                    var r  = envelope.Payload;
                    var r2 = new ReplicationRead(r.FromSequenceNr, r.Max, r.ScanLimit, endpoint.EndpointFilters.FilterFor(r.TargetLogId, envelope.LogName).And(r.Filter), r.TargetLogId, r.Replicator, r.CurrentTargetVersionVector);
                    endpoint.Logs[envelope.LogName].Forward(r2);
                }
                return(true);

            case ReplicationWriteSuccess _: return(true);

            default: return(false);
            }
        }
Exemplo n.º 3
0
 public Registration(ReplicationRead read)
     : this(read.Replicator, read.CurrentTargetVersionVector, read.Filter, DateTime.UtcNow)
 {
 }