Package org.apache.hadoop.hbase.snapshot

Examples of org.apache.hadoop.hbase.snapshot.ExportSnapshotException


    // The snapshot references must be copied before the files otherwise the files gets removed
    // by the HFileArchiver, since they have no references.
    try {
      if (!runCopyJob(inputRoot, outputRoot, files, verifyChecksum,
          filesUser, filesGroup, filesMode, mappers)) {
        throw new ExportSnapshotException("Snapshot export failed!");
      }

      // Step 3 - Rename fs2:/.snapshot/.tmp/<snapshot> fs2:/.snapshot/<snapshot>
      if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {
        System.err.println("Snapshot export failed!");
View Full Code Here


    // Run the MR Job
    if (!job.waitForCompletion(true)) {
      // TODO: Replace the fixed string with job.getStatus().getFailureInfo()
      // when it will be available on all the supported versions.
      throw new ExportSnapshotException("Copy Files Map-Reduce Job failed");
    }
  }
View Full Code Here

    // will remove them because they are unreferenced.
    try {
      LOG.info("Copy Snapshot Manifest");
      FileUtil.copy(inputFs, snapshotDir, outputFs, initialOutputSnapshotDir, false, false, conf);
    } catch (IOException e) {
      throw new ExportSnapshotException("Failed to copy the snapshot directory: from=" +
        snapshotDir + " to=" + initialOutputSnapshotDir, e);
    }

    // Write a new .snapshotinfo if the target name is different from the source name
    if (!targetName.equals(snapshotName)) {
      SnapshotDescription snapshotDesc =
        SnapshotDescriptionUtils.readSnapshotInfo(inputFs, snapshotDir)
          .toBuilder()
          .setName(targetName)
          .build();
      SnapshotDescriptionUtils.writeSnapshotInfo(snapshotDesc, snapshotTmpDir, outputFs);
    }

    // Step 2 - Start MR Job to copy files
    // The snapshot references must be copied before the files otherwise the files gets removed
    // by the HFileArchiver, since they have no references.
    try {
      if (files.size() == 0) {
        LOG.warn("There are 0 store file to be copied. There may be no data in the table.");
      } else {
        runCopyJob(inputRoot, outputRoot, files, verifyChecksum,
                   filesUser, filesGroup, filesMode, mappers);
      }

      // Step 3 - Rename fs2:/.snapshot/.tmp/<snapshot> fs2:/.snapshot/<snapshot>
      if (!skipTmp) {
        // Step 3 - Rename fs2:/.snapshot/.tmp/<snapshot> fs2:/.snapshot/<snapshot>
        if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {
          throw new ExportSnapshotException("Unable to rename snapshot directory from=" +
            snapshotTmpDir + " to=" + outputSnapshotDir);
        }
      }

      LOG.info("Export Completed: " + targetName);
View Full Code Here

    // Run the MR Job
    if (!job.waitForCompletion(true)) {
      // TODO: Replace the fixed string with job.getStatus().getFailureInfo()
      // when it will be available on all the supported versions.
      throw new ExportSnapshotException("Copy Files Map-Reduce Job failed");
    }
  }
View Full Code Here

    // The snapshot references must be copied before the hfiles otherwise the cleaner
    // will remove them because they are unreferenced.
    try {
      FileUtil.copy(inputFs, snapshotDir, outputFs, snapshotTmpDir, false, false, conf);
    } catch (IOException e) {
      throw new ExportSnapshotException("Failed to copy the snapshot directory: from=" +
        snapshotDir + " to=" + snapshotTmpDir);
    }

    // Step 2 - Start MR Job to copy files
    // The snapshot references must be copied before the files otherwise the files gets removed
    // by the HFileArchiver, since they have no references.
    try {
      if (files.size() == 0) {
        LOG.warn("There are 0 store file to be copied. There may be no data in the table.");
      } else {
        runCopyJob(inputRoot, outputRoot, files, verifyChecksum,
                   filesUser, filesGroup, filesMode, mappers);
      }

      // Step 3 - Rename fs2:/.snapshot/.tmp/<snapshot> fs2:/.snapshot/<snapshot>
      if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {
        throw new ExportSnapshotException("Unable to rename snapshot directory from=" +
          snapshotTmpDir + " to=" + outputSnapshotDir);
      }
      return 0;
    } catch (Exception e) {
      LOG.error("Snapshot export failed", e);
View Full Code Here

      if (files.size() == 0) {
        LOG.warn("There are 0 store file to be copied. There may be no data in the table.");
      } else {
        if (!runCopyJob(inputRoot, outputRoot, files, verifyChecksum,
            filesUser, filesGroup, filesMode, mappers)) {
          throw new ExportSnapshotException("Snapshot export failed!");
        }
      }

      // Step 3 - Rename fs2:/.snapshot/.tmp/<snapshot> fs2:/.snapshot/<snapshot>
      if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {
View Full Code Here

      if (files.size() == 0) {
        LOG.warn("There are 0 store file to be copied. There may be no data in the table.");
      } else {
        if (!runCopyJob(inputRoot, outputRoot, files, verifyChecksum,
            filesUser, filesGroup, filesMode, mappers)) {
          throw new ExportSnapshotException("Snapshot export failed!");
        }
      }

      // Step 3 - Rename fs2:/.snapshot/.tmp/<snapshot> fs2:/.snapshot/<snapshot>
      if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {
View Full Code Here

      if (files.size() == 0) {
        LOG.warn("There are 0 store file to be copied. There may be no data in the table.");
      } else {
        if (!runCopyJob(inputRoot, outputRoot, files, verifyChecksum,
            filesUser, filesGroup, filesMode, mappers)) {
          throw new ExportSnapshotException("Snapshot export failed!");
        }
      }

      // Step 3 - Rename fs2:/.snapshot/.tmp/<snapshot> fs2:/.snapshot/<snapshot>
      if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {
View Full Code Here

      if (files.size() == 0) {
        LOG.warn("There are 0 store file to be copied. There may be no data in the table.");
      } else {
        if (!runCopyJob(inputRoot, outputRoot, files, verifyChecksum,
            filesUser, filesGroup, filesMode, mappers)) {
          throw new ExportSnapshotException("Snapshot export failed!");
        }
      }

      // Step 3 - Rename fs2:/.snapshot/.tmp/<snapshot> fs2:/.snapshot/<snapshot>
      if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {
View Full Code Here

    // Run the MR Job
    if (!job.waitForCompletion(true)) {
      // TODO: Replace the fixed string with job.getStatus().getFailureInfo()
      // when it will be available on all the supported versions.
      throw new ExportSnapshotException("Copy Files Map-Reduce Job failed");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.snapshot.ExportSnapshotException

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.