Search in sources :

Example 1 with InnerInlongManagerClient

use of org.apache.inlong.manager.client.api.inner.InnerInlongManagerClient 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());
    }
}
Also used : Socket(java.net.Socket) Getter(lombok.Getter) MapUtils(org.apache.commons.collections.MapUtils) ClientConfiguration(org.apache.inlong.manager.client.api.ClientConfiguration) IOException(java.io.IOException) PageInfo(com.github.pagehelper.PageInfo) InlongGroup(org.apache.inlong.manager.client.api.InlongGroup) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) InlongGroupTransfer(org.apache.inlong.manager.client.api.util.InlongGroupTransfer) InlongGroupListResponse(org.apache.inlong.manager.common.pojo.group.InlongGroupListResponse) Slf4j(lombok.extern.slf4j.Slf4j) InlongGroupResponse(org.apache.inlong.manager.common.pojo.group.InlongGroupResponse) List(java.util.List) Lists(com.google.common.collect.Lists) CollectionUtils(org.apache.commons.collections.CollectionUtils) InlongGroupConf(org.apache.inlong.manager.client.api.InlongGroupConf) Map(java.util.Map) InnerInlongManagerClient(org.apache.inlong.manager.client.api.inner.InnerInlongManagerClient) InlongClient(org.apache.inlong.manager.client.api.InlongClient) Splitter(com.google.common.base.Splitter) InlongGroupConf(org.apache.inlong.manager.client.api.InlongGroupConf) InnerInlongManagerClient(org.apache.inlong.manager.client.api.inner.InnerInlongManagerClient) InlongGroupListResponse(org.apache.inlong.manager.common.pojo.group.InlongGroupListResponse) InlongGroupResponse(org.apache.inlong.manager.common.pojo.group.InlongGroupResponse)

Example 2 with InnerInlongManagerClient

use of org.apache.inlong.manager.client.api.inner.InnerInlongManagerClient 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);
}
Also used : InlongGroupConf(org.apache.inlong.manager.client.api.InlongGroupConf) InnerInlongManagerClient(org.apache.inlong.manager.client.api.inner.InnerInlongManagerClient) InlongGroupResponse(org.apache.inlong.manager.common.pojo.group.InlongGroupResponse)

Aggregations

InlongGroupConf (org.apache.inlong.manager.client.api.InlongGroupConf)2 InnerInlongManagerClient (org.apache.inlong.manager.client.api.inner.InnerInlongManagerClient)2 InlongGroupResponse (org.apache.inlong.manager.common.pojo.group.InlongGroupResponse)2 PageInfo (com.github.pagehelper.PageInfo)1 Splitter (com.google.common.base.Splitter)1 Lists (com.google.common.collect.Lists)1 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 Socket (java.net.Socket)1 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 Getter (lombok.Getter)1 Slf4j (lombok.extern.slf4j.Slf4j)1 CollectionUtils (org.apache.commons.collections.CollectionUtils)1 MapUtils (org.apache.commons.collections.MapUtils)1 ClientConfiguration (org.apache.inlong.manager.client.api.ClientConfiguration)1 InlongClient (org.apache.inlong.manager.client.api.InlongClient)1 InlongGroup (org.apache.inlong.manager.client.api.InlongGroup)1 InlongGroupTransfer (org.apache.inlong.manager.client.api.util.InlongGroupTransfer)1