|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.infinispan.lucene.readlocks.DistributedSegmentReadLocker
public class DistributedSegmentReadLocker
DistributedSegmentReadLocker stores reference counters in the cache to keep track of the number of clients still needing to be able to read a segment. It makes extensive usage of Infinispan's atomic operations.
Locks stored this way are not optimally performing as it might spin on remote invocations, and might fail to cleanup some garbage in case a node is disconnected without having released the readlock.
Constructor Summary | |
---|---|
DistributedSegmentReadLocker(Cache cache,
String indexName)
|
Method Summary | |
---|---|
boolean |
aquireReadLock(String filename)
Acquires a readlock on all chunks for this file, to make sure chunks are not deleted while iterating on the group. |
void |
deleteOrReleaseReadLock(String filename)
Deletes or releases a read-lock for the specified filename, so that if it was marked as deleted and no other InfinispanIndexInput instances are reading from it, then it will
be effectively deleted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DistributedSegmentReadLocker(Cache cache, String indexName)
Method Detail |
---|
public void deleteOrReleaseReadLock(String filename)
InfinispanIndexInput
instances are reading from it, then it will
be effectively deleted.
For removal of readLockKey the SKIP_CACHE_STORE is not used to make sure even
values eventually stored by a rehash are cleaned up.
deleteOrReleaseReadLock
in interface SegmentReadLocker
filename
- of the file to release or deleteaquireReadLock(String)
,
InfinispanDirectory.deleteFile(String)
public boolean aquireReadLock(String filename)
aquireReadLock
in interface SegmentReadLocker
name
- the name of the "file" for which a readlock is requested
deleteOrReleaseReadLock(String)
|
Google Analytics | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |