else {
ConcurrentSkipListMap<IWorkItemState,IWorkItemState> sortedMap = new ConcurrentSkipListMap<IWorkItemState,IWorkItemState>();
for (Entry<Long, IWorkItemState> entry : map.entrySet()) {
sortedMap.put(entry.getValue(), entry.getValue());
}
DuccMachinesData machinesData = DuccMachinesData.getInstance();
DecimalFormat formatter = new DecimalFormat("##0.00");
double time;
int counter = 0;
for (Entry<IWorkItemState, IWorkItemState> entry : sortedMap.entrySet()) {
StringBuffer row = new StringBuffer();
IWorkItemState wis = entry.getValue();
row.append(trGet(counter++));
if(counter > DuccConstants.workItemsDisplayMax) {
// SeqNo
row.append("<td align=\"right\">");
row.append("*****");
// Id
row.append("<td align=\"right\">");
row.append("*****");
// Status
row.append("<td align=\"right\">");
row.append("display");
// Queuing Time (sec)
row.append("<td align=\"right\">");
row.append("limit");
// Processing Time (sec)
row.append("<td align=\"right\">");
row.append("reached");
// Node (IP)
row.append("<td align=\"right\">");
row.append("*****");
// Node (Name)
row.append("<td align=\"right\">");
row.append("*****");
// PID
row.append("<td align=\"right\">");
row.append("*****");
sb.append(row);
duccLogger.warn(methodName, job.getDuccId(), "work items display max:"+DuccConstants.workItemsDisplayMax);
break;
}
// SeqNo
row.append("<td align=\"right\">");
row.append(wis.getSeqNo());
// Id
row.append("<td align=\"right\">");
row.append(wis.getWiId());
// Status
row.append("<td align=\"right\">");
State state = wis.getState();
StringBuffer status = new StringBuffer();
switch(state) {
case lost:
//status = row.append("<span title=\"Work Item was queued but never dequeued. (This is most likely a DUCC framework issue.)\" >");
status.append("<span title=\"Work Item was queued but never dequeued.\" >");
status.append(state);
status.append("</span>");
break;
default:
status.append(state);
break;
}
row.append(status);
// Queuing Time (sec)
time = getAdjustedTime(wis.getMillisOverhead(), job);
time = time/1000;
row.append("<td align=\"right\">");
row.append(formatter.format(time));
// Processing Time (sec)
time = getAdjustedTime(wis.getMillisProcessing(), job);
time = time/1000;
row.append("<td align=\"right\">");
switch(state) {
case start:
case queued:
case operating:
row.append("<span title=\"estimated\" class=\"health_green\">");
break;
default:
row.append("<span class=\"health_black\">");
break;
}
row.append(formatter.format(time));
row.append("</span>");
// Node (IP)
row.append("<td>");
String node = wis.getNode();
if(node != null) {
row.append(node);
}
// Node (Name)
row.append("<td>");
if(node != null) {
String hostName = machinesData.getNameForIp(node);
if(hostName != null) {
row.append(hostName);
}
}
// PID