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


Java Store.getStorefiles方法代码示例

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


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

示例1: addRegion

import org.apache.hadoop.hbase.regionserver.Store; //导入方法依赖的package包/类
/**
 * Creates a 'manifest' for the specified region, by reading directly from the HRegion object.
 * This is used by the "online snapshot" when the table is enabled.
 */
public void addRegion(final HRegion region) throws IOException {
  // 0. Get the ManifestBuilder/RegionVisitor
  RegionVisitor visitor = createRegionVisitor(desc);

  // 1. dump region meta info into the snapshot directory
  LOG.debug("Storing '" + region + "' region-info for snapshot.");
  Object regionData = visitor.regionOpen(region.getRegionInfo());
  monitor.rethrowException();

  // 2. iterate through all the stores in the region
  LOG.debug("Creating references for hfiles");

  for (Store store : region.getStores()) {
    // 2.1. build the snapshot reference for the store
    Object familyData = visitor.familyOpen(regionData, store.getFamily().getName());
    monitor.rethrowException();

    List<StoreFile> storeFiles = new ArrayList<StoreFile>(store.getStorefiles());
    if (LOG.isDebugEnabled()) {
      LOG.debug("Adding snapshot references for " + storeFiles  + " hfiles");
    }

    // 2.2. iterate through all the store's files and create "references".
    for (int i = 0, sz = storeFiles.size(); i < sz; i++) {
      StoreFile storeFile = storeFiles.get(i);
      monitor.rethrowException();

      // create "reference" to this store file.
      LOG.debug("Adding reference for file (" + (i+1) + "/" + sz + "): " + storeFile.getPath());
      visitor.storeFile(regionData, familyData, storeFile.getFileInfo());
    }
    visitor.familyClose(regionData, familyData);
  }
  visitor.regionClose(regionData);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:40,代码来源:SnapshotManifest.java

示例2: testFlushedFileWithVisibilityTags

import org.apache.hadoop.hbase.regionserver.Store; //导入方法依赖的package包/类
@Test
public void testFlushedFileWithVisibilityTags() throws Exception {
  final byte[] qual2 = Bytes.toBytes("qual2");
  TableName tableName = TableName.valueOf(TEST_NAME.getMethodName());
  HTableDescriptor desc = new HTableDescriptor(tableName);
  HColumnDescriptor col = new HColumnDescriptor(fam);
  desc.addFamily(col);
  TEST_UTIL.getHBaseAdmin().createTable(desc);
  try (Table table = TEST_UTIL.getConnection().getTable(tableName)) {
    Put p1 = new Put(row1);
    p1.add(fam, qual, value);
    p1.setCellVisibility(new CellVisibility(CONFIDENTIAL));

    Put p2 = new Put(row1);
    p2.add(fam, qual2, value);
    p2.setCellVisibility(new CellVisibility(SECRET));

    RowMutations rm = new RowMutations(row1);
    rm.add(p1);
    rm.add(p2);

    table.mutateRow(rm);
  }
  TEST_UTIL.getHBaseAdmin().flush(tableName);
  List<HRegion> regions = TEST_UTIL.getHBaseCluster().getRegions(tableName);
  Store store = regions.get(0).getStore(fam);
  Collection<StoreFile> storefiles = store.getStorefiles();
  assertTrue(storefiles.size() > 0);
  for (StoreFile storeFile : storefiles) {
    assertTrue(storeFile.getReader().getHFileReader().getFileContext().isIncludesTags());
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:33,代码来源:TestVisibilityLabels.java

示例3: findStorefilePaths

import org.apache.hadoop.hbase.regionserver.Store; //导入方法依赖的package包/类
private List<Path> findStorefilePaths(TableName tableName) throws Exception {
  List<Path> paths = new ArrayList<Path>();
  for (Region region:
      TEST_UTIL.getRSForFirstRegionInTable(tableName).getOnlineRegions(htd.getTableName())) {
    for (Store store: region.getStores()) {
      for (StoreFile storefile: store.getStorefiles()) {
        paths.add(storefile.getPath());
      }
    }
  }
  return paths;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:TestHBaseFsckEncryption.java

示例4: addRegion

import org.apache.hadoop.hbase.regionserver.Store; //导入方法依赖的package包/类
/**
 * Creates a 'manifest' for the specified region, by reading directly from the HRegion object.
 * This is used by the "online snapshot" when the table is enabled.
 */
public void addRegion(final HRegion region) throws IOException {
  // 0. Get the ManifestBuilder/RegionVisitor
  RegionVisitor visitor = createRegionVisitor(desc);

  // 1. dump region meta info into the snapshot directory
  LOG.debug("Storing '" + region + "' region-info for snapshot.");
  Object regionData = visitor.regionOpen(region.getRegionInfo());
  monitor.rethrowException();

  // 2. iterate through all the stores in the region
  LOG.debug("Creating references for hfiles");

  for (Store store : region.getStores().values()) {
    // 2.1. build the snapshot reference for the store
    Object familyData = visitor.familyOpen(regionData, store.getFamily().getName());
    monitor.rethrowException();

    List<StoreFile> storeFiles = new ArrayList<StoreFile>(store.getStorefiles());
    if (LOG.isDebugEnabled()) {
      LOG.debug("Adding snapshot references for " + storeFiles  + " hfiles");
    }

    // 2.2. iterate through all the store's files and create "references".
    for (int i = 0, sz = storeFiles.size(); i < sz; i++) {
      StoreFile storeFile = storeFiles.get(i);
      monitor.rethrowException();

      // create "reference" to this store file.
      LOG.debug("Adding reference for file (" + (i+1) + "/" + sz + "): " + storeFile.getPath());
      visitor.storeFile(regionData, familyData, storeFile.getFileInfo());
    }
    visitor.familyClose(regionData, familyData);
  }
  visitor.regionClose(regionData);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:40,代码来源:SnapshotManifest.java

示例5: findStorefilePaths

import org.apache.hadoop.hbase.regionserver.Store; //导入方法依赖的package包/类
private List<Path> findStorefilePaths(TableName tableName) throws Exception {
  List<Path> paths = new ArrayList<Path>();
  for (HRegion region:
      TEST_UTIL.getRSForFirstRegionInTable(tableName).getOnlineRegions(htd.getTableName())) {
    for (Store store: region.getStores().values()) {
      for (StoreFile storefile: store.getStorefiles()) {
        paths.add(storefile.getPath());
      }
    }
  }
  return paths;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:13,代码来源:TestHBaseFsckEncryption.java

示例6: findStorefilePaths

import org.apache.hadoop.hbase.regionserver.Store; //导入方法依赖的package包/类
private List<Path> findStorefilePaths(byte[] tableName) throws Exception {
  List<Path> paths = new ArrayList<Path>();
  for (HRegion region:
      TEST_UTIL.getRSForFirstRegionInTable(tableName).getOnlineRegions(htd.getTableName())) {
    for (Store store: region.getStores().values()) {
      for (StoreFile storefile: store.getStorefiles()) {
        paths.add(storefile.getPath());
      }
    }
  }
  return paths;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:13,代码来源:TestHBaseFsckEncryption.java


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