public virtual void TestFixtureSetUp()
 {
     _indexCommitter        = new FakeIndexCommitter();
     _replicationCheckpoint = new InMemoryCheckpoint(_replicationPosition);
     _writerCheckpoint      = new InMemoryCheckpoint(0);
     _publisher.Subscribe(new AdHocHandler <StorageMessage.CommitReplicated>(m => _handledMessages.Add(m)));
     _tableIndex = new FakeTableIndex();
     _tfChunkScavengerLogManager = new FakeTfChunkLogManager();
     _service = new IndexCommitterService(_indexCommitter, _publisher, _replicationCheckpoint, _writerCheckpoint,
                                          _commitCount, _tableIndex);
     _service.Init(0);
     When();
 }
        public StorageScavenger(TFChunkDb db, ITableIndex tableIndex, IReadIndex readIndex, ITFChunkScavengerLogManager logManager, bool alwaysKeepScavenged, bool mergeChunks, bool unsafeIgnoreHardDeletes)
        {
            Ensure.NotNull(db, "db");
            Ensure.NotNull(logManager, "logManager");
            Ensure.NotNull(tableIndex, "tableIndex");
            Ensure.NotNull(readIndex, "readIndex");

            _db                      = db;
            _tableIndex              = tableIndex;
            _readIndex               = readIndex;
            _alwaysKeepScavenged     = alwaysKeepScavenged;
            _mergeChunks             = mergeChunks;
            _unsafeIgnoreHardDeletes = unsafeIgnoreHardDeletes;
            _logManager              = logManager;
        }
Ejemplo n.º 3
0
        public virtual void TestFixtureSetUp()
        {
            IndexCommitter             = new FakeIndexCommitter();
            ReplicationCheckpoint      = new InMemoryCheckpoint();
            WriterCheckpoint           = new InMemoryCheckpoint(0);
            TableIndex                 = new FakeTableIndex();
            TfChunkScavengerLogManager = new FakeTfChunkLogManager();
            Service = new IndexCommitterService(IndexCommitter, Publisher, WriterCheckpoint, ReplicationCheckpoint, CommitCount, TableIndex, new QueueStatsManager());
            Service.Init(0);
            Publisher.Subscribe(new AdHocHandler <StorageMessage.CommitIndexed>(m => CommitReplicatedMgs.Enqueue(m)));
            Publisher.Subscribe(new AdHocHandler <ReplicationTrackingMessage.IndexedTo>(m => IndexWrittenMgs.Enqueue(m)));
            Publisher.Subscribe <ReplicationTrackingMessage.ReplicatedTo>(Service);
            Given();

            When();
        }