congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
EditsDoubleBuffer.getFirstReadyTxId
Code IndexAdd Tabnine to your IDE (free)

How to use
getFirstReadyTxId
method
in
org.apache.hadoop.hdfs.server.namenode.EditsDoubleBuffer

Best Java code snippets using org.apache.hadoop.hdfs.server.namenode.EditsDoubleBuffer.getFirstReadyTxId (Showing top 6 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

@Override // EditLogOutputStream
protected void flushAndSync(boolean durable) throws IOException {
 assert out.getLength() == 0 : "Output buffer is not empty";
 
 if (doubleBuf.isFlushed()) {
  LOG.info("Nothing to flush");
  return;
 }
 int numReadyTxns = doubleBuf.countReadyTxns();
 long firstTxToFlush = doubleBuf.getFirstReadyTxId();
 
 doubleBuf.flushTo(out);
 if (out.getLength() > 0) {
  assert numReadyTxns > 0;
  
  byte[] data = Arrays.copyOf(out.getData(), out.getLength());
  out.reset();
  assert out.getLength() == 0 : "Output buffer is not empty";
  backupNode.journal(journalInfo, 0, firstTxToFlush, numReadyTxns, data);
 }
}
origin: org.apache.hadoop/hadoop-hdfs

if (numReadyBytes > 0) {
 int numReadyTxns = buf.countReadyTxns();
 long firstTxToFlush = buf.getFirstReadyTxId();
origin: ch.cern.hadoop/hadoop-hdfs

@Override // EditLogOutputStream
protected void flushAndSync(boolean durable) throws IOException {
 assert out.getLength() == 0 : "Output buffer is not empty";
 
 if (doubleBuf.isFlushed()) {
  LOG.info("Nothing to flush");
  return;
 }
 int numReadyTxns = doubleBuf.countReadyTxns();
 long firstTxToFlush = doubleBuf.getFirstReadyTxId();
 
 doubleBuf.flushTo(out);
 if (out.getLength() > 0) {
  assert numReadyTxns > 0;
  
  byte[] data = Arrays.copyOf(out.getData(), out.getLength());
  out.reset();
  assert out.getLength() == 0 : "Output buffer is not empty";
  backupNode.journal(journalInfo, 0, firstTxToFlush, numReadyTxns, data);
 }
}
origin: io.prestosql.hadoop/hadoop-apache

@Override // EditLogOutputStream
protected void flushAndSync(boolean durable) throws IOException {
 assert out.getLength() == 0 : "Output buffer is not empty";
 
 if (doubleBuf.isFlushed()) {
  LOG.info("Nothing to flush");
  return;
 }
 int numReadyTxns = doubleBuf.countReadyTxns();
 long firstTxToFlush = doubleBuf.getFirstReadyTxId();
 
 doubleBuf.flushTo(out);
 if (out.getLength() > 0) {
  assert numReadyTxns > 0;
  
  byte[] data = Arrays.copyOf(out.getData(), out.getLength());
  out.reset();
  assert out.getLength() == 0 : "Output buffer is not empty";
  backupNode.journal(journalInfo, 0, firstTxToFlush, numReadyTxns, data);
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

@Override
protected void flushAndSync(boolean durable) throws IOException {
 int numReadyBytes = buf.countReadyBytes();
 if (numReadyBytes > 0) {
  int numReadyTxns = buf.countReadyTxns();
  long firstTxToFlush = buf.getFirstReadyTxId();
  assert numReadyTxns > 0;
  // Copy from our double-buffer into a new byte array. This is for
  // two reasons:
  // 1) The IPC code has no way of specifying to send only a slice of
  //    a larger array.
  // 2) because the calls to the underlying nodes are asynchronous, we
  //    need a defensive copy to avoid accidentally mutating the buffer
  //    before it is sent.
  DataOutputBuffer bufToSend = new DataOutputBuffer(numReadyBytes);
  buf.flushTo(bufToSend);
  assert bufToSend.getLength() == numReadyBytes;
  byte[] data = bufToSend.getData();
  assert data.length == bufToSend.getLength();
  QuorumCall<AsyncLogger, Void> qcall = loggers.sendEdits(
    segmentTxId, firstTxToFlush,
    numReadyTxns, data);
  loggers.waitForWriteQuorum(qcall, writeTimeoutMs, "sendEdits");
  
  // Since we successfully wrote this batch, let the loggers know. Any future
  // RPCs will thus let the loggers know of the most recent transaction, even
  // if a logger has fallen behind.
  loggers.setCommittedTxId(firstTxToFlush + numReadyTxns - 1);
 }
}
origin: io.prestosql.hadoop/hadoop-apache

@Override
protected void flushAndSync(boolean durable) throws IOException {
 int numReadyBytes = buf.countReadyBytes();
 if (numReadyBytes > 0) {
  int numReadyTxns = buf.countReadyTxns();
  long firstTxToFlush = buf.getFirstReadyTxId();
  assert numReadyTxns > 0;
  // Copy from our double-buffer into a new byte array. This is for
  // two reasons:
  // 1) The IPC code has no way of specifying to send only a slice of
  //    a larger array.
  // 2) because the calls to the underlying nodes are asynchronous, we
  //    need a defensive copy to avoid accidentally mutating the buffer
  //    before it is sent.
  DataOutputBuffer bufToSend = new DataOutputBuffer(numReadyBytes);
  buf.flushTo(bufToSend);
  assert bufToSend.getLength() == numReadyBytes;
  byte[] data = bufToSend.getData();
  assert data.length == bufToSend.getLength();
  QuorumCall<AsyncLogger, Void> qcall = loggers.sendEdits(
    segmentTxId, firstTxToFlush,
    numReadyTxns, data);
  loggers.waitForWriteQuorum(qcall, writeTimeoutMs, "sendEdits");
  
  // Since we successfully wrote this batch, let the loggers know. Any future
  // RPCs will thus let the loggers know of the most recent transaction, even
  // if a logger has fallen behind.
  loggers.setCommittedTxId(firstTxToFlush + numReadyTxns - 1);
 }
}
org.apache.hadoop.hdfs.server.namenodeEditsDoubleBuffergetFirstReadyTxId

Popular methods of EditsDoubleBuffer

  • <init>
  • close
  • countBufferedBytes
  • flushTo
    Writes the content of the "ready" buffer to the given output stream, and resets it. Does not swap an
  • isFlushed
  • setReadyToFlush
  • getCurrentBuf
  • shouldForceSync
  • writeOp
  • writeRaw
  • countReadyBytes
  • countReadyTxns
  • countReadyBytes,
  • countReadyTxns,
  • getReadyBuf

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • setScale (BigDecimal)
  • getSystemService (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now