Examples of HFileLink


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

     * @return the store file information
     */
    FileInfo addStoreFile(final String region, final String family, final String hfile)
          throws IOException {
      String table = this.snapshot.getTable();
      HFileLink link = HFileLink.create(conf, table, region, family, hfile);
      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

      hfilesStatus = fs.listStatus(storeHomeDir);

      for (FileStatus hfileStatus : hfilesStatus) {
        Path p = hfileStatus.getPath();
        if (HFileLink.isHFileLink(p)) {
          hfileStatus = new HFileLink(conf, p).getFileStatus(fs);
        } else if (StoreFile.isReference(p)) {
          p = StoreFile.getReferredToFile(p);
          if (HFileLink.isHFileLink(p)) {
            hfileStatus = new HFileLink(conf, p).getFileStatus(fs);
          } else {
            hfileStatus = fs.getFileStatus(p);
          }
        }
        HDFSBlocksDistribution storeFileBlocksDistribution =
View Full Code Here

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

      hfilesStatus = fs.listStatus(storeHomeDir);

      for (FileStatus hfileStatus : hfilesStatus) {
        Path p = hfileStatus.getPath();
        if (HFileLink.isHFileLink(p)) {
          hfileStatus = new HFileLink(conf, p).getFileStatus(fs);
        } else if (StoreFile.isReference(p)) {
          p = StoreFile.getReferredToFile(p);
          if (HFileLink.isHFileLink(p)) {
            hfileStatus = new HFileLink(conf, p).getFileStatus(fs);
          } else {
            hfileStatus = fs.getFileStatus(p);
          }
        }
        HDFSBlocksDistribution storeFileBlocksDistribution =
View Full Code Here

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

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

    // Create the new reference
    InputStream in;
    if (linkPath != null) {
      in = new HFileLink(conf, linkPath).open(fs);
    } else {
      linkPath = new Path(new Path(HRegion.getRegionDir(snapshotDir, regionInfo.getEncodedName()),
                      familyDir.getName()), hfileName);
      in = fs.open(linkPath);
    }
View Full Code Here

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

    this.dataBlockEncoder =
        dataBlockEncoder == null ? NoOpDataBlockEncoder.INSTANCE
            : dataBlockEncoder;

    if (HFileLink.isHFileLink(p)) {
      this.link = new HFileLink(conf, p);
      LOG.debug("Store file " + p + " is a link");
    } else if (isReference(p)) {
      this.reference = Reference.read(fs, p);
      this.referencePath = getReferredToFile(this.path);
      if (HFileLink.isHFileLink(this.referencePath)) {
        this.link = new HFileLink(conf, this.referencePath);
      }
      LOG.debug("Store file " + p + " is a " + reference.getFileRegion() +
        " reference to " + this.referencePath);
    } else if (!isHFile(p)) {
      throw new IOException("path=" + path + " doesn't look like a valid StoreFile");
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) || StoreFile.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) || StoreFile.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

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

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

    // Create the new reference
    InputStream in;
    if (linkPath != null) {
      in = new HFileLink(conf, linkPath).open(fs);
    } else {
      linkPath = new Path(new Path(HRegion.getRegionDir(snapshotDir, regionInfo.getEncodedName()),
                      familyDir.getName()), hfileName);
      in = fs.open(linkPath);
    }
View Full Code Here

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

     * @return the store file information
     */
    FileInfo addStoreFile(final String region, final String family, final String hfile)
          throws IOException {
      TableName table = snapshotTable;
      HFileLink link = HFileLink.create(conf, table, region, family, hfile);
      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
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.