b.r.k.KnitPacker(Packer) : class documentation

Part of bzrlib.repofmt.knitpack_repo View In Hierarchy

Known subclasses: bzrlib.repofmt.knitpack_repo.KnitReconcilePacker, bzrlib.repofmt.knitpack_repo.OptimisingKnitPacker

Packer that works with knit packs.
Method __init__ Create a Packer.
Method _pack_map_and_index_list Convert a list of packs to an index pack map and index list.
Method _index_contents Get an iterable of the index contents from a pack_map.
Method _copy_nodes Copy knit nodes between packs with no graph references.
Method _do_copy_nodes Undocumented
Method _copy_nodes_graph Copy knit nodes between packs.
Method _do_copy_nodes_graph Undocumented
Method _process_inventory_lines Use up the inv_lines generator and setup a text key filter.
Method _copy_inventory_texts Copy the inventory texts to the new pack.
Method _update_pack_order Determine how we want our packs to be ordered.
Method _copy_revision_texts Copy revision data to the new pack.
Method _get_text_nodes Undocumented
Method _copy_text_texts Undocumented
Method _create_pack_from_packs Undocumented
Method _least_readv_node_readv Generate request groups for nodes using the least readv's.
Method _revision_node_readv Return the total revisions and the readv's to issue.

Inherited from Packer:

Method pack Create a new pack by reading data from other packs.
Method open_pack Open a pack for the pack we are creating.
Method _log_copied_texts Undocumented
Method _use_pack Return True if new_pack should be used.
def __init__(self, pack_collection, packs, suffix, revision_ids=None, reload_func=None):
Create a Packer.
Parameterspack_collectionA RepositoryPackCollection object where the new pack is being written to.
packsThe packs to combine.
suffixThe suffix to use on the temporary files for the pack.
revision_idsRevision ids to limit the pack to.
reload_funcA function to call if a pack file/index goes missing. The side effect of calling this function should be to update self.packs. See also AggregateIndex
def _pack_map_and_index_list(self, index_attribute):
Convert a list of packs to an index pack map and index list.
Parametersindex_attributeThe attribute that the desired index is found on.
ReturnsA tuple (map, list) where map contains the dict from index:pack_tuple, and list contains the indices in the preferred access order.
def _index_contents(self, indices, key_filter=None):
Get an iterable of the index contents from a pack_map.
ParametersindicesThe list of indices to query
key_filterAn optional filter to limit the keys returned.
def _copy_nodes(self, nodes, index_map, writer, write_index, output_lines=None):
Copy knit nodes between packs with no graph references.
Parametersoutput_linesOutput full texts of copied items.
def _do_copy_nodes(self, nodes, index_map, writer, write_index, pb, output_lines=None):
Undocumented
def _copy_nodes_graph(self, index_map, writer, write_index, readv_group_iter, total_items, output_lines=False):
Copy knit nodes between packs.
Parametersoutput_linesReturn lines present in the copied data as an iterator of line,version_id.
def _do_copy_nodes_graph(self, index_map, writer, write_index, output_lines, pb, readv_group_iter, total_items):
Undocumented
def _process_inventory_lines(self, inv_lines):
Use up the inv_lines generator and setup a text key filter.
def _copy_inventory_texts(self):
Copy the inventory texts to the new pack.

self._revision_keys is used to determine what inventories to copy.

Sets self._text_filter appropriately.

def _update_pack_order(self, entries, index_to_pack_map):
Determine how we want our packs to be ordered.

This changes the sort order of the self.packs list so that packs unused by 'entries' will be at the end of the list, so that future requests can avoid probing them. Used packs will be at the front of the self.packs list, in the order of their first use in 'entries'.

ParametersentriesA list of (index, ...) tuples
index_to_pack_mapA mapping from index objects to pack objects.
def _copy_revision_texts(self):
Copy revision data to the new pack.
def _get_text_nodes(self):
Undocumented
def _copy_text_texts(self):
Undocumented
def _create_pack_from_packs(self):
Undocumented
def _least_readv_node_readv(self, nodes):
Generate request groups for nodes using the least readv's.
ParametersnodesAn iterable of graph index nodes.
ReturnsTotal node count and an iterator of the data needed to perform readvs to obtain the data for nodes. Each item yielded by the iterator is a tuple with: index, readv_vector, node_vector. readv_vector is a list ready to hand to the transport readv method, and node_vector is a list of (key, eol_flag, references) for the node retrieved by the matching readv_vector.
def _revision_node_readv(self, revision_nodes):
Return the total revisions and the readv's to issue.
Parametersrevision_nodesThe revision index contents for the packs being incorporated into the new pack.
ReturnsAs per _least_readv_node_readv.
API Documentation for Bazaar, generated by pydoctor at 2019-10-16 00:36:43.