accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch 2.0 updated: Fix #418 Javadoc updated with workaround for createIfNotExists (#1178)
Date Wed, 05 Jun 2019 16:55:02 GMT
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch 2.0
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.0 by this push:
     new 639f04c  Fix #418 Javadoc updated with workaround for createIfNotExists (#1178)
639f04c is described below

commit 639f04cdf4f21db7e078d1f5669805bcb33a59ea
Author: hkeebler <49656678+hkeebler@users.noreply.github.com>
AuthorDate: Wed Jun 5 12:54:56 2019 -0400

    Fix #418 Javadoc updated with workaround for createIfNotExists (#1178)
    
    includes comment cleanup
---
 .../core/client/admin/NamespaceOperations.java     | 11 ++++++++++-
 .../core/client/admin/TableOperations.java         | 22 +++++++++++++++++++++-
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/NamespaceOperations.java
b/core/src/main/java/org/apache/accumulo/core/client/admin/NamespaceOperations.java
index f2d0c98..0bfd84e 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/NamespaceOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/NamespaceOperations.java
@@ -84,7 +84,16 @@ public interface NamespaceOperations {
 
   /**
    * Create an empty namespace with no initial configuration. Valid names for a namespace
contain
-   * letters, numbers, and the underscore character.
+   * letters, numbers, and the underscore character. A safe way to ignore namespaces that
do exist
+   * would be to do something like the following:
+   *
+   * <pre>
+   * try {
+   *   connector.namespaceOperations().create("mynamespace");
+   * } catch (NamespaceExistsException e) {
+   *   // ignore or log
+   * }
+   * </pre>
    *
    * @param namespace
    *          the name of the namespace
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
index ffe370c..0e645a3 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
@@ -66,7 +66,16 @@ public interface TableOperations {
   boolean exists(String tableName);
 
   /**
-   * Create a table with no special configuration
+   * Create a table with no special configuration. A safe way to ignore tables that do something
+   * like the following:
+   *
+   * <pre>
+   * try {
+   *   connector.tableOperations().create("mynamespace.mytable");
+   * } catch (TableExistsException e) {
+   *   // ignore or log
+   * }
+   * </pre>
    *
    * @param tableName
    *          the name of the table
@@ -131,6 +140,17 @@ public interface TableOperations {
   }
 
   /**
+   * Create a table with specified configuration. A safe way to ignore tables that do exist
would be
+   * to do something like the following:
+   *
+   * <pre>
+   * try {
+   *   connector.tableOperations().create("mynamespace.mytable");
+   * } catch (TableExistsException e) {
+   *   // ignore or log
+   * }
+   * </pre>
+   *
    * @param tableName
    *          the name of the table
    * @param ntc


Mime
View raw message