Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6E94B1083F for ; Fri, 1 Nov 2013 02:00:10 +0000 (UTC) Received: (qmail 29879 invoked by uid 500); 1 Nov 2013 02:00:06 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 29639 invoked by uid 500); 1 Nov 2013 02:00:05 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 28625 invoked by uid 99); 1 Nov 2013 02:00:03 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Nov 2013 02:00:03 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 92A93D134; Fri, 1 Nov 2013 02:00:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctubbsii@apache.org To: commits@accumulo.apache.org Date: Fri, 01 Nov 2013 02:00:45 -0000 Message-Id: <1a6cc0fbb42b4820a907fa77409185e7@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [44/54] 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/d30d07d2 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d30d07d2 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d30d07d2 Branch: refs/heads/ACCUMULO-802 Commit: d30d07d29a61af22fc57cbb7f3ae09b86a7b4413 Parents: 1945411 Author: Sean Hickey Authored: Mon Aug 12 09:37:42 2013 -0400 Committer: Christopher Tubbs Committed: Thu Oct 31 21:37:55 2013 -0400 ---------------------------------------------------------------------- .../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/d30d07d2/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/d30d07d2/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/d30d07d2/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> 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 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/d30d07d2/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/d30d07d2/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 06568cd..200ceef 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 @@ -380,8 +380,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); @@ -389,16 +389,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 opts = IteratorUtil.generateInitialTableProperties(true); - for (Entry e : opts.entrySet()) { - zoo.putPersistentData(zPath + Constants.ZNAMESPACE_CONF + "/" + e.getKey(), e.getValue().getBytes(Constants.UTF8), - NodeExistsPolicy.SKIP); + if (defaultOpts) { + Map opts = IteratorUtil.generateInitialTableProperties(true); + for (Entry 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/d30d07d2/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 1f2c864..c1609c5 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 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 table : Tables.getIdToNameMap(instance).entrySet()) { @@ -943,7 +941,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); fate.seedTransaction(opid, new TraceRepo(new RenameTable(tableId, oldTableName, newTableName)), autoCleanup); - + break; } case CLONE: {