/** * Create a new LocalLockMergingSegmentReadLocker with special purpose caches * @param locksCache the cache to be used to store distributed locks * @param chunksCache the cache containing the chunks, this is where the bulk of data is stored * @param metadataCache smaller cache for the metadata of stored elements * @param indexName */ public LocalLockMergingSegmentReadLocker(Cache<?, ?> locksCache, Cache<?, ?> chunksCache, Cache<?, ?> metadataCache, String indexName, int affinitySegmentId) { this.delegate = new DistributedSegmentReadLocker((Cache<Object, Integer>) locksCache, chunksCache, metadataCache, indexName, affinitySegmentId); }
/** * Create a new LocalLockMergingSegmentReadLocker for specified cache and index name. * * @param cache * @param indexName */ public LocalLockMergingSegmentReadLocker(Cache<?, ?> cache, String indexName) { this.delegate = new DistributedSegmentReadLocker((Cache<Object, Integer>) cache, cache, cache, indexName); }
/** * Create a new LocalLockMergingSegmentReadLocker with special purpose caches * @param locksCache the cache to be used to store distributed locks * @param chunksCache the cache containing the chunks, this is where the bulk of data is stored * @param metadataCache smaller cache for the metadata of stored elements * @param indexName */ public LocalLockMergingSegmentReadLocker(Cache<?, ?> locksCache, Cache<?, ?> chunksCache, Cache<?, ?> metadataCache, String indexName, int affinitySegmentId) { this.delegate = new DistributedSegmentReadLocker((Cache<Object, Integer>) locksCache, chunksCache, metadataCache, indexName, affinitySegmentId); }
public LocalLockMergingSegmentReadLocker(Cache<?, ?> locksCache, Cache<?, ?> chunksCache, Cache<?, ?> metadataCache, String indexName, boolean forceSynchronousDeletes, int affinitySegmentId) { this.delegate = new DistributedSegmentReadLocker((Cache<Object, Integer>) locksCache, chunksCache, metadataCache, indexName, affinitySegmentId,forceSynchronousDeletes); }
/** * Create a new LocalLockMergingSegmentReadLocker for specified cache and index name. * * @param cache * @param indexName */ public LocalLockMergingSegmentReadLocker(Cache<?, ?> cache, String indexName, int affinitySegmentId) { this.delegate = new DistributedSegmentReadLocker((Cache<Object, Integer>) cache, cache, cache, indexName, affinitySegmentId); }
/** * Create a new LocalLockMergingSegmentReadLocker for specified cache and index name. * * @param cache * @param indexName */ public LocalLockMergingSegmentReadLocker(Cache<?, ?> cache, String indexName, int affinitySegmentId) { this.delegate = new DistributedSegmentReadLocker((Cache<Object, Integer>) cache, cache, cache, indexName, affinitySegmentId); }
/** * Create a new LocalLockMergingSegmentReadLocker with special purpose caches * @param locksCache the cache to be used to store distributed locks * @param chunksCache the cache containing the chunks, this is where the bulk of data is stored * @param metadataCache smaller cache for the metadata of stored elements * @param indexName */ public LocalLockMergingSegmentReadLocker(Cache<?, ?> locksCache, Cache<?, ?> chunksCache, Cache<?, ?> metadataCache, String indexName) { this.delegate = new DistributedSegmentReadLocker((Cache<Object, Integer>) locksCache, chunksCache, metadataCache, indexName); }
public LocalLockMergingSegmentReadLocker(Cache<?, ?> locksCache, Cache<?, ?> chunksCache, Cache<?, ?> metadataCache, String indexName, boolean forceSynchronousDeletes, int affinitySegmentId) { this.delegate = new DistributedSegmentReadLocker((Cache<Object, Integer>) locksCache, chunksCache, metadataCache, indexName, affinitySegmentId,forceSynchronousDeletes); }
private SegmentReadLocker makeTestableReadLocker(Cache cache, String indexName) { return new DistributedSegmentReadLocker(cache, cache, cache, indexName, -1 ,true); }
private static SegmentReadLocker makeDefaultSegmentReadLocker(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, Cache<?, ?> distLocksCache, String indexName) { checkNotNull(distLocksCache, "distLocksCache"); checkNotNull(indexName, "indexName"); return new DistributedSegmentReadLocker((Cache<Object, Integer>) distLocksCache, chunksCache, metadataCache, indexName); }
private static SegmentReadLocker makeDefaultSegmentReadLocker(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, Cache<?, ?> distLocksCache, String indexName, int affinitySegmentId) { checkNotNull(distLocksCache, "distLocksCache"); checkNotNull(indexName, "indexName"); return new DistributedSegmentReadLocker((Cache<Object, Integer>) distLocksCache, chunksCache, metadataCache, indexName, affinitySegmentId); }
private static SegmentReadLocker makeDefaultSegmentReadLocker(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, Cache<?, ?> distLocksCache, String indexName, int affinitySegmentId) { checkNotNull(distLocksCache, "distLocksCache"); checkNotNull(indexName, "indexName"); return new DistributedSegmentReadLocker((Cache<Object, Integer>) distLocksCache, chunksCache, metadataCache, indexName, affinitySegmentId); }
private static SegmentReadLocker makeDefaultSegmentReadLocker(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, Cache<?, ?> distLocksCache, String indexName) { checkNotNull(distLocksCache, "distLocksCache"); checkNotNull(indexName, "indexName"); return new DistributedSegmentReadLocker((Cache<Object, Integer>) distLocksCache, chunksCache, metadataCache, indexName); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testEvictionIsNotAllowed() { Cache<?, ?> c = cacheManager.getCache(); new DistributedSegmentReadLocker((Cache<Object, Integer>) c, c, c, "lucene.readlocks.ConfigurationCheckTest", -1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testMetaDataNullIsNotAllowed() { Cache<?, ?> c = cacheManager.getCache(); new DistributedSegmentReadLocker((Cache<Object, Integer>) c, c, null, "lucene.readlocks.ConfigurationCheckTest", -1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testLocksCacheNullIsNotAllowed() { Cache<?, ?> c = cacheManager.getCache(); new DistributedSegmentReadLocker(null, c, c, "lucene.readlocks.ConfigurationCheckTest", -1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testChunkCacheNullIsNotAllowed() { Cache<?, ?> c = cacheManager.getCache(); new DistributedSegmentReadLocker((Cache<Object, Integer>) c, null, c, "lucene.readlocks.ConfigurationCheckTest", -1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testIndexNameNullIsNotAllowed() { Cache<?, ?> c = cacheManager.getCache(); new DistributedSegmentReadLocker((Cache<Object, Integer>) c, c, c, null, -1); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "chunkSize must be a positive integer") public void testInitWithInvalidChunkSize() { Cache cache = cacheManager.getCache(); DirectoryBuilder.newDirectoryInstance(cache, cache, cache, "index") .overrideSegmentReadLocker(new DistributedSegmentReadLocker(cache, cache, cache, "index", -1)) .chunkSize(0); }
Directory createDirectory(Cache cache) { return DirectoryBuilder.newDirectoryInstance(cache, cache, cache, INDEX_NAME) .chunkSize(CHUNK_SIZE) .overrideSegmentReadLocker(new DistributedSegmentReadLocker(cache, cache, cache, INDEX_NAME, -1, true)) .create(); }