Klasse JobStepUtil

java.lang.Object
de.dlr.proseo.planner.util.JobStepUtil

@Component public class JobStepUtil extends Object
Handle job steps
Autor:
Ernst Melchinger
  • Felddetails

  • Konstruktordetails

    • JobStepUtil

      public JobStepUtil()
  • Methodendetails

    • findOrderedByJobStepStateAndMission

      public List<JobStep> findOrderedByJobStepStateAndMission(JobStep.JobStepState state, String mission, int limit)
      Find job steps of specific job step state. The result is ordered by processingCompletionTime descending and returns the first 'limit' entries.
      Parameter:
      state - The job step state
      mission - The mission code
      limit - The length of result entry list
      Gibt zurück:
      The found job steps
    • searchForJobStepsToRun

      public void searchForJobStepsToRun(long pfId, long pcId, boolean onlyWaiting)
      Search for not satisfied product queries referencing product class on processing facility and check which are now satisfied. Change state of job step to READY if all queries are now satisfied.
      Parameter:
      processingFacility -
      pc - Product class
    • suspend

      @Transactional(isolation=REPEATABLE_READ) public PlannerResultMessage suspend(JobStep js, Boolean force)
      Suspend job step, kill it if force is true otherwise wait until finish.
      Parameter:
      js - Job step
      force - Force
      Gibt zurück:
      Result message
    • cancel

      @Transactional(isolation=REPEATABLE_READ) public PlannerResultMessage cancel(JobStep js)
      Cancel job step
      Parameter:
      js - Job step
      Gibt zurück:
      Result message
    • close

      public PlannerResultMessage close(Long id)
      Close job step
      Parameter:
      js - Job step
      Gibt zurück:
      Result message
    • retry

      @Transactional(isolation=REPEATABLE_READ) public PlannerResultMessage retry(JobStep js)
      Retry job step
      Parameter:
      js - Job step
      Gibt zurück:
      Result message
    • checkFinish

      @Transactional(isolation=REPEATABLE_READ) public Boolean checkFinish(JobStep js)
      Check job step whether job step has been finished
      Parameter:
      js - Job step
      Gibt zurück:
      true if finished
    • delete

      @Transactional(isolation=REPEATABLE_READ) public Boolean delete(JobStep js)
      Delete job step
      Parameter:
      js - Job step
      Gibt zurück:
      true if deleted
    • deleteSatisfiedProductQueries

      public Boolean deleteSatisfiedProductQueries(Long jsId)
      Delete satisfied product queries of job step
      Parameter:
      js - Job step
      Gibt zurück:
      true if deleted
    • deleteForced

      @Transactional(isolation=REPEATABLE_READ) public Boolean deleteForced(JobStep js)
      Delete also not finished job step
      Parameter:
      js - Job step
      Gibt zurück:
      true if deleted
    • resume

      public PlannerResultMessage resume(JobStep js, Boolean force)
      Resume job step
      Parameter:
      js - Job step
      Gibt zurück:
      Result message
    • startJobStep

      @Transactional(isolation=REPEATABLE_READ) public Boolean startJobStep(JobStep js)
      Start job step on Kubernetes cluster
      Parameter:
      js - Job step
      Gibt zurück:
      Result message
    • checkJobStepQueries

      public void checkJobStepQueries(JobStep js, Boolean force)
      Check the queries of a job step which job is released or started. Check all if force is true
      Parameter:
      force -
      id - Job step id
    • checkForJobStepsToRun

      public void checkForJobStepsToRun()
      Check all unsatisfied queries of all job steps on all facilities whether they can be started.
    • checkForJobStepsToRun

      public void checkForJobStepsToRun(KubeConfig kc, long pcId, Boolean onlyRun, Boolean onlyWaiting)
      If onlyRun is false, check unsatisfied queries of product class on processing facility (defined in Kube config). Start ready job steps on facility.
      Parameter:
      kc - KubeConfig
      onlyRun -
      pc - ProductClass
    • checkJobStepToRun

      public Boolean checkJobStepToRun(KubeConfig kc, long jsId)
      Check unsatisfied queries of job step on processing facility (defined in Kube config). Start ready job steps on facility. Method is synchronized to avoid different threads (simultaneous event-triggered dispatching) to interfere with each other.
      Parameter:
      kc - KubeConfig
      jsId - JobStep id
    • checkJobToRun

      public void checkJobToRun(KubeConfig kc, long jobId) throws InterruptedException
      Check unsatisfied queries of job steps in job on processing facility (defined in Kube config). Start ready job steps on facility. Method is synchronized to avoid different threads (simultaneous event-triggered dispatching) to interfere with each other.
      Parameter:
      kc - KubeConfig
      job - Job
      Löst aus:
      InterruptedException
    • checkOrderToRun

      public void checkOrderToRun(KubeConfig kc, long orderId)
      Check unsatisfied queries of job steps in processing order on processing facility (defined in Kube config). Start ready job steps on facility. Method is synchronized to avoid different threads (simultaneous event-triggered dispatching) to interfere with each other.
      Parameter:
      kc - KubeConfig
      order - ProcessingOrder
    • checkCreatedProducts

      @Transactional(isolation=REPEATABLE_READ) public void checkCreatedProducts(JobStep js)
      Check whether the product of job step exists
      Parameter:
      js - job step
    • collectProducts

      @Transactional(isolation=REPEATABLE_READ) public void collectProducts(Product p, List<Product> list)
      Recursively collect products of a product tree into list
      Parameter:
      p - Root product
      list - Product list
    • checkProducts

      @Transactional(isolation=REPEATABLE_READ) public Boolean checkProducts(List<Product> list, ProcessingFacility pf)
      Check whether the products of list exists and are already generated
      Parameter:
      list - Product list
      pf - ProcessingFacility
      Gibt zurück:
      true if all products are generated