HBASE-13112 quota.rb, security.rb and visibility_labels.rb leak connection (Ashish Singhi)
This commit is contained in:
parent
ac7faf3ef7
commit
0ff1418b32
|
@ -56,11 +56,11 @@ module Hbase
|
|||
end
|
||||
|
||||
def security_admin(formatter)
|
||||
::Hbase::SecurityAdmin.new(configuration, formatter)
|
||||
::Hbase::SecurityAdmin.new(@connection.getAdmin, formatter)
|
||||
end
|
||||
|
||||
def visibility_labels_admin(formatter)
|
||||
::Hbase::VisibilityLabelsAdmin.new(configuration, formatter)
|
||||
::Hbase::VisibilityLabelsAdmin.new(@connection.getAdmin, formatter)
|
||||
end
|
||||
|
||||
def shutdown
|
||||
|
|
|
@ -24,13 +24,16 @@ module Hbase
|
|||
class SecurityAdmin
|
||||
include HBaseConstants
|
||||
|
||||
def initialize(configuration, formatter)
|
||||
@config = configuration
|
||||
@connection = org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(@config)
|
||||
@admin = @connection.getAdmin()
|
||||
def initialize(admin, formatter)
|
||||
@admin = admin
|
||||
@config = @admin.getConfiguration()
|
||||
@formatter = formatter
|
||||
end
|
||||
|
||||
def close
|
||||
@admin.close
|
||||
end
|
||||
|
||||
#----------------------------------------------------------------------------------------------
|
||||
def grant(user, permissions, table_name=nil, family=nil, qualifier=nil)
|
||||
security_available?
|
||||
|
|
|
@ -24,13 +24,14 @@ java_import org.apache.hadoop.hbase.util.Bytes
|
|||
module Hbase
|
||||
class VisibilityLabelsAdmin
|
||||
|
||||
def initialize(configuration, formatter)
|
||||
@config = configuration
|
||||
def initialize(admin, formatter)
|
||||
@admin = admin
|
||||
@config = @admin.getConfiguration()
|
||||
@formatter = formatter
|
||||
|
||||
# @connection = org.apache.hadoop.hbase.client.ConnectionFactory(configuration)
|
||||
# @admin = @connection.getAdmin()
|
||||
@admin = org.apache.hadoop.hbase.client.HBaseAdmin.new(configuration)
|
||||
end
|
||||
|
||||
def close
|
||||
@admin.close
|
||||
end
|
||||
|
||||
def add_labels(*args)
|
||||
|
|
Loading…
Reference in New Issue