コード例 #1
0
        public ReadSession(string collectionId,
                           SessionFactory sessionFactory,
                           IConfigurationService config)
            : base(collectionId, sessionFactory)
        {
            var collection = collectionId.ToHash();

            ValueStream      = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.val", collection)));
            KeyStream        = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.key", collection)));
            DocStream        = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.docs", collection)));
            ValueIndexStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.vix", collection)));
            KeyIndexStream   = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.kix", collection)));
            DocIndexStream   = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.dix", collection)));
            Index            = sessionFactory.GetCollectionIndex(collectionId.ToHash()) ?? new SortedList <long, VectorNode>();

            _docIx          = new DocIndexReader(DocIndexStream);
            _docs           = new DocReader(DocStream);
            _keyIx          = new ValueIndexReader(KeyIndexStream);
            _valIx          = new ValueIndexReader(ValueIndexStream);
            _keyReader      = new ValueReader(KeyStream);
            _valReader      = new ValueReader(ValueStream);
            _postingsReader = new RemotePostingsReader(config);

            _log = Logging.CreateWriter("readsession");
        }
コード例 #2
0
ファイル: WarmupSession.cs プロジェクト: crazyants/resin
        public WarmupSession(
            string collectionName,
            ulong collectionId,
            SessionFactory sessionFactory,
            ITokenizer tokenizer,
            IConfigurationProvider config,
            string baseUrl) : base(collectionName, collectionId, sessionFactory)
        {
            _config    = config;
            _tokenizer = tokenizer;
            _httpQueue = new ProducerConsumerQueue <string>(
                int.Parse(_config.Get("write_thread_count")), callback: SubmitQuery);
            _postingsReader = new RemotePostingsReader(_config, collectionName);
            _http           = new HttpClient();
            _baseUrl        = baseUrl;

            this.Log("initiated warmup session");
        }
コード例 #3
0
ファイル: BOWReadSession.cs プロジェクト: SVemulapalli/resin
        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;
        }