hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1512860 - in /hbase/branches/0.95/hbase-server/src/main/ruby: ./ shell/commands/
Date Sun, 11 Aug 2013 03:00:55 GMT
Author: stack
Date: Sun Aug 11 03:00:55 2013
New Revision: 1512860

URL: http://svn.apache.org/r1512860
Log:
HBASE-9130 Invert the name of namespace commands to match the snapshots and replication form

Added:
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/alter_namespace.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/create_namespace.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/describe_namespace.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/drop_namespace.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace_tables.rb
Removed:
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/namespace_alter.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/namespace_create.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/namespace_describe.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/namespace_drop.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/namespace_list.rb
    hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/namespace_list_tables.rb
Modified:
    hbase/branches/0.95/hbase-server/src/main/ruby/shell.rb

Modified: hbase/branches/0.95/hbase-server/src/main/ruby/shell.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/ruby/shell.rb?rev=1512860&r1=1512859&r2=1512860&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/ruby/shell.rb (original)
+++ hbase/branches/0.95/hbase-server/src/main/ruby/shell.rb Sun Aug 11 03:00:55 2013
@@ -257,12 +257,12 @@ Shell.load_command_group(
   'namespace',
   :full_name => 'NAMESPACE MANAGEMENT COMMANDS',
   :commands => %w[
-    namespace_create
-    namespace_drop
-    namespace_alter
-    namespace_describe
-    namespace_list
-    namespace_list_tables
+    create_namespace
+    drop_namespace
+    alter_namespace
+    describe_namespace
+    list_namespace
+    list_namespace_tables
   ]
 )
 

Added: hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/alter_namespace.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/alter_namespace.rb?rev=1512860&view=auto
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/alter_namespace.rb (added)
+++ hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/alter_namespace.rb Sun Aug
11 03:00:55 2013
@@ -0,0 +1,44 @@
+#
+#
+# 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.
+#
+
+module Shell
+  module Commands
+    class AlterNamespace < Command
+      def help
+        return <<-EOF
+Alter namespace properties.
+
+To add/modify a property:
+
+  hbase> alter_namespace 'ns1', {METHOD => 'set', 'PROERTY_NAME' => 'PROPERTY_VALUE'}
+
+To delete a property:
+
+  hbase> alter_namespace 'ns1', {METHOD => 'unset', NAME=>'PROERTY_NAME'}
+EOF
+      end
+
+      def command(namespace, *args)
+        format_simple_command do
+          admin.alter_namespace(namespace, *args)
+        end
+      end
+    end
+  end
+end

Added: hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/create_namespace.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/create_namespace.rb?rev=1512860&view=auto
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/create_namespace.rb (added)
+++ hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/create_namespace.rb Sun
Aug 11 03:00:55 2013
@@ -0,0 +1,41 @@
+#
+#
+# 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.
+#
+
+module Shell
+  module Commands
+    class CreateNamespace < Command
+      def help
+        return <<-EOF
+Create namespace; pass namespace name,
+and optionally a dictionary of namespace configuration.
+Examples:
+
+  hbase> create_namespace 'ns1'
+  hbase> create_namespace 'ns1', {'PROERTY_NAME'=>'PROPERTY_VALUE'}
+EOF
+      end
+
+      def command(namespace, *args)
+        format_simple_command do
+          admin.create_namespace(namespace, *args)
+        end
+      end
+    end
+  end
+end

Added: hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/describe_namespace.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/describe_namespace.rb?rev=1512860&view=auto
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/describe_namespace.rb (added)
+++ hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/describe_namespace.rb Sun
Aug 11 03:00:55 2013
@@ -0,0 +1,41 @@
+#
+#
+# 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.
+#
+
+module Shell
+  module Commands
+    class DescribeNamespace < Command
+      def help
+        return <<-EOF
+Describe the named namespace. For example:
+  hbase> describe_namespace 'ns1'
+EOF
+      end
+
+      def command(namespace)
+        now = Time.now
+
+        desc = admin.describe_namespace(namespace)
+
+        formatter.header([ "DESCRIPTION" ], [ 64 ])
+        formatter.row([ desc ], true, [ 64 ])
+        formatter.footer(now)
+      end
+    end
+  end
+end

Added: hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/drop_namespace.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/drop_namespace.rb?rev=1512860&view=auto
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/drop_namespace.rb (added)
+++ hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/drop_namespace.rb Sun Aug
11 03:00:55 2013
@@ -0,0 +1,36 @@
+#
+#
+# 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.
+#
+
+module Shell
+  module Commands
+    class DropNamespace < Command
+      def help
+        return <<-EOF
+Drop the named namespace. The namespace must be empty.
+EOF
+      end
+
+      def command(namespace)
+        format_simple_command do
+          admin.drop_namespace(namespace)
+        end
+      end
+    end
+  end
+end

Added: hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace.rb?rev=1512860&view=auto
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace.rb (added)
+++ hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace.rb Sun Aug
11 03:00:55 2013
@@ -0,0 +1,47 @@
+#
+#
+# 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.
+#
+
+module Shell
+  module Commands
+    class ListNamespace < Command
+      def help
+        return <<-EOF
+List all namespaces in hbase. Optional regular expression parameter could
+be used to filter the output. Examples:
+
+  hbase> list_namespace
+  hbase> list_namespace 'abc.*'
+EOF
+      end
+
+      def command(regex = ".*")
+        now = Time.now
+        formatter.header([ "NAMESPACE" ])
+
+        regex = /#{regex}/ unless regex.is_a?(Regexp)
+        list = admin.list_namespace.grep(regex)
+        list.each do |table|
+          formatter.row([ table ])
+        end
+
+        formatter.footer(now, list.size)
+      end
+    end
+  end
+end

Added: hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace_tables.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace_tables.rb?rev=1512860&view=auto
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace_tables.rb
(added)
+++ hbase/branches/0.95/hbase-server/src/main/ruby/shell/commands/list_namespace_tables.rb
Sun Aug 11 03:00:55 2013
@@ -0,0 +1,45 @@
+#
+#
+# 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.
+#
+
+module Shell
+  module Commands
+    class ListNamespaceTables < Command
+      def help
+        return <<-EOF
+List all tables that are members of the namespace.
+Examples:
+
+  hbase> list_namespace_tables 'ns1'
+EOF
+      end
+
+      def command(namespace)
+        now = Time.now
+        formatter.header([ "TABLE" ])
+
+        list = admin.list_namespace_tables(namespace)
+        list.each do |table|
+          formatter.row([ table ])
+        end
+
+        formatter.footer(now, list.size)
+      end
+    end
+  end
+end



Mime
View raw message