Tabnine Logo
FSEditLogOp.writeFields
Code IndexAdd Tabnine to your IDE (free)

How to use
writeFields
method
in
org.apache.hadoop.hdfs.server.namenode.FSEditLogOp

Best Java code snippets using org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.writeFields (Showing top 4 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

 /**
  * Write an operation to the output stream
  * 
  * @param op The operation to write
  * @throws IOException if an error occurs during writing.
  */
 public void writeOp(FSEditLogOp op) throws IOException {
  int start = buf.getLength();
  // write the op code first to make padding and terminator verification
  // work
  buf.writeByte(op.opCode.getOpCode());
  buf.writeInt(0); // write 0 for the length first
  buf.writeLong(op.txid);
  op.writeFields(buf);
  int end = buf.getLength();
  
  // write the length back: content of the op + 4 bytes checksum - op_code
  int length = end - start - 1;
  buf.writeInt(length, start + 1);
  checksum.reset();
  checksum.update(buf.getData(), start, end-start);
  int sum = (int)checksum.getValue();
  buf.writeInt(sum);
 }
}
origin: com.facebook.hadoop/hadoop-core

 /**
  * Write an operation to the output stream
  * 
  * @param op The operation to write
  * @throws IOException if an error occurs during writing.
  */
 public void writeOp(FSEditLogOp op) throws IOException {
  int start = buf.getLength();
  buf.writeByte(op.opCode.getOpCode());
  buf.writeLong(op.txid);
  op.writeFields(buf);
  int end = buf.getLength();
  Checksum checksum = FSEditLog.getChecksumForWrite();
  checksum.reset();
  checksum.update(buf.getData(), start, end-start);
  int sum = (int)checksum.getValue();
  buf.writeInt(sum);
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

 /**
  * Write an operation to the output stream
  * 
  * @param op The operation to write
  * @throws IOException if an error occurs during writing.
  */
 public void writeOp(FSEditLogOp op) throws IOException {
  int start = buf.getLength();
  // write the op code first to make padding and terminator verification
  // work
  buf.writeByte(op.opCode.getOpCode());
  buf.writeInt(0); // write 0 for the length first
  buf.writeLong(op.txid);
  op.writeFields(buf);
  int end = buf.getLength();
  
  // write the length back: content of the op + 4 bytes checksum - op_code
  int length = end - start - 1;
  buf.writeInt(length, start + 1);
  checksum.reset();
  checksum.update(buf.getData(), start, end-start);
  int sum = (int)checksum.getValue();
  buf.writeInt(sum);
 }
}
origin: io.prestosql.hadoop/hadoop-apache

 /**
  * Write an operation to the output stream
  * 
  * @param op The operation to write
  * @throws IOException if an error occurs during writing.
  */
 public void writeOp(FSEditLogOp op) throws IOException {
  int start = buf.getLength();
  // write the op code first to make padding and terminator verification
  // work
  buf.writeByte(op.opCode.getOpCode());
  buf.writeInt(0); // write 0 for the length first
  buf.writeLong(op.txid);
  op.writeFields(buf);
  int end = buf.getLength();
  
  // write the length back: content of the op + 4 bytes checksum - op_code
  int length = end - start - 1;
  buf.writeInt(length, start + 1);
  checksum.reset();
  checksum.update(buf.getData(), start, end-start);
  int sum = (int)checksum.getValue();
  buf.writeInt(sum);
 }
}
org.apache.hadoop.hdfs.server.namenodeFSEditLogOpwriteFields

Popular methods of FSEditLogOp

  • setTransactionId
  • getTransactionId
  • readFields
  • blockFromXml
  • blockToXml
  • decodeXml
  • delegationKeyToXml
  • delegationTokenToXml
  • fromXml
  • fsActionFromXml
  • fsActionToXml
  • fsPermissionFromXml
  • fsActionToXml,
  • fsPermissionFromXml,
  • fsPermissionToXml,
  • hasRpcIds,
  • hasTransactionId,
  • outputToXml,
  • permissionStatusToXml,
  • reset,
  • resetSubFields

Popular in Java

  • Running tasks concurrently on multiple threads
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Table (org.hibernate.mapping)
    A relational table
  • CodeWhisperer 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