/** * Set the LockFactory that this Directory instance should * use for its locking implementation. Each * instance of * LockFactory should only be used for one directory (ie, * do not share a single instance across multiple * Directories). * * @param lockFactory instance of {@link LockFactory}. */ public void setLockFactory(LockFactory lockFactory) throws IOException { assert lockFactory != null; this.lockFactory = lockFactory; lockFactory.setLockPrefix(this.getLockID()); }
/** * Set the LockFactory that this Directory instance should * use for its locking implementation. Each * instance of * LockFactory should only be used for one directory (ie, * do not share a single instance across multiple * Directories). * * @param lockFactory instance of {@link LockFactory}. */ public void setLockFactory(LockFactory lockFactory) { this.lockFactory = lockFactory; lockFactory.setLockPrefix(this.getLockID()); }
/** * Set the LockFactory that this Directory instance should * use for its locking implementation. Each * instance of * LockFactory should only be used for one directory (ie, * do not share a single instance across multiple * Directories). * * @param lockFactory instance of {@link LockFactory}. */ public void setLockFactory(LockFactory lockFactory) { this.lockFactory = lockFactory; lockFactory.setLockPrefix(this.getLockID()); }
DirectoryLuceneV3(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, String indexName, LockFactory lf, int chunkSize, SegmentReadLocker readLocker) { this.impl = new DirectoryImplementor(metadataCache, chunksCache, indexName, chunkSize, readLocker); this.indexName = indexName; this.lockFactory = lf; this.lockFactory.setLockPrefix(this.getLockID()); }
/** * @param metadataCache the cache to be used for all smaller metadata: prefer replication over distribution, avoid eviction * @param chunksCache the cache to use for the space consuming segments: prefer distribution, enable eviction if needed * @param indexName the unique index name, useful to store multiple indexes in the same caches * @param lf the LockFactory to be used by IndexWriters. @see org.infinispan.lucene.locking * @param chunkSize segments are fragmented in chunkSize bytes; larger values are more efficient for searching but less for distribution and network replication * @param readLocker @see org.infinispan.lucene.readlocks for some implementations; you might be able to provide more efficient implementations by controlling the IndexReader's lifecycle. */ public DirectoryLuceneV4(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, String indexName, LockFactory lf, int chunkSize, SegmentReadLocker readLocker) { this.impl = new DirectoryImplementor(metadataCache, chunksCache, indexName, chunkSize, readLocker); this.indexName = indexName; this.lockFactory = lf; this.lockFactory.setLockPrefix(this.getLockID()); }
public AnalyticsDirectory(AnalyticsFileSystem analyticsFileSystem, LockFactory lockFactory, String path) throws AnalyticsException { this.analyticsFileSystem = analyticsFileSystem; this.path = GenericUtils.normalizePath(path); this.lockFactory = lockFactory; this.getLockFactory().setLockPrefix(this.getPath()); }
lockFactory.setLockPrefix("test");
lockFactory.setLockPrefix("test");
lockFactory.setLockPrefix("test");
lockFactory.setLockPrefix(null);
lockFactory.setLockPrefix(null);
lockFactory.setLockPrefix(null);
lockFactory.setLockPrefix(null);
/** * @param metadataCache the cache to be used for all smaller metadata: prefer replication over distribution, avoid eviction * @param chunksCache the cache to use for the space consuming segments: prefer distribution, enable eviction if needed * @param indexName the unique index name, useful to store multiple indexes in the same caches * @param lf the LockFactory to be used by IndexWriters. @see org.infinispan.lucene.locking * @param chunkSize segments are fragmented in chunkSize bytes; larger values are more efficient for searching but less for distribution and network replication * @param readLocker @see org.infinispan.lucene.readlocks for some implementations; you might be able to provide more efficient implementations by controlling the IndexReader's lifecycle. */ public InfinispanDirectory(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, String indexName, LockFactory lf, int chunkSize, SegmentReadLocker readLocker) { checkNotNull(metadataCache, "metadataCache"); checkNotNull(chunksCache, "chunksCache"); checkNotNull(indexName, "indexName"); checkNotNull(lf, "LockFactory"); checkNotNull(readLocker, "SegmentReadLocker"); if (chunkSize <= 0) throw new IllegalArgumentException("chunkSize must be a positive integer"); this.metadataCache = (AdvancedCache<FileCacheKey, FileMetadata>) metadataCache.getAdvancedCache().withFlags(Flag.SKIP_INDEXING); this.chunksCache = (AdvancedCache<ChunkCacheKey, Object>) chunksCache.getAdvancedCache().withFlags(Flag.SKIP_INDEXING); this.indexName = indexName; this.lockFactory = lf; this.lockFactory.setLockPrefix(this.getLockID()); this.chunkSize = chunkSize; this.fileOps = new FileListOperations(this.metadataCache, indexName); this.readLocks = readLocker; }