Find the next block to be written in the input, and copy it to the output.
(self)
| 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): |
no test coverage detected