Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

/**
* Factory for {@link StreamSinkOperator}.
Expand All @@ -38,14 +37,11 @@ public class SinkOperatorFactory {
* Get a sink operator instance via the given sinkType
*/
public StreamSinkOperator getInstance(String sinkType) {
Optional<StreamSinkOperator> instance = sinkOperatorList.stream()
return sinkOperatorList.stream()
.filter(inst -> inst.accept(sinkType))
.findFirst();
if (!instance.isPresent()) {
throw new BusinessException(ErrorCodeEnum.SINK_TYPE_NOT_SUPPORT,
String.format(ErrorCodeEnum.SINK_TYPE_NOT_SUPPORT.getMessage(), sinkType));
}
return instance.get();
.findFirst()
.orElseThrow(() -> new BusinessException(ErrorCodeEnum.SINK_TYPE_NOT_SUPPORT,
String.format(ErrorCodeEnum.SINK_TYPE_NOT_SUPPORT.getMessage(), sinkType)));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public Map<String, List<StreamSource>> getSourcesMap(InlongGroupInfo groupInfo,
Map<String, List<StreamSource>> result;

// if the group mode is LIGHTWEIGHT, just get all related stream sources
List<StreamSource> streamSources = this.listSource(groupInfo.getInlongGroupId(), null);
List<StreamSource> streamSources = this.listSource(groupId, null);
if (InlongConstants.LIGHTWEIGHT_MODE.equals(groupInfo.getLightweight())) {
result = streamSources.stream()
.collect(Collectors.groupingBy(StreamSource::getInlongStreamId, HashMap::new,
Expand Down

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions inlong-manager/manager-web/sql/apache_inlong_manager.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Response<InlongGroupInfo> get(@PathVariable String groupId) {
}

@RequestMapping(value = "/group/list", method = RequestMethod.POST)
@ApiOperation(value = "Get inlong group list by paginating")
@ApiOperation(value = "List inlong groups by paginating")
public Response<PageResult<InlongGroupBriefInfo>> listBrief(@RequestBody InlongGroupPageRequest request) {
request.setCurrentUser(LoginUserUtils.getLoginUser().getName());
request.setIsAdminRole(LoginUserUtils.getLoginUser().getRoles().contains(UserTypeEnum.ADMIN.name()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ public Response<InlongStreamResponse> get(@RequestParam String groupId, @Request
}

@RequestMapping(value = "/stream/list", method = RequestMethod.POST)
@ApiOperation(value = "Get inlong stream brief info by paginating")
@ApiOperation(value = "List inlong stream briefs by paginating")
public Response<PageResult<InlongStreamBriefInfo>> listByCondition(@RequestBody InlongStreamPageRequest request) {
request.setCurrentUser(LoginUserUtils.getLoginUser().getName());
request.setIsAdminRole(LoginUserUtils.getLoginUser().getRoles().contains(UserRoleCode.ADMIN));
return Response.success(streamService.listBrief(request));
}

@RequestMapping(value = "/stream/listAll", method = RequestMethod.POST)
@ApiOperation(value = "Get inlong stream with all sources and sinks by paginating")
@ApiOperation(value = "List inlong streams with sources and sinks by paginating")
public Response<PageResult<InlongStreamInfo>> listAllWithGroupId(@RequestBody InlongStreamPageRequest request) {
request.setCurrentUser(LoginUserUtils.getLoginUser().getName());
request.setIsAdminRole(LoginUserUtils.getLoginUser().getRoles().contains(UserRoleCode.ADMIN));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Response<StreamSink> get(@PathVariable Integer id) {
}

@RequestMapping(value = "/sink/list", method = RequestMethod.GET)
@ApiOperation(value = "Get stream sink list by paginating")
@ApiOperation(value = "List stream sinks by paginating")
public Response<PageResult<? extends StreamSink>> listByCondition(SinkPageRequest request) {
return Response.success(sinkService.listByCondition(request));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Response<StreamSource> get(@PathVariable Integer id) {
}

@RequestMapping(value = "/source/list", method = RequestMethod.GET)
@ApiOperation(value = "Get stream source list by paginating")
@ApiOperation(value = "List stream sources by paginating")
public Response<PageResult<? extends StreamSource>> listByCondition(SourcePageRequest request) {
return Response.success(sourceService.listByCondition(request));
}
Expand Down