assertEquals(firstSubQueue.getJobQueueInfo().getSchedulingInfo(), "queueInfo"); assertEquals(secondSubQueue.getJobQueueInfo().getChildren().size(), 0);
/** * Method used to display the list of the JobQueues registered * with the {@link QueueManager} * * @throws IOException */ private void displayQueueList() throws IOException { JobQueueInfo[] queues = jc.getQueues(); for (JobQueueInfo queue : queues) { String schedInfo = queue.getSchedulingInfo(); if(schedInfo.trim().equals("")){ schedInfo = "N/A"; } System.out.printf("Queue Name : %s \n", queue.getQueueName()); System.out.printf("Scheduling Info : %s \n",queue.getSchedulingInfo()); } }
/** * Method used to display the list of the JobQueues registered * with the {@link QueueManager} * * @throws IOException */ private void displayQueueList() throws IOException { JobQueueInfo[] queues = jc.getQueues(); for (JobQueueInfo queue : queues) { String schedInfo = queue.getSchedulingInfo(); if(schedInfo.trim().equals("")){ schedInfo = "N/A"; } System.out.printf("Queue Name : %s \n", queue.getQueueName()); System.out.printf("Scheduling Info : %s \n",queue.getSchedulingInfo()); } }
void printJobQueueInfo(JobQueueInfo jobQueueInfo, Writer writer) throws IOException { if (jobQueueInfo == null) { writer.write("No queue found.\n"); writer.flush(); return; } writer.write(String.format("Queue Name : %s \n", jobQueueInfo.getQueueName())); writer.write(String.format("Queue State : %s \n", jobQueueInfo.getQueueState())); writer.write(String.format("Scheduling Info : %s \n", jobQueueInfo.getSchedulingInfo())); List<JobQueueInfo> childQueues = jobQueueInfo.getChildren(); if (childQueues != null && childQueues.size() > 0) { writer.write(String.format("Child Queues : ")); for (int i = 0; i < childQueues.size(); i++) { JobQueueInfo childQueue = childQueues.get(i); writer.write(String.format("%s", childQueue.getQueueName())); if (i != childQueues.size() - 1) { writer.write(String.format(", ")); } } writer.write("\n"); } writer.write(String.format("======================\n")); writer.flush(); }
@SuppressWarnings("deprecation") void printJobQueueInfo(JobQueueInfo jobQueueInfo, Writer writer, String prefix) throws IOException { if (jobQueueInfo == null) { writer.write("No queue found.\n"); writer.flush(); return; } writer.write(String.format(prefix + "======================\n")); writer.write(String.format(prefix + "Queue Name : %s \n", jobQueueInfo.getQueueName())); writer.write(String.format(prefix + "Queue State : %s \n", jobQueueInfo.getQueueState())); writer.write(String.format(prefix + "Scheduling Info : %s \n", jobQueueInfo.getSchedulingInfo())); List<JobQueueInfo> childQueues = jobQueueInfo.getChildren(); if (childQueues != null && childQueues.size() > 0) { for (int i = 0; i < childQueues.size(); i++) { printJobQueueInfo(childQueues.get(i), writer, " " + prefix); } } writer.flush(); }
@SuppressWarnings("deprecation") void printJobQueueInfo(JobQueueInfo jobQueueInfo, Writer writer, String prefix) throws IOException { if (jobQueueInfo == null) { writer.write("No queue found.\n"); writer.flush(); return; } writer.write(String.format(prefix + "======================\n")); writer.write(String.format(prefix + "Queue Name : %s \n", jobQueueInfo.getQueueName())); writer.write(String.format(prefix + "Queue State : %s \n", jobQueueInfo.getQueueState())); writer.write(String.format(prefix + "Scheduling Info : %s \n", jobQueueInfo.getSchedulingInfo())); List<JobQueueInfo> childQueues = jobQueueInfo.getChildren(); if (childQueues != null && childQueues.size() > 0) { for (int i = 0; i < childQueues.size(); i++) { printJobQueueInfo(childQueues.get(i), writer, " " + prefix); } } writer.flush(); }
@SuppressWarnings("deprecation") void printJobQueueInfo(JobQueueInfo jobQueueInfo, Writer writer, String prefix) throws IOException { if (jobQueueInfo == null) { writer.write("No queue found.\n"); writer.flush(); return; } writer.write(String.format(prefix + "======================\n")); writer.write(String.format(prefix + "Queue Name : %s \n", jobQueueInfo.getQueueName())); writer.write(String.format(prefix + "Queue State : %s \n", jobQueueInfo.getQueueState())); writer.write(String.format(prefix + "Scheduling Info : %s \n", jobQueueInfo.getSchedulingInfo())); List<JobQueueInfo> childQueues = jobQueueInfo.getChildren(); if (childQueues != null && childQueues.size() > 0) { for (int i = 0; i < childQueues.size(); i++) { printJobQueueInfo(childQueues.get(i), writer, " " + prefix); } } writer.flush(); }
@SuppressWarnings("deprecation") void printJobQueueInfo(JobQueueInfo jobQueueInfo, Writer writer, String prefix) throws IOException { if (jobQueueInfo == null) { writer.write("No queue found.\n"); writer.flush(); return; } writer.write(String.format(prefix + "======================\n")); writer.write(String.format(prefix + "Queue Name : %s \n", jobQueueInfo.getQueueName())); writer.write(String.format(prefix + "Queue State : %s \n", jobQueueInfo.getQueueState())); writer.write(String.format(prefix + "Scheduling Info : %s \n", jobQueueInfo.getSchedulingInfo())); List<JobQueueInfo> childQueues = jobQueueInfo.getChildren(); if (childQueues != null && childQueues.size() > 0) { for (int i = 0; i < childQueues.size(); i++) { printJobQueueInfo(childQueues.get(i), writer, " " + prefix); } } writer.flush(); }
private static String getTree(String parent, List<JobQueueInfo> children) { StringBuilder str = new StringBuilder(); if (children == null) { return ""; } for (JobQueueInfo queueInfo : children) { String variableName = StringUtils.replaceChars(queueInfo.getQueueName(), ":-*+#.^", "_______"); String label = queueInfo.getQueueName().split(":")[queueInfo .getQueueName().split(":").length - 1]; str.append(String.format( "var %sTreeNode = new YAHOO.widget.MenuNode(\"%s\", %s, false);\n", variableName, label, parent)); str.append(String.format("%sTreeNode.data=\"%s\";\n", variableName, queueInfo.getSchedulingInfo().replaceAll("\n", "<br/>"))); str.append(String.format("%sTreeNode.name=\"%s\";\n", variableName, queueInfo.getQueueName())); str.append(getTree(variableName + "TreeNode", queueInfo.getChildren())); } return str.toString(); }
/** * Method used to display information pertaining to a Single JobQueue * registered with the {@link QueueManager}. Display of the Jobs is * determine by the boolean * * @throws IOException */ private void displayQueueInfo(String queue, boolean showJobs) throws IOException { JobQueueInfo schedInfo = jc.getQueueInfo(queue); if (schedInfo == null) { System.out.printf("Queue Name : %s has no scheduling information \n", queue); } else { System.out.printf("Queue Name : %s \n", schedInfo.getQueueName()); System.out.printf("Scheduling Info : %s \n",schedInfo.getSchedulingInfo()); } if (showJobs) { System.out.printf("Job List\n"); JobStatus[] jobs = jc.getJobsFromQueue(queue); if (jobs == null) jobs = new JobStatus[0]; jc.displayJobList(jobs); } }
/** * Method used to display information pertaining to a Single JobQueue * registered with the {@link QueueManager}. Display of the Jobs is * determine by the boolean * * @throws IOException */ private void displayQueueInfo(String queue, boolean showJobs) throws IOException { JobQueueInfo schedInfo = jc.getQueueInfo(queue); if (schedInfo == null) { System.out.printf("Queue Name : %s has no scheduling information \n", queue); } else { System.out.printf("Queue Name : %s \n", schedInfo.getQueueName()); System.out.printf("Scheduling Info : %s \n",schedInfo.getSchedulingInfo()); } if (showJobs) { System.out.printf("Job List\n"); JobStatus[] jobs = jc.getJobsFromQueue(queue); if (jobs == null) jobs = new JobStatus[0]; jc.displayJobList(jobs); } }
String queueName = queue.getQueueName(); String state = queue.getQueueState(); String schedulingInformation = queue.getSchedulingInfo(); if(schedulingInformation == null || schedulingInformation.trim().equals("")) { schedulingInformation = "NA";
.getQueueName()); assertNotNull(queueInfo.getQueueName()); assertNotNull(queueInfo.getSchedulingInfo()); assertEquals(expectedQueueInfo, queueInfo.getSchedulingInfo()); numberOfJobs += jobStatusList.length; for (JobStatus status : jobStatusList) {
String schedulingInfoString = schedInfo.getSchedulingInfo();