Re: JournalDiskSyncStrategy?
Karl Wettin <[email protected]> Sun, 10 Aug 2014 20:55:39 +0200
| Newsgroups | gmane.comp.java.prevayler |
|---|---|
| Message-ID | <[email protected]> |
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