264
264
# iter_all validates completely at the moment, so just do that.
265
265
for node in self.iter_all_entries():
269
class CombinedGraphIndex(object):
270
"""A GraphIndex made up from smaller GraphIndices.
272
The backing indices must implement GraphIndex, and are presumed to be
276
def __init__(self, indices):
277
"""Create a CombinedGraphIndex backed by indices.
279
:param indices: The indices to query for data.
281
self._indices = indices
283
def iter_all_entries(self):
284
"""Iterate over all keys within the index
286
:return: An iterable of (key, reference_lists, value). There is no
287
defined order for the result iteration - it will be in the most
288
efficient order for the index.
291
for index in self._indices:
292
for node in index.iter_all_entries():
293
if node[0] not in seen_keys:
295
seen_keys.add(node[0])
297
def iter_entries(self, keys):
298
"""Iterate over keys within the index.
300
:param keys: An iterable providing the keys to be retrieved.
301
:return: An iterable of (key, reference_lists, value). There is no
302
defined order for the result iteration - it will be in the most
303
efficient order for the index.
307
for node in self.iter_all_entries():
311
missing = keys.difference(found)
313
raise errors.MissingKey(self, missing.pop())
316
"""Validate that everything in the index can be accessed."""
317
for index in self._indices: