def _build_data_links(self):
    config = ParseConfig.parse(config_path=os.getenv('HDM_MANIFEST'))
    state_manager_config = config['state_manager']
    manifest_name = os.getenv('HDM_MANIFEST')[(os.getenv('HDM_MANIFEST').rindex('/') + 1):]
    run_id = uuid.uuid4().hex
    for link_config in config['declared_data_links']['stages']:
        link_state = self._generate_state_manager(state_manager_config=state_manager_config, data_link_config=link_config, manifest_name=manifest_name, run_id=run_id)
        link_config['source']['conf']['state_manager'] = link_state
        link_config['sink']['conf']['state_manager'] = link_state
        source = DataLinkBuilder.build_source(link_config['source'])
        if (not isinstance(source, Source)):
            error = f'Source {type(source)} is not a Source.'
            self._logger.error(error)
            raise HDMError(error)
        sink = DataLinkBuilder.build_sink(link_config['sink'])
        if (not isinstance(sink, Sink)):
            error = f'Sink {type(sink)} is not a Sink.'
            self._logger.error(error)
            raise HDMError(error)
        self._data_links.append(DataLink(source=source, sink=sink))
def _build_data_links(self):
    config = ParseConfig.parse(config_path=os.getenv('HDM_MANIFEST'))
    state_manager_config = config['state_manager']
    manifest_name = os.getenv('HDM_MANIFEST')[(os.getenv('HDM_MANIFEST').rindex('/') + 1):]
    run_id = uuid.uuid4().hex
    for link_config in config['declared_data_links']['stages']:
        link_state = self._generate_state_manager(state_manager_config=state_manager_config, data_link_config=link_config, manifest_name=manifest_name, run_id=run_id)
        link_config['source']['conf']['state_manager'] = link_state
        link_config['sink']['conf']['state_manager'] = link_state
        source = DataLinkBuilder.build_source(link_config['source'])
        if (not isinstance(source, Source)):
            error = f'Source {type(source)} is not a Source.'
            self._logger.error(error)
            raise HDMError(error)
        sink = DataLinkBuilder.build_sink(link_config['sink'])
        if (not isinstance(sink, Sink)):
            error = f'Sink {type(sink)} is not a Sink.'
            self._logger.error(error)
            raise HDMError(error)
        self._data_links.append(DataLink(source=source, sink=sink))