'Returns the relevant chunk from the datastore and reads ahead.'

def _GetChunkForReading(self, chunk):

    try:
        return self.chunk_cache.Get(chunk)
    except KeyError:
        pass
    missing_chunks = []
    for chunk_number in range(chunk, (chunk + self.LOOK_AHEAD)):
        if (chunk_number not in self.chunk_cache):
            missing_chunks.append(chunk_number)
    self._ReadChunks(missing_chunks)
    try:
        return self.chunk_cache.Get(chunk)
    except KeyError:
        raise ChunkNotFoundError(('Cannot    open    chunk    %s' % chunk))
