@Override public Directory create() { if (lockFactory == null) { lockFactory = makeDefaultLockFactory(distLocksCache, indexName); } if (srl == null) { srl = makeDefaultSegmentReadLocker(metadataCache, chunksCache, distLocksCache, indexName); } if (LuceneVersionDetector.VERSION == 3) { return new DirectoryLuceneV3(metadataCache, chunksCache, indexName, lockFactory, chunkSize, srl); } else { Class<?>[] ctorType = new Class[]{ Cache.class, Cache.class, String.class, LockFactory.class, int.class, SegmentReadLocker.class }; Directory d; try { d = (Directory) DirectoryBuilderImpl.class.getClassLoader() .loadClass("org.infinispan.lucene.impl.DirectoryLuceneV4") .getConstructor(ctorType) .newInstance(metadataCache, chunksCache, indexName, lockFactory, chunkSize, srl); } catch (Exception e) { throw log.failedToCreateLucene4Directory(e); } return d; } }
@Override public Directory create() { if (lockFactory == null) { lockFactory = makeDefaultLockFactory(); } if (srl == null) { srl = makeDefaultSegmentReadLocker(metadataCache, chunksCache, distLocksCache, indexName, affinitySegmentId); } if (deleteExecutor == null) { deleteExecutor = new WithinThreadExecutor(); } return new DirectoryLucene(metadataCache, chunksCache, distLocksCache, indexName, lockFactory, chunkSize, srl, writeFileListAsync, deleteExecutor, affinitySegmentId); }
@Override public Directory create() { if (lockFactory == null) { lockFactory = makeDefaultLockFactory(); } if (srl == null) { srl = makeDefaultSegmentReadLocker(metadataCache, chunksCache, distLocksCache, indexName, affinitySegmentId); } if (deleteExecutor == null) { deleteExecutor = new WithinThreadExecutor(); } return new DirectoryLucene(metadataCache, chunksCache, distLocksCache, indexName, lockFactory, chunkSize, srl, writeFileListAsync, deleteExecutor, affinitySegmentId); }