Examples of AvatarFailoverSnapshot


Examples of org.apache.hadoop.hdfs.AvatarFailoverSnapshot

    float samplePercent = confg.getFloat(
        "dfs.avatarnode.failover.sample.percent", 0.05f);
    LOG.info("Failover: Test framework - using " + (100.0*samplePercent)
        + " % sample size");     
    List<FileStatusExtended> stat = super.getRandomFilesSample(samplePercent);
    AvatarFailoverSnapshot snapshot = new AvatarFailoverSnapshot(
        super.namesystem.getOpenFiles(), stat);
    File snapshotFile = new File(
        getSharedEditsFile(confg).getParentFile(), FAILOVER_SNAPSHOT_FILE);
    DataOutputStream out = new DataOutputStream(
        new BufferedOutputStream(new FileOutputStream(snapshotFile)))
    try {
      snapshot.write(out);
      out.writeBoolean(enableTestFrameworkFsck);
      if (enableTestFrameworkFsck) {
        Text.writeString(out, fsck);
      }
    } finally {
View Full Code Here

Examples of org.apache.hadoop.hdfs.AvatarFailoverSnapshot

      LOG.info("Failover: Test framework - disabled");
      return "";
    }
    String fsck = "";
    LOG.info("Failover: Test framework - verification - starting...");
    AvatarFailoverSnapshot snapshot = new AvatarFailoverSnapshot();
    File snapshotFile = getSnapshotFile(confg);
    DataInputStream in = new DataInputStream(
        new BufferedInputStream(new FileInputStream(snapshotFile)));
    try {
      snapshot.readFields(in);
      if (in.readBoolean()) {
        LOG.info("Failover: Test framework - found fsck data");
        fsck = Text.readString(in);
      }
    } finally {
      in.close();
    }
   
    LOG.info("Failover: Test framework - verifying open files: found "
        + snapshot.getOpenFilesInfo().getOpenFiles().size()
        + " files in the test snapshot")
    verifyOpenFiles(snapshot.getOpenFilesInfo());
   
    LOG.info("Failover: Test framework - verifying closed files: found "
        + snapshot.getSampledFiles().size()
        + " files in the test snapshot");   
    for (FileStatusExtended stat : snapshot.getSampledFiles()) {
      verifySnapshotSampledFile(stat);
    }

    LOG.info("Failover: Test framework - verification - succeeded");
    return fsck;
View Full Code Here

Examples of org.apache.hadoop.hdfs.AvatarFailoverSnapshot

    float samplePercent = confg.getFloat(
        "dfs.avatarnode.failover.sample.percent", 0.05f);
    LOG.info("Failover: Test framework - using " + (100.0*samplePercent)
        + " % sample size");     
    List<FileStatusExtended> stat = super.getRandomFilesSample(samplePercent);
    AvatarFailoverSnapshot snapshot = new AvatarFailoverSnapshot(
        super.namesystem.getOpenFiles(), stat);
    DataOutputStream out = new DataOutputStream(
        new BufferedOutputStream(new FileOutputStream(snapshotFile)))
    try {
      snapshot.write(out);
      out.writeBoolean(enableTestFrameworkFsck);
      if (enableTestFrameworkFsck) {
        Text.writeString(out, fsck);
      }
    } finally {
View Full Code Here

Examples of org.apache.hadoop.hdfs.AvatarFailoverSnapshot

      LOG.info("Failover: Test framework - disabled");
      return;
    }
    String fsck = "";
    LOG.info("Failover: Test framework - verification - starting...");
    AvatarFailoverSnapshot snapshot = new AvatarFailoverSnapshot();
    File snapshotFile = getSnapshotFile(confg, false);
    if (snapshotFile == null)
      return;
    DataInputStream in = new DataInputStream(
        new BufferedInputStream(new FileInputStream(snapshotFile)));
    try {
      snapshot.readFields(in);
      if (in.readBoolean()) {
        LOG.info("Failover: Test framework - found fsck data");
        fsck = Text.readString(in);
      }
    } finally {
      in.close();
    }
   
    LOG.info("Failover: Test framework - verifying open files: found "
        + snapshot.getOpenFilesInfo().getOpenFiles().size()
        + " files in the test snapshot")
    verifyOpenFiles(snapshot.getOpenFilesInfo());
   
    LOG.info("Failover: Test framework - verifying closed files: found "
        + snapshot.getSampledFiles().size()
        + " files in the test snapshot");   
    for (FileStatusExtended stat : snapshot.getSampledFiles()) {
      verifySnapshotSampledFile(stat);
    }

    LOG.info("Failover: Test framework - verification - succeeded");
    this.oldPrimaryFsck = fsck;
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.