public WriteSession( ulong collectionId, LocalStorageSessionFactory sessionFactory, ITokenizer tokenizer) : base(collectionId, sessionFactory) { _tokenizer = tokenizer; _log = Logging.CreateLogWriter("writesession"); _indexQueue = new ProducerConsumerQueue <IndexJob>(Write); _buildQueue = new ProducerConsumerQueue <BuildJob>(Write); ValueStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.val", collectionId))); KeyStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.key", collectionId))); DocStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.docs", collectionId))); ValueIndexStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.vix", collectionId))); KeyIndexStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.kix", collectionId))); DocIndexStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.dix", collectionId))); PostingsStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.pos", collectionId))); VectorStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.vec", collectionId))); Index = sessionFactory.GetCollectionIndex(collectionId); _vals = new ValueWriter(ValueStream); _keys = new ValueWriter(KeyStream); _docs = new DocWriter(DocStream); _valIx = new ValueIndexWriter(ValueIndexStream); _keyIx = new ValueIndexWriter(KeyIndexStream); _docIx = new DocIndexWriter(DocIndexStream); _postingsReader = new PagedPostingsReader(PostingsStream); _dirty = new Dictionary <long, VectorNode>(); }
public Writer(LocalStorageSessionFactory sessionFactory, ITokenizer analyzer) { _tokenizer = analyzer; _sessionFactory = sessionFactory; _writeQueue = new ProducerConsumerQueue <WriteJob>(ExecuteWrite); _log = Logging.CreateLogWriter("writer"); _itemTimer = new Stopwatch(); _batchTimer = new Stopwatch(); }
public DocumentReadSession(ulong collectionId, LocalStorageSessionFactory sessionFactory) : base(collectionId, sessionFactory) { ValueStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.val", collectionId))); KeyStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.key", collectionId))); DocStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.docs", collectionId))); ValueIndexStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.vix", collectionId))); KeyIndexStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.kix", collectionId))); DocIndexStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.dix", collectionId))); _docIx = new DocIndexReader(DocIndexStream); _docs = new DocReader(DocStream); _keyIx = new ValueIndexReader(KeyIndexStream); _valIx = new ValueIndexReader(ValueIndexStream); _keyReader = new ValueReader(KeyStream); _valReader = new ValueReader(ValueStream); }
public ReadSession(ulong collectionId, LocalStorageSessionFactory sessionFactory) : base(collectionId, sessionFactory) { ValueStream = sessionFactory.ValueStream; KeyStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.key", collectionId))); DocStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.docs", collectionId))); ValueIndexStream = sessionFactory.ValueIndexStream; KeyIndexStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.kix", collectionId))); DocIndexStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.dix", collectionId))); PostingsStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.pos", collectionId))); VectorStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.vec", collectionId))); Index = sessionFactory.GetIndex(collectionId); _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 PagedPostingsReader(PostingsStream); }
public WriteSession(ulong collectionId, LocalStorageSessionFactory sessionFactory) : base(collectionId, sessionFactory) { _dirty = new Dictionary <long, VectorNode>(); ValueStream = sessionFactory.WritableValueStream; KeyStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.key", collectionId))); DocStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.docs", collectionId))); ValueIndexStream = sessionFactory.WritableValueIndexStream; KeyIndexStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.kix", collectionId))); DocIndexStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.dix", collectionId))); PostingsStream = sessionFactory.CreateReadWriteStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.pos", collectionId))); VectorStream = sessionFactory.CreateAppendStream(Path.Combine(sessionFactory.Dir, string.Format("{0}.vec", collectionId))); Index = sessionFactory.GetIndex(collectionId); _vals = new ValueWriter(ValueStream); _keys = new ValueWriter(KeyStream); _docs = new DocWriter(DocStream); _valIx = new ValueIndexWriter(ValueIndexStream); _keyIx = new ValueIndexWriter(KeyIndexStream); _docIx = new DocIndexWriter(DocIndexStream); _postingsReader = new PagedPostingsReader(PostingsStream); }
public Reader(LocalStorageSessionFactory sessionFactory) { _sessionFactory = sessionFactory; }
public Writer(LocalStorageSessionFactory sessionFactory, ITokenizer analyzer) { _tokenizer = analyzer; _sessionFactory = sessionFactory; _writeQueue = new ProducerConsumerQueue <WriteJob>(Commit); }
public CollectionSession(ulong collectionId, LocalStorageSessionFactory sessionFactory) { SessionFactory = sessionFactory; CollectionId = collectionId; }
public Reader(LocalStorageSessionFactory sessionFactory) { _sessionFactory = sessionFactory; _log = Logging.CreateLogWriter("reader"); }