diff --git a/hbase-shell/src/main/ruby/hbase/hbase.rb b/hbase-shell/src/main/ruby/hbase/hbase.rb index 797d784..852f349 100644 --- a/hbase-shell/src/main/ruby/hbase/hbase.rb +++ b/hbase-shell/src/main/ruby/hbase/hbase.rb @@ -58,7 +58,7 @@ module Hbase # Create new one each time def table(table, shell) - ::Hbase::Table.new(@connection.getTable(table), shell) + ::Hbase::Table.new(@connection.getTable(TableName.valueOf(table)), shell) end def replication_admin(formatter) diff --git a/hbase-shell/src/main/ruby/hbase/taskmonitor.rb b/hbase-shell/src/main/ruby/hbase/taskmonitor.rb index df93848..bab2b2a 100644 --- a/hbase-shell/src/main/ruby/hbase/taskmonitor.rb +++ b/hbase-shell/src/main/ruby/hbase/taskmonitor.rb @@ -85,7 +85,12 @@ module Hbase java_import 'java.net.URL' java_import 'org.codehaus.jackson.map.ObjectMapper' - infoport = @admin.getClusterStatus().getLoad(host).getInfoServerPort().to_s + infoport = @admin.getClusterStatus().getLoad(host).getInfoServerPort() + if infoport > 0 + infoportStr = infoport.to_s + else + infoportStr = "16030" + end # Note: This condition use constants from hbase-server #if (!@admin.getConfiguration().getBoolean(org.apache.hadoop.hbase.http.ServerConfigurationKeys::HBASE_SSL_ENABLED_KEY, @@ -95,10 +100,11 @@ module Hbase # schema = "https://" #end schema = "http://" - url = schema + host.hostname + ":" + infoport + "/rs-status?format=json&filter=" + filter + url = schema + host.hostname + ":" + infoportStr + "/rs-status?format=json&filter=" + filter json = URL.new(url) mapper = ObjectMapper.new + puts(url) # read and parse JSON tasksArrayList = mapper.readValue(json,java.lang.Object.java_class)