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