Example #1
0
        /// <summary>
        /// Creates a new transaction tracker that monitors the provided buffers.
        /// </summary>
        /// <param name="prebuffer"></param>
        /// <param name="firstStageWriter"></param>
        public TransactionTracker(PrebufferWriter <TKey, TValue> prebuffer, FirstStageWriter <TKey, TValue> firstStageWriter)
        {
            m_waitingForHardCommit = new List <WaitForCommit>();
            m_waitingForSoftCommit = new List <WaitForCommit>();

            m_syncRoot = new object();
            m_transactionSoftCommitted = 0;
            m_transactionHardCommitted = 0;
            m_prebuffer        = prebuffer;
            m_firstStageWriter = firstStageWriter;
            m_firstStageWriter.RolloverComplete        += TransactionSoftCommitted;
            m_firstStageWriter.SequenceNumberCommitted += TransactionHardCommitted;
        }
Example #2
0
        /// <summary>
        /// Creates a <see cref="WriteProcessor{TKey,TValue}"/>.
        /// </summary>
        /// <param name="list">the master list of archive files</param>
        /// <param name="settings">the settings</param>
        /// <param name="rolloverLog">the rollover log value</param>
        public WriteProcessor(ArchiveList <TKey, TValue> list, WriteProcessorSettings settings, RolloverLog rolloverLog)
            : base(MessageClass.Framework)
        {
            m_settings = settings.CloneReadonly();
            m_settings.Validate();

            m_stagingRollovers   = new List <CombineFiles <TKey, TValue> >();
            m_firstStageWriter   = new FirstStageWriter <TKey, TValue>(settings.FirstStageWriter, list);
            m_isMemoryOnly       = false;
            m_prebuffer          = new PrebufferWriter <TKey, TValue>(settings.PrebufferWriter, m_firstStageWriter.AppendData);
            m_transactionTracker = new TransactionTracker <TKey, TValue>(m_prebuffer, m_firstStageWriter);
            foreach (CombineFilesSettings rollover in settings.StagingRollovers)
            {
                m_stagingRollovers.Add(new CombineFiles <TKey, TValue>(rollover, list, rolloverLog));
            }
        }