Package org.apache.uima.ducc.transport.event.common

Examples of org.apache.uima.ducc.transport.event.common.IDuccWorkJob


      DuccData duccData = DuccData.getInstance();
      DuccWorkMap duccWorkMap = duccData.getLive();
      Iterator<DuccId> iteratorS = duccWorkMap.getServiceKeySet().iterator();
      while(iteratorS.hasNext()) {
        DuccId jobid = iteratorS.next();
        IDuccWorkJob service = (IDuccWorkJob)duccWorkMap.findDuccWork(jobid);
        if(service.isOperational()) {
          int pMemSize = toInt(service.getSchedulingInfo().getShareMemorySize(),1*shareSize);
          long pShareSize = pMemSize/shareSize;
          if(pShareSize <= 0) {
            pShareSize = 1;
          }
          IDuccProcessMap processMap = service.getProcessMap();
          Iterator<DuccId> iteratorP = processMap.keySet().iterator();
          while(iteratorP.hasNext()) {
            DuccId jpid = iteratorP.next();
            IDuccProcess jp = processMap.get(jpid);
            ProcessState processState = jp.getProcessState();
View Full Code Here


        while(iterator.hasNext()) {
          IDuccWork duccWork = iterator.next();
          switch(duccWork.getDuccType()) {
          case Job:
          case Service:
            IDuccWorkJob job = (IDuccWorkJob) duccWork;
            switch(startType) {
            case cold:
              force(job, new Rationale("system cold start"));
              saveState = true;
              break;
View Full Code Here

          DuccId jobId = getJobId(processId);
          IDuccWork duccWork = workMap.findDuccWork(jobId);
          if(duccWork != null) {
            if(duccWork instanceof IDuccWorkExecutable) {
              IDuccWorkExecutable duccWorkExecutable = (IDuccWorkExecutable) duccWork;
              IDuccWorkJob job = null;
              if(duccWork instanceof IDuccWorkJob) {
                job = (IDuccWorkJob)duccWork;
              }
              IDuccProcessMap processMap = duccWorkExecutable.getProcessMap();
              IDuccProcess process = processMap.get(processId);
              if(process == null) {
                if(job != null) {
                  process = job.getDriver().getProcessMap().get(processId);
                }
              }
              if(process != null) {
                // PID
                copyInventoryPID(job, inventoryProcess, process);
                // Scheduler State
                setResourceStateAndReason(job, inventoryProcess, process);
                // Process State
                copyInventoryProcessState(job, inventoryProcess, process);
                // Process Reason
                copyReasonForStoppingProcess(job, inventoryProcess, process);
                // Process Exit code
                copyProcessExitCode(job, inventoryProcess, process);
                // Process Init & Run times
                updateProcessTime(job, inventoryProcess, process);
                // Process Initialization State
                switch(inventoryProcess.getProcessState()) {
                case Running:
                  process.setInitialized();
                  if(job != null) {
                    switch(job.getDuccType()) {
                    case Service:
                      switch(job.getJobState()) {
                      case Initializing:
                        stateJobAccounting.stateChange(job, JobState.Running);
                        break;
                      }
                      break;
View Full Code Here

  }
 
  public void put(IDuccWork dw) {
    if(dw != null) {
      if(dw instanceof IDuccWorkJob) {
        IDuccWorkJob job = (IDuccWorkJob) dw;
        if(!job.isCompleted()) {
          put(job);
        }
      }
    }
  }
View Full Code Here

    po.remove(id);
    id = new DuccId(0);
    po.remove(id);
    PagingInfo pi = new PagingInfo();
    pi.display();
    IDuccWorkJob job = new DuccWorkJob();
    pi = new PagingInfo(job);
    pi.display();
  }
View Full Code Here

    return jobRestore(fileName, Verbosity.SPEAK);
  }

  private IDuccWorkJob jobRestore(String fileName, Verbosity level) {
    String methodName = "jobRestore";
    IDuccWorkJob job = null;
    try {
      logger.trace(methodName, null, "restore:"+fileName);
      FileInputStream fis = null;
      ObjectInputStream in = null;
      fis = new FileInputStream(historyDirectory_jobs+File.separator+fileName);
View Full Code Here

    ArrayList<IDuccWorkJob> retVal = new ArrayList<IDuccWorkJob>();
    ArrayList<String> jobFileNames = jobList();
    ListIterator<String> listIterator = jobFileNames.listIterator();
    while(listIterator.hasNext()) {
      String fileName = listIterator.next();
      IDuccWorkJob job = jobRestore(fileName);
      if(job != null) {
        retVal.add(job);
      }
    }
    return retVal;
View Full Code Here

  private static int doJobs(HistoryPersistenceManager hpm) throws IOException, ClassNotFoundException {
    ArrayList<IDuccWorkJob> duccWorkJobs = hpm.jobRestore();
    ListIterator<IDuccWorkJob> listIterator = duccWorkJobs.listIterator();
    int acc = 0;
    while(listIterator.hasNext()) {
      IDuccWorkJob duccWorkJob = listIterator.next();
      System.out.println(duccWorkJob.getId());
      acc++;
    }
    return acc;
  }
View Full Code Here

        FileInputStream fis = null;
        ObjectInputStream in = null;
        fis = new FileInputStream(history);
        in = new ObjectInputStream(fis);
        IDuccWorkJob reply = (IDuccWorkJob) in.readObject();
        in.close();
        return reply;
    }
View Full Code Here

    }

    protected void formatProcesses(String job)
    {
        try {
      IDuccWorkJob dwj = readJob(job);
      IDuccProcessMap pmap = dwj.getProcessMap();
            String headerFmt =    "%25s %8s %12s %12s %12s %12s %12s %12s %10s %8s %8s %8s %8s %8s %8s %8s %s";
            String underline =    dup("-", 25) + " -------- ------------ ------------ ------------ ------------ ------------ ------------ ---------- -------- -------- -------- -------- -------- -------- -------- -----------------";
            String dataFmt = null;

            if ( csv ) {
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.transport.event.common.IDuccWorkJob

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.