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

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


        env.put("ProcessDuccId", ((ManagedProcess) managedProcess)
            .getDuccId().getUnique());
        if (((ManagedProcess) managedProcess).getDuccProcess()
            .getProcessType()
            .equals(ProcessType.Job_Uima_AS_Process)) {
          IDuccStandardInfo processInfo = ((ManagedProcess) managedProcess)
              .getProcessInfo();
          long maxInitTime = 0;

          if (processInfo != null) {
            maxInitTime = processInfo
                .getProcessInitializationTimeMax();
          }
          agent.logger.info("CommandExecutor.call",
              ((ManagedProcess) managedProcess).getWorkDuccId(),
              "Starting Process Initialization Monitor with Max Process Initialization Time:" + maxInitTime);
View Full Code Here


        // Convert Lou's structure into mine.
        IRmJob j = new RmJob(job.getDuccId());
       
        IDuccSchedulingInfo si = job.getSchedulingInfo();
        IDuccStandardInfo   sti = job.getStandardInfo();
       
        String name       = sti.getDescription();
        if ( name == null ) {
            name = "A Job With No Name.";
        }
        String user_name  = sti.getUser();
        j.setUserName(user_name);
        j.setJobName(name);

        int min_shares    = toInt(si.getSharesMin(), 0);
        int threads       = toInt(si.getThreadsPerShare(), scheduler.getDefaultNThreads());
        int user_priority = toInt(si.getSchedulingPriority(), 100);

        int total_work    =  toInt(si.getWorkItemsTotal(), scheduler.getDefaultNTasks());
        int completed_work = toInt(si.getWorkItemsCompleted(), 0);
        int remaining_work = Math.max(total_work - completed_work, 1)// never let this go 0 or negative - both cases
                                                                        // are (probably user) errors.

        logger.info(methodName, job.getDuccId(), "total_work", total_work, "completed_work", completed_work,"remaining_work", remaining_work);

        int memory        = toInt(si.getShareMemorySize(), scheduler.getDefaultMemory());
        String className  = si.getSchedulingClass();
        if ( className == null ) {
            switch ( job.getDuccType() ) {
               case Job:             
                   className = scheduler.getDefaultFairShareName();
                   break;
               case Service:
               case Pop:
               case Reservation:
                   className = scheduler.getDefaultReserveName();
                   break;
            }
            if ( className == null ) {
                j.refuse("No scheduling class defined and no default class configured.");
                return false;
            }
        }

        j.setMinShares(min_shares);
        j.setThreads(threads);
        j.setUserPriority(user_priority);
        j.setNQuestions(total_work, remaining_work, 0.0);
        j.setClassName(className);

        switch (si.getShareMemoryUnits()) {
            case GB:
                break;
            default:
                logger.warn(methodName, job.getDuccId(), "Memory units other than GB are not currently supported.  Job returned.");
                break;
        }
        j.setMemory(memory);
        j.init();

        j.setTimestamp(Long.parseLong(sti.getDateOfSubmission()));
        // logger.info(methodName, j.getId(), "SUBMISSION DATE:", subd, (new Date(subd)).toString());

        if ( job instanceof IDuccWorkJob ) {
            j.setInitWait( ((IDuccWorkJob) job).isRunnable());
        } else {
View Full Code Here

  }
 
  private long getAdjustedTime(long time, IDuccWorkJob job) {
    long adjustedTime = time;
    if(job.isCompleted()) {
      IDuccStandardInfo stdInfo = job.getStandardInfo();
      long t1 = stdInfo.getDateOfCompletionMillis();
      long t0 = stdInfo.getDateOfSubmissionMillis();
      long tmax = t1-t0;
      if(time > tmax) {
        adjustedTime = tmax;
      }
    }
View Full Code Here

TOP

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

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.