Package org.apache.uima.ducc.common

Examples of org.apache.uima.ducc.common.NodeIdentity


      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()
                        +" "+messages.fetchLabel("ip")+nodeId.getIp());
          changes++;
          // check on usefulness of recent allocation
          switch(duccWorkJob.getJobState()) {
          // allocation unnecessary if job is already completed
          case Completing:
          case Completed:
            process.setResourceState(ResourceState.Deallocated);
            process.setProcessDeallocationType(ProcessDeallocationType.Voluntary);
            process.advanceProcessState(ProcessState.Stopped);
            logger.warn(methodName, duccWorkJob.getDuccId(),
                messages.fetch("resource allocated for completed job")
                +" "+
                messages.fetchLabel("process")+duccId.getFriendly()
                );
            break;
          default:
            // allocation unnecessary if job has excess capacity
            if(isExcessCapacity(duccWorkJob,driverStatusReportMap.get(duccId))) {
              process.setResourceState(ResourceState.Deallocated);
              process.setProcessDeallocationType(ProcessDeallocationType.Voluntary);
              process.advanceProcessState(ProcessState.Stopped);
              logger.warn(methodName, duccWorkJob.getDuccId(),
                  messages.fetch("resource allocated for over capacity job")
                  +" "+
                  messages.fetchLabel("process")+duccId.getFriendly()
                  );
            }
            break;
          }
        }
        else {
          logger.warn(methodName, duccWorkJob.getDuccId(), messages.fetch("resource exists")
            +" "+messages.fetchLabel("process")+duccId.getFriendly()
            +" "+messages.fetchLabel("unique")+duccId.getUnique()
            +" "+messages.fetchLabel("name")+nodeId.getName()
            +" "+messages.fetchLabel("ip")+nodeId.getIp());
        }
      }
    }
    logger.trace(methodName, null, messages.fetch("exit"));
    return changes;
View Full Code Here


      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);
            process.setProcessDeallocationType(ProcessDeallocationType.Forced);
            logger.info(methodName, duccWorkJob.getDuccId(), messages.fetch("resource deallocated")
              +" "+messages.fetchLabel("process")+duccId.getFriendly()
              +" "+messages.fetchLabel("unique")+duccId.getUnique()
              +" "+messages.fetchLabel("name")+nodeId.getName()
              +" "+messages.fetchLabel("ip")+nodeId.getIp());
            break;
          }
          /*
          if(process.isDefunct()) {
            orchestratorCommonArea.getProcessAccounting().removeProcess(duccId);
            processMap.removeProcess(duccId);
            logger.info(methodName, duccId, messages.fetch("remove resource")+" "+messages.fetchLabel("name")+nodeId.getName()+" "+messages.fetchLabel("ip")+nodeId.getIp());
            changes++;
          }
          */
        }
        else {
          logger.info(methodName, duccWorkJob.getDuccId(), messages.fetch("resource not found")
            +" "+messages.fetchLabel("process")+duccId.getFriendly()
            +" "+messages.fetchLabel("unique")+duccId.getUnique()
            +" "+messages.fetchLabel("name")+nodeId.getName()
            +" "+messages.fetchLabel("ip")+nodeId.getIp());
        }
      }
    }
    logger.trace(methodName, duccWorkJob.getDuccId(), messages.fetch("exit"));
    return changes;
View Full Code Here

    try {
      Iterator<DuccId> iterator = processMap.keySet().iterator();
      while(iterator.hasNext()) {
        DuccId duccId = iterator.next();
        IDuccProcess process = processMap.get(duccId);
        NodeIdentity nodeIdentity = process.getNodeIdentity();
        String nodeName = nodeIdentity.getName();
        heartbeat(nodeName);
        break;
      }
    }
    catch(Throwable t) {
View Full Code Here

      Iterator<DuccId> resourceMapIterator = resourceMap.keySet().iterator();
      while(resourceMapIterator.hasNext()) {
        DuccId duccId = resourceMapIterator.next();
        IResource resource = resourceMap.get(duccId);
        Node node = resource.getNode();
        NodeIdentity nodeId = node.getNodeIdentity();
        int shares = resource.countShares();
        if(!reservationMap.containsKey(duccId)) {
          DuccReservation reservation = new DuccReservation(duccId, node, shares);
          reservationMap.addReservation(reservation);
          logger.info(methodName, duccId, messages.fetch("add resource")+" "+messages.fetchLabel("name")+nodeId.getName()+" "+messages.fetchLabel("ip")+nodeId.getIp());
          changes++;
        }
        else {
          logger.debug(methodName, duccId, messages.fetch("duplicate resource")+" "+messages.fetchLabel("name")+nodeId.getName()+" "+messages.fetchLabel("ip")+nodeId.getIp());
        }
      }
    }
    logger.trace(methodName, null, messages.fetch("exit"));
    return changes;
View Full Code Here

    if(resourceMap != null) {
      Iterator<DuccId> resourceMapIterator = resourceMap.keySet().iterator();
      while(resourceMapIterator.hasNext()) {
        DuccId duccId = resourceMapIterator.next();
        Node node = resourceMap.get(duccId).getNode();
        NodeIdentity nodeId = node.getNodeIdentity();
        if(reservationMap.containsKey(duccId)) {
          reservationMap.removeReservation(duccId);
          logger.info(methodName, duccId, messages.fetch("remove resource")+" "+messages.fetchLabel("name")+nodeId.getName()+" "+messages.fetchLabel("ip")+nodeId.getIp());
          changes++;
        }
        else {
          logger.debug(methodName, duccId, messages.fetch("not found resource")+" "+messages.fetchLabel("name")+nodeId.getName()+" "+messages.fetchLabel("ip")+nodeId.getIp());
        }
      }
    }
    logger.trace(methodName, null, messages.fetch("exit"));
    return changes;
View Full Code Here

      duccOut.debug(methodName, job.getDuccId(), "job:"+job.getId() );
      Map<DuccId, IDuccProcess> map = job.getProcessMap().getMap();
      for( Entry<DuccId, IDuccProcess> entry : map.entrySet() ) {
        IDuccProcess process = entry.getValue();
        process.getDuccId();
        NodeIdentity nodeIdentity = process.getNodeIdentity();
        String node = null;
        String ip = null;
        if(nodeIdentity != null) {
          node = nodeIdentity.getName();
          ip = nodeIdentity.getIp();
        }
       
        String pid = process.getPID();
        duccOut.debug(methodName, job.getDuccId(), process.getDuccId(), "node:"+node+" "+"ip:"+ip+" "+"pid:"+pid );
      }
View Full Code Here

    logger.debug(methodName, job.getDuccId(), "driver: "+driverCommandLine.getCommand());
    // Log directory
    driverCommandLine.setLogDirectory(jobRequestProperties.getProperty(JobSpecificationProperties.key_log_directory));
    driver.setCommandLine(driverCommandLine);
    //
    NodeIdentity nodeIdentity = hostManager.getNode();
    DuccId duccId = jdIdFactory.next();
    duccId.setFriendly(0);
    DuccProcess driverProcess = new DuccProcess(duccId,nodeIdentity,ProcessType.Pop);
    CGroupManager.assign(job.getDuccId(), driverProcess, driver_max_size_in_bytes);
    driverProcess.setResourceState(ResourceState.Allocated);
View Full Code Here

          Iterator<DuccId> procids = map.keySet().iterator();
          while(procids.hasNext()) {
            DuccId procid = procids.next();
            IDuccProcess proc = map.get(procid);
            if(!proc.isComplete()) {
              NodeIdentity nodeIdentity = proc.getNodeIdentity();
              String procNodeName = nodeIdentity.getName();
              if(procNodeName != null) {
                if(nodeName.equals(procNodeName)) {
                  JobProcessInfo jpi = new JobProcessInfo();
                  jpi.jobId = jobid;
                  jpi.procid = procid;
View Full Code Here

     * physical machine simulating a cluster of nodes.
     *
     */
    public void launchProcess(String host, String ip, ICommandLine cmdLine) throws Exception {
        IDuccProcess process =
            new DuccProcess(duccIdFactory.next(), new NodeIdentity(ip, host));
        process.setProcessType(ProcessType.Pop);
        ManagedProcess managedProcess = new ManagedProcess(process, cmdLine, true);
        DuccCommandExecutor executor =
            new DuccCommandExecutor(cmdLine, host, ip, managedProcess);
        executorService.submit(executor);
View Full Code Here

              if(jdHostClass.equals(reservation.getSchedulingInfo().getSchedulingClass())) {
                IDuccReservationMap map = reservation.getReservationMap();
                Iterator<Entry<DuccId, IDuccReservation>> entries = map.entrySet().iterator();
                while(entries.hasNext()) {
                  Entry<DuccId, IDuccReservation> entry = entries.next();
                  NodeIdentity node = entry.getValue().getNodeIdentity();
                  hostManager.addNode(node);
                }
              }
              break;
            }
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.common.NodeIdentity

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.