Package org.apache.hadoop.hdfs.server.protocol

Examples of org.apache.hadoop.hdfs.server.protocol.RemoteEditLog


          continue;
        }
      }

      // Find the one that extends the farthest forward
      RemoteEditLog bestLog = Collections.max(logGroup);
      logs.add(bestLog);
      // And then start looking from after that point
      curStartTxId = bestLog.getEndTxId() + 1;
    }
    RemoteEditLogManifest ret = new RemoteEditLogManifest(logs);
   
    if (LOG.isDebugEnabled()) {
      LOG.debug("Generated manifest for logs since " + fromTxId + ":"
View Full Code Here


          continue;
        }
      }

      // Find the one that extends the farthest forward
      RemoteEditLog bestLog = Collections.max(logGroup);
      logs.add(bestLog);
      // And then start looking from after that point
      curStartTxId = bestLog.getEndTxId() + 1;
    }
    RemoteEditLogManifest ret = new RemoteEditLogManifest(logs);
   
    if (LOG.isDebugEnabled()) {
      LOG.debug("Generated manifest for logs since " + fromTxId + ":"
View Full Code Here

        allLogFiles.size());

    for (EditLogFile elf : allLogFiles) {
      if (elf.hasCorruptHeader() || elf.isInProgress()) continue;
      if (elf.getFirstTxId() >= firstTxId) {
        ret.add(new RemoteEditLog(elf.firstTxId, elf.lastTxId));
      } else if ((firstTxId > elf.getFirstTxId()) &&
                 (firstTxId <= elf.getLastTxId())) {
        // Note that this behavior is different from getLogFiles below.
        throw new IllegalStateException("Asked for firstTxId " + firstTxId
            + " which is in the middle of file " + elf.file);
View Full Code Here

    assertEquals(l1.getStartTxId(), l2.getStartTxId());
  }
 
  @Test
  public void testConvertRemoteEditLog() {
    RemoteEditLog l = new RemoteEditLog(1, 100);
    RemoteEditLogProto lProto = PBHelper.convert(l);
    RemoteEditLog l1 = PBHelper.convert(lProto);
    compare(l, l1);
  }
View Full Code Here

  }
 
  @Test
  public void testConvertRemoteEditLogManifest() {
    List<RemoteEditLog> logs = new ArrayList<RemoteEditLog>();
    logs.add(new RemoteEditLog(1, 10));
    logs.add(new RemoteEditLog(11, 20));
    RemoteEditLogManifest m = new RemoteEditLogManifest(logs);
    RemoteEditLogManifestProto mProto = PBHelper.convert(m);
    RemoteEditLogManifest m1 = PBHelper.convert(mProto);
   
    List<RemoteEditLog> logs1 = m1.getLogs();
View Full Code Here

               srcNames[0].length() + " bytes.");

      // get edits file
      srcNames = ssStore.getEditsFiles();
      assert srcNames.length == 1 : "No snapshot temporary dir.";
      TransferFsImage.downloadEditsToStorage(fileServer, new RemoteEditLog(), ssStore, false);
      LOG.info("Downloaded file " + srcNames[0].getName() + " size " +
               srcNames[0].length() + " bytes.");

      // get edits.new file (only if in the middle of ckpt)
      try {
        srcNames = ssStore.getEditsNewFiles();
        assert srcNames.length == 1 : "No snapshot temporary dir.";
        TransferFsImage.downloadEditsToStorage(fileServer, new RemoteEditLog(), ssStore, true);
        LOG.info("Downloaded file " + srcNames[0].getName() + " size " +
               srcNames[0].length() + " bytes.");
      } catch (FileNotFoundException e) {
        // do nothing
      }
View Full Code Here

      if (endTxId == HdfsConstants.INVALID_TXID) {
        continue;
      }

      if (ledger.getFirstTxId() >= fromTxId) {
        ret.add(new RemoteEditLog(ledger.getFirstTxId(),
            endTxId,
            isInProgress));
      } else if ((fromTxId > ledger.getFirstTxId()) &&
                 (fromTxId <= endTxId)) {
        throw new IOException("Asked for firstTxId " + fromTxId +
View Full Code Here

    @Override
    public void readFields(DataInput in) throws IOException {
      int len = in.readInt();
      logs = new ArrayList<RemoteEditLog>(len);
      for (int i = 0; i < len; i++) {
        RemoteEditLog rel = new RemoteEditLog();
        rel.readFields(in);
        logs.add(rel);
      }
      httpPort = in.readInt();
    }
View Full Code Here

          continue;
        }
      }

      // Find the one that extends the farthest forward
      RemoteEditLog bestLog = Collections.max(logGroup);
      logs.add(bestLog);
      // And then start looking from after that point
      curStartTxId = bestLog.getEndTxId() + 1;
      if (curStartTxId == 0)
        break;
    }
    RemoteEditLogManifest ret = new RemoteEditLogManifest(logs);
   
View Full Code Here

        allLogFiles.size());

    for (EditLogFile elf : allLogFiles) {
      if (elf.isCorrupt()) continue;  
      if (elf.getFirstTxId() >= firstTxId) {
        ret.add(new RemoteEditLog(elf.firstTxId,
            elf.lastTxId,
            elf.isInProgress));
      } else if ((firstTxId > elf.getFirstTxId()) &&
                 (firstTxId <= elf.getLastTxId())) {
        throw new IOException("Asked for firstTxId " + firstTxId
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.protocol.RemoteEditLog

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.