Codota Logo
FSEditLogLoader$EditLogValidation.hasCorruptHeader
Code IndexAdd Codota to your IDE (free)

How to use
hasCorruptHeader
method
in
org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader$EditLogValidation

Best Java code snippets using org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader$EditLogValidation.hasCorruptHeader (Showing top 8 results out of 315)

  • Common ways to obtain FSEditLogLoader$EditLogValidation
private void myMethod () {
FSEditLogLoader$EditLogValidation f =
  • Codota Iconnew EditLogValidation(validLength, endTxId, false)
  • Codota IconEditLogInputStream in;FSEditLogLoader.validateEditLog(in)
  • Codota Iconnew FSEditLogLoader.EditLogValidation(long1, endTxId, true)
  • Smart code suggestions by Codota
}
origin: ch.cern.hadoop/hadoop-hdfs

@Test
public void testValidateEditLogWithCorruptHeader() throws IOException {
 File testDir = new File(TEST_DIR, "testValidateEditLogWithCorruptHeader");
 SortedMap<Long, Long> offsetToTxId = Maps.newTreeMap();
 File logFile = prepareUnfinalizedTestEditLog(testDir, 2, offsetToTxId);
 RandomAccessFile rwf = new RandomAccessFile(logFile, "rw");
 try {
  rwf.seek(0);
  rwf.writeLong(42); // corrupt header
 } finally {
  rwf.close();
 }
 EditLogValidation validation = EditLogFileInputStream.validateEditLog(logFile);
 assertTrue(validation.hasCorruptHeader());
}
origin: ch.cern.hadoop/hadoop-hdfs

EditLogValidation validation =
  EditLogFileInputStream.validateEditLog(logFile);
assertTrue(!validation.hasCorruptHeader());
 assertEquals("Failed when corrupting txn opcode at " + txOffset,
   expectedEndTxId, validation.getEndTxId());
 assertTrue(!validation.hasCorruptHeader());
 assertEquals("Failed when corrupting txid " + txId + " txn opcode " +
  "at " + txOffset, expectedEndTxId, validation.getEndTxId());
 assertTrue(!validation.hasCorruptHeader());
origin: ch.cern.hadoop/hadoop-hdfs

@Test
public void testValidateEmptyEditLog() throws IOException {
 File testDir = new File(TEST_DIR, "testValidateEmptyEditLog");
 SortedMap<Long, Long> offsetToTxId = Maps.newTreeMap();
 File logFile = prepareUnfinalizedTestEditLog(testDir, 0, offsetToTxId);
 // Truncate the file so that there is nothing except the header and
 // layout flags section.
 truncateFile(logFile, 8);
 EditLogValidation validation =
   EditLogFileInputStream.validateEditLog(logFile);
 assertTrue(!validation.hasCorruptHeader());
 assertEquals(HdfsConstants.INVALID_TXID, validation.getEndTxId());
}
origin: org.apache.hadoop/hadoop-hdfs

/** 
 * Find out where the edit log ends.
 * This will update the lastTxId of the EditLogFile or
 * mark it as corrupt if it is.
 * @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.
 * @param verifyVersion Whether the scan should verify the layout version
 */
public void scanLog(long maxTxIdToScan, boolean verifyVersion)
  throws IOException {
 EditLogValidation val = EditLogFileInputStream.scanEditLog(file,
   maxTxIdToScan, verifyVersion);
 this.lastTxId = val.getEndTxId();
 this.hasCorruptHeader = val.hasCorruptHeader();
}
origin: ch.cern.hadoop/hadoop-hdfs

/** 
 * Find out where the edit log ends.
 * This will update the lastTxId of the EditLogFile or
 * mark it as corrupt if it is.
 */
public void validateLog() throws IOException {
 EditLogValidation val = EditLogFileInputStream.validateEditLog(file);
 this.lastTxId = val.getEndTxId();
 this.hasCorruptHeader = val.hasCorruptHeader();
}
origin: ch.cern.hadoop/hadoop-hdfs

public void scanLog() throws IOException {
 EditLogValidation val = EditLogFileInputStream.scanEditLog(file);
 this.lastTxId = val.getEndTxId();
 this.hasCorruptHeader = val.hasCorruptHeader();
}
origin: io.prestosql.hadoop/hadoop-apache

/** 
 * Find out where the edit log ends.
 * This will update the lastTxId of the EditLogFile or
 * mark it as corrupt if it is.
 */
public void validateLog() throws IOException {
 EditLogValidation val = EditLogFileInputStream.validateEditLog(file);
 this.lastTxId = val.getEndTxId();
 this.hasCorruptHeader = val.hasCorruptHeader();
}
origin: io.prestosql.hadoop/hadoop-apache

public void scanLog() throws IOException {
 EditLogValidation val = EditLogFileInputStream.scanEditLog(file);
 this.lastTxId = val.getEndTxId();
 this.hasCorruptHeader = val.hasCorruptHeader();
}
org.apache.hadoop.hdfs.server.namenodeFSEditLogLoader$EditLogValidationhasCorruptHeader

Popular methods of FSEditLogLoader$EditLogValidation

  • <init>
  • getEndTxId

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • findViewById (Activity)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now