/// <summary> /// Constructs this data source. /// </summary> public LuceneDataSource(DatabaseLayout directoryStructure, Config config, IndexConfigStore indexStore, FileSystemAbstraction fileSystemAbstraction, OperationalMode operationalMode) { this._directoryStructure = directoryStructure; this._config = config; this._indexStore = indexStore; this._typeCache = new IndexTypeCache(indexStore); this._fileSystemAbstraction = fileSystemAbstraction; this._operationalMode = operationalMode; }
public override void Init() { LuceneFilesystemFacade filesystemFacade = _config.get(Configuration.Ephemeral) ? LuceneFilesystemFacade.Memory : LuceneFilesystemFacade.Fs; _readOnly = IsReadOnly(_config, _operationalMode); _indexSearchers = new IndexClockCache(_config.get(Configuration.LuceneSearcherCacheSize)); this._baseStorePath = filesystemFacade.ensureDirectoryExists(_fileSystemAbstraction, GetLuceneIndexStoreDirectory(_directoryStructure)); filesystemFacade.cleanWriteLocks(_baseStorePath); this._typeCache = new IndexTypeCache(_indexStore); this._indexReferenceFactory = _readOnly ? new ReadOnlyIndexReferenceFactory(filesystemFacade, _baseStorePath, _typeCache) : new WritableIndexReferenceFactory(filesystemFacade, _baseStorePath, _typeCache); this._indexTypeMap = new ConcurrentDictionary <IndexIdentifier, IDictionary <string, DocValuesType> >(); _closed = false; }
internal WritableIndexReferenceFactory(LuceneDataSource.LuceneFilesystemFacade filesystemFacade, File baseStorePath, IndexTypeCache typeCache) : base(filesystemFacade, baseStorePath, typeCache) { }
public ReadOnlyIndexReferenceFactory(LuceneDataSource.LuceneFilesystemFacade filesystemFacade, File baseStorePath, IndexTypeCache typeCache) : base(filesystemFacade, baseStorePath, typeCache) { }
internal IndexReferenceFactory(LuceneDataSource.LuceneFilesystemFacade filesystemFacade, File baseStorePath, IndexTypeCache typeCache) { this._filesystemFacade = filesystemFacade; this._baseStorePath = baseStorePath; this._typeCache = typeCache; }