Skip to content

Commit

Permalink
Merge pull request #6 from TongchengOpenSource/revert-3-optimize_gets…
Browse files Browse the repository at this point in the history
…erver

Revert "[Improve][Zeta]Optimize the logic of RestHttpGetCommandProcessor#getSeaTunnelServer()"
  • Loading branch information
xiaochen-zhou authored Apr 1, 2024
2 parents eac76d0 + 56be8bb commit 15a981c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,13 @@ public boolean taskIsEnded(@NonNull TaskGroupLocation taskGroupLocation) {
public boolean isMasterNode() {
// must retry until the cluster have master node
try {
return Boolean.TRUE.equals(
RetryUtils.retryWithException(
() -> nodeEngine.getThisAddress().equals(nodeEngine.getMasterAddress()),
new RetryUtils.RetryMaterial(
Constant.OPERATION_RETRY_TIME,
true,
exception ->
exception instanceof NullPointerException && isRunning,
Constant.OPERATION_RETRY_SLEEP)));
return RetryUtils.retryWithException(
() -> nodeEngine.getThisAddress().equals(nodeEngine.getMasterAddress()),
new RetryUtils.RetryMaterial(
Constant.OPERATION_RETRY_TIME,
true,
exception -> exception instanceof NullPointerException && isRunning,
Constant.OPERATION_RETRY_SLEEP));
} catch (InterruptedException e) {
LOGGER.info("master node check interrupted");
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ private JsonObject convertToJson(JobInfo jobInfo, long jobId) {
SeaTunnelServer seaTunnelServer = getSeaTunnelServer(true);
String jobMetrics;
JobStatus jobStatus;
ClassLoaderService classLoaderService;
if (seaTunnelServer == null) {
jobMetrics =
(String)
Expand All @@ -391,14 +390,15 @@ private JsonObject convertToJson(JobInfo jobInfo, long jobId) {
getNode().nodeEngine,
new GetJobStatusOperation(jobId))
.join()];
classLoaderService = getSeaTunnelServer(false).getClassLoaderService();
seaTunnelServer = getSeaTunnelServer(false);

} else {
jobMetrics =
seaTunnelServer.getCoordinatorService().getJobMetrics(jobId).toJsonString();
jobStatus = seaTunnelServer.getCoordinatorService().getJobStatus(jobId);
classLoaderService = seaTunnelServer.getClassLoaderService();
}

ClassLoaderService classLoaderService = seaTunnelServer.getClassLoaderService();
ClassLoader classLoader =
classLoaderService.getClassLoader(
jobId, jobImmutableInformation.getPluginJarsUrls());
Expand Down

0 comments on commit 15a981c

Please sign in to comment.