accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [01/50] [abbrv] ACCUMULO-802 updated more shell commands to include the tableNamespaces option
Date Wed, 04 Dec 2013 23:58:42 GMT
Updated Branches:
  refs/heads/master c29df8ef0 -> 7b8922c70


http://git-wip-us.apache.org/repos/asf/accumulo/blob/5acd6a48/server/base/src/main/java/org/apache/accumulo/server/conf/TableNamespaceConfWatcher.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/TableNamespaceConfWatcher.java
b/server/base/src/main/java/org/apache/accumulo/server/conf/TableNamespaceConfWatcher.java
new file mode 100644
index 0000000..8bb33b8
--- /dev/null
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableNamespaceConfWatcher.java
@@ -0,0 +1,107 @@
+/*
+ * 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.server.conf;
+
+import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.Instance;
+import org.apache.accumulo.core.zookeeper.ZooUtil;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.zookeeper.WatchedEvent;
+import org.apache.zookeeper.Watcher;
+
+class TableNamespaceConfWatcher implements Watcher {
+  static {
+    Logger.getLogger("org.apache.zookeeper").setLevel(Level.WARN);
+    Logger.getLogger("org.apache.hadoop.io.compress").setLevel(Level.WARN);
+  }
+  
+  private static final Logger log = Logger.getLogger(TableNamespaceConfWatcher.class);
+  private Instance instance = null;
+  
+  TableNamespaceConfWatcher(Instance instance) {
+    this.instance = instance;
+  }
+  
+  @Override
+  public void process(WatchedEvent event) {
+    String path = event.getPath();
+    if (log.isTraceEnabled())
+      log.trace("WatchEvent : " + path + " " + event.getState() + " " + event.getType());
+    
+    String namespacesPrefix = ZooUtil.getRoot(instance) + Constants.ZNAMESPACES + "/";
+    
+    String namespaceId = null;
+    String key = null;
+    
+    if (path != null) {
+      if (path.startsWith(namespacesPrefix)) {
+        namespaceId = path.substring(namespacesPrefix.length());
+        if (namespaceId.contains("/")) {
+          namespaceId = namespaceId.substring(0, namespaceId.indexOf('/'));
+          if (path.startsWith(namespacesPrefix + namespaceId + Constants.ZNAMESPACE_CONF
+ "/"))
+            key = path.substring((namespacesPrefix + namespaceId + Constants.ZNAMESPACE_CONF
+ "/").length());
+        }
+      }
+      
+      if (namespaceId == null) {
+        log.warn("Zookeeper told me about a path I was not watching " + path + " state="
+ event.getState() + " type=" + event.getType());
+        return;
+      }
+    }
+    
+    switch (event.getType()) {
+      case NodeDataChanged:
+        if (log.isTraceEnabled())
+          log.trace("EventNodeDataChanged " + event.getPath());
+        if (key != null)
+          ServerConfiguration.getTableNamespaceConfiguration(instance, namespaceId).propertyChanged(key);
+        break;
+      case NodeChildrenChanged:
+        ServerConfiguration.getTableNamespaceConfiguration(instance, namespaceId).propertiesChanged(key);
+        break;
+      case NodeDeleted:
+        if (key == null) {
+          ServerConfiguration.removeNamespaceIdInstance(namespaceId);
+        }
+        break;
+      case None:
+        switch (event.getState()) {
+          case Expired:
+            ServerConfiguration.expireAllTableObservers();
+            break;
+          case SyncConnected:
+            break;
+          case Disconnected:
+            break;
+          default:
+            log.warn("EventNone event not handled path = " + event.getPath() + " state="
+ event.getState());
+        }
+        break;
+      case NodeCreated:
+        switch (event.getState()) {
+          case SyncConnected:
+            break;
+          default:
+            log.warn("Event NodeCreated event not handled path = " + event.getPath() + "
state=" + event.getState());
+        }
+        break;
+      default:
+        log.warn("Event not handled path = " + event.getPath() + " state=" + event.getState()
+ " type = " + event.getType());
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5acd6a48/server/src/main/java/org/apache/accumulo/server/conf/TableNamespaceConfWatcher.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/conf/TableNamespaceConfWatcher.java
b/server/src/main/java/org/apache/accumulo/server/conf/TableNamespaceConfWatcher.java
deleted file mode 100644
index 8bb33b8..0000000
--- a/server/src/main/java/org/apache/accumulo/server/conf/TableNamespaceConfWatcher.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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.server.conf;
-
-import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.zookeeper.ZooUtil;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
-
-class TableNamespaceConfWatcher implements Watcher {
-  static {
-    Logger.getLogger("org.apache.zookeeper").setLevel(Level.WARN);
-    Logger.getLogger("org.apache.hadoop.io.compress").setLevel(Level.WARN);
-  }
-  
-  private static final Logger log = Logger.getLogger(TableNamespaceConfWatcher.class);
-  private Instance instance = null;
-  
-  TableNamespaceConfWatcher(Instance instance) {
-    this.instance = instance;
-  }
-  
-  @Override
-  public void process(WatchedEvent event) {
-    String path = event.getPath();
-    if (log.isTraceEnabled())
-      log.trace("WatchEvent : " + path + " " + event.getState() + " " + event.getType());
-    
-    String namespacesPrefix = ZooUtil.getRoot(instance) + Constants.ZNAMESPACES + "/";
-    
-    String namespaceId = null;
-    String key = null;
-    
-    if (path != null) {
-      if (path.startsWith(namespacesPrefix)) {
-        namespaceId = path.substring(namespacesPrefix.length());
-        if (namespaceId.contains("/")) {
-          namespaceId = namespaceId.substring(0, namespaceId.indexOf('/'));
-          if (path.startsWith(namespacesPrefix + namespaceId + Constants.ZNAMESPACE_CONF
+ "/"))
-            key = path.substring((namespacesPrefix + namespaceId + Constants.ZNAMESPACE_CONF
+ "/").length());
-        }
-      }
-      
-      if (namespaceId == null) {
-        log.warn("Zookeeper told me about a path I was not watching " + path + " state="
+ event.getState() + " type=" + event.getType());
-        return;
-      }
-    }
-    
-    switch (event.getType()) {
-      case NodeDataChanged:
-        if (log.isTraceEnabled())
-          log.trace("EventNodeDataChanged " + event.getPath());
-        if (key != null)
-          ServerConfiguration.getTableNamespaceConfiguration(instance, namespaceId).propertyChanged(key);
-        break;
-      case NodeChildrenChanged:
-        ServerConfiguration.getTableNamespaceConfiguration(instance, namespaceId).propertiesChanged(key);
-        break;
-      case NodeDeleted:
-        if (key == null) {
-          ServerConfiguration.removeNamespaceIdInstance(namespaceId);
-        }
-        break;
-      case None:
-        switch (event.getState()) {
-          case Expired:
-            ServerConfiguration.expireAllTableObservers();
-            break;
-          case SyncConnected:
-            break;
-          case Disconnected:
-            break;
-          default:
-            log.warn("EventNone event not handled path = " + event.getPath() + " state="
+ event.getState());
-        }
-        break;
-      case NodeCreated:
-        switch (event.getState()) {
-          case SyncConnected:
-            break;
-          default:
-            log.warn("Event NodeCreated event not handled path = " + event.getPath() + "
state=" + event.getState());
-        }
-        break;
-      default:
-        log.warn("Event not handled path = " + event.getPath() + " state=" + event.getState()
+ " type = " + event.getType());
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5acd6a48/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
index daa1f52..257881d 100644
--- a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java
@@ -869,6 +869,10 @@ public class ShellServerIT extends SimpleMacIT {
     exec("tables", true, "testers3.1", false);
     exec("namespaces", true, "testers3", true);
     exec("deletenamespace testers3 -f", true);
+    input.set("true\n\n\nSTRING\n");
+    exec("setiter -tn thing2 -scan -class org.apache.accumulo.core.iterators.user.SummingCombiner
-p 10 -n name", true);
+    exec("listiter -tn thing2 -scan", true, "Summing", true);
+    exec("deleteiter -tn thing2 -n name -scan", true);
     
     // properties override and such
     exec("config -tn thing2 -s table.file.max=44444", true);


Mime
View raw message