Part of bzrlib.repofmt.pack_repo View In Hierarchy
Method | __init__ | Create a _DirectPackAccess object. |
Method | add_raw_records | Add raw knit bytes to a storage area. |
Method | flush | Flush pending writes on this access object. |
Method | get_raw_records | Get the raw bytes for a records. |
Method | set_writer | Set a writer to use for adding data. |
Method | reload_or_raise | Try calling the reload function, or re-raise the original exception. |
Parameters | index_to_packs | A dict mapping index objects to the transport and file names for obtaining data. |
reload_func | A function to call if we determine that the pack files have moved and we need to reload our caches. See bzrlib.repo_fmt.pack_repo.AggregateIndex for more details. |
The data is spooled to the container writer in one bytes-record per raw data item.
Parameters | sizes | An iterable of tuples containing the key and size of each raw data segment. |
raw_data | A bytestring containing the data. | |
Returns | A list of memos to retrieve the record later. Each memo is an opaque index memo. For _DirectPackAccess the memo is (index, pos, length), where the index field is the write_index object supplied to the PackAccess object. |
This will flush any buffered writes to a NewPack.
Parameters | memos_for_retrieval | An iterable containing the (index, pos, length) memo for retrieving the bytes. The Pack access method looks up the pack to use for a given record in its index_to_pack map. |
Returns | An iterator over the bytes of the records. |
This should be called after _DirectPackAccess raises a RetryWithNewPacks exception. This function will handle the common logic of determining when the error is fatal versus being temporary. It will also make sure that the original exception is raised, rather than the RetryWithNewPacks exception.
If this function returns, then the calling function should retry whatever operation was being performed. Otherwise an exception will be raised.
Parameters | retry_exc | A RetryWithNewPacks exception. |