public class LocalLockMergingSegmentReadLocker extends Object implements SegmentReadLocker
DistributedSegmentReadLockerto minimize remote operations in case several IndexReaders are opened on the same
InfinispanDirectory. It keeps track of locks which where already acquired for a specific filename from another request on the same node and merges the request so that the different clients share the same remote lock.
|Constructor and Description|
Create a new LocalLockMergingSegmentReadLocker with special purpose caches
Create a new LocalLockMergingSegmentReadLocker for specified cache and index name.
|Modifier and Type||Method and Description|
Acquires a readlock, in order to prevent other invocations to
It will release a previously acquired readLock, or if no readLock was acquired it will mark the file to be deleted as soon as all pending locks are releases.
public LocalLockMergingSegmentReadLocker(Cache<?,?> locksCache, Cache<?,?> chunksCache, Cache<?,?> metadataCache, String indexName)
locksCache- the cache to be used to store distributed locks
chunksCache- the cache containing the chunks, this is where the bulk of data is stored
metadataCache- smaller cache for the metadata of stored elements
public boolean acquireReadLock(String name)
SegmentReadLocker.deleteOrReleaseReadLock(String)from deleting the file.
public void deleteOrReleaseReadLock(String name)
Copyright © 2017 JBoss, a division of Red Hat. All Rights Reserved.