Search in sources :

Example 1 with StreamConfigLogEntity

use of org.apache.inlong.manager.dao.entity.StreamConfigLogEntity in project incubator-inlong by apache.

the class StreamConfigLogServiceImpl method convertData.

public StreamConfigLogEntity convertData(InlongStreamConfigLogRequest request) {
    StreamConfigLogEntity entity = new StreamConfigLogEntity();
    entity.setComponentName(request.getComponentName());
    entity.setInlongGroupId(request.getInlongGroupId());
    entity.setInlongStreamId(request.getInlongStreamId());
    entity.setConfigName(request.getConfigName());
    entity.setReportTime(new Date(request.getReportTime()));
    entity.setVersion(request.getVersion());
    entity.setLogInfo(request.getLogInfo());
    entity.setLogType(request.getLogType());
    entity.setIp(request.getIp());
    return entity;
}
Also used : StreamConfigLogEntity(org.apache.inlong.manager.dao.entity.StreamConfigLogEntity) Date(java.util.Date)

Example 2 with StreamConfigLogEntity

use of org.apache.inlong.manager.dao.entity.StreamConfigLogEntity in project incubator-inlong by apache.

the class StreamConfigLogServiceImpl method listByCondition.

@Override
public PageInfo<InlongStreamConfigLogListResponse> listByCondition(InlongStreamConfigLogPageRequest request) {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("begin to list source page by " + request);
    }
    Preconditions.checkNotNull(request.getInlongGroupId(), Constant.GROUP_ID_IS_EMPTY);
    PageHelper.startPage(request.getPageNum(), request.getPageSize());
    if (request.getReportTime() == null) {
        Instant instant = Instant.now().minus(Duration.ofMillis(5));
        request.setReportTime(new Date(instant.toEpochMilli()));
    }
    Page<StreamConfigLogEntity> entityPage = (Page<StreamConfigLogEntity>) streamConfigLogEntityMapper.selectByCondition(request);
    List<InlongStreamConfigLogListResponse> detailList = CommonBeanUtils.copyListProperties(entityPage, InlongStreamConfigLogListResponse::new);
    PageInfo<InlongStreamConfigLogListResponse> pageInfo = new PageInfo<>(detailList);
    pageInfo.setTotal(entityPage.getTotal());
    return pageInfo;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) StreamConfigLogEntity(org.apache.inlong.manager.dao.entity.StreamConfigLogEntity) InlongStreamConfigLogListResponse(org.apache.inlong.manager.common.pojo.stream.InlongStreamConfigLogListResponse) Instant(java.time.Instant) Page(com.github.pagehelper.Page) Date(java.util.Date)

Aggregations

Date (java.util.Date)2 StreamConfigLogEntity (org.apache.inlong.manager.dao.entity.StreamConfigLogEntity)2 Page (com.github.pagehelper.Page)1 PageInfo (com.github.pagehelper.PageInfo)1 Instant (java.time.Instant)1 InlongStreamConfigLogListResponse (org.apache.inlong.manager.common.pojo.stream.InlongStreamConfigLogListResponse)1