Class: StrokeDB::FixedLengthSkiplistVolume
Constant Summary
SimpleSkiplist::DEFAULT_MAXLEVEL, SimpleSkiplist::DEFAULT_PROBABILITY
Instance Attribute Summary
#maxlevel, #probability
Instance Method Summary
collapse
#each, #each_node, #empty?, #find, #find_nearest, #find_nearest_node, #find_with_update, #first_key, from_a, from_hash, #insert, #marshal_dump, #marshal_load, #to_a
Methods included from Enumerable
#each_consecutive_pair, #group_by, #map_with_index
Constructor Details
Returns a new instance of FixedLengthSkiplistVolume.
4
5
6
7
8
9
10
|
# File 'lib/strokedb/volumes/fixed_length_skiplist_volume.rb', line 4
def initialize(options = {})
@options = options.stringify_keys
@volume = MapVolume.new(:record_size => (@options['maxlevel']||DEFAULT_MAXLEVEL) * 4 + 1 +
@options['key_length'] + @options['value_length'], :path => @options['path'])
@nodes = {}
super(nil,:maxlevel => @options['maxlevel'], :probability => @options['probability'])
end
|
Instance Method Details
24
25
26
|
# File 'lib/strokedb/volumes/fixed_length_skiplist_volume.rb', line 24
def close!
@volume.close!
end
|
28
29
30
|
# File 'lib/strokedb/volumes/fixed_length_skiplist_volume.rb', line 28
def inspect
"#<StrokeDB::FixedLengthSkiplistVolume:0x#{object_id.to_s(16)} path: #{path} key_length: #{key_length} value_length: #{value_length}"
end
|
#key_length ⇒ Object
12
13
14
|
# File 'lib/strokedb/volumes/fixed_length_skiplist_volume.rb', line 12
def key_length
@options['key_length']
end
|
20
21
22
|
# File 'lib/strokedb/volumes/fixed_length_skiplist_volume.rb', line 20
def path
@options['path']
end
|
#value_length ⇒ Object
16
17
18
|
# File 'lib/strokedb/volumes/fixed_length_skiplist_volume.rb', line 16
def value_length
@options['value_length']
end
|