Beispiel #1
0
        private bool CommitSync(out int numDeleted, out int numUpdated, out long numBytesWritten)
        {
            var  numDeletedLocal      = 0;
            var  numUpdatedLocal      = 0;
            long numBytesWrittenLocal = 0;

            void LocalCommit(IStorageProxyCacheCommit committer)
            {
                try
                {
                    var  numDeletedInternal      = 0;
                    var  numUpdatedInternal      = 0;
                    long numBytesWrittenInternal = 0;

                    committer?.Commit(out numDeletedInternal, out numUpdatedInternal, out numBytesWrittenInternal);

                    numDeletedLocal      += numDeletedInternal;
                    numUpdatedLocal      += numUpdatedInternal;
                    numBytesWrittenLocal += numBytesWrittenInternal;
                }
                catch (Exception e)
                {
                    _log.LogError(e, $"Exception thrown committing changes to Ignite for {committer?.Name}");
                    throw;
                }
            }

            CommittableCaches.ForEach(LocalCommit);

            numDeleted      = numDeletedLocal;
            numUpdated      = numUpdatedLocal;
            numBytesWritten = numBytesWrittenLocal;
            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Determine the amount of bytes that will be written as a result of Commit()
        /// </summary>
        public long PotentialCommitWrittenBytes()
        {
            long numBytes = 0;

            CommittableCaches.ForEach(x => numBytes += x.PotentialCommitWrittenBytes());

            return(numBytes);
        }
Beispiel #3
0
        /// <summary>
        /// Clears all changes in the spatial and non spatial stores
        /// </summary>
        public override void Clear()
        {
            void LocalClear(IStorageProxyCacheCommit committer)
            {
                try
                {
                    committer?.Clear();
                }
                catch
                {
                    _log.LogError($"Exception thrown clearing changes for cache {committer?.Name}");
                    throw;
                }
            }

            CommittableCaches.ForEach(LocalClear);
            ImmutableProxy?.Clear();
        }