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

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


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


      DuccData duccData = DuccData.getInstance();
      DuccWorkMap duccWorkMap = duccData.getLive();
      Iterator<DuccId> iteratorR = duccWorkMap.getReservationKeySet().iterator();
      while(iteratorR.hasNext()) {
        DuccId reservationId = iteratorR.next();
        IDuccWorkReservation reservation = (IDuccWorkReservation)duccWorkMap.findDuccWork(reservationId);
        if(reservation.isOperational()) {
          IDuccReservationMap reservationMap = reservation.getReservationMap();
          Iterator<DuccId> iteratorS = reservationMap.keySet().iterator();
          while(iteratorS.hasNext()) {
            DuccId spid = iteratorS.next();
            IDuccReservation rs = reservationMap.get(spid);
            NodeIdentity nodeIdentity = rs.getNodeIdentity();
View Full Code Here

            case hot:
              break;
            }
            break;
          case Reservation:
            IDuccWorkReservation reservation = (IDuccWorkReservation) duccWork;
            switch(startType) {
            case cold:
              cancel(reservation);
              saveState = true;
              break;
            case warm:
              if(jdHostClass.equals(reservation.getSchedulingInfo().getSchedulingClass())) {
                cancel(reservation);
                saveState = true;
              }
              break;
            case hot:
              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);
View Full Code Here

    private boolean receiveReservation(IRmJob j, IDuccWork job)
    {
      String methodName = "receiveReservation";
        j.setReservation();

        IDuccWorkReservation dr = (IDuccWorkReservation) job;
        IDuccReservationMap rm = dr.getReservationMap();
        if ( (rm.size() > 0) && !job.isCompleted() ) {          // need to recover, apparently RM crashed. hmph.
            for ( IDuccReservation res : rm.values() ) {       // build up Shares from the incoming state
                NodeIdentity ni = res.getNodeIdentity();
                Machine m = scheduler.getMachine(ni);
                if ( m == null ) {                             // not known, huh? maybe next epoch it will have checked in
View Full Code Here

                }
                break;

            case Reservation:
                {
                    IDuccWorkReservation de = (IDuccWorkReservation) w;
                    IDuccReservationMap  rm = de.getReservationMap();
                   
                    for ( Share s : shares.values() ) {
                        IDuccReservation r = rm.get(s.getId());
                        if ( r == null ) {
                            if ( (expanded == null) || (!expanded.containsKey(s)) ) {
View Full Code Here

                //     }
                //     break;
                   
                case Reservation:
                    {
                        IDuccWorkReservation de = (IDuccWorkReservation) w;
                        IDuccReservationMap  rm = de.getReservationMap();

                        logger.info(methodName, w.getDuccId(), "Receive:", prefix, w.getDuccType(), w.getStateObject(), "processes[", rm.size(), "] Completed:", w.isCompleted());
                       
                        for ( IDuccReservation r: rm.values()) {
                            Node n = r.getNode();                       
View Full Code Here

    return reservationRestore(fileName, Verbosity.SPEAK);
  }
 
  private IDuccWorkReservation reservationRestore(String fileName, Verbosity level) {
    String methodName = "reservationRestore";
    IDuccWorkReservation reservation = null;
    try {
      logger.trace(methodName, null, "restore:"+fileName);
      FileInputStream fis = null;
      ObjectInputStream in = null;
      fis = new FileInputStream(historyDirectory_reservations+File.separator+fileName);
View Full Code Here

    ArrayList<IDuccWorkReservation> retVal = new ArrayList<IDuccWorkReservation>();
    ArrayList<String> reservationFileNames = reservationList();
    ListIterator<String> listIterator = reservationFileNames.listIterator();
    while(listIterator.hasNext()) {
      String fileName = listIterator.next();
      IDuccWorkReservation reservation = reservationRestore(fileName);
      if(reservation != null) {
        retVal.add(reservation);
      }
    }
    return retVal;
View Full Code Here

  private static int doReservations(HistoryPersistenceManager hpm) throws IOException, ClassNotFoundException {
    ArrayList<IDuccWorkReservation> duccWorkReservations = hpm.reservationRestore();
    ListIterator<IDuccWorkReservation> listIterator = duccWorkReservations.listIterator();
    int acc = 0;
    while(listIterator.hasNext()) {
      IDuccWorkReservation duccWorkReservation = listIterator.next();
      System.out.println(duccWorkReservation.getId());
      acc++;
    }
    return acc;
  }
View Full Code Here

      duccLogger.info(methodName, null, messages.fetchLabel("cancel")+value);
      DuccData duccData = DuccData.getInstance();
      DuccWorkMap duccWorkMap = duccData.get();
      String text;
      String result;
      IDuccWorkReservation duccWorkReservation = (IDuccWorkReservation) duccWorkMap.findDuccWork(DuccType.Reservation, value);
      if(duccWorkReservation != null) {
        String resourceOwnerUserId = duccWorkReservation.getStandardInfo().getUser().trim();
        if(isUserAuthorized(request,resourceOwnerUserId)) {
          String arg1 = "-"+name;
          String arg2 = value;
          String userId = duccWebSessionManager.getUserId(request);
          String cp = System.getProperty("java.class.path");
View Full Code Here

TOP

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

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.