org.apache.hadoop.hbase.TableName.getNameWithNamespaceInclAsString()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中org.apache.hadoop.hbase.TableName.getNameWithNamespaceInclAsString()方法的一些代码示例,展示了TableName.getNameWithNamespaceInclAsString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableName.getNameWithNamespaceInclAsString()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.TableName
类名称:TableName
方法名:getNameWithNamespaceInclAsString

TableName.getNameWithNamespaceInclAsString介绍

[英]Ideally, getNameAsString should contain namespace within it, but if the namespace is default, it just returns the name. This method takes care of this corner case.
[中]理想情况下,getNameAsString应该包含名称空间,但如果名称空间是默认名称空间,则只返回名称。这种方法可以解决这个问题。

代码示例

代码示例来源:origin: apache/hbase

/**
 * @return a description of the operation
 */
protected String getDescription() {
 return "Operation: " + getOperationType() + ", " + "Table Name: " +
  tableName.getNameWithNamespaceInclAsString() + ", procId: " + procId;
}

代码示例来源:origin: apache/hbase

String getDescription() {
 return "Operation: " + getOperationType() + ", " + "Table Name: "
   + tableName.getNameWithNamespaceInclAsString();
}

代码示例来源:origin: apache/hbase

@Override
 public boolean checkState(int tries) throws IOException {
  try {
   if (getAdmin().isTableAvailable(tableName)) {
    return true;
   }
  } catch (TableNotFoundException tnfe) {
   LOG.debug("Table " + tableName.getNameWithNamespaceInclAsString()
     + " was not enabled, sleeping. tries=" + tries);
  }
  return false;
 }
});

代码示例来源:origin: apache/hbase

public String toContextString() {
 StringBuilder sb = new StringBuilder();
 String familiesString = toFamiliesString(families, family, qualifier);
 sb.append("(user=")
   .append(user != null ? user.getName() : "UNKNOWN")
   .append(", ");
 sb.append("scope=")
   .append(namespace != null ? namespace :
     table == null ? "GLOBAL" : table.getNameWithNamespaceInclAsString())
   .append(", ");
 if(namespace == null && familiesString.length() > 0) {
  sb.append("family=")
   .append(familiesString)
   .append(", ");
 }
 String paramsString = params.toString();
 if(paramsString.length() > 0) {
  sb.append("params=[")
    .append(paramsString)
    .append("],");
 }
 sb.append("action=")
   .append(action != null ? action.toString() : "")
   .append(")");
 return sb.toString();
}

代码示例来源:origin: apache/hbase

@Override
public String toString() {
 String familiesString = toFamiliesString(families, family, qualifier);
 String[] params = new String[] {
   namespace != null ? "namespace=" + namespace : null,
   tableName != null ? "table=" + tableName.getNameWithNamespaceInclAsString() : null,
   familiesString.length() > 0 ? "family=" + familiesString : null,
   extraParams.isEmpty() ? null : concatenateExtraParams()
 };
 return Joiner.on(",").skipNulls().join(params);
}

代码示例来源:origin: apache/hbase

tableInfo.getRegionLocator().getName().getNameWithNamespaceInclAsString():
 tableInfo.getRegionLocator().getName().getNameAsString();
allTableNames.add(tn);

代码示例来源:origin: apache/hbase

String tableName = table.getNameWithNamespaceInclAsString();
List<Pair<byte[], List<String>>> familyHFilePathsList = bulkLoadHFileMap.get(tableName);
if (familyHFilePathsList != null) {

代码示例来源:origin: apache/hbase

@Test
public void testAccessControlClientUserPerms() throws Exception {
 final TableName tableName = TableName.valueOf(name.getMethodName());
 createTestTable(tableName);
 try {
  final String regex = tableName.getNameWithNamespaceInclAsString();
  User testUserPerms = User.createUserForTesting(conf, "testUserPerms", new String[0]);
  assertEquals(0, testUserPerms.runAs(getPrivilegedAction(regex)).size());
  // Grant TABLE ADMIN privs to testUserPerms
  grantOnTable(TEST_UTIL, testUserPerms.getShortName(), tableName, null, null, Action.ADMIN);
  List<UserPermission> perms = testUserPerms.runAs(getPrivilegedAction(regex));
  assertNotNull(perms);
  // Superuser, testUserPerms
  assertEquals(2, perms.size());
 } finally {
  deleteTable(TEST_UTIL, tableName);
 }
}

代码示例来源:origin: apache/phoenix

public String authString(String user, TableName table, Set<Action> actions) {
  StringBuilder sb = new StringBuilder();
  sb.append(" (user=").append(user != null ? user : "UNKNOWN").append(", ");
  sb.append("scope=").append(table == null ? "GLOBAL" : table.getNameWithNamespaceInclAsString()).append(", ");
  sb.append(actions.size() > 1 ? "actions=" : "action=").append(actions != null ? actions.toString() : "")
      .append(")");
  return sb.toString();
}

代码示例来源:origin: org.apache.hbase/hbase-client

/**
 * @return a description of the operation
 */
protected String getDescription() {
 return "Operation: " + getOperationType() + ", " + "Table Name: " +
  tableName.getNameWithNamespaceInclAsString() + ", procId: " + procId;
}

代码示例来源:origin: org.apache.hbase/hbase-client

String getDescription() {
 return "Operation: " + getOperationType() + ", " + "Table Name: "
   + tableName.getNameWithNamespaceInclAsString();
}

代码示例来源:origin: org.apache.hbase/hbase-client

@Override
 public boolean checkState(int tries) throws IOException {
  try {
   if (getAdmin().isTableAvailable(tableName)) {
    return true;
   }
  } catch (TableNotFoundException tnfe) {
   LOG.debug("Table " + tableName.getNameWithNamespaceInclAsString()
     + " was not enabled, sleeping. tries=" + tries);
  }
  return false;
 }
});

代码示例来源:origin: apache/phoenix

Set<TableDescriptor> tableDescriptorsToSynchronize = new HashSet<>();
for (TableDescriptor origTableDesc : admin.listTableDescriptors()) {
  if (MetaDataUtil.isViewIndex(origTableDesc.getTableName().getNameWithNamespaceInclAsString())) {

代码示例来源:origin: org.apache.phoenix/phoenix-core

public String authString(String user, TableName table, Set<Action> actions) {
  StringBuilder sb = new StringBuilder();
  sb.append(" (user=").append(user != null ? user : "UNKNOWN").append(", ");
  sb.append("scope=").append(table == null ? "GLOBAL" : table.getNameWithNamespaceInclAsString()).append(", ");
  sb.append(actions.size() > 1 ? "actions=" : "action=").append(actions != null ? actions.toString() : "")
      .append(")");
  return sb.toString();
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

public String authString(String user, TableName table, Set<Action> actions) {
  StringBuilder sb = new StringBuilder();
  sb.append(" (user=").append(user != null ? user : "UNKNOWN").append(", ");
  sb.append("scope=").append(table == null ? "GLOBAL" : table.getNameWithNamespaceInclAsString()).append(", ");
  sb.append(actions.size() > 1 ? "actions=" : "action=").append(actions != null ? actions.toString() : "")
      .append(")");
  return sb.toString();
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

/**
 * @return a description of the operation
 */
protected String getDescription() {
 return "Operation: " + getOperationType() + ", "
   + "Table Name: " + tableName.getNameWithNamespaceInclAsString();
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

String getDescription() {
 return "Operation: " + getOperationType() + ", " + "Table Name: "
   + tableName.getNameWithNamespaceInclAsString();
}

代码示例来源:origin: harbby/presto-connectors

public String toString() {
 String familiesString = toFamiliesString(families, family, qualifier);
 String[] params = new String[] {
   namespace != null ? "namespace=" + namespace : null,
   tableName != null ? "table=" + tableName.getNameWithNamespaceInclAsString() : null,
   familiesString.length() > 0 ? "family=" + familiesString : null
 };
 return Joiner.on(",").skipNulls().join(params);
}

代码示例来源:origin: org.apache.atlas/hbase-bridge

private void deleteTableInstance(HBaseOperationContext hbaseOperationContext) {
  TableName tableName     = hbaseOperationContext.getTableName();
  String    nameSpaceName = tableName.getNamespaceAsString();
  if (nameSpaceName == null) {
    nameSpaceName = tableName.getNameWithNamespaceInclAsString();
  }
  String        tableNameStr = tableName.getNameAsString();
  String        tableQName   = getTableQualifiedName(clusterName, nameSpaceName, tableNameStr);
  AtlasObjectId tableId      = new AtlasObjectId(HBaseDataTypes.HBASE_TABLE.getName(), REFERENCEABLE_ATTRIBUTE_NAME, tableQName);
  LOG.info("Delete Table {}", tableQName);
  hbaseOperationContext.addMessage(new EntityDeleteRequestV2(hbaseOperationContext.getUser(), Collections.singletonList(tableId)));
}

代码示例来源:origin: apache/atlas

private void deleteTableInstance(HBaseOperationContext hbaseOperationContext) {
  TableName tableName     = hbaseOperationContext.getTableName();
  String    nameSpaceName = tableName.getNamespaceAsString();
  if (nameSpaceName == null) {
    nameSpaceName = tableName.getNameWithNamespaceInclAsString();
  }
  String        tableNameStr = tableName.getNameAsString();
  String        tableQName   = getTableQualifiedName(clusterName, nameSpaceName, tableNameStr);
  AtlasObjectId tableId      = new AtlasObjectId(HBaseDataTypes.HBASE_TABLE.getName(), REFERENCEABLE_ATTRIBUTE_NAME, tableQName);
  LOG.info("Delete Table {}", tableQName);
  hbaseOperationContext.addMessage(new EntityDeleteRequestV2(hbaseOperationContext.getUser(), Collections.singletonList(tableId)));
}

相关文章