Repository: accumulo Updated Branches: refs/heads/1.6.0-SNAPSHOT b9bc5e259 -> bd970de81
ACCUMULO-2421 Add table name to error message Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bd970de8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bd970de8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bd970de8 Branch: refs/heads/1.6.0-SNAPSHOT Commit: bd970de81567f4bcc363fe29bb109153d97a8947 Parents: b9bc5e2 Author: Christopher Tubbs <ctubb...@apache.org> Authored: Thu Feb 27 13:36:22 2014 -0500 Committer: Christopher Tubbs <ctubb...@apache.org> Committed: Thu Feb 27 13:48:52 2014 -0500 ---------------------------------------------------------------------- .../apache/accumulo/core/client/impl/Tables.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/bd970de8/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java index 404aa32..5988bda 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java @@ -275,7 +275,7 @@ public class Tables { public static Pair<String,String> qualify(String tableName, String defaultNamespace) { if (!tableName.matches(Tables.VALID_NAME_REGEX)) - throw new IllegalArgumentException("Improper table name format"); + throw new IllegalArgumentException("Invalid table name '" + tableName + "'"); if (MetadataTable.OLD_NAME.equals(tableName)) tableName = MetadataTable.NAME; if (tableName.contains(".")) { @@ -287,22 +287,26 @@ public class Tables { /** * Returns the namespace id for a given table ID. - * @param instance The Accumulo Instance - * @param tableId The tableId + * + * @param instance + * The Accumulo Instance + * @param tableId + * The tableId * @return The namespace id which this table resides in. - * @throws IllegalArgumentException if the table doesn't exist in ZooKeeper + * @throws IllegalArgumentException + * if the table doesn't exist in ZooKeeper */ public static String getNamespaceId(Instance instance, String tableId) throws IllegalArgumentException { ArgumentChecker.notNull(instance, tableId); - + ZooCache zc = getZooCache(instance); byte[] n = zc.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_NAMESPACE); - + // We might get null out of ZooCache if this tableID doesn't exist if (null == n) { throw new IllegalArgumentException("Table with id " + tableId + " does not exist"); } - + return new String(n, Constants.UTF8); }