Examples of IDuccWorkJob


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

    while(iterator.hasNext() && (++i < maxJobs)) {
      try {
        Integer key = iterator.next();
        logger.debug(location, jobid, messages.fetchLabel("restore")+key);
        String fileName = map.get(key);
        IDuccWorkJob duccWorkJob;
        duccWorkJob = hpm.jobRestore(fileName);
        if(duccWorkJob != null) {
          duccData.putIfNotPresent(duccWorkJob);
          restored++;
        }
View Full Code Here

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

    try {
      Set<DuccId> jobKeySet = workMap.getJobKeySet();
      boolean ckpt = false;
      for(DuccId jobId : jobKeySet) {
        try {
          IDuccWorkJob job = (IDuccWorkJob) workMap.findDuccWork(jobId);
          if(isDriverCompleted(job)) {
            ckpt = true;
          }
          if(isCancelJobExcessiveProcessFailures(job)) {
            ckpt = true;
          }
          else if(isCancelJobCappedWithNoJobProcesses(job)) {
            ckpt = true;
          }
          else if(isCancelJobDriverProcessFailed(job)) {
            ckpt = true;
          }
          long cap = job.getProcessInitFailureCap();
          // if an initialization cap was specified
          if(cap > 0) {
            long initFails = job.getProcessInitFailureCount();
            // if current number of initialization failures exceeds specified cap
            if(initFails > cap) {
              // set job's max shares to -1, indicating stop process expansion to RM
              job.getSchedulingInfo().setLongSharesMax(-1);
            }
          }
        }
        catch(Exception e) {
          logger.error(methodName, null, e);
View Full Code Here

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

    try {
      Set<DuccId> serviceKeySet = workMap.getServiceKeySet();
      boolean ckpt = false;
      for(DuccId serviceId : serviceKeySet) {
        try {
          IDuccWorkJob service = (IDuccWorkJob) workMap.findDuccWork(serviceId);
          if(isCancelJobExcessiveProcessFailures(service)) {
            ckpt = true;
          }
          else if(isCancelJobExcessiveInitializationFailures(service)) {
            ckpt = true;
          }
          long cap = service.getProcessInitFailureCap();
          // if an initialization cap was specified
          if(cap > 0) {
            long initFails = service.getProcessInitFailureCount();
            // if current number of initialization failures exceeds specified cap
            if(initFails > cap) {
              // set job's max shares to -1, indicating stop process expansion to RM
              service.getSchedulingInfo().setLongSharesMax(-1);
            }
          }
        }
        catch(Exception e) {
          logger.error(methodName, null, e);
View Full Code Here

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

        while(iterator.hasNext()) {
          jobid = iterator.next();
          IDuccWork duccWork = map.findDuccWork(jobid);
          switch(duccWork.getDuccType()) {
          case Job:
            IDuccWorkJob job = (IDuccWorkJob)duccWork;
            String jobNo = job.getId();
            String userId = job.getStandardInfo().getUser();
            String jobDir = job.getLogDirectory()+jobNo;
            WorkItemStateManager workItemStateManager = new WorkItemStateManager(jobDir);
            workItemStateManager.importData(userId);
            updatedWisMap.put(jobNo, workItemStateManager);
            break;
          }
View Full Code Here

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

  private void missingCallbackReaper() {
    String location = "missingCallbackReaper";
    try {
      if(casSource.isEmpty()) {
        IDuccWorkJob job = getJob();
        DriverStatusReport driverStatusReport = getDriverStatusReportLive();
        long todo = driverStatusReport.getWorkItemsToDo();
        long capacity = job.getWorkItemCapacity();
        if(capacity > 0) {
          if(todo > 0) {
            if(capacity > todo) {
              duccOut.debug(location, jobid, "capacity:"+capacity+" "+"todo:"+todo);
              Enumeration<WorkItem> workItems = casWorkItemMap.elements();
View Full Code Here

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

  }
 
  private void updateLocations(IJobDriver jobDriver) {
    String location = "updateLocations";
    try {
      IDuccWorkJob job = jobDriver.getJob();
      DuccId jobDuccId = job.getDuccId();
      ArrayList<WorkItem> removeList = new ArrayList<WorkItem>();
      duccOut.trace(location, jobDuccId, "pending map size:"+casLocationPendingMap.size());
      Iterator<Entry<String, NP>> iterator = casLocationPendingMap.entrySet().iterator();
      duccOut.trace(location, jobDuccId, iterator.hasNext());
      while(iterator.hasNext()) {
        Entry<String, NP> entry = iterator.next();
        String casId = entry.getKey();
        WorkItem workItem = casWorkItemMap.get(casId);
        String seqNo = null;
        if(workItem != null) {
          seqNo = ""+workItem.getSeqNo();
        }
        String nodeIP = entry.getValue().getNodeIP();
        if(nodeIP == null) {
          DuccId processDuccId = null;
          duccOut.trace(location, jobDuccId, processDuccId, "seqNo:"+seqNo+" "+"casId:"+casId);
          continue;
        }
        String PID = entry.getValue().getPID();
        if(PID == null) {
          DuccId processDuccId = null;
          duccOut.trace(location, jobDuccId, processDuccId, "seqNo:"+seqNo+" "+"casId:"+casId+" "+"node:"+nodeIP);
          continue;
        }
        DuccId processDuccId = null;
        IDuccProcess process = job.getProcessMap().findProcess(nodeIP, PID);
        if(process != null) {
          processDuccId = process.getDuccId();
          jobDriver.accountingWorkItemIsDispatch(processDuccId);
          workItem.setProcessId(processDuccId);
          removeList.add(workItem);
View Full Code Here

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

  }
 
  public void registerCasPendingLocation(IJobDriver jobDriver, String seqNo, String casId) {
    String location = "registerCasPendingLocation";
    try {
      IDuccWorkJob job = jobDriver.getJob();
      DuccId jobDuccId = job.getDuccId();
      DuccId processDuccId = null;
      NP casLocation = new NP();
      locationPendingMapPut(seqNo, casId, casLocation);
      duccOut.debug(location, jobDuccId, processDuccId, "seqNo:"+seqNo+" "+"casId:"+casId);
    }
View Full Code Here

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

  public void waitForLocation(IJobDriver jobDriver, WorkItem workItem) {
    String location = "waitForLocation";
    try {
      String casId = workItem.getCasId();
      String seqNo = ""+workItem.getSeqNo();
      IDuccWorkJob job = jobDriver.getJob();
      DuccId jobDuccId = job.getDuccId();
      if(casLocationPendingMap.containsKey(casId)) {
        DuccId processDuccId = null;
        duccOut.debug(location, jobDuccId, processDuccId, "seqNo:"+seqNo+" "+"wiId:"+workItem.getCasDocumentText()+" "+"casId:"+casId+" location pending");
        while(casLocationPendingMap.containsKey(casId)) {
          try {
View Full Code Here

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

 
 
  public void assignLocation(IJobDriver jobDriver, String casId, String nodeIP, String PID) {
    String location = "assignLocation";
    try {
      IDuccWorkJob job = jobDriver.getJob();
      DuccId jobDuccId = job.getDuccId();
      IDuccProcess process = job.getProcessMap().findProcess(nodeIP, PID);
      if(process != null) {
        DuccId processDuccId = process.getDuccId();
        jobDriver.accountingWorkItemIsDispatch(processDuccId);
        ThreadLocation threadLocation = jobDriver.getCasDispatchMap().get(casId);
        duccOut.debug(location, jobDuccId, processDuccId, "seqNo:"+threadLocation.getSeqNo()+" "+"casId:"+casId+" "+"node:"+nodeIP+" "+"PID:"+PID);
View Full Code Here

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

      DuccData duccData = DuccData.getInstance();
      DuccWorkMap duccWorkMap = duccData.getLive();
      Iterator<DuccId> iteratorJ = duccWorkMap.getJobKeySet().iterator();
      while(iteratorJ.hasNext()) {
        DuccId jobid = iteratorJ.next();
        IDuccWorkJob job = (IDuccWorkJob)duccWorkMap.findDuccWork(jobid);
        if(job.isOperational()) {
          int pMemSize = toInt(job.getSchedulingInfo().getShareMemorySize(),1*shareSize);
          long pShareSize = pMemSize/shareSize;
          if(pShareSize <= 0) {
            pShareSize = 1;
          }
          IDuccProcessMap processMap = job.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
TOP
Copyright © 2018 www.massapi.com. 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.