示例#1
0
    def __init__(self, image_name, config, metadata_raw=None):
        '''
        Initializes the class with the specified file contents.  The
        metadata_file is a JSON format file, which is generated by the
        UKAIMetadataCreate() function or the flush() method of this
        class.

        image_name: The name of a virtual disk image stored in a
            object storage.
        metadata_raw: a raw metadata which is specified when a new
            UKAIMetadata object is inserted.

        Return values: This function does not return any values.
        '''
        self._config = config
        self._rpc_trans = UKAIXMLRPCTranslation()
        if (metadata_raw != None):
            self._metadata = metadata_raw
        else:
            self._metadata = None
            self._metadata = ukai_db_client.get_metadata(image_name)

        self._lock = []
        for idx in range(0, len(self.blocks)):
            self._lock.append(threading.Lock())
示例#2
0
 def _get_metadata(self, image_name):
     return ukai_db_client.get_metadata(image_name)