@Test(groups = "fast") public void testCommit() throws Exception { writeAndTestCounts(1, 0); writeAndTestCounts(2, 0); eventWriter.commit(); assertTestCounts(2, 0); now = now.plusSeconds(301); eventWriter.commit(); assertTestCounts(0, 2); }
@Override public synchronized void commit() throws IOException { commitIfNeeded(); }
ThresholdEventWriter implements EventWriter { @Override public synchronized void commit() throws IOException { commitIfNeeded(); } }
ThresholdEventWriter implements EventWriter { @Override public synchronized void commit() throws IOException { commitIfNeeded(); } ThresholdEventWriter(final EventWriter delegate, final long maxUncommittedWriteCount, final long maxUncommittedPeriodInSeconds); }
ThresholdEventWriter implements EventWriter { @Override public synchronized void commit() throws IOException { commitIfNeeded(); } ThresholdEventWriter(final EventWriter delegate, final long maxUncommittedWriteCount, final long maxUncommittedPeriodInSeconds); @Override synchronized void write(final Event event); @Managed(description = "Commit locally spooled events for flushing") @Override synchronized void forceCommit(); @Override synchronized void commit(); @Override synchronized void rollback(); @Override synchronized void flush(); @Override synchronized void close(); @Override String getSpoolPath(); @Managed(description = "Set the max number of writes before a commit is performed") void setMaxWriteCount(final long maxWriteCount); @Managed(description = "The max number of writes before a commit is performed") long getMaxWriteCount(); @Managed(description = "Set the max number of seconds between commits of local disk spools") void setMaxUncommittedPeriodInSeconds(final long maxUncommittedPeriodInSeconds); @Managed(description = "The max number of seconds between commits of local disk spools") long getMaxUncommittedPeriodInSeconds(); }
ThresholdEventWriter implements EventWriter { @Override public synchronized void commit() throws IOException { commitIfNeeded(); } ThresholdEventWriter(final EventWriter delegate, final long maxUncommittedWriteCount, final long maxUncommittedPeriodInSeconds); @Override synchronized void write(final Event event); @Managed(description = "Commit locally spooled events for flushing") @Override synchronized void forceCommit(); @Override synchronized void commit(); @Override synchronized void rollback(); @Override synchronized void flush(); @Override synchronized void close(); @Override String getSpoolPath(); @Managed(description = "Set the max number of writes before a commit is performed") void setMaxWriteCount(final long maxWriteCount); @Managed(description = "The max number of writes before a commit is performed") long getMaxWriteCount(); @Managed(description = "Set the max number of seconds between commits of local disk spools") void setMaxUncommittedPeriodInSeconds(final long maxUncommittedPeriodInSeconds); @Managed(description = "The max number of seconds between commits of local disk spools") long getMaxUncommittedPeriodInSeconds();  }