@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."); } }
entry = new AbstractTransactionLog.Entry(new LongWritable(logSequence.getAndIncrement()), edits.get(j)); writer.append(entry.getKey(), entry.getEdit()); entry = new AbstractTransactionLog.Entry(new LongWritable(logSequence.getAndIncrement()), edits.get(i)); writer.append(entry.getKey(), entry.getEdit()); entry = new AbstractTransactionLog.Entry(new LongWritable(logSequence.getAndIncrement()), edits.get(totalCount - 1)); if (isComplete) {
@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 TransactionEdit next() throws IOException { Entry entry = new Entry(); try { entry.readFields(in); } catch (EOFException eofe) { // signal end of file by returning null return null; } return entry.getEdit(); }
@Override public TransactionEdit next() throws IOException { Entry entry = new Entry(); try { entry.readFields(in); } catch (EOFException eofe) { // signal end of file by returning null return null; } return entry.getEdit(); }