Пример #1
0
        public BOWReadSession(string collectionName,
                              ulong collectionId,
                              SessionFactory sessionFactory,
                              IConfigurationProvider config)
            : base(collectionName, collectionId, sessionFactory)
        {
            ValueStream      = sessionFactory.CreateAsyncReadStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.val", CollectionId)));
            KeyStream        = sessionFactory.CreateAsyncReadStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.key", CollectionId)));
            DocStream        = sessionFactory.CreateAsyncReadStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.docs", CollectionId)));
            ValueIndexStream = sessionFactory.CreateAsyncReadStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.vix", CollectionId)));
            KeyIndexStream   = sessionFactory.CreateAsyncReadStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.kix", CollectionId)));
            DocIndexStream   = sessionFactory.CreateAsyncReadStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.dix", CollectionId)));

            _docIx          = new DocIndexReader(DocIndexStream);
            _docs           = new DocMapReader(DocStream);
            _keyIx          = new ValueIndexReader(KeyIndexStream);
            _valIx          = new ValueIndexReader(ValueIndexStream);
            _keyReader      = new ValueReader(KeyStream);
            _valReader      = new ValueReader(ValueStream);
            _postingsReader = new RemotePostingsReader(config, collectionName);
            _indexReaders   = new ConcurrentDictionary <long, NodeReader>();
            _config         = config;
        }