Tabnine Logo
EditsDoubleBuffer.countReadyBytes
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.hadoop/hadoop-hdfs

@Override
protected void flushAndSync(boolean durable) throws IOException {
 int numReadyBytes = buf.countReadyBytes();
 if (numReadyBytes > 0) {
  int numReadyTxns = buf.countReadyTxns();
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.namenodeEditsDoubleBuffercountReadyBytes

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
  • countReadyTxns
  • getFirstReadyTxId
  • countReadyTxns,
  • getFirstReadyTxId,
  • getReadyBuf

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • BoxLayout (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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