当前位置: 首页>>代码示例>>Java>>正文


Java FSVisitor.visitTableStoreFiles方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.util.FSVisitor.visitTableStoreFiles方法的典型用法代码示例。如果您正苦于以下问题:Java FSVisitor.visitTableStoreFiles方法的具体用法?Java FSVisitor.visitTableStoreFiles怎么用?Java FSVisitor.visitTableStoreFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.util.FSVisitor的用法示例。


在下文中一共展示了FSVisitor.visitTableStoreFiles方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listHFileNames

import org.apache.hadoop.hbase.util.FSVisitor; //导入方法依赖的package包/类
/**
 * List all the HFiles in the given table
 *
 * @param fs: FileSystem where the table lives
 * @param tableDir directory of the table
 * @return array of the current HFiles in the table (could be a zero-length array)
 * @throws IOException on unexecpted error reading the FS
 */
public static ArrayList<String> listHFileNames(final FileSystem fs, final Path tableDir)
    throws IOException {
  final ArrayList<String> hfiles = new ArrayList<String>();
  FSVisitor.visitTableStoreFiles(fs, tableDir, new FSVisitor.StoreFileVisitor() {
    @Override
    public void storeFile(final String region, final String family, final String hfileName)
        throws IOException {
      hfiles.add(hfileName);
    }
  });
  Collections.sort(hfiles);
  return hfiles;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:22,代码来源:SnapshotTestingUtils.java

示例2: setupTable

import org.apache.hadoop.hbase.util.FSVisitor; //导入方法依赖的package包/类
private void setupTable(final TableName tableName) throws IOException {
  // load the table
  Table table = UTIL.createTable(tableName, FAMILY_NAME);
  try {
    rowCount = 0;
    byte[] value = new byte[1024];
    byte[] q = Bytes.toBytes("q");
    while (rowCount < NUM_ROWS) {
      Put put = new Put(Bytes.toBytes(String.format("%010d", rowCount)));
      put.setDurability(Durability.SKIP_WAL);
      put.add(FAMILY_NAME, q, value);
      table.put(put);

      if ((rowCount++ % ROW_PER_FILE) == 0) {
        // flush it
        ((HTable)table).flushCommits();
        UTIL.getHBaseAdmin().flush(tableName);
      }
    }
  } finally {
    UTIL.getHBaseAdmin().flush(tableName);
    table.close();
  }

  assertEquals(NUM_ROWS, rowCount);

  // get the store file paths
  storeFiles.clear();
  tableDir = FSUtils.getTableDir(getRootDir(), tableName);
  FSVisitor.visitTableStoreFiles(getFileSystem(), tableDir, new FSVisitor.StoreFileVisitor() {
    @Override
    public void storeFile(final String region, final String family, final String hfile)
        throws IOException {
      HFileLink link = HFileLink.build(UTIL.getConfiguration(), tableName, region, family, hfile);
      storeFiles.add(link.getOriginPath());
    }
  });
  assertTrue("Expected at least " + NUM_FILES + " store files", storeFiles.size() >= NUM_FILES);
  LOG.info("Store files: " + storeFiles);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:41,代码来源:TestCorruptedRegionStoreFile.java

示例3: listHFiles

import org.apache.hadoop.hbase.util.FSVisitor; //导入方法依赖的package包/类
/**
 * List all the HFiles in the given table
 *
 * @param fs: FileSystem where the table lives
 * @param tableDir directory of the table
 * @return array of the current HFiles in the table (could be a zero-length array)
 * @throws IOException on unexecpted error reading the FS
 */
public static Path[] listHFiles(final FileSystem fs, final Path tableDir)
    throws IOException {
  final ArrayList<Path> hfiles = new ArrayList<Path>();
  FSVisitor.visitTableStoreFiles(fs, tableDir, new FSVisitor.StoreFileVisitor() {
    public void storeFile(final String region, final String family, final String hfileName)
        throws IOException {
      hfiles.add(new Path(tableDir, new Path(region, new Path(family, hfileName))));
    }
  });
  return hfiles.toArray(new Path[hfiles.size()]);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:20,代码来源:SnapshotTestingUtils.java

示例4: listHFiles

import org.apache.hadoop.hbase.util.FSVisitor; //导入方法依赖的package包/类
/**
 * List all the HFiles in the given table
 *
 * @param fs: FileSystem where the table lives
 * @param tableDir directory of the table
 * @return array of the current HFiles in the table (could be a zero-length array)
 * @throws IOException on unexecpted error reading the FS
 */
public static Path[] listHFiles(final FileSystem fs, final Path tableDir)
    throws IOException {
  final ArrayList<Path> hfiles = new ArrayList<Path>();
  FSVisitor.visitTableStoreFiles(fs, tableDir, new FSVisitor.StoreFileVisitor() {
    @Override
    public void storeFile(final String region, final String family, final String hfileName)
        throws IOException {
      hfiles.add(new Path(tableDir, new Path(region, new Path(family, hfileName))));
    }
  });
  return hfiles.toArray(new Path[hfiles.size()]);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:21,代码来源:SnapshotTestingUtils.java

示例5: listHFileNames

import org.apache.hadoop.hbase.util.FSVisitor; //导入方法依赖的package包/类
/**
 * List all the HFiles in the given table
 *
 * @param fs: FileSystem where the table lives
 * @param tableDir directory of the table
 * @return array of the current HFiles in the table (could be a zero-length array)
 * @throws IOException on unexecpted error reading the FS
 */
public static ArrayList<String> listHFileNames(final FileSystem fs, final Path tableDir)
    throws IOException {
  final ArrayList<String> hfiles = new ArrayList<>();
  FSVisitor.visitTableStoreFiles(fs, tableDir, new FSVisitor.StoreFileVisitor() {
    @Override
    public void storeFile(final String region, final String family, final String hfileName)
        throws IOException {
      hfiles.add(hfileName);
    }
  });
  Collections.sort(hfiles);
  return hfiles;
}
 
开发者ID:apache,项目名称:hbase,代码行数:22,代码来源:SnapshotTestingUtils.java

示例6: visitTableStoreFiles

import org.apache.hadoop.hbase.util.FSVisitor; //导入方法依赖的package包/类
/**
 * Iterate over the snapshot store files
 *
 * @param fs {@link FileSystem}
 * @param snapshotDir {@link Path} to the Snapshot directory
 * @param visitor callback object to get the store files
 * @throws IOException if an error occurred while scanning the directory
 */
public static void visitTableStoreFiles(final FileSystem fs, final Path snapshotDir,
    final FSVisitor.StoreFileVisitor visitor) throws IOException {
  FSVisitor.visitTableStoreFiles(fs, snapshotDir, visitor);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:13,代码来源:SnapshotReferenceUtil.java


注:本文中的org.apache.hadoop.hbase.util.FSVisitor.visitTableStoreFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。