I have a chronicle reader (ExcerptTailer
), Code follows,
ChronicleQueue queue = ChronicleQueueBuilder.single(chroniclePath).storeFileListener(new StoreFileListener() {
@Override
public void onReleased(int cycle, File file) {
if (file != null) {
try {
file.delete();
} catch (Exception e) {
}
}
}
}).rollCycle(RollCycles.HOURLY).build();
ExcerptTailer excerptTailer = queueForReader.createTailer();
I implemented the onRealease
method for deleting completed file.
But my problem is that the file got deleted on calling the queue.close()
because of the code inside onRelease
method.
In this case how can I understand that the file read isn't completed inside onReleased
?
Or is there a better way to implement my case?