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

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


  }
 
  private void copyProcessWorkItemsReport(DuccWorkJob job, DriverStatusReport jdStatusReport) {
    String methodName = "copyProcessWorkItemsReport";
    try {
      IDuccProcessMap processMap = job.getProcessMap();
      DuccProcessWorkItemsMap pwiMap = jdStatusReport.getDuccProcessWorkItemsMap();
      Iterator<DuccId> iterator = pwiMap.keySet().iterator();
      while(iterator.hasNext()) {
        DuccId processId = iterator.next();
        IDuccProcess process = processMap.get(processId);
        IDuccProcessWorkItems pwi = pwiMap.get(processId);
        process.setProcessWorkItems(pwi);
        logger.trace(methodName, job.getDuccId(), "done:"+pwi.getCountDone()+" "+"error:"+pwi.getCountError()+" "+"dispatch:"+pwi.getCountDispatch()+" "+"unassigned:"+pwi.getCountUnassigned()+" "+"lost:"+pwi.getCountLost());
      }
    }
View Full Code Here


    try {
      DuccProcessWorkItemsMap pwiMap = jdStatusReport.getDuccProcessWorkItemsMap();
      IDuccProcessWorkItems pwi = pwiMap.getTotals();
      pwi.setCountUnassigned(jdStatusReport.getWorkItemPendingProcessAssignmentCount());
      DuccWorkPopDriver driver = job.getDriver();
      IDuccProcessMap processMap = driver.getProcessMap();
      if(processMap != null) {
        Iterator<DuccId> iterator = processMap.keySet().iterator();
        while(iterator.hasNext()) {
          DuccId processId = iterator.next();
          IDuccProcess process = processMap.get(processId);
          process.setProcessWorkItems(pwi);
          logger.debug(methodName, job.getDuccId(), "done:"+pwi.getCountDone()+" "+"error:"+pwi.getCountError()+" "+"dispatch:"+pwi.getCountDispatch()+" "+"unassigned:"+pwi.getCountUnassigned()+" "+"lost:"+pwi.getCountLost());
        }
      }
    }
View Full Code Here

 
  private boolean deallocateIdleProcesses(DuccWorkJob job, DriverStatusReport jdStatusReport) {
    String methodName = "deallocateIdleProcesses";
    boolean retVal = false;
    if(!jdStatusReport.isPending()  && !jdStatusReport.isWorkItemPendingProcessAssignment()) {
      IDuccProcessMap processMap = job.getProcessMap();
      Iterator<DuccId> iterator = processMap.keySet().iterator();
      boolean excessCapacity = isExcessCapacity(job, jdStatusReport);
      while(iterator.hasNext() && excessCapacity) {
        DuccId duccId = iterator.next();
        IDuccProcess process = processMap.get(duccId);
        if(!process.isDeallocated()) {
          String nodeIP = process.getNodeIdentity().getIp();
          String PID = process.getPID();
          if(!jdStatusReport.isOperating(nodeIP, PID)) {
            process.setResourceState(ResourceState.Deallocated);
View Full Code Here

  }
 
  private boolean deallocateFailedProcesses(DuccWorkJob job, DriverStatusReport jdStatusReport) {
    String methodName = "deallocateFailedProcesses";
    boolean retVal = false;
    IDuccProcessMap processMap = job.getProcessMap();
    Iterator<DuccId> iterator = jdStatusReport.getKillDuccIds();
    while (iterator.hasNext()) {
      DuccId duccId = iterator.next();
      IDuccProcess process = processMap.get(duccId);
      if(process != null) {
        if(!process.isDeallocated()) {
          process.setResourceState(ResourceState.Deallocated);
          process.setProcessDeallocationType(ProcessDeallocationType.Exception);
          logger.info(methodName, job.getDuccId(), process.getDuccId(), "deallocated");
View Full Code Here

 
 
  private boolean deallocateJobDriver(DuccWorkJob job, DriverStatusReport jdStatusReport) {
    String methodName = "deallocateJobDriver";
    boolean retVal = false;
    IDuccProcessMap processMap = job.getDriver().getProcessMap();
    Iterator<DuccId> iterator = processMap.keySet().iterator();
    while (iterator.hasNext()) {
      DuccId duccId = iterator.next();
      IDuccProcess process = processMap.get(duccId);
      if(process != null) {
        if(!process.isDeallocated()) {
          process.setResourceState(ResourceState.Deallocated);
          process.setProcessDeallocationType(ProcessDeallocationType.Voluntary);
          logger.info(methodName, job.getDuccId(), process.getDuccId(), "deallocated");
View Full Code Here

    int changes = 0;
    if(resourceMap == null) {
      logger.info(methodName, duccWorkJob.getDuccId(), messages.fetch("no map found"));
    }
    else {
      IDuccProcessMap processMap = duccWorkJob.getProcessMap();
      Iterator<DuccId> resourceMapIterator = resourceMap.keySet().iterator();
      while(resourceMapIterator.hasNext()) {
        DuccId duccId = resourceMapIterator.next();
        IResource resource = resourceMap.get(duccId);
        Node node = resourceMap.get(duccId).getNode();
        NodeIdentity nodeId = node.getNodeIdentity();
        if(!processMap.containsKey(duccId)) {
          ProcessType processType = null;
          switch(duccWorkJob.getServiceDeploymentType()) {
          case custom:
          case other:
            processType = ProcessType.Pop;
            break;
          case uima:
          case unspecified:
            processType = ProcessType.Job_Uima_AS_Process;
            break;
          }
          DuccProcess process = new DuccProcess(duccId, node, processType);
          long process_max_size_in_bytes = quantum_size_in_bytes * resource.countShares();
          CGroupManager.assign(duccWorkJob.getDuccId(), process, process_max_size_in_bytes);
          orchestratorCommonArea.getProcessAccounting().addProcess(duccId, duccWorkJob.getDuccId());
          processMap.addProcess(process);
          process.setResourceState(ResourceState.Allocated);
          logger.info(methodName, duccWorkJob.getDuccId(), messages.fetch("resource added")
                        +" "+messages.fetchLabel("process")+duccId.getFriendly()
                        +" "+messages.fetchLabel("unique")+duccId.getUnique()
                        +" "+messages.fetchLabel("name")+nodeId.getName()
View Full Code Here

    int changes = 0;
    if(resourceMap == null) {
      logger.info(methodName, duccWorkJob.getDuccId(), messages.fetch("no map found"));
    }
    else {
      IDuccProcessMap processMap = duccWorkJob.getProcessMap();
      Iterator<DuccId> resourceMapIterator = resourceMap.keySet().iterator();
      logger.debug(methodName, duccWorkJob.getDuccId(), messages.fetchLabel("size")+processMap.size());
      while(resourceMapIterator.hasNext()) {
        DuccId duccId = resourceMapIterator.next();
        Node node = resourceMap.get(duccId).getNode();
        NodeIdentity nodeId = node.getNodeIdentity();
        logger.info(methodName, duccWorkJob.getDuccId(), messages.fetch("resource processing")
          +" "+messages.fetchLabel("process")+duccId.getFriendly()
          +" "+messages.fetchLabel("unique")+duccId.getUnique()
          +" "+messages.fetchLabel("name")+nodeId.getName()
          +" "+messages.fetchLabel("ip")+nodeId.getIp());
        if(processMap.containsKey(duccId)) {
          IDuccProcess process = processMap.get(duccId);
          switch(process.getResourceState()) {
          case Deallocated:
            break;
          default:
            process.setResourceState(ResourceState.Deallocated);
View Full Code Here

              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);
                }
              }
View Full Code Here

     */
    private boolean receiveExecutable(IRmJob j, IDuccWork job)
    {
      String methodName = "receiveExecutable";
        IDuccWorkExecutable de = (IDuccWorkExecutable) job;
        IDuccProcessMap     pm = de.getProcessMap();

        if ( (pm.size() > 0) && !job.isCompleted() ) {          // need to recover, apparently RM crashed. hmph.
            for ( IDuccProcess proc : pm.values() ) {          // build up Shares from the incoming state

                ProcessState state = proc.getProcessState();               
                String pid = proc.getPID();                       
                NodeIdentity ni = proc.getNodeIdentity();

View Full Code Here

    }

    public void reconcileProcesses(DuccId jobid, IDuccWork l, IDuccWork r)
    {
      String methodName = "reconcileProcess";
        IDuccProcessMap lpm = ((IDuccWorkJob )l).getProcessMap();
        IDuccProcessMap rpm = ((IDuccWorkJob)r).getProcessMap();

        @SuppressWarnings("unchecked")
        DuccMapDifference<DuccId, IDuccProcess> diffmap = DuccCollectionUtils.difference(lpm, rpm);

        // new stuff in in the left side of the map
View Full Code Here

TOP

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

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.