public interface SegmentReadLocker
SegmentReadLocker implementations have to make sure that segments are not deleted while they are being used by an IndexReader.
deleteOrReleaseReadLock(String) is invoked when a file is deleted, so if this invocation is not balancing
a lock acquire this implementation must delete all segment chunks and the associated metadata.
Note that if you can use and tune the
LogByteSizeMergePolicy you could avoid the need
for readlocks by setting a maximum segment size to equal the chunk size used by the InfinispanDirectory; readlocks
will be skipped automatically when not needed, so it's advisable to still configure an appropriate SegmentReadLocker
for the cases you might want to tune the chunk size.
|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.
void deleteOrReleaseReadLock(String fileName)
fileName- of the file to release or delete
boolean acquireReadLock(String filename)
deleteOrReleaseReadLock(String)from deleting the file.
Copyright © 2017 JBoss, a division of Red Hat. All Rights Reserved.