Exemplo n.º 1
0
        public VoronIndexOutput(
            TempFileCache fileCache,
            string name,
            Transaction tx,
            string tree,
            IndexOutputFilesSummary indexOutputFilesSummary)
        {
            _fileCache = fileCache;
            _name      = name;
            _tree      = tree;
            _tx        = tx;
            _indexOutputFilesSummary = indexOutputFilesSummary;

            _ms = fileCache.RentMemoryStream();
            _tx.ReadTree(_tree).AddStream(name, Stream.Null); // ensure it's visible by LuceneVoronDirectory.FileExists, the actual write is inside Dispose
        }
Exemplo n.º 2
0
        public LuceneVoronDirectory(Transaction tx, StorageEnvironment environment, TempFileCache tempFileCache, string name)
        {
            if (tx.IsWriteTransaction == false)
            {
                throw new InvalidOperationException($"Creation of the {nameof(LuceneVoronDirectory)} must be done under a write transaction.");
            }

            _environment   = environment;
            _tempFileCache = tempFileCache;
            _name          = name;

            SetLockFactory(NoLockFactory.Instance);

            tx.CreateTree(_name);

            _indexOutputFilesSummary = new IndexOutputFilesSummary();
        }
Exemplo n.º 3
0
 public LuceneVoronDirectory(Transaction tx, StorageEnvironment environment, TempFileCache tempFileCache) : this(tx, environment, tempFileCache, "Files")
 {
 }