use of org.apache.inlong.manager.common.pojo.sink.SinkForSortDTO in project incubator-inlong by apache.
the class CreateHiveTableListener method listen.
@Override
public ListenerResult listen(WorkflowContext context) {
GroupResourceProcessForm form = (GroupResourceProcessForm) context.getProcessForm();
String groupId = form.getInlongGroupId();
log.info("begin to create hive table for groupId={}", groupId);
List<SinkForSortDTO> configList = sinkMapper.selectAllConfig(groupId, null);
List<SinkForSortDTO> needCreateList = configList.stream().filter(sinkForSortDTO -> sinkForSortDTO.getEnableCreateResource() == 1).collect(Collectors.toList());
if (hiveTableOperator == null) {
hiveTableOperator = (IHiveTableOperator) SpringContextUtils.getBean(IHiveTableOperator.BEAN_NAME, DefaultHiveTableOperator.class.getName());
}
hiveTableOperator.createHiveResource(groupId, needCreateList);
String result = "success to create hive table for group [" + groupId + "]";
log.info(result);
return ListenerResult.success(result);
}
use of org.apache.inlong.manager.common.pojo.sink.SinkForSortDTO in project incubator-inlong by apache.
the class CreateHiveTableForStreamListener method listen.
@Override
public ListenerResult listen(WorkflowContext context) {
GroupResourceProcessForm form = (GroupResourceProcessForm) context.getProcessForm();
String groupId = form.getInlongGroupId();
String streamId = form.getInlongStreamId();
log.info("begin create hive table for groupId={}, streamId={}", groupId, streamId);
List<SinkForSortDTO> configList = sinkMapper.selectAllConfig(groupId, streamId);
if (hiveTableOperator == null) {
hiveTableOperator = (IHiveTableOperator) SpringContextUtils.getBean(IHiveTableOperator.BEAN_NAME, DefaultHiveTableOperator.class.getName());
}
hiveTableOperator.createHiveResource(groupId, configList);
String result = "success to create hive table for group [" + groupId + "], stream [" + streamId + "]";
log.info(result);
return ListenerResult.success(result);
}
Aggregations