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


Java HTableDescriptor.getNameAsString方法代码示例

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


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

示例1: verifyTableInfo

import org.apache.hadoop.hbase.HTableDescriptor; //导入方法依赖的package包/类
/**
 * Check that the table descriptor for the snapshot is a valid table descriptor
 * @param manifest snapshot manifest to inspect
 */
private void verifyTableInfo(final SnapshotManifest manifest) throws IOException {
  HTableDescriptor htd = manifest.getTableDescriptor();
  if (htd == null) {
    throw new CorruptedSnapshotException("Missing Table Descriptor", snapshot);
  }

  if (!htd.getNameAsString().equals(snapshot.getTable())) {
    throw new CorruptedSnapshotException("Invalid Table Descriptor. Expected "
      + snapshot.getTable() + " name, got " + htd.getNameAsString(), snapshot);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:16,代码来源:MasterSnapshotVerifier.java

示例2: add

import org.apache.hadoop.hbase.HTableDescriptor; //导入方法依赖的package包/类
/**
 * Adds (or updates) the table descriptor to the FileSystem
 * and updates the local cache with it.
 */
@Override
public void add(HTableDescriptor htd) throws IOException {
  if (fsreadonly) {
    throw new NotImplementedException("Cannot add a table descriptor - in read only mode");
  }
  if (TableName.META_TABLE_NAME.equals(htd.getTableName())) {
    throw new NotImplementedException();
  }
  if (HConstants.HBASE_NON_USER_TABLE_DIRS.contains(htd.getTableName().getNameAsString())) {
    throw new NotImplementedException(
      "Cannot add a table descriptor for a reserved subdirectory name: " + htd.getNameAsString());
  }
  updateTableDescriptor(htd);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:FSTableDescriptors.java

示例3: listReplicated

import org.apache.hadoop.hbase.HTableDescriptor; //导入方法依赖的package包/类
/**
 * Find all column families that are replicated from this cluster
 * @return the full list of the replicated column families of this cluster as:
 *        tableName, family name, replicationType
 *
 * Currently replicationType is Global. In the future, more replication
 * types may be extended here. For example
 *  1) the replication may only apply to selected peers instead of all peers
 *  2) the replicationType may indicate the host Cluster servers as Slave
 *     for the table:columnFam.
 */
public List<HashMap<String, String>> listReplicated() throws IOException {
  List<HashMap<String, String>> replicationColFams = new ArrayList<HashMap<String, String>>();

  Admin admin = connection.getAdmin();
  HTableDescriptor[] tables;
  try {
    tables = admin.listTables();
  } finally {
    if (admin!= null) admin.close();
  }

  for (HTableDescriptor table : tables) {
    HColumnDescriptor[] columns = table.getColumnFamilies();
    String tableName = table.getNameAsString();
    for (HColumnDescriptor column : columns) {
      if (column.getScope() != HConstants.REPLICATION_SCOPE_LOCAL) {
        // At this moment, the columfam is replicated to all peers
        HashMap<String, String> replicationEntry = new HashMap<String, String>();
        replicationEntry.put(TNAME, tableName);
        replicationEntry.put(CFNAME, column.getNameAsString());
        replicationEntry.put(REPLICATIONTYPE, REPLICATIONGLOBAL);
        replicationColFams.add(replicationEntry);
      }
    }
  }

  return replicationColFams;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:40,代码来源:ReplicationAdmin.java


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