You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2019/02/03 15:50:51 UTC

[hbase] branch master updated (2b1b79f -> 8d75ac8)

This is an automated email from the ASF dual-hosted git repository.

busbey pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git.


    from 2b1b79f  HBASE-21829 Use FutureUtils.addListener instead of calling whenComplete directly
     new 65caa08  HBASE-21812 Address ruby static analysis for shell/bin modules [2nd pass]
     new 8d75ac8  HBASE-21765 Website should point to lists.apache.org

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bin/draining_servers.rb      | 22 ++++++++++++----------
 bin/hirb.rb                  |  4 ++--
 bin/region_status.rb         |  1 +
 bin/shutdown_regionserver.rb | 12 ++++++------
 pom.xml                      | 10 +++++-----
 5 files changed, 26 insertions(+), 23 deletions(-)


[hbase] 02/02: HBASE-21765 Website should point to lists.apache.org

Posted by bu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

busbey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 8d75ac80a81b8cf8e5a3ba06ee95b6da69d15bd4
Author: Surbhi Kochhar <su...@cloudera.com>
AuthorDate: Wed Jan 23 12:58:52 2019 -0800

    HBASE-21765 Website should point to lists.apache.org
    
    Signed-off-by: Sean Busbey <bu...@apache.org>
---
 pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 629cc9c..d2d9d2f 100755
--- a/pom.xml
+++ b/pom.xml
@@ -119,7 +119,7 @@
       <subscribe>user-subscribe@hbase.apache.org</subscribe>
       <unsubscribe>user-unsubscribe@hbase.apache.org</unsubscribe>
       <post>user@hbase.apache.org</post>
-      <archive>http://mail-archives.apache.org/mod_mbox/hbase-user/</archive>
+      <archive>https://lists.apache.org/list.html?user@hbase.apache.org</archive>
       <otherArchives>
         <otherArchive>http://dir.gmane.org/gmane.comp.java.hadoop.hbase.user</otherArchive>
         <otherArchive>http://search-hadoop.com/?q=&amp;fc_project=HBase</otherArchive>
@@ -130,7 +130,7 @@
       <subscribe>dev-subscribe@hbase.apache.org</subscribe>
       <unsubscribe>dev-unsubscribe@hbase.apache.org</unsubscribe>
       <post>dev@hbase.apache.org</post>
-      <archive>http://mail-archives.apache.org/mod_mbox/hbase-dev/</archive>
+      <archive>https://lists.apache.org/list.html?dev@hbase.apache.org</archive>
       <otherArchives>
         <otherArchive>http://dir.gmane.org/gmane.comp.java.hadoop.hbase.devel</otherArchive>
         <otherArchive>http://search-hadoop.com/?q=&amp;fc_project=HBase</otherArchive>
@@ -140,19 +140,19 @@
       <name>Commits List</name>
       <subscribe>commits-subscribe@hbase.apache.org</subscribe>
       <unsubscribe>commits-unsubscribe@hbase.apache.org</unsubscribe>
-      <archive>http://mail-archives.apache.org/mod_mbox/hbase-commits/</archive>
+      <archive>https://lists.apache.org/list.html?commits@hbase.apache.org</archive>
     </mailingList>
     <mailingList>
       <name>Issues List</name>
       <subscribe>issues-subscribe@hbase.apache.org</subscribe>
       <unsubscribe>issues-unsubscribe@hbase.apache.org</unsubscribe>
-      <archive>http://mail-archives.apache.org/mod_mbox/hbase-issues/</archive>
+      <archive>https://lists.apache.org/list.html?issues@hbase.apache.org</archive>
     </mailingList>
     <mailingList>
       <name>Builds List</name>
       <subscribe>builds-subscribe@hbase.apache.org</subscribe>
       <unsubscribe>builds-unsubscribe@hbase.apache.org</unsubscribe>
-      <archive>http://mail-archives.apache.org/mod_mbox/hbase-builds/</archive>
+      <archive>https://lists.apache.org/list.html?builds@hbase.apache.org</archive>
     </mailingList>
   </mailingLists>
   <developers>


[hbase] 01/02: HBASE-21812 Address ruby static analysis for shell/bin modules [2nd pass]

Posted by bu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

busbey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 65caa08edc2be1d3db4e321c1228c1cddb73b88b
Author: Sakthi <sa...@gmail.com>
AuthorDate: Fri Feb 1 11:21:49 2019 -0800

    HBASE-21812 Address ruby static analysis for shell/bin modules [2nd pass]
    
    Signed-off-by: Sean Busbey <bu...@apache.org>
---
 bin/draining_servers.rb      | 22 ++++++++++++----------
 bin/hirb.rb                  |  4 ++--
 bin/region_status.rb         |  1 +
 bin/shutdown_regionserver.rb | 12 ++++++------
 4 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/bin/draining_servers.rb b/bin/draining_servers.rb
index a8e20f0..12f0ba4 100644
--- a/bin/draining_servers.rb
+++ b/bin/draining_servers.rb
@@ -51,28 +51,29 @@ optparse.parse!
 def getServers(admin)
   serverInfos = admin.getClusterStatus.getServers
   servers = []
-  for server in serverInfos
+  serverInfos.each do |server|
     servers << server.getServerName
   end
   servers
 end
 
+# rubocop:disable Metrics/AbcSize
 def getServerNames(hostOrServers, config)
   ret = []
   connection = ConnectionFactory.createConnection(config)
 
-  for hostOrServer in hostOrServers
+  hostOrServers.each do |host_or_server|
     # check whether it is already serverName. No need to connect to cluster
-    parts = hostOrServer.split(',')
+    parts = host_or_server.split(',')
     if parts.size == 3
-      ret << hostOrServer
+      ret << host_or_server
     else
-      admin = connection.getAdmin unless admin
+      admin ||= connection.getAdmin
       servers = getServers(admin)
 
-      hostOrServer = hostOrServer.tr(':', ',')
-      for server in servers
-        ret << server if server.start_with?(hostOrServer)
+      host_or_server = host_or_server.tr(':', ',')
+      servers.each do |server|
+        ret << server if server.start_with?(host_or_server)
       end
     end
   end
@@ -90,7 +91,7 @@ def addServers(_options, hostOrServers)
 
   begin
     parentZnode = zkw.getZNodePaths.drainingZNode
-    for server in servers
+    servers.each do |server|
       node = ZNodePaths.joinZNode(parentZnode, server)
       ZKUtil.createAndFailSilent(zkw, node)
     end
@@ -107,7 +108,7 @@ def removeServers(_options, hostOrServers)
 
   begin
     parentZnode = zkw.getZNodePaths.drainingZNode
-    for server in servers
+    servers.each do |server|
       node = ZNodePaths.joinZNode(parentZnode, server)
       ZKUtil.deleteNodeFailSilent(zkw, node)
     end
@@ -115,6 +116,7 @@ def removeServers(_options, hostOrServers)
     zkw.close
   end
 end
+# rubocop:enable Metrics/AbcSize
 
 # list servers in draining mode
 def listServers(_options)
diff --git a/bin/hirb.rb b/bin/hirb.rb
index e857db7..fcbec78 100644
--- a/bin/hirb.rb
+++ b/bin/hirb.rb
@@ -82,7 +82,7 @@ log_level = org.apache.log4j.Level::ERROR
 @shell_debug = false
 interactive = true
 _configuration = nil
-D_ARG = '-D'
+D_ARG = '-D'.freeze
 while (arg = ARGV.shift)
   if arg == '-h' || arg == '--help'
     puts cmdline_help
@@ -248,7 +248,7 @@ else
     # exception unwrapping in shell means we'll have to handle Java exceptions
     # as a special case in order to format them properly.
     if exception.is_a? java.lang.Exception
-      $stderr.puts 'java exception'
+      warn 'java exception'
       message = exception.get_message
     end
     # Include the 'ERROR' string to try to make transition easier for scripts that
diff --git a/bin/region_status.rb b/bin/region_status.rb
index abd19dd..f8c203b 100644
--- a/bin/region_status.rb
+++ b/bin/region_status.rb
@@ -116,6 +116,7 @@ while iter.hasNext
     # Gone too far, break
     break
   end
+
   region = MetaTableAccessor.getHRegionInfo(result)
   unless region.isOffline
     # only include regions that should be online
diff --git a/bin/shutdown_regionserver.rb b/bin/shutdown_regionserver.rb
index fd1af30..a131776 100644
--- a/bin/shutdown_regionserver.rb
+++ b/bin/shutdown_regionserver.rb
@@ -28,24 +28,24 @@ java_import org.apache.hadoop.hbase.client.HBaseAdmin
 java_import org.apache.hadoop.hbase.client.ConnectionFactory
 
 def usage(msg = nil)
-  $stderr.puts 'Usage: shutdown_regionserver.rb <host:port>..'
-  $stderr.puts
-  $stderr.puts 'Stops the specified regionservers via RPC'
-  $stderr.puts format('Error: %s', msg) if msg
+  warn 'Usage: shutdown_regionserver.rb <host:port>..'
+  warn
+  warn 'Stops the specified regionservers via RPC'
+  warn format('Error: %<msg>s') if msg
   abort
 end
 
 usage if ARGV.empty?
 
 ARGV.each do |x|
-  usage format('Invalid host:port: %s', x) unless x.include? ':'
+  usage format('Invalid host:port: %<x>s') unless x.include? ':'
 end
 
 config = HBaseConfiguration.create
 connection = ConnectionFactory.createConnection(config)
 begin
   admin = connection.getAdmin
-rescue
+rescue StandardError
   abort "Error: Couldn't instantiate HBaseAdmin"
 end