lib/purecdb/writer.rb
# Store 'value' under 'key'.
#
# Multiple values can we stored for the same key by calling #store multiple times
# with the same key value.
Store 'value' under 'key'.
Multiple values can we stored for the same key by calling #store multiple times
with the same key value.
Store ' value ' under ' key ' . Multiple values can we stored for the same key by calling #store multiple times with the same key value .
def store key,value
      h = hash(key)
      hi = (h % num_hashes)
      @hashes[hi] ||= ""
      header = build_header(key.length, value.length)
      @io.syswrite(header+key+value)
      size = header.size + key.size + value.size
      @hashes[hi] += [h,@pos].pack("ww") 
      @pos += size
    end
def store key , value h = hash ( key ) hi = ( h % num_hashes ) @hashes [ hi ] ||= "" header = build_header ( key . length , value . length ) @io . syswrite ( header + key + value ) size = header . size + key . size + value . size @hashes [ hi ] += [ h , @pos ] . pack ( "ww" ) @pos += size end
Store 'value' under 'key'.
Store ' value ' under ' key ' .
# In an attempt to save memory, we pack the hash data we gather into # strings of BER compressed integers... # BER compressed
key
<not_specific>
value
<not_specific>