Пример #1
0
 public BackgroundCompactionService(PersistentState state)
 {
     this.state = state;
     compaction = state is ILogCompactionSupport support ?
                  support.ForceCompactionAsync :
                  state.ForceIncrementalCompactionAsync;
 }
 internal bool IsValid(PersistentState state)
 => ReferenceEquals(this.state, state) && state.lockVersion.VolatileRead() == version;
 internal WriteLockToken(PersistentState state)
 {
     this.state = state;
     version    = state.lockVersion.VolatileRead();
 }
Пример #4
0
 internal static ValueTask ForceIncrementalCompactionAsync(this PersistentState state, CancellationToken token)
 => state.CompactionCount > 0L ? state.ForceCompactionAsync(1L, token) : new ValueTask();