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

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


    String javaCmd = jobRequestProperties.getProperty(JobSpecificationProperties.key_jvm);
    if(javaCmd == null) {
            // Agent will set javaCmd for Driver and Processes
    }
    // standard info
    DuccStandardInfo standardInfo = new DuccStandardInfo();
    job.setStandardInfo(standardInfo);
    standardInfo.setUser(jobRequestProperties.getProperty(JobSpecificationProperties.key_user));
    standardInfo.setSubmitter(jobRequestProperties.getProperty(JobSpecificationProperties.key_submitter_pid_at_host));
    standardInfo.setDateOfSubmission(TimeStamp.getCurrentMillis());
    standardInfo.setDateOfCompletion(null);
    standardInfo.setDescription(jobRequestProperties.getProperty(JobSpecificationProperties.key_description));
    standardInfo.setLogDirectory(jobRequestProperties.getProperty(JobSpecificationProperties.key_log_directory));
    standardInfo.setWorkingDirectory(jobRequestProperties.getProperty(JobSpecificationProperties.key_working_directory));
    String notifications = jobRequestProperties.getProperty(JobSpecificationProperties.key_notifications);
    if(notifications == null) {
      standardInfo.setNotifications(null);
    }
    else {
      String[] notificationsArray = notifications.split(" ,");
      for(String notification : notificationsArray) {
        notification.trim();
      }
      standardInfo.setNotifications(notificationsArray);
    }
    // scheduling info
    DuccSchedulingInfo schedulingInfo = new DuccSchedulingInfo();
    String ducc_rm_share_quantum = DuccPropertiesResolver.getInstance().getFileProperty(DuccPropertiesResolver.ducc_rm_share_quantum);
    if(ducc_rm_share_quantum != null) {
      ducc_rm_share_quantum = ducc_rm_share_quantum.trim();
      if(ducc_rm_share_quantum.length() > 0) {
        schedulingInfo.setShareMemorySize(ducc_rm_share_quantum);
      }
    }
    job.setSchedulingInfo(schedulingInfo);
    schedulingInfo.setSchedulingClass(jobRequestProperties.getProperty(JobSpecificationProperties.key_scheduling_class));
    schedulingInfo.setSchedulingPriority(jobRequestProperties.getProperty(JobSpecificationProperties.key_scheduling_priority));
    schedulingInfo.setSharesMax(jobRequestProperties.getProperty(JobSpecificationProperties.key_process_deployments_max));
    schedulingInfo.setSharesMin(jobRequestProperties.getProperty(JobSpecificationProperties.key_process_deployments_min));
    schedulingInfo.setThreadsPerShare(jobRequestProperties.getProperty(JobSpecificationProperties.key_process_thread_count));
    schedulingInfo.setShareMemorySize(jobRequestProperties.getProperty(JobSpecificationProperties.key_process_memory_size));
    schedulingInfo.setShareMemoryUnits(MemoryUnits.GB);
   
    if (job.getDuccType() == DuccType.Job){
        checkSchedulingLimits(job, schedulingInfo);
    }
   
    // process_initialization_time_max
    String pi_time = jobRequestProperties.getProperty(JobRequestProperties.key_process_initialization_time_max);
    if(pi_time == null) {
      pi_time = DuccPropertiesResolver.getInstance().getFileProperty(DuccPropertiesResolver.ducc_agent_launcher_process_init_timeout);
    }
    try {
      long value = Long.parseLong(pi_time)*60*1000;
      standardInfo.setProcessInitializationTimeMax(value);
    }
    catch(Exception e) {
      logger.error(methodName, job.getDuccId(), e);
    }
    // jp
View Full Code Here


    DuccWorkReservation duccWorkReservation = new DuccWorkReservation();
    // id, type
    duccWorkReservation.setDuccId(duccIdFactory.next());
    duccWorkReservation.setDuccType(DuccType.Reservation);
    // standard info
    DuccStandardInfo standardInfo = new DuccStandardInfo();
    duccWorkReservation.setStandardInfo(standardInfo);
    standardInfo.setUser(reservationRequestProperties.getProperty(ReservationSpecificationProperties.key_user));
    standardInfo.setSubmitter(reservationRequestProperties.getProperty(ReservationSpecificationProperties.key_submitter_pid_at_host));
    standardInfo.setDateOfSubmission(TimeStamp.getCurrentMillis());
    standardInfo.setDateOfCompletion(null);
    standardInfo.setDescription(reservationRequestProperties.getProperty(ReservationSpecificationProperties.key_description));
    // scheduling info
    DuccSchedulingInfo schedulingInfo = new DuccSchedulingInfo();
    duccWorkReservation.setSchedulingInfo(schedulingInfo);
    schedulingInfo.setSchedulingClass(reservationRequestProperties.getProperty(ReservationSpecificationProperties.key_scheduling_class));
    String memorySize = reservationRequestProperties.getProperty(ReservationSpecificationProperties.key_instance_memory_size);
    MemorySpecification memorySpecification = new MemorySpecification(memorySize);
    schedulingInfo.setShareMemorySize(memorySpecification.getSize());
    schedulingInfo.setShareMemoryUnits(memorySpecification.getMemoryUnits());
    schedulingInfo.setInstancesCount(reservationRequestProperties.getProperty(ReservationSpecificationProperties.key_number_of_instances));
    logger.info(methodName, duccWorkReservation.getDuccId(), messages.fetchLabel("user")+standardInfo.getUser());
    logger.info(methodName, duccWorkReservation.getDuccId(), messages.fetchLabel("description")+standardInfo.getDescription());
    logger.info(methodName, duccWorkReservation.getDuccId(), messages.fetchLabel("class")+schedulingInfo.getSchedulingClass());
    logger.info(methodName, duccWorkReservation.getDuccId(), messages.fetchLabel("priority")+schedulingInfo.getSchedulingPriority());
    logger.info(methodName, duccWorkReservation.getDuccId(), messages.fetchLabel("memory")+schedulingInfo.getShareMemorySize()+schedulingInfo.getShareMemoryUnits());
    logger.info(methodName, duccWorkReservation.getDuccId(), messages.fetchLabel("instances")+schedulingInfo.getInstancesCount());
    logger.trace(methodName, null, messages.fetch("exit"));
View Full Code Here

TOP

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

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.