use of org.apache.inlong.manager.client.api.InlongGroupConf in project incubator-inlong by apache.
the class InlongGroupTransfer method parseGroupResponse.
public static InlongGroupConf parseGroupResponse(InlongGroupResponse groupResponse) {
InlongGroupConf inlongGroupConf = new InlongGroupConf();
inlongGroupConf.setGroupName(groupResponse.getName());
inlongGroupConf.setDescription(groupResponse.getDescription());
inlongGroupConf.setCnName(groupResponse.getCnName());
inlongGroupConf.setZookeeperEnabled(groupResponse.getZookeeperEnabled() == 1);
inlongGroupConf.setDailyRecords(Long.valueOf(groupResponse.getDailyRecords()));
inlongGroupConf.setPeakRecords(Long.valueOf(groupResponse.getPeakRecords()));
inlongGroupConf.setMqBaseConf(parseMqBaseConf(groupResponse));
inlongGroupConf.setSortBaseConf(parseSortBaseConf(groupResponse));
inlongGroupConf.setProxyClusterId(groupResponse.getProxyClusterId());
return inlongGroupConf;
}
use of org.apache.inlong.manager.client.api.InlongGroupConf in project incubator-inlong by apache.
the class InlongClientImpl method listGroup.
@Override
public List<InlongGroup> listGroup(String expr, int status, int pageNum, int pageSize) throws Exception {
InnerInlongManagerClient managerClient = new InnerInlongManagerClient(this);
PageInfo<InlongGroupListResponse> responsePageInfo = managerClient.listGroups(expr, status, pageNum, pageSize);
if (CollectionUtils.isEmpty(responsePageInfo.getList())) {
return Lists.newArrayList();
} else {
return responsePageInfo.getList().stream().map(response -> {
String groupId = response.getInlongGroupId();
InlongGroupResponse groupResponse = managerClient.getGroupInfo(groupId);
InlongGroupConf groupConf = InlongGroupTransfer.parseGroupResponse(groupResponse);
return new InlongGroupImpl(groupConf, this);
}).collect(Collectors.toList());
}
}
use of org.apache.inlong.manager.client.api.InlongGroupConf in project incubator-inlong by apache.
the class InlongClientImpl method getGroup.
@Override
public InlongGroup getGroup(String groupName) throws Exception {
InnerInlongManagerClient managerClient = new InnerInlongManagerClient(this);
final String groupId = "b_" + groupName;
InlongGroupResponse groupResponse = managerClient.getGroupInfo(groupId);
if (groupResponse == null) {
return new BlankInlongGroup();
}
InlongGroupConf groupConf = InlongGroupTransfer.parseGroupResponse(groupResponse);
return new InlongGroupImpl(groupConf, this);
}
Aggregations