Beispiel #1
0
        public ReadIndex(IPublisher bus,
                         ObjectPool <ITransactionFileReader> readerPool,
                         ITableIndex tableIndex,
                         IHasher hasher,
                         int streamInfoCacheCapacity,
                         bool additionalCommitChecks,
                         int metastreamMaxCount)
        {
            Ensure.NotNull(bus, "bus");
            Ensure.NotNull(readerPool, "readerPool");
            Ensure.NotNull(tableIndex, "tableIndex");
            Ensure.NotNull(hasher, "hasher");
            Ensure.Nonnegative(streamInfoCacheCapacity, "streamInfoCacheCapacity");
            Ensure.Positive(metastreamMaxCount, "metastreamMaxCount");

            var metastreamMetadata = new StreamMetadata(maxCount: metastreamMaxCount);

            _indexCache  = new IndexCache(readerPool, streamInfoCacheCapacity, streamInfoCacheCapacity);
            _indexReader = new IndexReader(_indexCache, hasher, tableIndex, metastreamMetadata);
            var writer = new IndexWriter(bus, tableIndex, hasher, _indexCache, _indexReader, additionalCommitChecks);

            _indexWriter    = writer;
            _indexCommitter = writer;
            _allReader      = new AllReader(_indexCache);
        }
Beispiel #2
0
        public IndexReader(IIndexCache cache, IHasher hasher, ITableIndex tableIndex, StreamMetadata metastreamMetadata)
        {
            Ensure.NotNull(cache, "backend");
            Ensure.NotNull(hasher, "hasher");
            Ensure.NotNull(tableIndex, "tableIndex");
            Ensure.NotNull(metastreamMetadata, "metastreamMetadata");

            _cache              = cache;
            _hasher             = hasher;
            _tableIndex         = tableIndex;
            _metastreamMetadata = metastreamMetadata;
        }
        public IndexReader(IIndexCache cache, IHasher hasher, ITableIndex tableIndex, StreamMetadata metastreamMetadata)
        {
            Ensure.NotNull(cache, "backend");
            Ensure.NotNull(hasher, "hasher");
            Ensure.NotNull(tableIndex, "tableIndex");
            Ensure.NotNull(metastreamMetadata, "metastreamMetadata");

            _cache = cache;
            _hasher = hasher;
            _tableIndex = tableIndex;
            _metastreamMetadata = metastreamMetadata;
        }
Beispiel #4
0
 public IndexWriter(IPublisher bus, ITableIndex tableIndex, IHasher hasher, IIndexCache indexCache, IIndexReader indexReader, bool additionalCommitChecks)
 {
     Ensure.NotNull(indexCache, "indexBackend");
     Ensure.NotNull(indexReader, "indexReader");
     Ensure.NotNull(bus, "bus");
     Ensure.NotNull(tableIndex, "tableIndex");
     Ensure.NotNull(hasher, "hasher");
     _bus                    = bus;
     _tableIndex             = tableIndex;
     _hasher                 = hasher;
     _indexCache             = indexCache;
     _indexReader            = indexReader;
     _additionalCommitChecks = additionalCommitChecks;
 }
        public ReadIndex(IPublisher bus,
                         ObjectPool<ITransactionFileReader> readerPool,
                         ITableIndex tableIndex,
                         IHasher hasher,
                         int streamInfoCacheCapacity,
                         bool additionalCommitChecks,
                         int metastreamMaxCount)
        {
            Ensure.NotNull(bus, "bus");
            Ensure.NotNull(readerPool, "readerPool");
            Ensure.NotNull(tableIndex, "tableIndex");
            Ensure.NotNull(hasher, "hasher");
            Ensure.Nonnegative(streamInfoCacheCapacity, "streamInfoCacheCapacity");
            Ensure.Positive(metastreamMaxCount, "metastreamMaxCount");

            var metastreamMetadata = new StreamMetadata(maxCount: metastreamMaxCount);

            _indexCache = new IndexCache(readerPool, streamInfoCacheCapacity, streamInfoCacheCapacity);
            _indexReader = new IndexReader(_indexCache, hasher, tableIndex, metastreamMetadata);
            var writer = new IndexWriter(bus, tableIndex, hasher, _indexCache, _indexReader, additionalCommitChecks);
            _indexWriter = writer;
            _indexCommitter = writer;
            _allReader = new AllReader(_indexCache);
        }
 public IndexWriter(IPublisher bus, ITableIndex tableIndex, IHasher hasher, IIndexCache indexCache, IIndexReader indexReader, bool additionalCommitChecks)
 {
     Ensure.NotNull(indexCache, "indexBackend");
     Ensure.NotNull(indexReader, "indexReader");
     Ensure.NotNull(bus, "bus");
     Ensure.NotNull(tableIndex, "tableIndex");
     Ensure.NotNull(hasher, "hasher");
     _bus = bus;
     _tableIndex = tableIndex;
     _hasher = hasher;
     _indexCache = indexCache;
     _indexReader = indexReader;
     _additionalCommitChecks = additionalCommitChecks;
 }
Beispiel #7
0
 public AllReader(IIndexCache cache)
 {
     Ensure.NotNull(cache, "backend");
     _cache = cache;
 }
Beispiel #8
0
 public AllReader(IIndexCache cache)
 {
     Ensure.NotNull(cache, "backend");
     _cache = cache;
 }