Class: PEROBS::BigHash::Entry

Inherits:
Object show all
Defined in:
lib/perobs/BigHash.rb

Overview

Internally this class uses BigTree to store the values by the hashed key. We are using a 64 bit hash space so collisions are fairly unlikely but not impossible. Therefor we have to store the originial key with the value to ensure that we got the right value. The key and value are stored in an Entry object.

In case we have a collision we need to store multiple values for the same hashed key. In that case we store the Entry objects for the same hashed key in a Collisions object instead of storing the Entry directly in the BigTree.

Constant Summary

Constants inherited from ObjectBase

ObjectBase::NATIVE_CLASSES

Instance Attribute Summary

Attributes inherited from Object

#attributes

Attributes inherited from ObjectBase

#_id, #myself, #store

Instance Method Summary collapse

Methods inherited from Object

#_delete_reference_to_id, #_deserialize, #_referenced_object_ids, #attr_init, attr_persist, #init_attr, #inspect, #mark_as_modified

Methods inherited from ObjectBase

#==, #_check_assignment_value, _finalize, #_initialize, #_restore, #_stash, #_sync, #_transfer, read, #restore

Constructor Details

#initialize(p, key, value) ⇒ Entry

Returns a new instance of Entry.



58
59
60
61
62
# File 'lib/perobs/BigHash.rb', line 58

def initialize(p, key, value)
  super(p)
  self.key = key
  self.value = value
end