Re: JournalDiskSyncStrategy?

Karl Wettin <[email protected]> Mon, 11 Aug 2014 20:05:58 +0200
Newsgroups gmane.comp.java.prevayler
Message-ID <[email protected]>
The application I described in the paper-thread.

What I do is to place a transient object graph of a given root object on a queue which is polled by a single thread which evaluate the delta which produce and execute transactions. Sometimes as many as 200 transaction from a single delta. 

Usually I manage to empty this queue a every few seconds when not syncing on each transaction. It would be nice to sync at that point.

Running FS.sync on each and every transaction produced from the delta of a transient root object graph takes up to 10 seconds on my slow HDD, usually 5-7, while not syncing takes 1-3 milliseconds. 

Mainly this is a development problem for me. I kill the service and loose the last few minutes worth of data. It's quite OK if my application lose data as it will find it again, I do however prefer not to loose any.



		karl


On 11 Aug 2014, at 18:27, Klaus Wuestefeld <[email protected]> wrote:

> Karl, do you have a specific need for this currently? Could you
> describe your use case?
> 
> On Sun, Aug 10, 2014 at 3:55 PM, Karl Wettin <[email protected]> wrote:
>> It's simply the least invasive solution I could come up with as the
>> FileDescriptor is rather protected in DurableOutputStream. Would you prefer
>> JournalDiskSyncStrategy#sync() as a compliment to below or as the only
>> method?
>> 
>> On 10 Aug 2014, at 15:49, Klaus Wuestefeld <[email protected]> wrote:
>> 
>> Maybe some design without the temporal coupling?
>> 
>> On Aug 9, 2014 1:54 AM, "Karl Wettin" <[email protected]> wrote:
>>> 
>>> Wouldn't it be nice if it was possible to expose journal FD-sync as a
>>> public method somewhere in case of
>>> prevaylerFactory.configureJournalDiskSync(false)?
>>> 
>>> 
>>> How about something like this:
>>> 
>>> +public interface JournalDiskSyncStrategy {
>>> +  boolean isSyncOnNextExecuteTransaction();
>>> +}
>>> 
>>> 
>>> public class PrevaylerFactory<P>{
>>> 261:
>>> -    public void configureJournalDiskSync(boolean journalDiskSync) {
>>> +    public void configureJournalDiskSync(JournalDiskSyncStrategy
>>> journalDiskSync) {
>>> 
>>> 
>>> public class DurableOutputStream {
>>> -   public DurableOutputStream(File file, boolean journalDiskSync) throws
>>> IOException {
>>> +  public DurableOutputStream(File file, JournalDiskSyncStrategy
>>> journalDiskSync) throws IOException {
>>> 152:
>>> -      if (_journalDiskSync) {
>>> +     if (_ journalDiskSync.isSyncOnNextExecuteTransaction()) {
>>>        _fileDescriptor.sync();
>>>      }
>>> 
>>> 
>>> 
>>>        karl
>>> 
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> To unsubscribe go to the end of this page:
>>> http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
>>> _______________________________________________
>>> "Databases in Memoriam" -- http://www.prevayler.org
>> 
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> To unsubscribe go to the end of this page:
>> http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
>> _______________________________________________
>> "Databases in Memoriam" -- http://www.prevayler.org
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> 
>> _______________________________________________
>> To unsubscribe go to the end of this page:
>> http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
>> _______________________________________________
>> "Databases in Memoriam" -- http://www.prevayler.org
>> 
> 
> 
> 
> -- 
> Valeu, Klaus.
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
> _______________________________________________
> "Databases in Memoriam" -- http://www.prevayler.org


------------------------------------------------------------------------------
_______________________________________________
To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
_______________________________________________
"Databases in Memoriam" -- http://www.prevayler.org