'Reads a chunk of data from the given block from the first available
datanode that serves it.
@param block a thrift Block object
@param offset offset from the beginning of the block (not file)
@param len the number of bytes to read'

@_coerce_exceptions
def _read_block(self, block, offset, len):

    errs = []
    unipath = block.path
    block.path = encode_fs_path(block.path)
    try:
        for node in block.nodes:
            dn_conn = self._connect_dn(node)
            try:
                data = dn_conn.readBlock(self.request_context, block, offset, len)
                return data.data
            except Exception as e:
                errs.append(e)
            finally:
                dn_conn.close()
    finally:
        block.path = unipath
    raise IOError(('Could    not    read    block    %s    from    any    replicas:    %s' % (block, repr(errs))))
