Skip to content

Commit

Permalink
Fix findbug and rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
NihalJain committed Dec 21, 2023
1 parent f334fb1 commit ae3ef7c
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bin/draining_servers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def listServers(_options)
hostOrServers = ARGV[1..ARGV.size]

# disable debug/info logging on this script for clarity
log_level = "ERROR"
log_level = 'ERROR'
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop.hbase', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.zookeeper', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop', log_level)
Expand Down
2 changes: 1 addition & 1 deletion bin/get-active-master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
java_import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker

# disable debug/info logging on this script for clarity
log_level = "ERROR"
log_level = 'ERROR'
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop.hbase', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.zookeeper', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop', log_level)
Expand Down
2 changes: 1 addition & 1 deletion bin/replication/copy_tables_desc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def copy(src, dst, table)
end

# disable debug/info logging on this script for clarity
log_level = "ERROR"
log_level = 'ERROR'
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop.hbase', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.zookeeper', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop', log_level)
Expand Down
2 changes: 1 addition & 1 deletion bin/shutdown_regionserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def usage(msg = nil)
end

# disable debug/info logging on this script for clarity
log_level = "ERROR"
log_level = 'ERROR'
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop.hbase', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.zookeeper', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop', log_level)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ private static org.apache.logging.log4j.Level getLevel(String levelName)
}

static void setAllLevels(String loggerName, String levelName) {
org.apache.logging.log4j.Level level = getLevel(levelName);
org.apache.logging.log4j.core.config.Configurator.setAllLevels(loggerName, getLevel(levelName));
}

Expand Down
8 changes: 4 additions & 4 deletions hbase-shell/src/main/ruby/jar-bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def add_to_configuration(c, arg)
opts.ordering = GetoptLong::REQUIRE_ORDER

script2run = nil
log_level = "ERROR"
log_level = 'ERROR'
@shell_debug = false
interactive = true
full_backtrace = false
Expand All @@ -118,7 +118,7 @@ def add_to_configuration(c, arg)
when D_ARG
conf_from_cli = add_to_configuration(conf_from_cli, arg)
when '--debug'
log_level = "DEBUG"
log_level = 'DEBUG'
full_backtrace = true
@shell_debug = true
puts 'Setting DEBUG log level...'
Expand Down Expand Up @@ -165,11 +165,11 @@ def debug
if @shell_debug
@shell_debug = false
conf.back_trace_limit = 0
log_level = "ERROR"
log_level = 'ERROR'
else
@shell_debug = true
conf.back_trace_limit = 100
log_level = "DEBUG"
log_level = 'DEBUG'
end
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.zookeeper', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop', log_level)
Expand Down
11 changes: 6 additions & 5 deletions hbase-shell/src/test/ruby/no_cluster_tests_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
include Java

# Set logging level to avoid verboseness
log_level = "OFF"
log_level = 'OFF'
org.apache.hadoop.hbase.logging.Log4jUtils.setRootLevel(log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels("org.apache.zookeeper", log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels("org.apache.hadoop.hdfs", log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels("org.apache.hadoop.hbase", log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels("org.apache.hadoop.ipc.HBaseServer", log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.zookeeper', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop.hdfs', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop.hbase', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils
.setAllLevels('org.apache.hadoop.ipc.HBaseServer', log_level)

java_import org.apache.hadoop.hbase.HBaseTestingUtility

Expand Down
11 changes: 6 additions & 5 deletions hbase-shell/src/test/ruby/tests_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
include Java

# Set logging level to avoid verboseness
log_level = "OFF"
log_level = 'OFF'
org.apache.hadoop.hbase.logging.Log4jUtils.setRootLevel(log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels("org.apache.zookeeper", log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels("org.apache.hadoop.hdfs", log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels("org.apache.hadoop.hbase", log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels("org.apache.hadoop.ipc.HBaseServer", log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.zookeeper', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop.hdfs', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils.setAllLevels('org.apache.hadoop.hbase', log_level)
org.apache.hadoop.hbase.logging.Log4jUtils
.setAllLevels('org.apache.hadoop.ipc.HBaseServer', log_level)

java_import org.apache.hadoop.hbase.HBaseTestingUtility

Expand Down

0 comments on commit ae3ef7c

Please sign in to comment.