You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "vernedeng (via GitHub)" <gi...@apache.org> on 2023/05/17 07:16:22 UTC
[GitHub] [inlong] vernedeng commented on a diff in pull request #8040: [INLONG-8039][Manager] Optimize the transform interface to support pagination query
vernedeng commented on code in PR #8040:
URL: https://github.com/apache/inlong/pull/8040#discussion_r1196038299
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/transform/StreamTransformServiceImpl.java:
##########
@@ -139,16 +142,35 @@ public Integer save(TransformRequest request, UserInfo opInfo) {
}
@Override
- public List<TransformResponse> listTransform(String groupId, String streamId) {
+ public PageResult<TransformResponse> listTransform(TransformPageRequest request) {
+ String groupId = request.getInlongGroupId();
+ String streamId = request.getInlongStreamId();
LOGGER.debug("begin to fetch transform info by groupId={} and streamId={} ", groupId, streamId);
- Preconditions.expectNotBlank(groupId, ErrorCodeEnum.GROUP_ID_IS_EMPTY);
- List<StreamTransformEntity> entityList = transformMapper.selectByRelatedId(groupId, streamId, null);
- if (CollectionUtils.isEmpty(entityList)) {
- return Collections.emptyList();
- }
+ PageHelper.startPage(request.getPageNum(), request.getPageSize());
+ PageResult<TransformResponse> pageResponse = new PageResult<>();
+ pageResponse.setList(getTransform(groupId, streamId));
Review Comment:
For the scalability, it's better to make a **selectByCondition** method in **StreamTransformMapper** which accept **TransformPageRequest** and select entities by those condition defined in page request.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org