/** * Lookup table ID in ZK. Throw TableNotFoundException if not found. Also wraps * NamespaceNotFoundException in TableNotFoundException if namespace is not found. */ public static Table.ID getTableId(ClientContext context, String tableName) throws TableNotFoundException { try { return _getTableId(context, tableName); } catch (NamespaceNotFoundException e) { throw new TableNotFoundException(tableName, e); } }
public static Table.ID checkTableId(ClientContext context, String tableName, TableOperation operation) throws ThriftTableOperationException { TableOperationExceptionType reason = null; try { return Tables._getTableId(context, tableName); } catch (NamespaceNotFoundException e) { reason = TableOperationExceptionType.NAMESPACE_NOTFOUND; } catch (TableNotFoundException e) { reason = TableOperationExceptionType.NOTFOUND; } throw new ThriftTableOperationException(null, tableName, operation, reason, null); }