Пример #1
0
 private void WorkProvider_MovalChangedOrAdded(TsdbVolumeMoval <TKey> moval)
 {
     lock ( _scheduledWork )
     {
         TsdbScheduledMoval <TKey, TEntry> work;
         if (_scheduledWork.TryGetValue(moval.Id, out work))
         {
             work.Reschedule(moval);
         }
         else
         {
             work = new TsdbScheduledMoval <TKey, TEntry>(this, moval);
             _scheduledWork.Add(moval.Id, work);
             work.Schedule();
         }
     }
 }
Пример #2
0
        public async void Execute(DateTime timestamp)
        {
            try
            {
                await _engine.Client.MoveToVolumeStorageAsync(new[] { _moval.Id }, _engine.Work.GetDynamicMovalBatchSize(), _moval.To, _moval.StorageExpiration).ConfigureAwait(false);
            }
            catch (Exception e)
            {
                _engine.Logger.Error(e, "An error ocurred while moving data from dynamic storage to volume storage.");
            }

            var newMoval = await _engine.Work.GetMovalAsync(_moval).ConfigureAwait(false);

            if (newMoval != null)
            {
                _moval = newMoval;

                // schedule again
                Schedule();
            }
        }
Пример #3
0
 public void Reschedule(TsdbVolumeMoval <TKey> newMoval)
 {
     _unsubscribe?.Invoke();
     _moval = newMoval;
     Schedule();
 }
Пример #4
0
 public TsdbScheduledMoval(TsdbEngine <TKey, TEntry> engine, TsdbVolumeMoval <TKey> moval)
 {
     _engine = engine;
     _moval  = moval;
 }