use of com.webank.wedatasphere.qualitis.metadata.response.cluster.ClusterInfoDetail in project Qualitis by WeBankFinTech.
the class MetaDataServiceImpl method getUserCluster.
@Override
public GeneralResponse<GetAllClusterResponse<ClusterInfoDetail>> getUserCluster(GetUserClusterRequest request) throws UnExpectedRequestException, MetaDataAcquireFailedException {
// Check Arguments
checkRequest(request);
// Get login user
String userName = HttpUtils.getUserName(httpServletRequest);
GetClusterByUserRequest getClusterByUserRequest = new GetClusterByUserRequest(userName, request.getStartIndex(), request.getPageSize());
DataInfo<ClusterInfoDetail> response = metaDataClient.getClusterByUser(getClusterByUserRequest);
GetAllClusterResponse<ClusterInfoDetail> result = new GetAllClusterResponse<>();
result.setOptionalClusters(ruleLimitationService.getLimitClusters());
result.setTotal(response.getTotalCount());
result.setData(response.getContent());
LOGGER.info("Succeed to get cluster. response: {}", result);
return new GeneralResponse<>("200", "{&GET_CLUSTER_SUCCESSFULLY}", result);
}
use of com.webank.wedatasphere.qualitis.metadata.response.cluster.ClusterInfoDetail in project Qualitis by WeBankFinTech.
the class MetaDataClientImpl method getClusterByUser.
@Override
public DataInfo<ClusterInfoDetail> getClusterByUser(GetClusterByUserRequest request) {
Long total = clusterInfoDao.countAll();
List<ClusterInfo> allCluster = clusterInfoDao.findAllClusterInfo(request.getStartIndex(), request.getPageSize());
DataInfo<ClusterInfoDetail> dataInfo = new DataInfo<>(total.intValue());
if (CollectionUtils.isEmpty(allCluster)) {
return dataInfo;
}
List<ClusterInfoDetail> details = new ArrayList<>();
for (ClusterInfo clusterInfo : allCluster) {
ClusterInfoDetail detail = new ClusterInfoDetail(clusterInfo.getClusterName());
details.add(detail);
}
dataInfo.setContent(details);
return dataInfo;
}
Aggregations