diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb index 9b65cc3..39a30f1 100644 --- a/hbase-shell/src/main/ruby/hbase/admin.rb +++ b/hbase-shell/src/main/ruby/hbase/admin.rb @@ -23,6 +23,7 @@ java_import org.apache.hadoop.hbase.util.Pair java_import org.apache.hadoop.hbase.util.RegionSplitter java_import org.apache.hadoop.hbase.util.Bytes java_import org.apache.hadoop.hbase.ServerName +java_import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker java_import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos::SnapshotDescription # Wrapper for org.apache.hadoop.hbase.client.HBaseAdmin @@ -817,6 +818,12 @@ module Hbase end #---------------------------------------------------------------------------------------------- + # Updates the configuration of master + def update_master_config() + @admin.updateConfiguration(MasterAddressTracker.getMasterAddress(@connection.getKeepAliveZooKeeperWatcher())); + end + + #---------------------------------------------------------------------------------------------- # Returns namespace's structure description def describe_namespace(namespace_name) namespace = @admin.getNamespaceDescriptor(namespace_name) diff --git a/hbase-shell/src/main/ruby/shell.rb b/hbase-shell/src/main/ruby/shell.rb index 082a7f0..c75289c 100644 --- a/hbase-shell/src/main/ruby/shell.rb +++ b/hbase-shell/src/main/ruby/shell.rb @@ -372,6 +372,7 @@ Shell.load_command_group( :commands => %w[ update_config update_all_config + update_master_config ] ) diff --git a/hbase-shell/src/main/ruby/shell/commands/update_master_config.rb b/hbase-shell/src/main/ruby/shell/commands/update_master_config.rb new file mode 100644 index 0000000..701edb8 --- /dev/null +++ b/hbase-shell/src/main/ruby/shell/commands/update_master_config.rb @@ -0,0 +1,39 @@ +# +# +# 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 UpdateMasterConfig < Command + def help + return <<-EOF +Reload a subset of configuration on master server in the cluster. See +http://hbase.apache.org/book.html?dyn_config for more details. Here is how +you would run the command in the hbase shell: + hbase> update_master_config +EOF + end + + def command() + format_simple_command do + admin.update_master_config() + end + end + end + end +end