You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2013/12/05 00:58:13 UTC

[21/50] [abbrv] git commit: ACCUMULO-802 removed default initial properties from system namespace, plus minor documentation fixes

ACCUMULO-802 removed default initial properties from system namespace, plus minor documentation fixes


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

Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 5262bd501d1ba1a2bbb71009080fd1847e151f41
Parents: d10feb7
Author: Sean Hickey <ta...@gmail.com>
Authored: Mon Aug 12 09:37:42 2013 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Wed Dec 4 18:46:10 2013 -0500

----------------------------------------------------------------------
 .../client/TableNamespaceNotEmptyException.java    | 15 ++++++---------
 .../client/TableNamespaceNotFoundException.java    |  2 +-
 .../client/admin/TableNamespaceOperations.java     | 17 ++++++++++-------
 .../client/admin/TableNamespaceOperationsImpl.java | 11 +++++++----
 .../apache/accumulo/server/init/Initialize.java    | 16 +++++++++-------
 .../java/org/apache/accumulo/master/Master.java    |  4 +---
 6 files changed, 34 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/5262bd50/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotEmptyException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotEmptyException.java b/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotEmptyException.java
index 81ef03a..e333693 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotEmptyException.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotEmptyException.java
@@ -22,19 +22,16 @@ import org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException
  * Thrown when the table namespace specified contains tables
  */
 public class TableNamespaceNotEmptyException extends Exception {
-  /**
-   * Exception to throw if an operation is attempted on a table that doesn't exist.
-   * 
-   */
+
   private static final long serialVersionUID = 1L;
   
   private String namespace;
   
   /**
    * @param namespaceId
-   *          the internal id of the table namespace that was sought
+   *          the internal id of the table namespace
    * @param namespaceName
-   *          the visible name of the table namespace that was sought
+   *          the visible name of the table namespace
    * @param description
    *          the specific reason why it failed
    */
@@ -46,9 +43,9 @@ public class TableNamespaceNotEmptyException extends Exception {
   
   /**
    * @param namespaceId
-   *          the internal id of the table namespace that was sought
+   *          the internal id of the table namespace
    * @param namespaceName
-   *          the visible name of the table namespace that was sought
+   *          the visible name of the table namespace
    * @param description
    *          the specific reason why it failed
    * @param cause
@@ -68,7 +65,7 @@ public class TableNamespaceNotEmptyException extends Exception {
   }
   
   /**
-   * @return the name of the table namespace sought
+   * @return the name of the table namespace
    */
   public String getNamespaceName() {
     return namespace;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5262bd50/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotFoundException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotFoundException.java b/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotFoundException.java
index 3dd0740..30e63c3 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotFoundException.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/TableNamespaceNotFoundException.java
@@ -23,7 +23,7 @@ import org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException
  */
 public class TableNamespaceNotFoundException extends Exception {
   /**
-   * Exception to throw if an operation is attempted on a table that doesn't exist.
+   * Exception to throw if an operation is attempted on a table namespace that doesn't exist.
    * 
    */
   private static final long serialVersionUID = 1L;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5262bd50/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperations.java b/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperations.java
index 33f9dc0..136f79b 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperations.java
@@ -113,10 +113,11 @@ public interface TableNamespaceOperations {
    *           if the table namespace does not exist
    * @throws TableNamespaceNotEmptyException
    *           if the table namespaces still contains tables
-   * @throws TableNotFoundException 
+   * @throws TableNotFoundException
    *           if table not found while deleting
    */
-  public void delete(String namespace) throws AccumuloException, AccumuloSecurityException, TableNamespaceNotFoundException, TableNamespaceNotEmptyException, TableNotFoundException;
+  public void delete(String namespace) throws AccumuloException, AccumuloSecurityException, TableNamespaceNotFoundException, TableNamespaceNotEmptyException,
+      TableNotFoundException;
   
   /**
    * Delete a table namespace
@@ -133,7 +134,7 @@ public interface TableNamespaceOperations {
    *           if the table namespace does not exist
    * @throws TableNamespaceNotEmptyException
    *           if the table namespaces still contains tables
-   * @throws TableNotFoundException 
+   * @throws TableNotFoundException
    *           if table not found while deleting
    */
   public void delete(String namespace, boolean deleteTables) throws AccumuloException, AccumuloSecurityException, TableNamespaceNotFoundException,
@@ -159,7 +160,8 @@ public interface TableNamespaceOperations {
       TableNamespaceExistsException;
   
   /**
-   * Sets a property on a table namespace. Note that it may take a short period of time (a second) to propagate the change everywhere.
+   * Sets a property on a table namespace which applies to all tables in the namespace. Note that it may take a short period of time (a second) to propagate the
+   * change everywhere.
    * 
    * @param namespace
    *          the name of the table namespace
@@ -195,7 +197,7 @@ public interface TableNamespaceOperations {
    *          the name of the table namespace
    * @return all properties visible by this table (system and per-table properties). Note that recently changed properties may not be visible immediately.
    * @throws TableNamespaceNotFoundException
-   *           if the table does not exist
+   *           if the table namespace does not exist
    */
   public Iterable<Entry<String,String>> getProperties(String namespace) throws AccumuloException, TableNamespaceNotFoundException;
   
@@ -208,6 +210,7 @@ public interface TableNamespaceOperations {
    * @throws AccumuloSecurityException
    *           when the user does not have the proper permissions
    * @throws TableNamespaceNotFoundException
+   *           if the table namespace does not exist
    */
   public void offline(String namespace) throws AccumuloSecurityException, AccumuloException, TableNamespaceNotFoundException;
   
@@ -220,6 +223,7 @@ public interface TableNamespaceOperations {
    * @throws AccumuloSecurityException
    *           when the user does not have the proper permissions
    * @throws TableNamespaceNotFoundException
+   *           if the table namespace does not exist
    */
   public void online(String namespace) throws AccumuloSecurityException, AccumuloException, TableNamespaceNotFoundException;
   
@@ -279,7 +283,7 @@ public interface TableNamespaceOperations {
    * @param setting
    *          object specifying the properties of the iterator
    * @throws AccumuloSecurityException
-   *           thrown if the user does not have the ability to set properties on the table
+   *           thrown if the user does not have the ability to set properties on the table namespace
    * @throws AccumuloException
    * @throws TableNamespaceNotFoundException
    *           throw if the table namespace no longer exists
@@ -419,7 +423,6 @@ public interface TableNamespaceOperations {
    *           thrown if the table namespace no longer exists
    */
   public Map<String,Integer> listConstraints(String tableNamespace) throws AccumuloException, TableNamespaceNotFoundException;
-
   
   /**
    * Test to see if the instance can load the given class as the given type. This check uses the table classpath property if it is set.

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5262bd50/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperationsImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperationsImpl.java
index c35319d..694ba89 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/TableNamespaceOperationsImpl.java
@@ -297,11 +297,12 @@ public class TableNamespaceOperationsImpl extends TableNamespaceOperationsHelper
    *           if the table namespace does not exist
    * @throws TableNamespaceNotEmptyException
    *           if the table namespaces still contains tables
-   * @throws TableNotFoundException 
+   * @throws TableNotFoundException
    *           if table not found while deleting
    */
   @Override
-  public void delete(String namespace) throws AccumuloException, AccumuloSecurityException, TableNamespaceNotFoundException, TableNamespaceNotEmptyException, TableNotFoundException {
+  public void delete(String namespace) throws AccumuloException, AccumuloSecurityException, TableNamespaceNotFoundException, TableNamespaceNotEmptyException,
+      TableNotFoundException {
     delete(namespace, false);
   }
 
@@ -320,7 +321,7 @@ public class TableNamespaceOperationsImpl extends TableNamespaceOperationsHelper
    *           if the table namespace does not exist
    * @throws TableNamespaceNotEmptyException
    *           if the table namespaces still contains tables
-   * @throws TableNotFoundException 
+   * @throws TableNotFoundException
    *           if table not found while deleting
    */
   @Override
@@ -446,7 +447,7 @@ public class TableNamespaceOperationsImpl extends TableNamespaceOperationsHelper
   }
 
   /**
-   * Sets a property on a table namespace
+   * Sets a property on a table namespace which will apply to all tables in the namespace
    * 
    * @param namespace
    *          the name of the table namespace
@@ -539,6 +540,7 @@ public class TableNamespaceOperationsImpl extends TableNamespaceOperationsHelper
    * @throws AccumuloSecurityException
    *           when the user does not have the proper permissions
    * @throws TableNamespaceNotFoundException
+   *           if the table namespace does not exist
    */
   @Override
   public void offline(String namespace) throws AccumuloSecurityException, AccumuloException, TableNamespaceNotFoundException {
@@ -563,6 +565,7 @@ public class TableNamespaceOperationsImpl extends TableNamespaceOperationsHelper
    * @throws AccumuloSecurityException
    *           when the user does not have the proper permissions
    * @throws TableNamespaceNotFoundException
+   *           if the table namespace does not exist
    */
   @Override
   public void online(String namespace) throws AccumuloSecurityException, AccumuloException, TableNamespaceNotFoundException {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5262bd50/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java b/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java
index f54816f..042811a 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java
@@ -416,8 +416,8 @@ public class Initialize {
     zoo.putPersistentData(zkInstanceRoot + Constants.ZRECOVERY, new byte[] {'0'}, NodeExistsPolicy.FAIL);
     zoo.putPersistentData(zkInstanceRoot + Constants.ZNAMESPACES, new byte[0], NodeExistsPolicy.FAIL);
     
-    createInitialTableNamespace(zoo, zkInstanceRoot, Constants.DEFAULT_TABLE_NAMESPACE_ID, Constants.DEFAULT_TABLE_NAMESPACE);
-    createInitialTableNamespace(zoo, zkInstanceRoot, Constants.SYSTEM_TABLE_NAMESPACE_ID, Constants.SYSTEM_TABLE_NAMESPACE);
+    createInitialTableNamespace(zoo, zkInstanceRoot, Constants.DEFAULT_TABLE_NAMESPACE_ID, Constants.DEFAULT_TABLE_NAMESPACE, true);
+    createInitialTableNamespace(zoo, zkInstanceRoot, Constants.SYSTEM_TABLE_NAMESPACE_ID, Constants.SYSTEM_TABLE_NAMESPACE, false);
     
     zoo.putPersistentData(zkInstanceRoot + Constants.ZTABLES + "/" + MetadataTable.ID + Constants.ZTABLE_NAMESPACE,
         Constants.SYSTEM_TABLE_NAMESPACE_ID.getBytes(Constants.UTF8), NodeExistsPolicy.FAIL);
@@ -425,16 +425,18 @@ public class Initialize {
         Constants.SYSTEM_TABLE_NAMESPACE_ID.getBytes(Constants.UTF8), NodeExistsPolicy.FAIL);
   }
   
-  private static void createInitialTableNamespace(IZooReaderWriter zoo, String root, String id, String namespace) throws KeeperException, InterruptedException {
+  private static void createInitialTableNamespace(IZooReaderWriter zoo, String root, String id, String namespace, boolean defaultOpts) throws KeeperException,
+      InterruptedException {
     String zPath = root + Constants.ZNAMESPACES + "/" + id;
     zoo.putPersistentData(zPath, new byte[0], NodeExistsPolicy.FAIL);
     zoo.putPersistentData(zPath + Constants.ZNAMESPACE_NAME, namespace.getBytes(Constants.UTF8), NodeExistsPolicy.FAIL);
     zoo.putPersistentData(zPath + Constants.ZNAMESPACE_CONF, new byte[0], NodeExistsPolicy.FAIL);
     
-    Map<String,String> opts = IteratorUtil.generateInitialTableProperties(true);
-    for (Entry<String,String> e : opts.entrySet()) {
-      zoo.putPersistentData(zPath + Constants.ZNAMESPACE_CONF + "/" + e.getKey(), e.getValue().getBytes(Constants.UTF8),
-          NodeExistsPolicy.SKIP);
+    if (defaultOpts) {
+      Map<String,String> opts = IteratorUtil.generateInitialTableProperties(true);
+      for (Entry<String,String> e : opts.entrySet()) {
+        zoo.putPersistentData(zPath + Constants.ZNAMESPACE_CONF + "/" + e.getKey(), e.getValue().getBytes(Constants.UTF8), NodeExistsPolicy.SKIP);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5262bd50/server/master/src/main/java/org/apache/accumulo/master/Master.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/Master.java b/server/master/src/main/java/org/apache/accumulo/master/Master.java
index 0d508dd..0af32d4 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@ -352,8 +352,6 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
         for (Entry<String,String> e : opts.entrySet()) {
           zoo.putPersistentData(defaultTableNamespace + Constants.ZNAMESPACE_CONF + "/" + e.getKey(), e.getValue().getBytes(Constants.UTF8),
               NodeExistsPolicy.SKIP);
-          zoo.putPersistentData(systemTableNamespace + Constants.ZNAMESPACE_CONF + "/" + e.getKey(), e.getValue().getBytes(Constants.UTF8),
-              NodeExistsPolicy.SKIP);
         }
 
         for (Entry<String,String> table : Tables.getIdToNameMap(instance).entrySet()) {
@@ -944,7 +942,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
             throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
 
           fate.seedTransaction(opid, new TraceRepo<Master>(new RenameTable(tableId, oldTableName, newTableName)), autoCleanup);
-
+          
           break;
         }
         case CLONE: {