Sha256: e9448dc2d5ccce985158f2bbf73f2af040c03fb4cfa9ef42099ae7d140dfbeef

Contents?: true

Size: 563 Bytes

Versions: 29

Compression:

Stored size: 563 Bytes

Contents

class HBase
# @private
module Admin
private
  def with_admin
    check_closed

    begin
      admin = HBaseAdmin.new(@config)
      yield admin
    ensure
      admin.close if admin
    end
  end

  def wait_async_admin admin, &block
    prev_yet = nil
    while true
      pair  = admin.getAlterStatus(@name.to_java_bytes)
      yet   = pair.getFirst
      total = pair.getSecond

      if block && yet != prev_yet
        block.call(total - yet, total)
        prev_yet = yet
      end

      break if yet == 0
      sleep 1
    end
  end
end#Admin
end#HBase

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hbase-jruby-0.3.1-java lib/hbase-jruby/admin.rb
hbase-jruby-0.3.0-java lib/hbase-jruby/admin.rb
hbase-jruby-0.2.6-java lib/hbase-jruby/admin.rb
hbase-jruby-0.2.5-java lib/hbase-jruby/admin.rb
hbase-jruby-0.2.4-java lib/hbase-jruby/admin.rb
hbase-jruby-0.2.3-java lib/hbase-jruby/admin.rb
hbase-jruby-0.2.2-java lib/hbase-jruby/admin.rb
hbase-jruby-0.2.1-java lib/hbase-jruby/admin.rb
hbase-jruby-0.2.0-java lib/hbase-jruby/admin.rb