You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2015/05/04 20:39:23 UTC

[1/6] accumulo git commit: ACCUMULO-3589 Check tables for existence at end of shell command.

Repository: accumulo
Updated Branches:
  refs/heads/1.6 a506c0bed -> 2b168f819
  refs/heads/1.7 12366d4e6 -> 0bbc67594
  refs/heads/master 5e15913d9 -> ca02e85d1


ACCUMULO-3589 Check tables for existence at end of shell command.

We were checking tables provided to the DUCommand to early which
caused us to miss the existence check on some of the ways that
users can specify tables.

Signed-off-by: Josh Elser <el...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/2b168f81
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/2b168f81
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/2b168f81

Branch: refs/heads/1.6
Commit: 2b168f819f8dfa865785fd644e6bfa82722ff4d0
Parents: a506c0b
Author: Tristen Georgiou <tr...@gmail.com>
Authored: Mon May 4 13:50:42 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon May 4 13:53:04 2015 -0400

----------------------------------------------------------------------
 .../accumulo/core/util/shell/commands/DUCommand.java   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/2b168f81/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
index 5c0a486..d0ee908 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
@@ -44,11 +44,7 @@ public class DUCommand extends Command {
     final SortedSet<String> tables = new TreeSet<String>(Arrays.asList(cl.getArgs()));
 
     if (cl.hasOption(Shell.tableOption)) {
-      String tableName = cl.getOptionValue(Shell.tableOption);
-      if (!shellState.getConnector().tableOperations().exists(tableName)) {
-        throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
-      }
-      tables.add(tableName);
+      tables.add(cl.getOptionValue(Shell.tableOption));
     }
 
     if (cl.hasOption(optNamespace.getOpt())) {
@@ -73,6 +69,13 @@ public class DUCommand extends Command {
       tables.add(shellState.getTableName());
     }
 
+    // sanity check...make sure the user-specified tables exist
+    for (String tableName : tables) {
+      if (!shellState.getConnector().tableOperations().exists(tableName)) {
+        throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
+      }
+    }
+
     try {
       String valueFormat = prettyPrint ? "%9s" : "%,24d";
       for (DiskUsage usage : shellState.getConnector().tableOperations().getDiskUsage(tables)) {


[4/6] accumulo git commit: Merge branch '1.6' into 1.7

Posted by el...@apache.org.
Merge branch '1.6' into 1.7

Conflicts:
	shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0bbc6759
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0bbc6759
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0bbc6759

Branch: refs/heads/master
Commit: 0bbc67594b25954ed2cb3a2f04e45789a1c7691c
Parents: 12366d4 2b168f8
Author: Josh Elser <el...@apache.org>
Authored: Mon May 4 14:09:31 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon May 4 14:09:31 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/shell/commands/DUCommand.java  | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0bbc6759/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
----------------------------------------------------------------------
diff --cc shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
index 3e851d4,0000000..2adcc81
mode 100644,000000..100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
@@@ -1,126 -1,0 +1,129 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one or more
 + * contributor license agreements.  See the NOTICE file distributed with
 + * this work for additional information regarding copyright ownership.
 + * The ASF licenses this file to You under the Apache License, Version 2.0
 + * (the "License"); you may not use this file except in compliance with
 + * the License.  You may obtain a copy of the License at
 + *
 + *     http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + */
 +package org.apache.accumulo.shell.commands;
 +
 +import java.io.IOException;
 +import java.util.Arrays;
 +import java.util.SortedSet;
 +import java.util.TreeSet;
 +
 +import org.apache.accumulo.core.client.Instance;
 +import org.apache.accumulo.core.client.NamespaceNotFoundException;
 +import org.apache.accumulo.core.client.TableNotFoundException;
 +import org.apache.accumulo.core.client.admin.DiskUsage;
 +import org.apache.accumulo.core.client.impl.Namespaces;
 +import org.apache.accumulo.core.util.NumUtil;
 +import org.apache.accumulo.shell.Shell;
 +import org.apache.accumulo.shell.Shell.Command;
 +import org.apache.accumulo.shell.ShellOptions;
 +import org.apache.commons.cli.CommandLine;
 +import org.apache.commons.cli.Option;
 +import org.apache.commons.cli.Options;
 +
 +public class DUCommand extends Command {
 +
 +  private Option optTablePattern, optHumanReadble, optNamespace;
 +
 +  @Override
 +  public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws IOException, TableNotFoundException,
 +      NamespaceNotFoundException {
 +
 +    final SortedSet<String> tables = new TreeSet<String>(Arrays.asList(cl.getArgs()));
 +
 +    if (cl.hasOption(ShellOptions.tableOption)) {
-       String tableName = cl.getOptionValue(ShellOptions.tableOption);
-       if (!shellState.getConnector().tableOperations().exists(tableName)) {
-         throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
-       }
-       tables.add(tableName);
++      tables.add(cl.getOptionValue(ShellOptions.tableOption));
 +    }
 +
 +    if (cl.hasOption(optNamespace.getOpt())) {
 +      Instance instance = shellState.getInstance();
 +      String namespaceId = Namespaces.getNamespaceId(instance, cl.getOptionValue(optNamespace.getOpt()));
 +      tables.addAll(Namespaces.getTableNames(instance, namespaceId));
 +    }
 +
 +    boolean prettyPrint = cl.hasOption(optHumanReadble.getOpt()) ? true : false;
 +
 +    // Add any patterns
 +    if (cl.hasOption(optTablePattern.getOpt())) {
 +      for (String table : shellState.getConnector().tableOperations().list()) {
 +        if (table.matches(cl.getOptionValue(optTablePattern.getOpt()))) {
 +          tables.add(table);
 +        }
 +      }
 +    }
 +
 +    // If we didn't get any tables, and we have a table selected, add the current table
 +    if (tables.isEmpty() && !shellState.getTableName().isEmpty()) {
 +      tables.add(shellState.getTableName());
 +    }
 +
++    // sanity check...make sure the user-specified tables exist
++    for (String tableName : tables) {
++      if (!shellState.getConnector().tableOperations().exists(tableName)) {
++        throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
++      }
++    }
++
 +    try {
 +      String valueFormat = prettyPrint ? "%9s" : "%,24d";
 +      for (DiskUsage usage : shellState.getConnector().tableOperations().getDiskUsage(tables)) {
 +        Object value = prettyPrint ? NumUtil.bigNumberForSize(usage.getUsage()) : usage.getUsage();
 +        shellState.getReader().println(String.format(valueFormat + " %s", value, usage.getTables()));
 +      }
 +    } catch (Exception ex) {
 +      throw new RuntimeException(ex);
 +    }
 +    return 0;
 +  }
 +
 +  @Override
 +  public String description() {
 +    return "prints how much space, in bytes, is used by files referenced by a table.  "
 +        + "When multiple tables are specified it prints how much space, in bytes, is used by files shared between tables, if any.";
 +  }
 +
 +  @Override
 +  public Options getOptions() {
 +    final Options o = new Options();
 +
 +    optTablePattern = new Option("p", "pattern", true, "regex pattern of table names");
 +    optTablePattern.setArgName("pattern");
 +
 +    optHumanReadble = new Option("h", "human-readable", false, "format large sizes to human readable units");
 +    optHumanReadble.setArgName("human readable output");
 +
 +    optNamespace = new Option(ShellOptions.namespaceOption, "namespace", true, "name of a namespace");
 +    optNamespace.setArgName("namespace");
 +
 +    o.addOption(OptUtil.tableOpt("table to examine"));
 +
 +    o.addOption(optTablePattern);
 +    o.addOption(optHumanReadble);
 +    o.addOption(optNamespace);
 +
 +    return o;
 +  }
 +
 +  @Override
 +  public String usage() {
 +    return getName() + " <table>{ <table>}";
 +  }
 +
 +  @Override
 +  public int numArgs() {
 +    return Shell.NO_FIXED_ARG_LENGTH_CHECK;
 +  }
 +}


[3/6] accumulo git commit: ACCUMULO-3589 Check tables for existence at end of shell command.

Posted by el...@apache.org.
ACCUMULO-3589 Check tables for existence at end of shell command.

We were checking tables provided to the DUCommand to early which
caused us to miss the existence check on some of the ways that
users can specify tables.

Signed-off-by: Josh Elser <el...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/2b168f81
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/2b168f81
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/2b168f81

Branch: refs/heads/master
Commit: 2b168f819f8dfa865785fd644e6bfa82722ff4d0
Parents: a506c0b
Author: Tristen Georgiou <tr...@gmail.com>
Authored: Mon May 4 13:50:42 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon May 4 13:53:04 2015 -0400

----------------------------------------------------------------------
 .../accumulo/core/util/shell/commands/DUCommand.java   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/2b168f81/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
index 5c0a486..d0ee908 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
@@ -44,11 +44,7 @@ public class DUCommand extends Command {
     final SortedSet<String> tables = new TreeSet<String>(Arrays.asList(cl.getArgs()));
 
     if (cl.hasOption(Shell.tableOption)) {
-      String tableName = cl.getOptionValue(Shell.tableOption);
-      if (!shellState.getConnector().tableOperations().exists(tableName)) {
-        throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
-      }
-      tables.add(tableName);
+      tables.add(cl.getOptionValue(Shell.tableOption));
     }
 
     if (cl.hasOption(optNamespace.getOpt())) {
@@ -73,6 +69,13 @@ public class DUCommand extends Command {
       tables.add(shellState.getTableName());
     }
 
+    // sanity check...make sure the user-specified tables exist
+    for (String tableName : tables) {
+      if (!shellState.getConnector().tableOperations().exists(tableName)) {
+        throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
+      }
+    }
+
     try {
       String valueFormat = prettyPrint ? "%9s" : "%,24d";
       for (DiskUsage usage : shellState.getConnector().tableOperations().getDiskUsage(tables)) {


[6/6] accumulo git commit: Merge branch '1.7'

Posted by el...@apache.org.
Merge branch '1.7'


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ca02e85d
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ca02e85d
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ca02e85d

Branch: refs/heads/master
Commit: ca02e85d11b332edaef72cc64789cad9b73ceaba
Parents: 5e15913 0bbc675
Author: Josh Elser <el...@apache.org>
Authored: Mon May 4 14:39:12 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon May 4 14:39:12 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/shell/commands/DUCommand.java  | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[5/6] accumulo git commit: Merge branch '1.6' into 1.7

Posted by el...@apache.org.
Merge branch '1.6' into 1.7

Conflicts:
	shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0bbc6759
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0bbc6759
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0bbc6759

Branch: refs/heads/1.7
Commit: 0bbc67594b25954ed2cb3a2f04e45789a1c7691c
Parents: 12366d4 2b168f8
Author: Josh Elser <el...@apache.org>
Authored: Mon May 4 14:09:31 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon May 4 14:09:31 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/shell/commands/DUCommand.java  | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0bbc6759/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
----------------------------------------------------------------------
diff --cc shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
index 3e851d4,0000000..2adcc81
mode 100644,000000..100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
@@@ -1,126 -1,0 +1,129 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one or more
 + * contributor license agreements.  See the NOTICE file distributed with
 + * this work for additional information regarding copyright ownership.
 + * The ASF licenses this file to You under the Apache License, Version 2.0
 + * (the "License"); you may not use this file except in compliance with
 + * the License.  You may obtain a copy of the License at
 + *
 + *     http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + */
 +package org.apache.accumulo.shell.commands;
 +
 +import java.io.IOException;
 +import java.util.Arrays;
 +import java.util.SortedSet;
 +import java.util.TreeSet;
 +
 +import org.apache.accumulo.core.client.Instance;
 +import org.apache.accumulo.core.client.NamespaceNotFoundException;
 +import org.apache.accumulo.core.client.TableNotFoundException;
 +import org.apache.accumulo.core.client.admin.DiskUsage;
 +import org.apache.accumulo.core.client.impl.Namespaces;
 +import org.apache.accumulo.core.util.NumUtil;
 +import org.apache.accumulo.shell.Shell;
 +import org.apache.accumulo.shell.Shell.Command;
 +import org.apache.accumulo.shell.ShellOptions;
 +import org.apache.commons.cli.CommandLine;
 +import org.apache.commons.cli.Option;
 +import org.apache.commons.cli.Options;
 +
 +public class DUCommand extends Command {
 +
 +  private Option optTablePattern, optHumanReadble, optNamespace;
 +
 +  @Override
 +  public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws IOException, TableNotFoundException,
 +      NamespaceNotFoundException {
 +
 +    final SortedSet<String> tables = new TreeSet<String>(Arrays.asList(cl.getArgs()));
 +
 +    if (cl.hasOption(ShellOptions.tableOption)) {
-       String tableName = cl.getOptionValue(ShellOptions.tableOption);
-       if (!shellState.getConnector().tableOperations().exists(tableName)) {
-         throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
-       }
-       tables.add(tableName);
++      tables.add(cl.getOptionValue(ShellOptions.tableOption));
 +    }
 +
 +    if (cl.hasOption(optNamespace.getOpt())) {
 +      Instance instance = shellState.getInstance();
 +      String namespaceId = Namespaces.getNamespaceId(instance, cl.getOptionValue(optNamespace.getOpt()));
 +      tables.addAll(Namespaces.getTableNames(instance, namespaceId));
 +    }
 +
 +    boolean prettyPrint = cl.hasOption(optHumanReadble.getOpt()) ? true : false;
 +
 +    // Add any patterns
 +    if (cl.hasOption(optTablePattern.getOpt())) {
 +      for (String table : shellState.getConnector().tableOperations().list()) {
 +        if (table.matches(cl.getOptionValue(optTablePattern.getOpt()))) {
 +          tables.add(table);
 +        }
 +      }
 +    }
 +
 +    // If we didn't get any tables, and we have a table selected, add the current table
 +    if (tables.isEmpty() && !shellState.getTableName().isEmpty()) {
 +      tables.add(shellState.getTableName());
 +    }
 +
++    // sanity check...make sure the user-specified tables exist
++    for (String tableName : tables) {
++      if (!shellState.getConnector().tableOperations().exists(tableName)) {
++        throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
++      }
++    }
++
 +    try {
 +      String valueFormat = prettyPrint ? "%9s" : "%,24d";
 +      for (DiskUsage usage : shellState.getConnector().tableOperations().getDiskUsage(tables)) {
 +        Object value = prettyPrint ? NumUtil.bigNumberForSize(usage.getUsage()) : usage.getUsage();
 +        shellState.getReader().println(String.format(valueFormat + " %s", value, usage.getTables()));
 +      }
 +    } catch (Exception ex) {
 +      throw new RuntimeException(ex);
 +    }
 +    return 0;
 +  }
 +
 +  @Override
 +  public String description() {
 +    return "prints how much space, in bytes, is used by files referenced by a table.  "
 +        + "When multiple tables are specified it prints how much space, in bytes, is used by files shared between tables, if any.";
 +  }
 +
 +  @Override
 +  public Options getOptions() {
 +    final Options o = new Options();
 +
 +    optTablePattern = new Option("p", "pattern", true, "regex pattern of table names");
 +    optTablePattern.setArgName("pattern");
 +
 +    optHumanReadble = new Option("h", "human-readable", false, "format large sizes to human readable units");
 +    optHumanReadble.setArgName("human readable output");
 +
 +    optNamespace = new Option(ShellOptions.namespaceOption, "namespace", true, "name of a namespace");
 +    optNamespace.setArgName("namespace");
 +
 +    o.addOption(OptUtil.tableOpt("table to examine"));
 +
 +    o.addOption(optTablePattern);
 +    o.addOption(optHumanReadble);
 +    o.addOption(optNamespace);
 +
 +    return o;
 +  }
 +
 +  @Override
 +  public String usage() {
 +    return getName() + " <table>{ <table>}";
 +  }
 +
 +  @Override
 +  public int numArgs() {
 +    return Shell.NO_FIXED_ARG_LENGTH_CHECK;
 +  }
 +}


[2/6] accumulo git commit: ACCUMULO-3589 Check tables for existence at end of shell command.

Posted by el...@apache.org.
ACCUMULO-3589 Check tables for existence at end of shell command.

We were checking tables provided to the DUCommand to early which
caused us to miss the existence check on some of the ways that
users can specify tables.

Signed-off-by: Josh Elser <el...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/2b168f81
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/2b168f81
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/2b168f81

Branch: refs/heads/1.7
Commit: 2b168f819f8dfa865785fd644e6bfa82722ff4d0
Parents: a506c0b
Author: Tristen Georgiou <tr...@gmail.com>
Authored: Mon May 4 13:50:42 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon May 4 13:53:04 2015 -0400

----------------------------------------------------------------------
 .../accumulo/core/util/shell/commands/DUCommand.java   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/2b168f81/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
index 5c0a486..d0ee908 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DUCommand.java
@@ -44,11 +44,7 @@ public class DUCommand extends Command {
     final SortedSet<String> tables = new TreeSet<String>(Arrays.asList(cl.getArgs()));
 
     if (cl.hasOption(Shell.tableOption)) {
-      String tableName = cl.getOptionValue(Shell.tableOption);
-      if (!shellState.getConnector().tableOperations().exists(tableName)) {
-        throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
-      }
-      tables.add(tableName);
+      tables.add(cl.getOptionValue(Shell.tableOption));
     }
 
     if (cl.hasOption(optNamespace.getOpt())) {
@@ -73,6 +69,13 @@ public class DUCommand extends Command {
       tables.add(shellState.getTableName());
     }
 
+    // sanity check...make sure the user-specified tables exist
+    for (String tableName : tables) {
+      if (!shellState.getConnector().tableOperations().exists(tableName)) {
+        throw new TableNotFoundException(tableName, tableName, "specified table that doesn't exist");
+      }
+    }
+
     try {
       String valueFormat = prettyPrint ? "%9s" : "%,24d";
       for (DiskUsage usage : shellState.getConnector().tableOperations().getDiskUsage(tables)) {