Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaochen-zhou committed Mar 31, 2024
1 parent 9e0afeb commit be05a1d
Showing 1 changed file with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ private SeaTunnelServer getSeaTunnelServer(boolean shouldBeMaster) {
this.textCommandService.getNode().getNodeExtension().createExtensionServices();
SeaTunnelServer seaTunnelServer =
(SeaTunnelServer) extensionServices.get(Constant.SEATUNNEL_SERVICE_NAME);
if (shouldBeMaster && !seaTunnelServer.isMasterNode() ) {
if (shouldBeMaster && !seaTunnelServer.isMasterNode()) {
return null;
}
return seaTunnelServer;
Expand All @@ -374,10 +374,21 @@ private JsonObject convertToJson(JobInfo jobInfo, long jobId) {
.getSerializationService()
.toObject(jobInfo.getJobImmutableInformation()));

ClassLoaderService classLoaderService = getSeaTunnelServer(false).getClassLoaderService();
ClassLoader classLoader =
classLoaderService.getClassLoader(
jobId, jobImmutableInformation.getPluginJarsUrls());
LogicalDag logicalDag =
CustomClassLoadedObject.deserializeWithCustomClassLoader(
this.textCommandService.getNode().getNodeEngine().getSerializationService(),
classLoader,
jobImmutableInformation.getLogicalDag());
classLoaderService.releaseClassLoader(jobId, jobImmutableInformation.getPluginJarsUrls());

SeaTunnelServer seaTunnelServer = getSeaTunnelServer(true);
String jobMetrics;
JobStatus jobStatus;
ClassLoaderService classLoaderService;

if (seaTunnelServer == null) {
jobMetrics =
(String)
Expand All @@ -391,23 +402,11 @@ private JsonObject convertToJson(JobInfo jobInfo, long jobId) {
getNode().nodeEngine,
new GetJobStatusOperation(jobId))
.join()];
classLoaderService = getSeaTunnelServer(false).getClassLoaderService();

} else {
jobMetrics =
seaTunnelServer.getCoordinatorService().getJobMetrics(jobId).toJsonString();
jobStatus = seaTunnelServer.getCoordinatorService().getJobStatus(jobId);
classLoaderService = seaTunnelServer.getClassLoaderService();
}
ClassLoader classLoader =
classLoaderService.getClassLoader(
jobId, jobImmutableInformation.getPluginJarsUrls());
LogicalDag logicalDag =
CustomClassLoadedObject.deserializeWithCustomClassLoader(
this.textCommandService.getNode().getNodeEngine().getSerializationService(),
classLoader,
jobImmutableInformation.getLogicalDag());
classLoaderService.releaseClassLoader(jobId, jobImmutableInformation.getPluginJarsUrls());

jobInfoJson
.add(RestConstant.JOB_ID, String.valueOf(jobId))
Expand Down

0 comments on commit be05a1d

Please sign in to comment.