Examples of HFileLink


Examples of org.apache.hadoop.hbase.io.HFileLink

     * if the file is not found.
     */
    private FSDataInputStream openSourceFile(Context context, final Path path) throws IOException {
      try {
        if (HFileLink.isHFileLink(path) || StoreFileInfo.isReference(path)) {
          return new HFileLink(inputRoot, inputArchive, path).open(inputFs);
        } else if (isHLogLinkPath(path)) {
          String serverName = path.getParent().getName();
          String logName = path.getName();
          return new HLogLink(inputRoot, serverName, logName).open(inputFs);
        }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HFileLink

    }

    private FileStatus getSourceFileStatus(Context context, final Path path) throws IOException {
      try {
        if (HFileLink.isHFileLink(path) || StoreFileInfo.isReference(path)) {
          HFileLink link = new HFileLink(inputRoot, inputArchive, path);
          return link.getFileStatus(inputFs);
        } else if (isHLogLinkPath(path)) {
          String serverName = path.getParent().getName();
          String logName = path.getName();
          return new HLogLink(inputRoot, serverName, logName).getFileStatus(inputFs);
        }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HFileLink

    this.fileStatus = fileStatus;
    Path p = fileStatus.getPath();
    if (HFileLink.isHFileLink(p)) {
      // HFileLink
      this.reference = null;
      this.link = new HFileLink(conf, p);
      if (LOG.isTraceEnabled()) LOG.trace(p + " is a link");
    } else if (isReference(p)) {
      this.reference = Reference.read(fs, p);
      Path referencePath = getReferredToFile(p);
      if (HFileLink.isHFileLink(referencePath)) {
        // HFileLink Reference
        this.link = new HFileLink(conf, referencePath);
      } else {
        // Reference
        this.link = null;
      }
      if (LOG.isTraceEnabled()) LOG.trace(p + " is a " + reference.getFileRegion() +
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HFileLink

    final ArrayList corruptedFiles = new ArrayList();
    SnapshotReferenceUtil.visitTableStoreFiles(fs, snapshotDir, new FSVisitor.StoreFileVisitor() {
      public void storeFile (final String region, final String family, final String hfile)
          throws IOException {
        HFileLink link = HFileLink.create(util.getConfiguration(), table, region, family, hfile);
        if (corruptedFiles.size() % 2 == 0) {
          fs.delete(link.getAvailablePath(fs));
          corruptedFiles.add(hfile);
        }
      }
    });
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HFileLink

    SnapshotReferenceUtil.visitReferencedFiles(fs, snapshotDir,
      new SnapshotReferenceUtil.FileVisitor() {
        public void storeFile (final String region, final String family, final String hfile)
            throws IOException {
          Path path = HFileLink.createPath(table, region, family, hfile);
          long size = new HFileLink(conf, path).getFileStatus(fs).getLen();
          files.add(new Pair<Path, Long>(path, size));
        }

        public void recoveredEdits (final String region, final String logfile)
            throws IOException {
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HFileLink

    Path outPath = new Path(familyDir, refLink + '.' + clonedRegionName);

    // Create the new reference
    Path linkPath = new Path(familyDir,
      HFileLink.createHFileLinkName(snapshotTable, regionInfo.getEncodedName(), hfileName));
    InputStream in = new HFileLink(conf, linkPath).open(fs);
    OutputStream out = fs.create(outPath);
    IOUtils.copyBytes(in, out, conf);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HFileLink

     */
    FileInfo addStoreFile(final String region, final String family, final String hfile)
          throws IOException {
      TableName table = snapshotTable;
      Path path = new Path(family, HFileLink.createHFileLinkName(table, region, hfile));
      HFileLink link = new HFileLink(conf, path);
      boolean inArchive = false;
      long size = -1;
      try {
        if ((inArchive = fs.exists(link.getArchivePath()))) {
          size = fs.getFileStatus(link.getArchivePath()).getLen();
          hfileArchiveSize += size;
          hfileArchiveCount++;
        } else {
          size = link.getFileStatus(fs).getLen();
          hfileSize += size;
          hfilesCount++;
        }
      } catch (FileNotFoundException e) {
        hfilesMissing++;
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HFileLink

    SnapshotReferenceUtil.visitReferencedFiles(fs, snapshotDir,
      new SnapshotReferenceUtil.FileVisitor() {
        public void storeFile (final String region, final String family, final String hfile)
            throws IOException {
          Path path = new Path(family, HFileLink.createHFileLinkName(table, region, hfile));
          long size = new HFileLink(conf, path).getFileStatus(fs).getLen();
          files.add(new Pair<Path, Long>(path, size));
        }

        public void recoveredEdits (final String region, final String logfile)
            throws IOException {
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HFileLink

    }

    private FSDataInputStream openSourceFile(final Path path) {
      try {
        if (HFileLink.isHFileLink(path) || StoreFileInfo.isReference(path)) {
          return new HFileLink(inputRoot, inputArchive, path).open(inputFs);
        } else if (isHLogLinkPath(path)) {
          String serverName = path.getParent().getName();
          String logName = path.getName();
          return new HLogLink(inputRoot, serverName, logName).open(inputFs);
        }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.HFileLink

    }

    private FileStatus getFileStatus(final FileSystem fs, final Path path) {
      try {
        if (HFileLink.isHFileLink(path) || StoreFileInfo.isReference(path)) {
          HFileLink link = new HFileLink(inputRoot, inputArchive, path);
          return link.getFileStatus(fs);
        } else if (isHLogLinkPath(path)) {
          String serverName = path.getParent().getName();
          String logName = path.getName();
          return new HLogLink(inputRoot, serverName, logName).getFileStatus(fs);
        }
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.