@Override public void append(TransactionEdit edit) throws IOException { long startTime = System.nanoTime(); synchronized (this) { ensureAvailable(); Entry entry = new Entry(new LongWritable(logSequence.getAndIncrement()), edit); // add to pending edits append(entry); } // wait for sync to complete sync(); long durationMillis = (System.nanoTime() - startTime) / 1000000L; if (durationMillis > SLOW_APPEND_THRESHOLD) { LOG.info("Slow append to log " + getName() + ", took " + durationMillis + " msec."); } }
@Override public void append(TransactionEdit edit) throws IOException { long startTime = System.nanoTime(); synchronized (this) { ensureAvailable(); Entry entry = new Entry(new LongWritable(logSequence.getAndIncrement()), edit); // add to pending edits append(entry); } // wait for sync to complete sync(); long durationMillis = (System.nanoTime() - startTime) / 1000000L; if (durationMillis > SLOW_APPEND_THRESHOLD) { LOG.info("Slow append to log " + getName() + ", took " + durationMillis + " msec."); } }
@Override public void append(List<TransactionEdit> edits) throws IOException { long startTime = System.nanoTime(); synchronized (this) { ensureAvailable(); for (TransactionEdit edit : edits) { Entry entry = new Entry(new LongWritable(logSequence.getAndIncrement()), edit); // add to pending edits append(entry); } } // wait for sync to complete sync(); long durationMillis = (System.nanoTime() - startTime) / 1000000L; if (durationMillis > SLOW_APPEND_THRESHOLD) { LOG.info("Slow append to log " + getName() + ", took " + durationMillis + " msec."); } }
@Override public void append(List<TransactionEdit> edits) throws IOException { long startTime = System.nanoTime(); synchronized (this) { ensureAvailable(); for (TransactionEdit edit : edits) { Entry entry = new Entry(new LongWritable(logSequence.getAndIncrement()), edit); // add to pending edits append(entry); } } // wait for sync to complete sync(); long durationMillis = (System.nanoTime() - startTime) / 1000000L; if (durationMillis > SLOW_APPEND_THRESHOLD) { LOG.info("Slow append to log " + getName() + ", took " + durationMillis + " msec."); } }