public class DistributedSegmentReadLocker extends Object implements SegmentReadLocker
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 and Description|
|Modifier and Type||Method and Description|
Acquires a readlock on all chunks for this file, to make sure chunks are not deleted while iterating on the group.
Deletes or releases a read-lock for the specified filename, so that if it was marked as deleted and no other
public DistributedSegmentReadLocker(Cache<Object,Integer> locksCache, Cache<?,?> chunksCache, Cache<?,?> metadataCache, String indexName)
public void deleteOrReleaseReadLock(String filename)
InfinispanIndexInputinstances are reading from it, then it will be effectively deleted.
filename- of the file to release or delete
public boolean acquireReadLock(String filename)
filename- the name of the "file" for which a readlock is requested
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.