當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。