Esempio n. 1
0
 def proxy_read(self, image_name, str_block_size, str_block_index,
                str_offset, str_size):
     block_size = int(str_block_size)
     block_index = int(str_block_index)
     offset = int(str_offset)
     size = int(str_size)
     data = ukai_local_read(image_name, block_size, block_index,
                            offset, size, self._config)
     return self._rpc_trans.encode(zlib.compress(data))
Esempio n. 2
0
    def _get_data_local(self, node, blk_idx, off_in_blk, size_in_blk):
        '''
        Returns a data read from a local store.

        node: the target node from which we read the data.
        num: the block index of the disk image.
        offset: the offset relative to the beginning of the specified
            block.
        size: the length of the data to be read.
        '''
        data = ukai_local_read(self._metadata.name, self._metadata.block_size,
                               blk_idx, off_in_blk, size_in_blk, self._config)
        return (data)
Esempio n. 3
0
    def _get_data_local(self, node, blk_idx, off_in_blk, size_in_blk):
        '''
        Returns a data read from a local store.

        node: the target node from which we read the data.
        num: the block index of the disk image.
        offset: the offset relative to the beginning of the specified
            block.
        size: the length of the data to be read.
        '''
        data = ukai_local_read(self._metadata.name,
                               self._metadata.block_size,
                               blk_idx, off_in_blk, size_in_blk,
                               self._config)
        return (data)
Esempio n. 4
0
 def proxy_read(self, image_name, block_size, block_index, offset,
                size):
     data = ukai_local_read(image_name, block_size, block_index,
                            offset, size, self._config)
     return self._rpc_trans.encode(zlib.compress(data))