Class: Aerospike::Large

Inherits:
Object
  • Object
show all
Defined in:
lib/aerospike/ldt/large.rb

Direct Known Subclasses

LargeList, LargeMap, LargeSet, LargeStack

Instance Method Summary collapse

Constructor Details

#initialize(client, policy, key, bin_name, user_module = nil) ⇒ Large

Returns a new instance of Large.



25
26
27
28
29
30
31
32
33
# File 'lib/aerospike/ldt/large.rb', line 25

def initialize(client, policy, key, bin_name, user_module=nil)
  @client = client
  @policy = policy
  @key = key
  @bin_name = bin_name
  @user_module = user_module unless user_module.nil?

  self
end

Instance Method Details

#capacityObject

Return maximum number of entries in the object.



58
59
60
# File 'lib/aerospike/ldt/large.rb', line 58

def capacity
  @client.execute_udf(@key, @PACKAGE_NAME, 'get_capacity', [@bin_name], @policy)
end

#capacity=(capacity) ⇒ Object

Set maximum number of entries in the object.

capacity max entries in set



53
54
55
# File 'lib/aerospike/ldt/large.rb', line 53

def capacity=(capacity)
  @client.execute_udf(@key, @PACKAGE_NAME, 'set_capacity', [@bin_name, capacity], @policy)
end

#configObject

Return map of object configuration parameters.



46
47
48
# File 'lib/aerospike/ldt/large.rb', line 46

def config
  @client.execute_udf(@key, @PACKAGE_NAME, 'get_config', [@bin_name], @policy)
end

#destroyObject

Delete bin containing the object.



36
37
38
# File 'lib/aerospike/ldt/large.rb', line 36

def destroy
  @client.execute_udf(@key, @PACKAGE_NAME, 'destroy', [@bin_name], @policy)
end

#scanObject

Return list of all objects on the stack.



63
64
65
# File 'lib/aerospike/ldt/large.rb', line 63

def scan
  @client.execute_udf(@key, @PACKAGE_NAME, 'scan', [@bin_name], @policy)
end

#sizeObject

Return size of object.



41
42
43
# File 'lib/aerospike/ldt/large.rb', line 41

def size
  @client.execute_udf(@key, @PACKAGE_NAME, 'size', [@bin_name], @policy)
end