mikewalch opened a new issue #418: Add createIfNotExists method to 
table/namespace operations
URL: https://github.com/apache/accumulo/issues/418
 
 
   Currently, if you want to create a namespace or table in Accumulo that may 
already exists, you need to try to create it and ignore the exception.
   
   ```java 
     try {
         connector.namespaceOperations().create("mynamespace");
       } catch (NamespaceExistsException e) {
         // ignore
       }
   
       try {
         connector.tableOperations().create("mynamespace.mytable");
       } catch (TableExistsException e) {
         // ignore
       }
   ```
   
   It would be nice if a `createIfNotExists` method was added to the API that 
ignored this exception. This would simplify the above code to the following:
   
   ```java
   connector.namespaceOperations().createIfNotExists("mynamespace");
   connector.tableOperations().createIfNotExists("mynamespace.mytable");
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to