Examples of IDuccWork


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

 
  
  public boolean equals(Object object) {
    boolean retVal = false;
    try {
      IDuccWork dw1 = this._dw;
      IDuccWork dw2 = (IDuccWork)object;
      String s1 = dw1.getDuccId().toString();
      String s2 = dw2.getDuccId().toString();
      DuccType dt1 = dw1.getDuccType();
      DuccType dt2 = dw2.getDuccType();
      if(dt1 == dt2) {
        retVal = s1.equals(s2);
      }
    }
    catch(Throwable t) { 
View Full Code Here

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

    return retVal;
  }
 
  
  public int hashCode() {
    IDuccWork dw = this._dw;
    String s1 = dw.getDuccId().toString();
    return s1.hashCode();
  }
View Full Code Here

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

        }

        // Now: stuff we both know about
        for( DuccMapValueDifference<IDuccWork> jd: diffmap ) {

            IDuccWork r = jd.getRight();
            IDuccWork l = jd.getLeft();

            if ( l.getDuccType() == DuccType.Reservation ) continue;

            logger.debug(methodName, l.getDuccId(), "Reconciling, incoming state = ", l.getStateObject(), " my state = ", r.getStateObject());

            // Update our own state by replacing the old (right) object with the new (left)
      switch(l.getDuccType()) {
              case Job:
                  modifiedJobs.put(l.getDuccId(), l);
                  localMap.addDuccWork(l);
                  break;

              case Service:
                  localMap.addDuccWork(l);
                  switch ( ((IDuccWorkService)l).getServiceDeploymentType() )
                  {
                      case uima:
                      case custom:
                          modifiedServices.put(l.getDuccId(), l);
                          break;
                      case other:
                          modifiedJobs.put(l.getDuccId(), l);
                          break;
                  }
                  break;

              default:
View Full Code Here

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

        //
        // Stuff on the left is incoming.  Stuff on the right is already in my map.
        //
        for( DuccMapValueDifference<IDuccWork> jd: diffmap ) {
            IDuccWork r = jd.getRight();
            IDuccWork l = jd.getLeft();

            if ( ! l.isSchedulable() ) {
                logger.info(methodName, l.getDuccId(), "Removing unschedulable:", r.getStateObject(), "->", l.getStateObject());
                jobRemoved(r.getDuccId());
            } else {

                localMap.addDuccWork(l);           // still schedulable, and we already know about it, just sync the state

                switch ( l.getDuccType() ) {
                  case Job:   
                      jobUpdate(r.getStateObject(), l);
                      reconcileProcesses(l.getDuccId(), l, r);
                      break;
                  case Service:
                  case Pop:
                  case Reservation:
                      if ( r.getStateObject() != l.getStateObject() ) {
                          logger.info(methodName, l.getDuccId(), "[SPR] State: ", r.getStateObject(), "->", l.getStateObject());
                      }
                      // for the moment, these guys have nothing to reconcile.
                      break;
                  case Undefined:
                      throw new SchedulingException(l.getDuccId(), "Work arrives as type Undefined - should have been filtered out by now.");                     
                }
            }
          
        }
View Full Code Here

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

     * there, forcibly add it to the expanded shares list.
     */
    Map<Share, Share> sanityCheckForOrchestrator(IRmJob j, Map<Share, Share> shares, Map<Share, Share>expanded)
    {
        String methodName = "sanityCheckForOrchestrator";
        IDuccWork w = localMap.findDuccWork(j.getId());

        if ( w == null ) return null;                  // deal with race - the job could have completed right as we are ready to
                                                       // publish, in which case it's gone from localMap
        if ( shares == null ) return null;             // no shares for whatever reason, we couldn't care less ...

        Map<Share, Share> ret = new HashMap<Share, Share>();
        switch ( w.getDuccType() ) {
            case Job:
            case Service:
                {
                    IDuccWorkExecutable de = (IDuccWorkExecutable) w;
                    IDuccProcessMap pm = de.getProcessMap();
View Full Code Here

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

    long expiryMillis = System.currentTimeMillis()+timeoutMillis+1;
   
    iterator = dwm.getManagedReservationKeySet().iterator();
    while( iterator.hasNext() ) {
      DuccId duccId = iterator.next();
      IDuccWork dw = (IDuccWork)dwm.findDuccWork(duccId);
      gone.remove(duccId);
      if(!mMap.containsKey(duccId)) {
        MonitorInfo monitorInfo = new MonitorInfo();
        mMap.put(duccId, monitorInfo);
        duccLogger.info(location, duccId, "monitor start");
        if(!tMap.containsKey(duccId)) {
          if(dw.isCancelOnInterrupt()) {
            TrackingInfo ti = new TrackingInfo();
            ti.time = expiryMillis;
            ti.user = dw.getStandardInfo().getUser();
            tMap.put(duccId,ti);
            duccLogger.info(location, duccId, "auto-cancel on");
          }
          else {
            duccLogger.info(location, duccId, "auto-cancel off");
View Full Code Here

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

    if((sortedCombinedReservations.size() > 0)) {
      int counter = 0;
      Iterator<Entry<Info, Info>> iR = sortedCombinedReservations.entrySet().iterator();
      while(iR.hasNext()) {
        Info info = iR.next().getValue();
        IDuccWork dw = info.getDuccWork();
        boolean list = DuccWebUtil.isListable(request, users, maxRecords, counter, dw);
        if(list) {
          counter++;
          if(dw instanceof DuccWorkReservation) {
            DuccWorkReservation reservation = (DuccWorkReservation) dw;
View Full Code Here

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

    long expiryMillis = System.currentTimeMillis()+timeoutMillis+1;
   
    iterator = dwm.getJobKeySet().iterator();
    while( iterator.hasNext() ) {
      DuccId duccId = iterator.next();
      IDuccWork dw = (IDuccWork)dwm.findDuccWork(duccId);
      gone.remove(duccId);
      if(!mMap.containsKey(duccId)) {
        MonitorInfo monitorInfo = new MonitorInfo();
        mMap.put(duccId, monitorInfo);
        duccLogger.info(location, duccId, "monitor start");
        if(!tMap.containsKey(duccId)) {
          if(dw.isCancelOnInterrupt()) {
            TrackingInfo ti = new TrackingInfo();
            ti.time = expiryMillis;
            ti.user = dw.getStandardInfo().getUser();
            tMap.put(duccId,ti);
            duccLogger.info(location, duccId, "auto-cancel on");
          }
          else {
            duccLogger.info(location, duccId, "auto-cancel off");
          }
        }
      }
      DuccWorkJob dwj = (DuccWorkJob) dw;
      MonitorInfo monitorInfo = mMap.get(duccId);
      IDuccSchedulingInfo si = dw.getSchedulingInfo();
      monitorInfo.total = si.getWorkItemsTotal();
      monitorInfo.done  = si.getWorkItemsCompleted();
      monitorInfo.error = ""+si.getIntWorkItemsError();
      monitorInfo.retry = si.getWorkItemsRetry();
      monitorInfo.lost = si.getWorkItemsLost();
View Full Code Here

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

  private void abbreviate() {
    if(workMap != null) {
      Iterator<DuccId> jobKeys = workMap.getJobKeySet().iterator();
      while(jobKeys.hasNext()) {
        DuccId jobKey = jobKeys.next();
        IDuccWork duccWork = workMap.findDuccWork(jobKey);
        IDuccWorkJob job = (IDuccWorkJob)duccWork;
        job.setCommandLine(null);
        job.getDriver().setCommandLine(null);
      }
    }
View Full Code Here

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

    if((sortedCombinedReservations.size() > 0)) {
      int counter = 0;
      Iterator<Entry<Info, Info>> iR = sortedCombinedReservations.entrySet().iterator();
      while(iR.hasNext()) {
        Info info = iR.next().getValue();
        IDuccWork dw = info.getDuccWork();
        boolean list = DuccWebUtil.isListable(request, users, maxRecords, counter, dw);
        if(list) {
          counter++;
          if(dw instanceof DuccWorkReservation) {
            DuccWorkReservation reservation = (DuccWorkReservation) dw;
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.