public JournalWriter(JournalMetadata<T> metadata, JournalKey<T> key) throws JournalException { super(metadata, key); if (metadata.isPartialMapped()) { close(); throw new JournalException("Metadata is unusable for writer. Partially mapped?"); } this.lagMillis = TimeUnit.HOURS.toMillis(getMetadata().getLag()); this.lagSwellMillis = lagMillis * 3; this.checkOrder = key.isOrdered() && getTimestampOffset() != -1; this.journalEntryWriter = new JournalEntryWriterImpl(this); this.discardTxt = new File(metadata.getLocation(), "discard.txt"); }