Ejemplo n.º 1
0
        private void DoRecovery()
        {
            TransactionalStateRecord <TState> storageState = this.storage.State;

            this.stableVersion   = storageState.StableVersion;
            this.writeLowerBound = storageState.WriteLowerBound;
            this.version         = storageState.Version;
            this.value           = storageState.Value;
            RevertToPersistedLog();

            // Rollback any known aborted transactions
            Restore();
        }
Ejemplo n.º 2
0
        private async Task Persist(long newStableVersion, long newWriteLowerBound)
        {
            RecordInPersistedLog();

            // update storage state
            TransactionalStateRecord <TState> storageState = this.storage.State;

            storageState.Value           = this.value;
            storageState.Version         = this.version;
            storageState.StableVersion   = newStableVersion;
            storageState.WriteLowerBound = newWriteLowerBound;

            await this.storage.WriteStateAsync();

            this.stableVersion = newStableVersion;
        }