'Retrieve the relevant blob from the AFF4 data store or cache.'

def _GetChunkForReading(self, chunk):

    offset = (chunk * self._HASH_SIZE)
    self.index.seek(offset)
    chunk_name = self.index.read(self._HASH_SIZE).encode('hex')
    try:
        return self.chunk_cache.Get(chunk_name)
    except KeyError:
        pass
    self.index.seek(offset)
    readahead = []
    for _ in range(self._READAHEAD):
        name = self.index.read(self._HASH_SIZE).encode('hex')
        if (name and (name not in self.chunk_cache)):
            readahead.append(name)
    self._ReadChunks(readahead)
    try:
        return self.chunk_cache.Get(chunk_name)
    except KeyError:
        raise aff4.ChunkNotFoundError(('Cannot    open    chunk    %s' % chunk))
