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


Java FSTableDescriptors.createTableDescriptorForTableDirectory方法代码示例

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


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

示例1: call

import org.apache.hadoop.hbase.util.FSTableDescriptors; //导入方法依赖的package包/类
@Override
public Void call() throws Exception {
  LOG.debug("Running table info copy.");
  this.rethrowException();
  LOG.debug("Attempting to copy table info for snapshot:"
      + SnapshotDescriptionUtils.toString(this.snapshot));
  // get the HTable descriptor
  HTableDescriptor orig = FSTableDescriptors.getTableDescriptor(fs, rootDir,
    Bytes.toBytes(this.snapshot.getTable()));
  this.rethrowException();
  // write a copy of descriptor to the snapshot directory
  Path snapshotDir = SnapshotDescriptionUtils.getWorkingSnapshotDir(snapshot, rootDir);
  FSTableDescriptors.createTableDescriptorForTableDirectory(fs, snapshotDir, orig, false);
  LOG.debug("Finished copying tableinfo.");
  return null;
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:17,代码来源:TableInfoCopyTask.java

示例2: copyTableRegionInfo

import org.apache.hadoop.hbase.util.FSTableDescriptors; //导入方法依赖的package包/类
/**
 * copy out Table RegionInfo into incremental backup image need to consider move this logic into
 * HBackupFileSystem
 * @param conn connection
 * @param backupInfo backup info
 * @param conf configuration
 * @throws IOException exception
 */
public static void copyTableRegionInfo(Connection conn, BackupInfo backupInfo, Configuration conf)
        throws IOException {
  Path rootDir = FSUtils.getRootDir(conf);
  FileSystem fs = rootDir.getFileSystem(conf);

  // for each table in the table set, copy out the table info and region
  // info files in the correct directory structure
  for (TableName table : backupInfo.getTables()) {
    if (!MetaTableAccessor.tableExists(conn, table)) {
      LOG.warn("Table " + table + " does not exists, skipping it.");
      continue;
    }
    TableDescriptor orig = FSTableDescriptors.getTableDescriptorFromFs(fs, rootDir, table);

    // write a copy of descriptor to the target directory
    Path target = new Path(backupInfo.getTableBackupDir(table));
    FileSystem targetFs = target.getFileSystem(conf);
    FSTableDescriptors descriptors =
        new FSTableDescriptors(conf, targetFs, FSUtils.getRootDir(conf));
    descriptors.createTableDescriptorForTableDirectory(target, orig, false);
    LOG.debug("Attempting to copy table info for:" + table + " target: " + target
        + " descriptor: " + orig);
    LOG.debug("Finished copying tableinfo.");
    List<RegionInfo> regions = MetaTableAccessor.getTableRegions(conn, table);
    // For each region, write the region info to disk
    LOG.debug("Starting to write region info for table " + table);
    for (RegionInfo regionInfo : regions) {
      Path regionDir =
          HRegion.getRegionDir(new Path(backupInfo.getTableBackupDir(table)), regionInfo);
      regionDir = new Path(backupInfo.getTableBackupDir(table), regionDir.getName());
      writeRegioninfoOnFilesystem(conf, targetFs, regionDir, regionInfo);
    }
    LOG.debug("Finished writing region info for table " + table);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:44,代码来源:BackupUtils.java


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