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

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

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

origin: org.apache.hadoop/hadoop-hdfs

@Override
public FSEditLogOp decodeOp() throws IOException {
 limiter.setLimit(maxOpSize);
 in.mark(maxOpSize);
 byte opCodeByte;
 try {
  opCodeByte = in.readByte();
 } catch (EOFException eof) {
  // EOF at an opcode boundary is expected.
  return null;
 }
 FSEditLogOpCodes opCode = FSEditLogOpCodes.fromByte(opCodeByte);
 if (opCode == OP_INVALID) {
  verifyTerminator();
  return null;
 }
 FSEditLogOp op = cache.get(opCode);
 if (op == null) {
  throw new IOException("Read invalid opcode " + opCode);
 }
 if (NameNodeLayoutVersion.supports(
    LayoutVersion.Feature.STORED_TXIDS, logVersion)) {
  op.setTransactionId(in.readLong());
 } else {
  op.setTransactionId(HdfsServerConstants.INVALID_TXID);
 }
 op.readFields(in, logVersion);
 return op;
}
origin: org.apache.hadoop/hadoop-hdfs

synchronized boolean doEditTransaction(final FSEditLogOp op) {
 long start = beginTransaction();
 op.setTransactionId(txid);
 try {
  editLogStream.write(op);
 } catch (IOException ex) {
  // All journals failed, it is handled in logSync.
 } finally {
  op.reset();
 }
 endTransaction(start);
 return shouldForceSync();
}
origin: org.apache.hadoop/hadoop-hdfs

 throw new IOException("Read invalid opcode " + opCode);
op.setTransactionId(in.readLong());
op.readFields(in, logVersion);
origin: org.apache.hadoop/hadoop-hdfs

@Override
public FSEditLogOp decodeOp() throws IOException {
 long txid = decodeOpFrame();
 if (txid == HdfsServerConstants.INVALID_TXID) {
  return null;
 }
 in.reset();
 in.mark(maxOpSize);
 FSEditLogOpCodes opCode = FSEditLogOpCodes.fromByte(in.readByte());
 FSEditLogOp op = cache.get(opCode);
 if (op == null) {
  throw new IOException("Read invalid opcode " + opCode);
 }
 op.setTransactionId(txid);
 IOUtils.skipFully(in, 4 + 8); // skip length and txid
 op.readFields(in, logVersion);
 // skip over the checksum, which we validated above.
 IOUtils.skipFully(in, CHECKSUM_LENGTH);
 return op;
}
origin: org.apache.hadoop/hadoop-hdfs

op.setTransactionId(nextTxId);
nextTxId++;
origin: org.apache.hadoop/hadoop-hdfs

op.setTransactionId(nextTxId);
nextTxId++;
origin: com.facebook.hadoop/hadoop-core

op.setTransactionId(in.readLong());
origin: io.prestosql.hadoop/hadoop-apache

  LayoutVersion.Feature.STORED_TXIDS, logVersion)) {
 op.setTransactionId(in.readLong());
} else {
 op.setTransactionId(HdfsConstants.INVALID_TXID);
origin: ch.cern.hadoop/hadoop-hdfs

public static void writeOp(EditLogOutputStream stm, long txid) throws IOException {
 FSEditLogOp op = NameNodeAdapter.createMkdirOp("tx " + txid);
 op.setTransactionId(txid);
 stm.write(op);
}
origin: ch.cern.hadoop/hadoop-hdfs

  LayoutVersion.Feature.STORED_TXIDS, logVersion)) {
 op.setTransactionId(in.readLong());
} else {
 op.setTransactionId(HdfsConstants.INVALID_TXID);
origin: com.facebook.hadoop/hadoop-core

op.setTransactionId(txid);
assert this.getNumEditStreams() > 0 : "no editlog streams";
long start = FSNamesystem.now();
origin: ch.cern.hadoop/hadoop-hdfs

op.setTransactionId(nextTxId);
nextTxId++;
origin: io.prestosql.hadoop/hadoop-apache

op.setTransactionId(nextTxId);
nextTxId++;
origin: ch.cern.hadoop/hadoop-hdfs

op.setTransactionId(nextTxId);
nextTxId++;
origin: ch.cern.hadoop/hadoop-hdfs

public static byte[] createTxnData(int startTxn, int numTxns) throws Exception {
 DataOutputBuffer buf = new DataOutputBuffer();
 FSEditLogOp.Writer writer = new FSEditLogOp.Writer(buf);
 
 for (long txid = startTxn; txid < startTxn + numTxns; txid++) {
  FSEditLogOp op = NameNodeAdapter.createMkdirOp("tx " + txid);
  op.setTransactionId(txid);
  writer.writeOp(op);
 }
 
 return Arrays.copyOf(buf.getData(), buf.getLength());
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Generate byte array representing a set of GarbageMkdirOp
 */
public static byte[] createGabageTxns(long startTxId, int numTxns)
  throws IOException {
 DataOutputBuffer buf = new DataOutputBuffer();
 FSEditLogOp.Writer writer = new FSEditLogOp.Writer(buf);
 for (long txid = startTxId; txid < startTxId + numTxns; txid++) {
  FSEditLogOp op = new TestEditLog.GarbageMkdirOp();
  op.setTransactionId(txid);
  writer.writeOp(op);
 }
 return Arrays.copyOf(buf.getData(), buf.getLength());
}
origin: ch.cern.hadoop/hadoop-hdfs

op.setTransactionId(txid);
origin: io.prestosql.hadoop/hadoop-apache

op.setTransactionId(txid);
origin: io.prestosql.hadoop/hadoop-apache

op.setTransactionId(nextTxId);
nextTxId++;
org.apache.hadoop.hdfs.server.namenodeFSEditLogOpsetTransactionId

Popular methods of FSEditLogOp

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

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Best IntelliJ plugins
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