Tabnine Logo
FSEditLogLoader$EditLogValidation.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader$EditLogValidation
constructor

Best Java code snippets using org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader$EditLogValidation.<init> (Showing top 12 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

return new EditLogValidation(lastPos, lastTxId, false);
origin: org.apache.hadoop/hadoop-hdfs

/**
 * @param file          File being scanned and validated.
 * @param maxTxIdToScan Maximum Tx ID to try to scan.
 *                      The scan returns after reading this or a higher
 *                      ID. The file portion beyond this ID is
 *                      potentially being updated.
 * @return Result of the validation
 * @throws IOException
 */
static FSEditLogLoader.EditLogValidation scanEditLog(File file,
  long maxTxIdToScan, boolean verifyVersion)
  throws IOException {
 EditLogFileInputStream in;
 try {
  in = new EditLogFileInputStream(file);
  // read the header, initialize the inputstream, but do not check the
  // layoutversion
  in.getVersion(verifyVersion);
 } catch (LogHeaderCorruptException e) {
  LOG.warn("Log file " + file + " has no valid header", e);
  return new FSEditLogLoader.EditLogValidation(0,
    HdfsServerConstants.INVALID_TXID, true);
 }
 try {
  return FSEditLogLoader.scanEditLog(in, maxTxIdToScan);
 } finally {
  IOUtils.closeStream(in);
 }
}
origin: com.facebook.hadoop/hadoop-core

   " ops from " + in + " while determining its valid length.", t);
return new EditLogValidation(lastPos, firstTxId, lastTxId);
origin: io.prestosql.hadoop/hadoop-apache

} catch (LogHeaderCorruptException e) {
 LOG.warn("Log file " + file + " has no valid header", e);
 return new FSEditLogLoader.EditLogValidation(0,
   HdfsConstants.INVALID_TXID, true);
 return new EditLogValidation(lastPos, lastTxId, false);
} finally {
 IOUtils.closeStream(in);
origin: ch.cern.hadoop/hadoop-hdfs

} catch (LogHeaderCorruptException e) {
 LOG.warn("Log file " + file + " has no valid header", e);
 return new FSEditLogLoader.EditLogValidation(0,
   HdfsConstants.INVALID_TXID, true);
 return new EditLogValidation(lastPos, lastTxId, false);
} finally {
 IOUtils.closeStream(in);
origin: ch.cern.hadoop/hadoop-hdfs

return new EditLogValidation(lastPos, lastTxId, false);
origin: io.prestosql.hadoop/hadoop-apache

return new EditLogValidation(lastPos, lastTxId, false);
origin: io.prestosql.hadoop/hadoop-apache

static EditLogValidation scanEditLog(EditLogInputStream in) {
 long lastPos = 0;
 long lastTxId = HdfsConstants.INVALID_TXID;
 long numValid = 0;
 FSEditLogOp op = null;
 while (true) {
  lastPos = in.getPosition();
  try {
   if ((op = in.readOp()) == null) { // TODO
    break;
   }
  } catch (Throwable t) {
   FSImage.LOG.warn("Caught exception after reading " + numValid +
     " ops from " + in + " while determining its valid length." +
     "Position was " + lastPos, t);
   in.resync();
   FSImage.LOG.warn("After resync, position is " + in.getPosition());
   continue;
  }
  if (lastTxId == HdfsConstants.INVALID_TXID
    || op.getTransactionId() > lastTxId) {
   lastTxId = op.getTransactionId();
  }
  numValid++;
 }
 return new EditLogValidation(lastPos, lastTxId, false);
}
origin: ch.cern.hadoop/hadoop-hdfs

static EditLogValidation scanEditLog(EditLogInputStream in) {
 long lastPos = 0;
 long lastTxId = HdfsConstants.INVALID_TXID;
 long numValid = 0;
 FSEditLogOp op = null;
 while (true) {
  lastPos = in.getPosition();
  try {
   if ((op = in.readOp()) == null) { // TODO
    break;
   }
  } catch (Throwable t) {
   FSImage.LOG.warn("Caught exception after reading " + numValid +
     " ops from " + in + " while determining its valid length." +
     "Position was " + lastPos, t);
   in.resync();
   FSImage.LOG.warn("After resync, position is " + in.getPosition());
   continue;
  }
  if (lastTxId == HdfsConstants.INVALID_TXID
    || op.getTransactionId() > lastTxId) {
   lastTxId = op.getTransactionId();
  }
  numValid++;
 }
 return new EditLogValidation(lastPos, lastTxId, false);
}
origin: io.prestosql.hadoop/hadoop-apache

static FSEditLogLoader.EditLogValidation validateEditLog(File file)
  throws IOException {
 EditLogFileInputStream in;
 try {
  in = new EditLogFileInputStream(file);
  in.getVersion(true); // causes us to read the header
 } catch (LogHeaderCorruptException e) {
  // If the header is malformed or the wrong value, this indicates a corruption
  LOG.warn("Log file " + file + " has no valid header", e);
  return new FSEditLogLoader.EditLogValidation(0,
    HdfsConstants.INVALID_TXID, true);
 }
 
 try {
  return FSEditLogLoader.validateEditLog(in);
 } finally {
  IOUtils.closeStream(in);
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

static FSEditLogLoader.EditLogValidation validateEditLog(File file)
  throws IOException {
 EditLogFileInputStream in;
 try {
  in = new EditLogFileInputStream(file);
  in.getVersion(true); // causes us to read the header
 } catch (LogHeaderCorruptException e) {
  // If the header is malformed or the wrong value, this indicates a corruption
  LOG.warn("Log file " + file + " has no valid header", e);
  return new FSEditLogLoader.EditLogValidation(0,
    HdfsConstants.INVALID_TXID, true);
 }
 
 try {
  return FSEditLogLoader.validateEditLog(in);
 } finally {
  IOUtils.closeStream(in);
 }
}
origin: com.facebook.hadoop/hadoop-core

static FSEditLogLoader.EditLogValidation validateEditLog(File file) throws IOException {
 EditLogFileInputStream in;
 try {
  in = new EditLogFileInputStream(file);
 } catch (LogHeaderCorruptException corrupt) {
  // If it's missing its header, this is equivalent to no transactions
  FSImage.LOG.warn("Log at " + file + " has no valid header",
    corrupt);
  return new FSEditLogLoader.EditLogValidation(0, HdfsConstants.INVALID_TXID, 
                         HdfsConstants.INVALID_TXID);
 }
 
 try {
  return FSEditLogLoader.validateEditLog(in);
 } finally {
  IOUtils.closeStream(in);
 }
}
org.apache.hadoop.hdfs.server.namenodeFSEditLogLoader$EditLogValidation<init>

Popular methods of FSEditLogLoader$EditLogValidation

  • getEndTxId
  • hasCorruptHeader

Popular in Java

  • Reading from database using SQL prepared statement
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Reference (javax.naming)
  • Best plugins for Eclipse
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