b.k._KnitKeyAccess(object) : class documentation

Part of bzrlib.knit View In Hierarchy

Access to records in .knit files.
Method __init__ Create a _KnitKeyAccess with transport and mapper.
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.
def __init__(self, transport, mapper):
Create a _KnitKeyAccess with transport and mapper.
ParameterstransportThe transport the access object is rooted at.
mapperThe mapper used to map keys to .knit files.
def add_raw_records(self, key_sizes, raw_data):
Add raw knit bytes to a storage area.

The data is spooled to the container writer in one bytes-record per raw data item.

ParameterssizesAn iterable of tuples containing the key and size of each raw data segment.
raw_dataA bytestring containing the data.
ReturnsA list of memos to retrieve the record later. Each memo is an opaque index memo. For _KnitKeyAccess the memo is (key, pos, length), where the key is the record key.
def flush(self):
Flush pending writes on this access object.

For .knit files this is a no-op.

def get_raw_records(self, memos_for_retrieval):
Get the raw bytes for a records.
Parametersmemos_for_retrievalAn iterable containing the access memo for retrieving the bytes.
ReturnsAn iterator over the bytes of the records.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.