You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2016/03/02 20:58:45 UTC
svn commit: r1733357 - in
/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main:
java/org/apache/uima/ducc/ws/server/DuccHandlerClassic.java
java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java
webapp/root/system.classes.jsp
Author: degenaro
Date: Wed Mar 2 19:58:45 2016
New Revision: 1733357
URL: http://svn.apache.org/viewvc?rev=1733357&view=rev
Log:
UIMA-4815 DUCC Web Server (WS) System Classes page re-imagined
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerClassic.java
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerClassic.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerClassic.java?rev=1733357&r1=1733356&r2=1733357&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerClassic.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerClassic.java Wed Mar 2 19:58:45 2016
@@ -1217,7 +1217,7 @@ public class DuccHandlerClassic extends
String methodName = "handleServletClassicSystemClasses";
duccLogger.trace(methodName, jobid, messages.fetch("enter"));
StringBuffer sb = new StringBuffer();
-
+ String val = null;
DuccSchedulerClasses schedulerClasses = DuccSchedulerClasses.getInstance();
Map<String, DuccProperties> clmap = schedulerClasses.getClasses();
@@ -1227,121 +1227,38 @@ public class DuccHandlerClassic extends
int i = 0;
for ( DuccProperties cl : class_set) {
+
+ sb.append(trGet(i+1));
+
+ // Name
String class_name = cl.getProperty("name");
- sb.append(trGet(i+1));
sb.append("<td>");
sb.append(class_name);
+ sb.append("</td>");
+
+ // Nodepool
+ sb.append("<td align=\"right\">");
+ val = cl.getProperty("nodepool");
+ sb.append(val);
sb.append("</td>");
+
+ // Policy
sb.append("<td>");
-
String policy = cl.getProperty("policy");
sb.append(policy);
sb.append("</td>");
+
+ // Weight
sb.append("<td align=\"right\">");
sb.append(cl.getStringProperty("weight", "-"));
sb.append("</td>");
+
+ // Priority
sb.append("<td align=\"right\">");
sb.append(cl.getProperty("priority"));
sb.append("</td>");
- // cap is either absolute or proportional. if proprotional, it ends with '%'. It's always
- // either-or so at least one of these columns will have N/A
- String val = cl.getProperty("cap");
- if( (val == null) || val.equals("0") || (Integer.parseInt(val) == Integer.MAX_VALUE) ) {
- sb.append("<td align=\"right\">");
- sb.append("-");
- sb.append("</td>");
- sb.append("<td align=\"right\">");
- sb.append("-");
- sb.append("</td>");
- } else if ( val.endsWith("%") ) {
- sb.append("<td align=\"right\">");
- sb.append(val);
- sb.append("</td>");
-
- sb.append("<td align=\"right\">");
- sb.append("-");
- sb.append("</td>");
- } else {
- sb.append("<td align=\"right\">");
- sb.append("-");
- sb.append("</td>");
-
- sb.append("<td align=\"right\">");
- sb.append(val);
- sb.append("</td>");
- }
-
- if ( policy.equals("FAIR_SHARE") ) {
- sb.append("<td align=\"right\">");
- val = cl.getStringProperty("initialization-cap",
- System.getProperty("ducc.rm.initialization.cap"));
- if ( val == null ) {
- val = "2";
- }
-
- sb.append(val);
- sb.append("</td>");
-
- sb.append("<td align=\"right\">");
- String bval = cl.getStringProperty("expand-by-doubling", "-");
- sb.append(bval);
- sb.append("</td>");
-
- sb.append("<td align=\"right\">");
- val = cl.getStringProperty("use-prediction",
- System.getProperty("ducc.rm.prediction"));
- if ( val == null ) {
- val = "-";
- }
- sb.append(val);
- sb.append("</td>");
-
- sb.append("<td align=\"right\">");
- val = cl.getStringProperty("prediction-fudge",
- System.getProperty("ducc.rm.prediction.fudge"));
- if ( val == null ) {
- val = "-";
- }
- sb.append(val);
- sb.append("</td>");
- } else {
- sb.append("<td align=\"right\">-</td>"); // not applicable for non-fair-share
- sb.append("<td align=\"right\">-</td>");
- sb.append("<td align=\"right\">-</td>");
- sb.append("<td align=\"right\">-</td>");
- }
-
- // max for reserve in in machines. For fixed is in processes. No max on fair-share. So slightly
- // ugly code here.
- sb.append("<td align=\"right\">");
- if ( policy.equals("RESERVE") ) {
- val = cl.getProperty("max-machines");
- if( val == null || val.equals("0")) {
- val = "-";
- }
- } else if ( policy.equals("FIXED_SHARE") ) {
- val = cl.getProperty("max-processes");
- if( val == null || val.equals("0")) {
- val = "-";
- }
- } else {
- val = "-";
- }
-
- val = cl.getProperty("max-shares");
- if( val == null || val.equals("0")) {
- val = "-";
- }
- sb.append(val);
- sb.append("</td>");
-
- sb.append("<td align=\"right\">");
- val = cl.getProperty("nodepool");
- sb.append(val);
- sb.append("</td>");
-
- // Debug
+ // Non-preemptable Class
sb.append("<td align=\"right\">");
val = "-";
if(schedulerClasses.isPreemptable(class_name)) {
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java?rev=1733357&r1=1733356&r2=1733357&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java Wed Mar 2 19:58:45 2016
@@ -1690,7 +1690,9 @@ public class DuccHandlerJsonFormat exten
DuccSchedulerClasses schedulerClasses = DuccSchedulerClasses.getInstance();
Map<String, DuccProperties> clmap = schedulerClasses.getClasses();
-
+
+ String val = null;
+
if( clmap != null ) {
DuccProperties[] class_set = clmap.values().toArray(new DuccProperties[clmap.size()]);
Arrays.sort(class_set, new NodeConfiguration.ClassSorter());
@@ -1700,6 +1702,9 @@ public class DuccHandlerJsonFormat exten
String class_name = cl.getProperty("name");
// Name
row.add(new JsonPrimitive(class_name));
+ // Nodepool
+ val = cl.getProperty("nodepool");
+ row.add(new JsonPrimitive(val));
// Policy
String policy = cl.getProperty("policy");
row.add(new JsonPrimitive(policy));
@@ -1709,84 +1714,7 @@ public class DuccHandlerJsonFormat exten
// Priority
String priority = cl.getProperty("priority");
row.add(new JsonPrimitive(priority));
-
- // cap is either absolute or proportional. if proprotional, it ends with '%'. It's always
- // either-or so at least one of these columns will have N/A
-
- // Relative & Absolute Caps
- String val = cl.getStringProperty("cap", "0");
- if( (val == null) || val.equals("0") ) {
- row.add(new JsonPrimitive("-"));
- row.add(new JsonPrimitive("-"));
- }
- else if ( val.endsWith("%") ) {
- row.add(new JsonPrimitive(val));
- row.add(new JsonPrimitive("-"));
- }
- else {
- row.add(new JsonPrimitive("-"));
- row.add(new JsonPrimitive(val));
- }
-
- if ( policy.equals("FAIR_SHARE") ) {
- // Initialization Cap
- String defaultInitializationCap = "2";
- val = cl.getStringProperty("initialization-cap",
- System.getProperty("ducc.rm.initialization.cap",defaultInitializationCap));
- row.add(new JsonPrimitive(val));
-
- // Expand-by-Doubling
- boolean bval = cl.getBooleanProperty("expand-by-doubling", true);
- row.add(new JsonPrimitive(bval));
-
- // Use Prediction
- String defaultUsePrediction = "true";
- val = cl.getProperty("use-prediction",
- System.getProperty("ducc.rm.prediction",defaultUsePrediction));
- row.add(new JsonPrimitive(val));
-
- // Prediction Fudge
- String defaultPredictionFudge = "10000";
- val = cl.getStringProperty("prediction-fudge",
- System.getProperty("ducc.rm.prediction.fudge",defaultPredictionFudge));
- row.add(new JsonPrimitive(val));
- } else {
- row.add(new JsonPrimitive("-"));
- row.add(new JsonPrimitive("-"));
- row.add(new JsonPrimitive("-"));
- row.add(new JsonPrimitive("-"));
- }
-
- // max for reserve in in machines. For fixed is in processes. No max on fair-share. So slightly
- // ugly code here.
-
- // Max Allocation
-
- if ( policy.equals("RESERVE") ) {
- val = cl.getStringProperty("max-machines", "0");
- if( val == null || val.equals("0")) {
- val = "-";
- }
- } else if ( policy.equals("FIXED_SHARE") ) {
- val = cl.getStringProperty("max-processes", "0");
- if( val == null || val.equals("0")) {
- val = "-";
- }
- } else {
- val = "-";
- }
-
- val = cl.getStringProperty("max-shares", "0");
- if( val == null || val.equals("0")) {
- val = "-";
- }
- row.add(new JsonPrimitive(val));
-
- // Nodepool
- val = cl.getProperty("nodepool");
- row.add(new JsonPrimitive(val));
-
- // Debug
+ // Non-preemptable
val = "-";
if(schedulerClasses.isPreemptable(class_name)) {
if(schedulerClasses.isPreemptable(class_name)) {
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp?rev=1733357&r1=1733356&r2=1733357&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/webapp/root/system.classes.jsp Wed Mar 2 19:58:45 2016
@@ -39,13 +39,9 @@ if (table_style.equals("scroll")) {
"sAjaxSource": "ducc-servlet/json-format-aaData-classes",
aaSorting: [],
"fnRowCallback" : function(nRow,aData,iDisplayIndex) {
- $('td:eq(2)' , nRow).css( "text-align", "right" );
$('td:eq(3)' , nRow).css( "text-align", "right" );
$('td:eq(4)' , nRow).css( "text-align", "right" );
$('td:eq(5)' , nRow).css( "text-align", "right" );
- $('td:eq(6)' , nRow).css( "text-align", "right" );
- $('td:eq(9)' , nRow).css( "text-align", "right" );
- $('td:eq(10)' , nRow).css( "text-align", "right" );
return nRow;
},
} );
@@ -101,18 +97,11 @@ if (table_style.equals("scroll")) {
<thead>
<tr class="ducc-header">
<th align="left">Name</th>
+ <th align="left">Nodepool</th>
<th align="left">Policy</th>
<th align="left">Weight</th>
<th align="left">Priority</th>
- <th align="left">Relative Cap</th>
- <th align="left">Absolute Cap</th>
- <th align="left">Initialization Cap</th>
- <th align="left">Expand-by-Doubling</th>
- <th align="left">Use Prediction</th>
- <th align="left">Prediction Fudge</th>
- <th align="left">Max Allocation</th>
- <th align="left">Nodepool</th>
- <th align="left" title="corresponding non-preemptable specific [or default] class name, if any">Debug Class</th>
+ <th align="left" title="corresponding non-preemptable specific [or default] class name, if any">Non-preemptable Class</th>
</tr>
</thead>
<tbody id="system_classes_list_area">
@@ -132,18 +121,11 @@ if (table_style.equals("classic")) {
<thead>
<tr class="ducc-head">
<th align="left">Name</th>
+ <th align="left">Nodepool</th>
<th align="left">Policy</th>
<th align="left">Weight</th>
<th align="left">Priority</th>
- <th align="left">Relative Cap</th>
- <th align="left">Absolute Cap</th>
- <th align="left">Initialization Cap</th>
- <th align="left">Expand-by-Doubling</th>
- <th align="left">Use Prediction</th>
- <th align="left">Prediction Fudge</th>
- <th align="left">Max Allocation</th>
- <th align="left">Nodepool</th>
- <th align="left" title="corresponding non-preemptable specific [or default] class name, if any">Debug Class</th>
+ <th align="left" title="corresponding non-preemptable specific [or default] class name, if any">Non-preemptable Class</th>
</tr>
</thead>
<tbody id="system_classes_list_area">