Package org.apache.hadoop.hdfs.server.namenode

Examples of org.apache.hadoop.hdfs.server.namenode.FileJournalManager$EditLogFile


      StorageErrorReporter errorReporter) throws IOException {
    super(NodeType.JOURNAL_NODE);
   
    sd = new StorageDirectory(logDir);
    this.addStorageDir(sd);
    this.fjm = new FileJournalManager(conf, sd, errorReporter);

    analyzeAndRecoverStorage(startOpt);
  }
View Full Code Here


      }
     
      long segmentTxId = ServletUtil.parseLongParam(request,
          SEGMENT_TXID_PARAM);

      FileJournalManager fjm = storage.getJournalManager();
      File editFile;

      synchronized (fjm) {
        // Synchronize on the FJM so that the file doesn't get finalized
        // out from underneath us while we're in the process of opening
        // it up.
        EditLogFile elf = fjm.getLogFile(
            segmentTxId);
        if (elf == null) {
          response.sendError(HttpServletResponse.SC_NOT_FOUND,
              "No edit log found starting at txid " + segmentTxId);
          return;
View Full Code Here

      StorageErrorReporter errorReporter) throws IOException {
    super(NodeType.JOURNAL_NODE);
   
    sd = new StorageDirectory(logDir);
    this.addStorageDir(sd);
    this.fjm = new FileJournalManager(conf, sd, errorReporter);
   
    analyzeStorage();
  }
View Full Code Here

  protected JNStorage(File logDir, StorageErrorReporter errorReporter) throws IOException {
    super(NodeType.JOURNAL_NODE);
   
    sd = new StorageDirectory(logDir);
    this.addStorageDir(sd);
    this.fjm = new FileJournalManager(sd, errorReporter);
   
    analyzeStorage();
  }
View Full Code Here

      }
     
      long segmentTxId = ServletUtil.parseLongParam(request,
          SEGMENT_TXID_PARAM);

      FileJournalManager fjm = storage.getJournalManager();
      File editFile;

      synchronized (fjm) {
        // Synchronize on the FJM so that the file doesn't get finalized
        // out from underneath us while we're in the process of opening
        // it up.
        EditLogFile elf = fjm.getLogFile(
            segmentTxId);
        if (elf == null) {
          response.sendError(HttpServletResponse.SC_NOT_FOUND,
              "No edit log found starting at txid " + segmentTxId);
          return;
View Full Code Here

      StorageErrorReporter errorReporter) throws IOException {
    super(NodeType.JOURNAL_NODE);
   
    sd = new StorageDirectory(logDir);
    this.addStorageDir(sd);
    this.fjm = new FileJournalManager(conf, sd, errorReporter);

    analyzeAndRecoverStorage(startOpt);
  }
View Full Code Here

      }
     
      long segmentTxId = ServletUtil.parseLongParam(request,
          SEGMENT_TXID_PARAM);

      FileJournalManager fjm = storage.getJournalManager();
      File editFile;

      synchronized (fjm) {
        // Synchronize on the FJM so that the file doesn't get finalized
        // out from underneath us while we're in the process of opening
        // it up.
        EditLogFile elf = fjm.getLogFile(
            segmentTxId);
        if (elf == null) {
          response.sendError(HttpServletResponse.SC_NOT_FOUND,
              "No edit log found starting at txid " + segmentTxId);
          return;
View Full Code Here

  protected JNStorage(File logDir, StorageErrorReporter errorReporter) throws IOException {
    super(NodeType.JOURNAL_NODE);
   
    sd = new StorageDirectory(logDir);
    this.addStorageDir(sd);
    this.fjm = new FileJournalManager(sd, errorReporter);
   
    analyzeStorage();
  }
View Full Code Here

      }
     
      long segmentTxId = ServletUtil.parseLongParam(request,
          SEGMENT_TXID_PARAM);

      FileJournalManager fjm = storage.getJournalManager();
      File editFile;
      FileInputStream editFileIn;
     
      synchronized (fjm) {
        // Synchronize on the FJM so that the file doesn't get finalized
        // out from underneath us while we're in the process of opening
        // it up.
        EditLogFile elf = fjm.getLogFile(
            segmentTxId);
        if (elf == null) {
          response.sendError(HttpServletResponse.SC_NOT_FOUND,
              "No edit log found starting at txid " + segmentTxId);
          return;
View Full Code Here

    Callable<Void> producerThread = new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        int currentTxId = 0;
        try {
          FileJournalManager jm = new FileJournalManager(storageDirectory);
          for (int segment = 0; segment < numSegments; segment++) {
            // start new segment
            int firstTxId = currentTxId;
            EditLogOutputStream out = jm.startLogSegment(currentTxId);

            // starting transaction
            FSEditLogOp startOp = new LogSegmentOp(
                FSEditLogOpCodes.OP_START_LOG_SEGMENT);
            startOp.setTransactionId(firstTxId);
            FSEditLogTestUtil.writeToStreams(startOp, out);
            LOG.info("Written op: " + startOp);
            writtenTransactions.add(startOp);

            currentTxId++;

            // other transactions
            List<FSEditLogOp> transactions = FSEditLogTestUtil
                .getContiguousLogSegment(currentTxId, currentTxId
                    + editsPerFile);

            for (int i = 0; i < editsPerFile; i++) {
              FSEditLogOp op = transactions.get(i);
              op.setTransactionId(currentTxId);
              FSEditLogTestUtil.writeToStreams(op, out);
              writtenTransactions.add(op);
              currentTxId++;
              LOG.info("Written op: " + op);
              if (i % 100 == 0) {
                Thread.sleep(10);
                FSEditLogTestUtil.flushStreams(out);
              }
            }

            // write ending transactions if needed
            if (endLogSegment || (segment == numSegments - 1)) {
              int lastTxId = currentTxId;
              FSEditLogOp endOp = new LogSegmentOp(
                  FSEditLogOpCodes.OP_END_LOG_SEGMENT);
              endOp.setTransactionId(lastTxId);
              FSEditLogTestUtil.writeToStreams(endOp, out);
              LOG.info("Written op: " + endOp);
              writtenTransactions.add(endOp);
              currentTxId++;
            }

            FSEditLogTestUtil.flushStreams(out);
            FSEditLogTestUtil.closeStreams(out);
            jm.finalizeLogSegment(firstTxId, currentTxId - 1);

            // simulate NFS cache delay (reader won't see
            // the new file for 1 second
            if (r.nextBoolean())
              ;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.namenode.FileJournalManager$EditLogFile

Copyright © 2018 www.massapicom. 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.