Module: OkHbase::Concerns::Table::Instrumentation::ClassMethods

Defined in:
lib/ok_hbase/concerns/table/instrumentation.rb

Instance Method Summary collapse

Instance Method Details

#batch(timestamp = nil, batch_size = nil, transaction = false) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/ok_hbase/concerns/table/instrumentation.rb', line 29

def batch(timestamp = nil, batch_size = nil, transaction = false)

   batch_wrapper = Proc.new do |*args, &block|
    opts = {
        name: [table_name, 'write'].join(' '),
        description: "send_batch",
        options: args
    }
    ActiveSupport::Notifications.instrument("write.ok_hbase", opts, &block)
  end

  batch = Batch.new(self, timestamp, batch_size, transaction)
  batch.batch_wrapper = batch_wrapper
  batch
end