Wrapper for snapshot data.
Example #1
0
        private byte[] SnapshotToBytes(SnapshotMetadata metadata, object snapshotData, ActorSystem actorSystem)
        {
            var snapshot = new AkkaPersistenceSerialization.Snapshot(snapshotData);

            if (_serializeWithTransport)
            {
                return(Serialization.SerializeWithTransport(actorSystem, _transportSerializationFallbackAddress, () => _snapshotSerializer.ToBinary(snapshot)));
            }
            else
            {
                return(_snapshotSerializer.ToBinary(snapshot));
            }
        }
 protected override async Task SaveAsync(SnapshotMetadata metadata, object snapshot)
 {
     var snapData = new Snapshot(Guid.NewGuid(), metadata.PersistenceId, typeof(Snapshot).Name, metadata.SequenceNr, new SelectedSnapshot(metadata, snapshot));
     try
     {
         CloudTableClient tableClient = _extension.TableSnapshotStoreSettings.GetClient(metadata.PersistenceId);
         CloudTable table = tableClient.GetTableReference(_extension.TableSnapshotStoreSettings.TableName);
         TableOperation insertOperation = TableOperation.Insert(snapData);
         TableResult result = await table.ExecuteAsync(insertOperation);
     }
     catch (Exception ex)
     {
         _log.Error(ex,ex.Message);
     }
 }
Example #3
0
 /// <inheritdoc/>
 private bool Equals(Snapshot other)
 {
     return(Equals(Data, other.Data));
 }
 private bool Equals(Snapshot other)
 {
     return Equals(Data, other.Data);
 }