Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INLONG-4203][Manager] Improve HTTP request and response parse in manager client #4204

Merged
merged 2 commits into from
May 16, 2022
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 @@ -121,25 +121,22 @@ public InlongStream init() {
InlongStreamInfo streamInfo = streamContext.getStreamInfo();
StreamPipeline streamPipeline = inlongStream.createPipeline();
streamInfo.setTempView(GsonUtil.toJson(streamPipeline));
String streamIndex = managerClient.createStreamInfo(streamInfo);
streamInfo.setId(Double.valueOf(streamIndex).intValue());
Double streamIndex = managerClient.createStreamInfo(streamInfo);
streamInfo.setId(streamIndex.intValue());
//Create source and update index
List<SourceRequest> sourceRequests = Lists.newArrayList(streamContext.getSourceRequests().values());
for (SourceRequest sourceRequest : sourceRequests) {
String sourceIndex = managerClient.createSource(sourceRequest);
sourceRequest.setId(Double.valueOf(sourceIndex).intValue());
sourceRequest.setId(managerClient.createSource(sourceRequest).intValue());
}
//Create sink and update index
List<SinkRequest> sinkRequests = Lists.newArrayList(streamContext.getSinkRequests().values());
for (SinkRequest sinkRequest : sinkRequests) {
String sinkIndex = managerClient.createSink(sinkRequest);
sinkRequest.setId(Double.valueOf(sinkIndex).intValue());
sinkRequest.setId(managerClient.createSink(sinkRequest).intValue());
}
//Create transform and update index
List<TransformRequest> transformRequests = Lists.newArrayList(streamContext.getTransformRequests().values());
for (TransformRequest transformRequest : transformRequests) {
String transformIndex = managerClient.createTransform(transformRequest);
transformRequest.setId(Double.valueOf(transformIndex).intValue());
transformRequest.setId(managerClient.createTransform(transformRequest).intValue());
}
return inlongStream;
}
Expand Down Expand Up @@ -200,8 +197,7 @@ private void initOrUpdateTransform() {
continue;
}
TransformRequest transformRequest = requestEntry.getValue();
String index = managerClient.createTransform(transformRequest);
transformRequest.setId(Double.valueOf(index).intValue());
transformRequest.setId(managerClient.createTransform(transformRequest).intValue());
}
}

Expand Down Expand Up @@ -238,8 +234,7 @@ private void initOrUpdateSource() {
continue;
}
SourceRequest sourceRequest = requestEntry.getValue();
String index = managerClient.createSource(sourceRequest);
sourceRequest.setId(Double.valueOf(index).intValue());
sourceRequest.setId(managerClient.createSource(sourceRequest).intValue());
}
}

Expand Down Expand Up @@ -276,8 +271,7 @@ private void initOrUpdateSink() {
continue;
}
SinkRequest sinkRequest = requestEntry.getValue();
String index = managerClient.createSink(sinkRequest);
sinkRequest.setId(Double.valueOf(index).intValue());
sinkRequest.setId(managerClient.createSink(sinkRequest).intValue());
}
}
}
Loading