Examples of validateLog()


Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

      // verify that the edits file is NOT empty
      NameNode nn = cluster.getNameNode();
      for (StorageDirectory sd : nn.getFSImage().getStorage().dirIterable(null)) {
        EditLogFile log = FSImageTestUtil.findLatestEditsLog(sd);
        assertTrue(log.isInProgress());
        log.validateLog();
        long numTransactions = (log.getLastTxId() - log.getFirstTxId()) + 1;
        assertEquals("In-progress log " + log + " should have 5 transactions",
                     5, numTransactions);;
      }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

      }
      // verify that the edits file is empty except for the START txn
      for (StorageDirectory sd : nn.getFSImage().getStorage().dirIterable(null)) {
        EditLogFile log = FSImageTestUtil.findLatestEditsLog(sd);
        assertTrue(log.isInProgress());
        log.validateLog();
        long numTransactions = (log.getLastTxId() - log.getFirstTxId()) + 1;
        assertEquals("In-progress log " + log + " should only have START txn",
            1, numTransactions);
      }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

    LOG.info("Scanning storage " + fjm);
    List<EditLogFile> files = fjm.getLogFiles(0);
   
    while (!files.isEmpty()) {
      EditLogFile latestLog = files.remove(files.size() - 1);
      latestLog.validateLog();
      LOG.info("Latest log is " + latestLog);
      if (latestLog.getLastTxId() == HdfsConstants.INVALID_TXID) {
        // the log contains no transactions
        LOG.warn("Latest log " + latestLog + " has no transactions. " +
            "moving it aside and looking for previous log");
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

      }
     
      // If it's in-progress, it should only contain one transaction,
      // because the "startLogSegment" transaction is written alone at the
      // start of each segment.
      existing.validateLog();
      if (existing.getLastTxId() != existing.getFirstTxId()) {
        throw new IllegalStateException("The log file " +
            existing + " seems to contain valid transactions");
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

    EditLogFile elf = fjm.getLogFile(segmentTxId);
    if (elf == null) {
      return null;
    }
    if (elf.isInProgress()) {
      elf.validateLog();
    }
    if (elf.getLastTxId() == HdfsConstants.INVALID_TXID) {
      LOG.info("Edit log file " + elf + " appears to be empty. " +
          "Moving it aside...");
      elf.moveAsideEmptyFile();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

    LOG.info("Scanning storage " + fjm);
    List<EditLogFile> files = fjm.getLogFiles(0);
   
    while (!files.isEmpty()) {
      EditLogFile latestLog = files.remove(files.size() - 1);
      latestLog.validateLog();
      LOG.info("Latest log is " + latestLog);
      if (latestLog.getLastTxId() == HdfsConstants.INVALID_TXID) {
        // the log contains no transactions
        LOG.warn("Latest log " + latestLog + " has no transactions. " +
            "moving it aside and looking for previous log");
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

      }
     
      // If it's in-progress, it should only contain one transaction,
      // because the "startLogSegment" transaction is written alone at the
      // start of each segment.
      existing.validateLog();
      if (existing.getLastTxId() != existing.getFirstTxId()) {
        throw new IllegalStateException("The log file " +
            existing + " seems to contain valid transactions");
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

    EditLogFile elf = fjm.getLogFile(segmentTxId);
    if (elf == null) {
      return null;
    }
    if (elf.isInProgress()) {
      elf.validateLog();
    }
    if (elf.getLastTxId() == HdfsConstants.INVALID_TXID) {
      LOG.info("Edit log file " + elf + " appears to be empty. " +
          "Moving it aside...");
      elf.moveAsideEmptyFile();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

      // verify that the edits file is NOT empty
      NameNode nn = cluster.getNameNode();
      for (StorageDirectory sd : nn.getFSImage().getStorage().dirIterable(null)) {
        EditLogFile log = FSImageTestUtil.findLatestEditsLog(sd);
        assertTrue(log.isInProgress());
        log.validateLog();
        long numTransactions = (log.getLastTxId() - log.getFirstTxId()) + 1;
        assertEquals("In-progress log " + log + " should have 5 transactions",
                     5, numTransactions);;
      }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile.validateLog()

      }
      // verify that the edits file is empty except for the START txn
      for (StorageDirectory sd : nn.getFSImage().getStorage().dirIterable(null)) {
        EditLogFile log = FSImageTestUtil.findLatestEditsLog(sd);
        assertTrue(log.isInProgress());
        log.validateLog();
        long numTransactions = (log.getLastTxId() - log.getFirstTxId()) + 1;
        assertEquals("In-progress log " + log + " should only have START txn",
            1, numTransactions);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.