Dear Journal.io group.
I have done some testing in a small application which is a primitive synthesis of what our main use case will be.
1. a number of web threads (producers) will buffer date into the journal (sync write), then handoff the "Location" to a worker. (consumer)
2. The worker is a runnable which is serviced by a fixed size threadpool to deal with the journal entry (sync read)
3. the worker then deletes it.
if the application crashes, the application can redo() the journal on next boot to purge the journal entries.
I have noticed that the consumers of these journal locations always lag the producers; Even if the number of consumers to producers is at a 20:1 ratio.
I have reduced the lag to an almost negligible amount by introducing the following method into Journal.java
public void deleteAsync(Location location) throws IOException, IllegalStateException {
accessor.updateLocation(location, Location.DELETED_RECORD_TYPE, false);
}
This does not issue a "sync" whilst deleting.
Please may I ask - what are the dangers of using such a function?
The most obvious would be that un-synced deletes remain in the journal upon application crash.
(my application can actually tolerate that circumstance)
Are there any other side effects? what else could go wrong?
Are these deletes then batched like async writes?
Many thanks
Rob