MCPcopy Create free account
hub / github.com/ElementsProject/elements / copyOneBlock

Method copyOneBlock

contrib/linearize/linearize-data.py:210–220  ·  view source on GitHub ↗

Find the next block to be written in the input, and copy it to the output.

(self)

Source from the content-addressed store, hash-verified

208 return f.read(extent.size)
209
210 def copyOneBlock(self):
211 '''Find the next block to be written in the input, and copy it to the output.'''
212 extent = self.blockExtents.pop(self.blkCountOut)
213 if self.blkCountOut in self.outOfOrderData:
214 # If the data is cached, use it from memory and remove from the cache
215 rawblock = self.outOfOrderData.pop(self.blkCountOut)
216 self.outOfOrderSize -= len(rawblock)
217 else: # Otherwise look up data on disk
218 rawblock = self.fetchBlock(extent)
219
220 self.writeBlock(extent.inhdr, extent.blkhdr, rawblock)
221
222 def run(self):
223 while self.blkCountOut < len(self.blkindex):

Callers 1

runMethod · 0.95

Calls 2

fetchBlockMethod · 0.95
writeBlockMethod · 0.95

Tested by

no test coverage detected