|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SegmentReadLocker
SegmentReadLocker implementations have to make sure that segments are not deleted while they are being used by an IndexReader.
When an InfinispanIndexInput
is opened on a file which is split in smaller chunks,
acquireReadLock(String)
is invoked; then the deleteOrReleaseReadLock(String)
is
invoked when the stream is closed.
The same 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.
Method Summary | |
---|---|
boolean |
acquireReadLock(String filename)
Acquires a readlock, in order to prevent other invocations to deleteOrReleaseReadLock(String)
from deleting the file. |
boolean |
aquireReadLock(String filename)
Deprecated. |
void |
deleteOrReleaseReadLock(String fileName)
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. |
Method Detail |
---|
void deleteOrReleaseReadLock(String fileName)
fileName
- of the file to release or deleteInfinispanDirectory.deleteFile(String)
boolean acquireReadLock(String filename)
deleteOrReleaseReadLock(String)
from deleting the file.
filename
-
InfinispanDirectory.openInput(String)
@Deprecated boolean aquireReadLock(String filename)
|
--> | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |