Find the next block to be written in the input, and copy it to the output.
(self)
| 220 | return f.read(extent.size) |
| 221 | |
| 222 | def copyOneBlock(self): |
| 223 | '''Find the next block to be written in the input, and copy it to the output.''' |
| 224 | extent = self.blockExtents.pop(self.blkCountOut) |
| 225 | if self.blkCountOut in self.outOfOrderData: |
| 226 | # If the data is cached, use it from memory and remove from the cache |
| 227 | rawblock = self.outOfOrderData.pop(self.blkCountOut) |
| 228 | self.outOfOrderSize -= len(rawblock) |
| 229 | else: # Otherwise look up data on disk |
| 230 | rawblock = self.fetchBlock(extent) |
| 231 | |
| 232 | self.writeBlock(extent.inhdr, extent.blkhdr, rawblock) |
| 233 | |
| 234 | def run(self): |
| 235 | while self.blkCountOut < len(self.blkindex): |
no test coverage detected