Class: HbaseAdapter::MutationList

Inherits:
Object
  • Object
show all
Defined in:
lib/hbase_adapter/mutation.rb

Instance Method Summary collapse

Constructor Details

#initialize(&blk) ⇒ MutationList

Returns a new instance of MutationList.



37
38
39
40
41
# File 'lib/hbase_adapter/mutation.rb', line 37

def initialize(&blk)
  @mutations = []
  
  self.instance_eval(&blk)
end

Instance Method Details

#batch_mutation(key, &blk) ⇒ Object



43
44
45
# File 'lib/hbase_adapter/mutation.rb', line 43

def batch_mutation(key, &blk)
  @mutations << BatchMutation.new(key, &blk)
end

#delete(column) ⇒ Object



51
52
53
# File 'lib/hbase_adapter/mutation.rb', line 51

def delete(column)
  @mutations << DeleteMutation.new(column)
end

#to_thriftObject



55
56
57
# File 'lib/hbase_adapter/mutation.rb', line 55

def to_thrift
  @mutations.map {|m| m.to_thrift}
end

#update(column, value) ⇒ Object



47
48
49
# File 'lib/hbase_adapter/mutation.rb', line 47

def update(column, value)
  @mutations << UpdateMutation.new(column, value)
end