本文整理汇总了Java中org.apache.hadoop.hbase.TableName.isLegalFullyQualifiedTableName方法的典型用法代码示例。如果您正苦于以下问题:Java TableName.isLegalFullyQualifiedTableName方法的具体用法?Java TableName.isLegalFullyQualifiedTableName怎么用?Java TableName.isLegalFullyQualifiedTableName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.TableName
的用法示例。
在下文中一共展示了TableName.isLegalFullyQualifiedTableName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enableTableAsyncV2
import org.apache.hadoop.hbase.TableName; //导入方法依赖的package包/类
/**
* Enable the table but does not block and wait for it be completely enabled.
* You can use Future.get(long, TimeUnit) to wait on the operation to complete.
* It may throw ExecutionException if there was an error while executing the operation
* or TimeoutException in case the wait timeout was not long enough to allow the
* operation to complete.
*
* @param tableName name of table to delete
* @throws IOException if a remote or network exception occurs
* @return the result of the async enable. You can use Future.get(long, TimeUnit)
* to wait on the operation to complete.
*/
// TODO: This should be called Async but it will break binary compatibility
private Future<Void> enableTableAsyncV2(final TableName tableName) throws IOException {
TableName.isLegalFullyQualifiedTableName(tableName.getName());
EnableTableResponse response = executeCallable(
new MasterCallable<EnableTableResponse>(getConnection()) {
@Override
public EnableTableResponse call(int callTimeout) throws ServiceException {
PayloadCarryingRpcController controller = rpcControllerFactory.newController();
controller.setCallTimeout(callTimeout);
controller.setPriority(tableName);
LOG.info("Started enable of " + tableName);
EnableTableRequest req =
RequestConverter.buildEnableTableRequest(tableName, ng.getNonceGroup(),ng.newNonce());
return master.enableTable(controller,req);
}
});
return new EnableTableFuture(this, tableName, response);
}
示例2: disableTableAsyncV2
import org.apache.hadoop.hbase.TableName; //导入方法依赖的package包/类
/**
* Disable the table but does not block and wait for it be completely disabled.
* You can use Future.get(long, TimeUnit) to wait on the operation to complete.
* It may throw ExecutionException if there was an error while executing the operation
* or TimeoutException in case the wait timeout was not long enough to allow the
* operation to complete.
*
* @param tableName name of table to delete
* @throws IOException if a remote or network exception occurs
* @return the result of the async disable. You can use Future.get(long, TimeUnit)
* to wait on the operation to complete.
*/
// TODO: This should be called Async but it will break binary compatibility
private Future<Void> disableTableAsyncV2(final TableName tableName) throws IOException {
TableName.isLegalFullyQualifiedTableName(tableName.getName());
DisableTableResponse response = executeCallable(
new MasterCallable<DisableTableResponse>(getConnection()) {
@Override
public DisableTableResponse call(int callTimeout) throws ServiceException {
PayloadCarryingRpcController controller = rpcControllerFactory.newController();
controller.setCallTimeout(callTimeout);
controller.setPriority(tableName);
LOG.info("Started disable of " + tableName);
DisableTableRequest req =
RequestConverter.buildDisableTableRequest(
tableName, ng.getNonceGroup(), ng.newNonce());
return master.disableTable(controller, req);
}
});
return new DisableTableFuture(this, tableName, response);
}
示例3: deleteSnapshot
import org.apache.hadoop.hbase.TableName; //导入方法依赖的package包/类
/**
* Delete an existing snapshot.
* @param snapshotName name of the snapshot
* @throws IOException if a remote or network exception occurs
*/
@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()) {
@Override
public Void call(int callTimeout) throws ServiceException {
PayloadCarryingRpcController controller = rpcControllerFactory.newController();
controller.setCallTimeout(callTimeout);
master.deleteSnapshot(controller,
DeleteSnapshotRequest.newBuilder().
setSnapshot(SnapshotDescription.newBuilder().setName(snapshotName).build()).build()
);
return null;
}
});
}
示例4: testInvalidNamespace
import org.apache.hadoop.hbase.TableName; //导入方法依赖的package包/类
@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");
}
}
示例5: testEmptyTableName
import org.apache.hadoop.hbase.TableName; //导入方法依赖的package包/类
@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");
}
}
示例6: testIllegalHTableNames
import org.apache.hadoop.hbase.TableName; //导入方法依赖的package包/类
@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
}
}
}
示例7: testLegalHTableNames
import org.apache.hadoop.hbase.TableName; //导入方法依赖的package包/类
@Test
public void testLegalHTableNames() {
for (String tn : legalTableNames) {
TableName.isLegalFullyQualifiedTableName(Bytes.toBytes(tn));
}
}