MCPcopy
hub / github.com/borgbackup/borg / chunk_processor

Method chunk_processor

src/borg/archive.py:2295–2303  ·  view source on GitHub ↗
(self, target, chunk)

Source from the content-addressed store, hash-verified

2293 target.process_file_chunks(item, self.cache, target.stats, self.progress, chunk_iterator, chunk_processor)
2294
2295 def chunk_processor(self, target, chunk):
2296 chunk_id, data = cached_hash(chunk, self.key.id_hash)
2297 size = len(data)
2298 if chunk_id in self.seen_chunks:
2299 return self.cache.reuse_chunk(chunk_id, size, target.stats)
2300 chunk_entry = self.cache.add_chunk(chunk_id, {}, data, stats=target.stats, wait=False, ro_type=ROBJ_FILE_STREAM)
2301 self.cache.repository.async_response(wait=False)
2302 self.seen_chunks.add(chunk_entry.id)
2303 return chunk_entry
2304
2305 def iter_chunks(self, archive, target, chunks):
2306 chunk_iterator = archive.pipeline.fetch_many(chunks, ro_type=ROBJ_FILE_STREAM)

Callers

nothing calls this directly

Calls 5

cached_hashFunction · 0.85
reuse_chunkMethod · 0.80
add_chunkMethod · 0.45
async_responseMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected