Search in sources :

Example 1 with StreamBriefResponse

use of org.apache.inlong.manager.common.pojo.stream.StreamBriefResponse in project incubator-inlong by apache.

the class AbstractSourceOperateListener method listen.

@Override
public ListenerResult listen(WorkflowContext context) throws Exception {
    log.info("Delete data source for context={}", context);
    InlongGroupInfo groupInfo = getGroupInfo(context.getProcessForm());
    final String groupId = groupInfo.getInlongGroupId();
    List<StreamBriefResponse> streamBriefResponses = streamService.getBriefList(groupId);
    streamBriefResponses.forEach(streamBriefResponse -> operateStreamSources(groupId, streamBriefResponse.getInlongStreamId(), context.getApplicant()));
    return ListenerResult.success();
}
Also used : StreamBriefResponse(org.apache.inlong.manager.common.pojo.stream.StreamBriefResponse) InlongGroupInfo(org.apache.inlong.manager.common.pojo.group.InlongGroupInfo)

Example 2 with StreamBriefResponse

use of org.apache.inlong.manager.common.pojo.stream.StreamBriefResponse in project incubator-inlong by apache.

the class InlongGroupProcessOperation method genNewGroupProcessForm.

/**
 * Generate the form of [New Group Workflow]
 */
public NewGroupProcessForm genNewGroupProcessForm(String groupId) {
    NewGroupProcessForm form = new NewGroupProcessForm();
    InlongGroupInfo groupInfo = groupService.get(groupId);
    form.setGroupInfo(groupInfo);
    List<StreamBriefResponse> infoList = streamService.getBriefList(groupInfo.getInlongGroupId());
    form.setStreamInfoList(infoList);
    return form;
}
Also used : StreamBriefResponse(org.apache.inlong.manager.common.pojo.stream.StreamBriefResponse) NewGroupProcessForm(org.apache.inlong.manager.common.pojo.workflow.form.NewGroupProcessForm) InlongGroupInfo(org.apache.inlong.manager.common.pojo.group.InlongGroupInfo)

Example 3 with StreamBriefResponse

use of org.apache.inlong.manager.common.pojo.stream.StreamBriefResponse in project incubator-inlong by apache.

the class InlongStreamServiceImpl method getBriefList.

@Override
public List<StreamBriefResponse> getBriefList(String groupId) {
    LOGGER.debug("begin to get inlong stream brief list by groupId={}", groupId);
    Preconditions.checkNotNull(groupId, Constant.GROUP_ID_IS_EMPTY);
    List<InlongStreamEntity> entityList = streamMapper.selectByGroupId(groupId);
    List<StreamBriefResponse> briefInfoList = CommonBeanUtils.copyListProperties(entityList, StreamBriefResponse::new);
    // Query stream sinks based on groupId and streamId
    for (StreamBriefResponse briefInfo : briefInfoList) {
        String streamId = briefInfo.getInlongStreamId();
        List<SinkBriefResponse> sinkList = sinkService.listBrief(groupId, streamId);
        briefInfo.setSinkList(sinkList);
    }
    LOGGER.info("success to get inlong stream brief list for groupId={}", groupId);
    return briefInfoList;
}
Also used : StreamBriefResponse(org.apache.inlong.manager.common.pojo.stream.StreamBriefResponse) InlongStreamEntity(org.apache.inlong.manager.dao.entity.InlongStreamEntity) SinkBriefResponse(org.apache.inlong.manager.common.pojo.sink.SinkBriefResponse)

Aggregations

StreamBriefResponse (org.apache.inlong.manager.common.pojo.stream.StreamBriefResponse)3 InlongGroupInfo (org.apache.inlong.manager.common.pojo.group.InlongGroupInfo)2 SinkBriefResponse (org.apache.inlong.manager.common.pojo.sink.SinkBriefResponse)1 NewGroupProcessForm (org.apache.inlong.manager.common.pojo.workflow.form.NewGroupProcessForm)1 InlongStreamEntity (org.apache.inlong.manager.dao.entity.InlongStreamEntity)1