Part of bzrlib.chk_map View In Hierarchy
| Instance Variables | _items | A dict of key->value items. The key is in tuple form. |
| _size | The number of bytes that would be used by serializing all of the key/value pairs. |
| Method | __init__ | Create a node. |
| Method | __repr__ | Undocumented |
| Class Method | deserialise | Deserialise bytes, with key key, into a LeafNode. |
| Method | iteritems | Iterate over items in the node. |
| Method | map | Map key to value. |
| Method | serialise | Serialise the LeafNode to store. |
| Method | refs | Return the references to other CHK's held by this node. |
| Method | unmap | Unmap key from the node. |
| Method | _current_size | Answer the current serialised size of this node. |
| Method | _key_value_len | Undocumented |
| Method | _search_key | Undocumented |
| Method | _map_no_split | Map a key to a value. |
| Method | _split | We have overflowed. |
| Method | _compute_search_prefix | Determine the common search prefix for all keys in this node. |
| Method | _are_search_keys_identical | Check to see if the search keys for all entries are the same. |
| Method | _compute_serialised_prefix | Determine the common prefix for serialised keys in this node. |
Inherited from Node:
| Method | key | Undocumented |
| Method | __len__ | Undocumented |
| Method | maximum_size | What is the upper limit for adding references to a node. |
| Method | set_maximum_size | Set the size threshold for nodes. |
| Class Method | common_prefix | Given 2 strings, return the longest prefix common to both. |
| Class Method | common_prefix_for_keys | Given a list of keys, find their common prefix. |
| Parameters | key_width | The width of keys for this node. |
This differs from self._raw_size in that it includes the bytes used for the header.
| Parameters | bytes | The bytes of the node. |
| key | The key that the serialised node has. |
| Parameters | key_filter | A filter to apply to the node. It should be a list/set/dict or similar repeatedly iterable container. |
This assumes either the key does not already exist, or you have already removed its size and length from self.
| Returns | True if adding this node should cause us to split. | |
Split this node into multiple LeafNodes, return it up the stack so that the next layer creates a new InternalNode and references the new nodes.
| Returns | (common_serialised_prefix, [(node_serialised_prefix, node)]) | |
| Parameters | store | A VersionedFiles honouring the CHK extensions. |
| Returns | An iterable of the keys inserted by this operation. | |
| Returns | A bytestring of the longest search key prefix that is unique within this node. | |
When using a hash as the search_key it is possible for non-identical keys to collide. If that happens enough, we may try overflow a LeafNode, but as all are collisions, we must not split.