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

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

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

TableName.isLegalFullyQualifiedTableName介绍

[英]Check passed byte array, "tableName", is legal user-space table name.
[中]检查传递的字节数组“tableName”是否为合法的用户空间表名。

代码示例

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

private TableName parseTable(String msg) {
 // ... TableNotFoundException: '<table>'/n...
 Pattern p = Pattern.compile("TableNotFoundException: '([\\S]*)'");
 Matcher m = p.matcher(msg);
 if (m.find()) {
  String table = m.group(1);
  try {
   // double check that table is a valid table name
   TableName.valueOf(TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(table)));
   return TableName.valueOf(table);
  } catch (IllegalArgumentException ignore) {
  }
 }
 return null;
}

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

@Override
public void deleteSnapshot(final String snapshotName) throws IOException {
 // make sure the snapshot is possibly valid
 TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(snapshotName));
 // do the delete
 executeCallable(new MasterCallable<Void>(getConnection(), getRpcControllerFactory()) {
  @Override
  protected Void rpcCall() throws Exception {
   master.deleteSnapshot(getRpcController(),
    DeleteSnapshotRequest.newBuilder().setSnapshot(
       SnapshotProtos.SnapshotDescription.newBuilder().setName(snapshotName).build())
      .build()
   );
   return null;
  }
 });
}

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

@Test
public void testLegalTableNames() {
 for (String tn : legalTableNames) {
  TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
 }
}

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

@Test
public void testLegalHTableNames() {
 for (String tn : legalTableNames) {
  TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
 }
}

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

@Test
public void testLegalHTableNames() {
 for (String tn : legalTableNames) {
  TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
 }
}

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

@Test
public void testIllegalZooKeeperName() {
 for (String name : Arrays.asList("zookeeper", "ns:zookeeper", "zookeeper:table")) {
  try {
   TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(name));
   fail("invalid tablename " + name + " should have failed");
  } catch (Exception e) {
   // expected
  }
 }
}

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

@Test(expected = IllegalArgumentException.class)
public void testInvalidNamespace() {
 for (String tn : invalidNamespace) {
  TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
  fail("invalid namespace " + tn
    + " should have failed with IllegalArgumentException for namespace");
 }
}

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

@Test(expected = IllegalArgumentException.class)
public void testEmptyTableName() {
 for (String tn : emptyNames) {
  TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
  fail("invalid tablename " + tn + " should have failed with IllegalArgumentException");
 }
}

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

@Test
public void testIllegalHTableNames() {
 for (String tn : illegalTableNames) {
  try {
   TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
   fail("invalid tablename " + tn + " should have failed");
  } catch (Exception e) {
   // expected
  }
 }
}

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

@Test
public void testIllegalTableNames() {
 for (String tn : illegalTableNames) {
  try {
   TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
   fail("invalid tablename " + tn + " should have failed");
  } catch (Exception e) {
   // expected
  }
 }
}

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

@Test
public void testIllegalHTableNames() {
 for (String tn : illegalTableNames) {
  try {
   TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
   fail("invalid tablename " + tn + " should have failed");
  } catch (Exception e) {
   // expected
  }
 }
}

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

@Override
public Future<Void> disableTableAsync(final TableName tableName) throws IOException {
 TableName.isLegalFullyQualifiedTableName(tableName.getName());
 DisableTableResponse response = executeCallable(
  new MasterCallable<DisableTableResponse>(getConnection(), getRpcControllerFactory()) {
   Long nonceGroup = ng.getNonceGroup();
   Long nonce = ng.newNonce();
   @Override
   protected DisableTableResponse rpcCall() throws Exception {
    setPriority(tableName);
    LOG.info("Started disable of " + tableName);
    DisableTableRequest req =
      RequestConverter.buildDisableTableRequest(
       tableName, nonceGroup, nonce);
    return master.disableTable(getRpcController(), req);
   }
  });
 return new DisableTableFuture(this, tableName, response);
}

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

@Override
public Future<Void> enableTableAsync(final TableName tableName) throws IOException {
 TableName.isLegalFullyQualifiedTableName(tableName.getName());
 EnableTableResponse response = executeCallable(
  new MasterCallable<EnableTableResponse>(getConnection(), getRpcControllerFactory()) {
   Long nonceGroup = ng.getNonceGroup();
   Long nonce = ng.newNonce();
   @Override
   protected EnableTableResponse rpcCall() throws Exception {
    setPriority(tableName);
    LOG.info("Started enable of " + tableName);
    EnableTableRequest req =
      RequestConverter.buildEnableTableRequest(tableName, nonceGroup, nonce);
    return master.enableTable(getRpcController(),req);
   }
  });
 return new EnableTableFuture(this, tableName, response);
}

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

@Test
public void testLegalHTableNames() {
 for (String tn : legalTableNames) {
  TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
 }
}

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

@Override
public void deleteSnapshot(final String snapshotName) throws IOException {
 // make sure the snapshot is possibly valid
 TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(snapshotName));
 // do the delete
 executeCallable(new MasterCallable<Void>(getConnection(), getRpcControllerFactory()) {
  @Override
  protected Void rpcCall() throws Exception {
   master.deleteSnapshot(getRpcController(),
    DeleteSnapshotRequest.newBuilder().setSnapshot(
       SnapshotProtos.SnapshotDescription.newBuilder().setName(snapshotName).build())
      .build()
   );
   return null;
  }
 });
}

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

@Test
public void testLegalTableNames() {
 for (String tn : legalTableNames) {
  TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
 }
}

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

@Test
public void testIllegalZooKeeperName() {
 for (String name : Arrays.asList("zookeeper", "ns:zookeeper", "zookeeper:table")) {
  try {
   TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(name));
   fail("invalid tablename " + name + " should have failed");
  } catch (Exception e) {
   // expected
  }
 }
}

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

@Test
public void testIllegalTableNames() {
 for (String tn : illegalTableNames) {
  try {
   TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
   fail("invalid tablename " + tn + " should have failed");
  } catch (Exception e) {
   // expected
  }
 }
}

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

@Test
public void testIllegalHTableNames() {
 for (String tn : illegalTableNames) {
  try {
   TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
   fail("invalid tablename " + tn + " should have failed");
  } catch (Exception e) {
   // expected
  }
 }
}

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

@Override
public Future<Void> enableTableAsync(final TableName tableName) throws IOException {
 TableName.isLegalFullyQualifiedTableName(tableName.getName());
 EnableTableResponse response = executeCallable(
  new MasterCallable<EnableTableResponse>(getConnection(), getRpcControllerFactory()) {
   Long nonceGroup = ng.getNonceGroup();
   Long nonce = ng.newNonce();
   @Override
   protected EnableTableResponse rpcCall() throws Exception {
    setPriority(tableName);
    LOG.info("Started enable of " + tableName);
    EnableTableRequest req =
      RequestConverter.buildEnableTableRequest(tableName, nonceGroup, nonce);
    return master.enableTable(getRpcController(),req);
   }
  });
 return new EnableTableFuture(this, tableName, response);
}

相关文章