Part of bzrlib.index View In Hierarchy
This is designed to allow the accumulation of GraphIndex entries during a single write operation, where the accumulated entries need to be immediately available - for example via a CombinedGraphIndex.
Method | add_nodes | Add nodes to the index. |
Method | iter_all_entries | Iterate over all keys within the index |
Method | iter_entries | Iterate over keys within the index. |
Method | iter_entries_prefix | Iterate over keys within the index using prefix matching. |
Method | key_count | Return an estimate of the number of keys in this index. |
Method | validate | In memory index's have no known corruption at the moment. |
Inherited from GraphIndexBuilder:
Method | __init__ | Create a GraphIndex builder. |
Method | add_node | Add a node to the index. |
Method | clear_cache | See GraphIndex.clear_cache() |
Method | finish | Finish the index. |
Method | set_optimize | Change how the builder tries to optimize the result. |
Method | find_ancestry | See CombinedGraphIndex.find_ancestry() |
Method | _check_key | Raise BadIndexKey if key is not a valid key for this index. |
Method | _external_references | Return references that are not present in this index. |
Method | _get_nodes_by_key | Undocumented |
Method | _update_nodes_by_key | Update the _nodes_by_key dict with a new key. |
Method | _check_key_ref_value | Check that 'key' and 'references' are all valid. |
Parameters | nodes | An iterable of (key, node_refs, value) entries to add. |
Returns | An iterable of (index, key, reference_lists, value). There is no defined order for the result iteration - it will be in the most efficient order for the index (in this case dictionary hash order). |
Parameters | keys | An iterable providing the keys to be retrieved. |
Returns | An iterable of (index, key, value, reference_lists). There is no defined order for the result iteration - it will be in the most efficient order for the index (keys iteration order in this case). |
Prefix matching is applied within the tuple of a key, not to within the bytestring of each key element. e.g. if you have the keys ('foo', 'bar'), ('foobar', 'gam') and do a prefix search for ('foo', None) then only the former key is returned.
Parameters | keys | An iterable providing the key prefixes to be retrieved. Each key prefix takes the form of a tuple the length of a key, but with the last N elements 'None' rather than a regular bytestring. The first element cannot be 'None'. |
Returns | An iterable as per iter_all_entries, but restricted to the keys with a matching prefix to those supplied. No additional keys will be returned, and every match that is in the index will be returned. |