git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorSweidan Omar <TFS\sweidan.omar>
Mon, 6 Dec 2021 11:40:32 +0000 (11:40 +0000)
committerSweidan Omar <TFS\sweidan.omar>
Mon, 6 Dec 2021 11:40:32 +0000 (11:40 +0000)
server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java

index 764472f21c650891e04b5db690bfca11e21d9df6..db06c75fbc3d6ac14056b81a5475bf9f30457ec1 100644 (file)
@@ -25,7 +25,7 @@ public class JobStepExecutor implements IJobStepExecutor {
 
                @Override
                public void run() {
-                       //setName(String.format("%s step executor thread", stepClass.getSimpleName()));
+                       // setName(String.format("%s step executor thread", stepClass.getSimpleName()));
                        try {
                                barrier.countDown();
                        } catch (Exception e) {
@@ -40,10 +40,10 @@ public class JobStepExecutor implements IJobStepExecutor {
                                                logger.info("JobEngine is null");
 
                                        if (jobEngine.isWorker() && isRemote) {
-                                               //a worker is csak azokat akarja vegrehajtani
+                                               // a worker is csak azokat akarja vegrehajtani
                                                ClusteredJob job = jobEngine.getRemoteEngine().getRemoteJob(getStepUnitName());
 
-                                               //TODO remote-ba jelezni, hogy nem sikerult
+                                               // TODO remote-ba jelezni, hogy nem sikerult
                                                if (shutdown) {
                                                        logger.trace("{} skipping by shutdown", jobRuntime);
                                                        jobEngine.sendMessage(new JobStepSkippedMessage(jobRuntime.getId()));
@@ -51,8 +51,8 @@ public class JobStepExecutor implements IJobStepExecutor {
                                                }
 
                                                if (job != null) {
-                                                       //TODO set job accepted = PROCESSING_REMOTLY + if error then feedback?
-                                                       //jobRuntime.setDescription(PROCESSING_REMOTLY);
+                                                       // TODO set job accepted = PROCESSING_REMOTLY + if error then feedback?
+                                                       // jobRuntime.setDescription(PROCESSING_REMOTLY);
                                                        jobRuntime = new ClusteredJobRuntime(job, jobEngine, e -> {
                                                                IJobRuntime runtime = (IJobRuntime) e.getSource();
                                                                job.setStatus(runtime.getStatus());
@@ -74,7 +74,7 @@ public class JobStepExecutor implements IJobStepExecutor {
                                        }
 
                                        if (jobRuntime != null) {
-                                               //ha remote, de nem jelentkezik senki, akkor helyi vegrehajtas
+                                               // ha remote, de nem jelentkezik senki, akkor helyi vegrehajtas
                                                if (isRemote) {
                                                        long submitted = jobRuntime.getSubmitted().getTime();
                                                        long current = System.currentTimeMillis();
@@ -82,15 +82,15 @@ public class JobStepExecutor implements IJobStepExecutor {
                                                        if (timeout) {
                                                                logger.info("Remote JobStep timed out, processing locally.");
                                                        } else {
-                                                               //                                                                      if (!WAIT_REMOTE_PROCESSOR.equals(jobRuntime.getDescription()))
-                                                               //                                                                              jobRuntime.setDescription(WAIT_REMOTE_PROCESSOR);
+                                                               // if (!WAIT_REMOTE_PROCESSOR.equals(jobRuntime.getDescription()))
+                                                               // jobRuntime.setDescription(WAIT_REMOTE_PROCESSOR);
                                                                queue.put(jobRuntime);
                                                                continue;
                                                        }
                                                }
 
                                                logger.info("Executing locally {}", jobRuntime.getId());
-                                               //jobRuntime.setDescription(PROCESSING_LOCALLY);
+                                               // jobRuntime.setDescription(PROCESSING_LOCALLY);
                                                Object[] inputs = jobEngine.getInputsFromStack(jobRuntime);
 
                                                IJobStep stepObject = runStep(jobRuntime, inputs);
@@ -145,24 +145,22 @@ public class JobStepExecutor implements IJobStepExecutor {
                        } finally {
 
                                /*
-                               //kozos loader hasznalata!
-                               if (step != null) {
-                                       ClassLoader cl = step.getClass().getClassLoader();
-                                       if (cl instanceof GroovyClassLoader) {
-                               
-                                               GroovyClassLoader stepClassLoader = (GroovyClassLoader) cl;
-                                               stepClassLoader.close();
-                                       }
-                               }
-                               */
+                                * //kozos loader hasznalata! if (step != null) { ClassLoader cl =
+                                * step.getClass().getClassLoader(); if (cl instanceof GroovyClassLoader) {
+                                * 
+                                * GroovyClassLoader stepClassLoader = (GroovyClassLoader) cl;
+                                * stepClassLoader.close(); } }
+                                */
                        }
 
-                       //TODO itt lekezelni a remote notification-t
+                       // TODO itt lekezelni a remote notification-t
 
-                       //TODO ha ez van, akkor a WAITING_CANCEL allpotban marad, ha nincs, akkor meg neha visszakerul a run queue-ba
-                       //                      if (!jobRuntime.isWaitingCancel()) {
-                       //                      jobEngine.sendMessage(new JobStepCompletedMessage(jobRuntime.getId(), outputs));
-                       //                      }
+                       // TODO ha ez van, akkor a WAITING_CANCEL allpotban marad, ha nincs, akkor meg
+                       // neha visszakerul a run queue-ba
+                       // if (!jobRuntime.isWaitingCancel()) {
+                       // jobEngine.sendMessage(new JobStepCompletedMessage(jobRuntime.getId(),
+                       // outputs));
+                       // }
                        jobEngine.sendMessage(new JobStepCompletedMessage(jobRuntime.getId(), outputs));
                        return step;
                }