accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1296262 - in /incubator/accumulo/trunk: ./ src/core/ src/packages/deb/accumulo-native/ src/packages/deb/accumulo/ src/server/ src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ src/server/src/main/resources/web/
Date Fri, 02 Mar 2012 15:52:31 GMT
Author: vines
Date: Fri Mar  2 15:52:30 2012
New Revision: 1296262

URL: http://svn.apache.org/viewvc?rev=1296262&view=rev
Log:
Merging ACCUMULO-435 and ACCUMULO-431


Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/   (props changed)
    incubator/accumulo/trunk/src/packages/deb/accumulo-native/postinst
    incubator/accumulo/trunk/src/packages/deb/accumulo/postinst
    incubator/accumulo/trunk/src/packages/deb/accumulo/postrm
    incubator/accumulo/trunk/src/server/   (props changed)
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
    incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  2 15:52:30 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043,1236873,1245632
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1295933
+/incubator/accumulo/branches/1.4:1201902-1296260

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  2 15:52:30 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
 /incubator/accumulo/branches/1.3.5rc/src/core:1209938
-/incubator/accumulo/branches/1.4/src/core:1201902-1295933
+/incubator/accumulo/branches/1.4/src/core:1201902-1296260

Modified: incubator/accumulo/trunk/src/packages/deb/accumulo-native/postinst
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/packages/deb/accumulo-native/postinst?rev=1296262&r1=1296261&r2=1296262&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/packages/deb/accumulo-native/postinst (original)
+++ incubator/accumulo/trunk/src/packages/deb/accumulo-native/postinst Fri Mar  2 15:52:30
2012
@@ -16,7 +16,7 @@
 # limitations under the License.
 
 # postinst script for Apache Accumulo native libraries
-if [ -z $JAVA_HOME ]; then
+if [ -z $JAVA_HOME -o ! -f $JAVA_HOME/jre/bin/ ] ; then
   JAVA_HOME=`readlink -f /usr/bin/java`
   JAVA_HOME=`dirname $JAVA_HOME`
   JAVA_HOME=`cd $JAVA_HOME/../../; pwd`

Modified: incubator/accumulo/trunk/src/packages/deb/accumulo/postinst
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/packages/deb/accumulo/postinst?rev=1296262&r1=1296261&r2=1296262&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/packages/deb/accumulo/postinst (original)
+++ incubator/accumulo/trunk/src/packages/deb/accumulo/postinst Fri Mar  2 15:52:30 2012
@@ -22,11 +22,11 @@ mv -f /usr/lib/accumulo/conf/* /etc/accu
 rm -Rf /usr/lib/accumulo/conf
 ln -fs /etc/accumulo/conf /usr/lib/accumulo/conf 
 mkdir -p /var/log/accumulo/logs
-mkdir -p /var/log/accumulo/walogs
+mkdir -p /var/lib/accumulo/walogs
 ln -fs /var/log/accumulo/logs /usr/lib/accumulo/logs 
-ln -fs /var/log/accumulo/walogs /usr/lib/accumulo/walogs 
+ln -fs /var/lib/accumulo/walogs /usr/lib/accumulo/walogs 
 
-if [ -z $JAVA_HOME ]; then
+if [ -z $JAVA_HOME -o ! -f $JAVA_HOME/jre/bin/ ] ; then
   JAVA_HOME=`readlink -f /usr/bin/java`
   JAVA_HOME=`dirname $JAVA_HOME`
   JAVA_HOME=`cd $JAVA_HOME/../../; pwd`

Modified: incubator/accumulo/trunk/src/packages/deb/accumulo/postrm
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/packages/deb/accumulo/postrm?rev=1296262&r1=1296261&r2=1296262&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/packages/deb/accumulo/postrm (original)
+++ incubator/accumulo/trunk/src/packages/deb/accumulo/postrm Fri Mar  2 15:52:30 2012
@@ -16,13 +16,13 @@
 # limitations under the License.
 
 # postrm script for Apache Accumulo
+rm -f /usr/lib/accumulo/conf
 rm -f /usr/lib/accumulo/logs
 rm -f /usr/lib/accumulo/walogs
-rm -f /usr/lib/accumulo/conf
-rm -f /usr/bin/accumulo
 case "$1" in
   purge)
     rm -Rf /var/log/accumulo
+    rm -Rf /var/lib/accumulo
     rm -Rf /etc/accumulo
   ;;
   remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
@@ -33,4 +33,5 @@ case "$1" in
   ;;
 esac
 
+rm -f /usr/bin/accumulo
 exit 0

Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  2 15:52:30 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
 /incubator/accumulo/branches/1.3.5rc/src/server:1209938
-/incubator/accumulo/branches/1.4/src/server:1201902-1295933
+/incubator/accumulo/branches/1.4/src/server:1201902-1296260

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java?rev=1296262&r1=1296261&r2=1296262&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
Fri Mar  2 15:52:30 2012
@@ -47,12 +47,15 @@ public class VisServlet extends BasicSer
     queryMB(5, true, 10, "Scan MB"),
     scans(concurrentScans * 2, false, 1, "Running Scans"),
     scansessions(50, true, 10, "Scan Sessions"),
-    holdtime(60000, false, 1, "Hold Time");
+    holdtime(60000, false, 1, "Hold Time"),
+    allavg(1, false, 100, "Overall Avg", true),
+    allmax(1, false, 100, "Overall Max", true);
     
     private int max;
     private boolean adjustMax;
     private float significance;
     private String description;
+    private boolean derived;
     
     /**
      * @param max
@@ -65,10 +68,15 @@ public class VisServlet extends BasicSer
      *          as appears in selection box
      */
     private StatType(int max, boolean adjustMax, float significance, String description)
{
+      this(max, adjustMax, significance, description, false);
+    }
+    
+    private StatType(int max, boolean adjustMax, float significance, String description,
boolean derived) {
       this.max = max;
       this.adjustMax = adjustMax;
       this.significance = significance;
       this.description = description;
+      this.derived = derived;
     }
     
     public int getMax() {
@@ -86,6 +94,18 @@ public class VisServlet extends BasicSer
     public String getDescription() {
       return description;
     }
+    
+    public boolean isDerived() {
+      return derived;
+    }
+    
+    public static int numDerived() {
+      int count = 0;
+      for (StatType st : StatType.values())
+        if (st.isDerived())
+          count++;
+      return count;
+    }
   }
   
   @Override
@@ -106,7 +126,7 @@ public class VisServlet extends BasicSer
     }
     
     s = req.getParameter("motion");
-    motion = StatType.ingest;
+    motion = StatType.allmax;
     if (s != null) {
       try {
         motion = StatType.valueOf(s);
@@ -114,20 +134,20 @@ public class VisServlet extends BasicSer
     }
     
     s = req.getParameter("color");
-    color = StatType.osload;
+    color = StatType.allavg;
     if (s != null) {
       try {
         color = StatType.valueOf(s);
       } catch (Exception e) {}
     }
     
-    spacing = 20;
+    spacing = 40;
     String size = req.getParameter("size");
     if (size != null) {
       if (size.equals("10"))
         spacing = 10;
-      else if (size.equals("40"))
-        spacing = 40;
+      else if (size.equals("20"))
+        spacing = 20;
       else if (size.equals("80"))
         spacing = 80;
     }
@@ -198,6 +218,7 @@ public class VisServlet extends BasicSer
       sb.append(st.getSignificance()).append(",");
     sb.setLength(sb.length() - 1);
     sb.append("]; // values will be converted by floor(this*value)/this\n");
+    sb.append("var numNormalStats = ").append(StatType.values().length - StatType.numDerived()).append(";\n");
     sb.append("</script>\n");
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml?rev=1296262&r1=1296261&r2=1296262&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml (original)
+++ incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml Fri Mar  2 15:52:30
2012
@@ -79,27 +79,26 @@ function handleNewData() {
     xmlReturned = true;
     return;
   }
-  var statinfo = new Array(statName.length);
-  for (j=0; j < statName.length; j++)
+  var statinfo = new Array(numNormalStats);
+  for (j=0; j < numNormalStats; j++)
     statinfo[j] = xmlhttp.responseXML.getElementsByTagName(statName[j]);
   var deadinfo = xmlhttp.responseXML.getElementsByTagName('deadTabletServer');
   var badinfo = xmlhttp.responseXML.getElementsByTagName('badTabletServer');
   var idinfo = xmlhttp.responseXML.getElementsByTagName('server');
   
-  var statValues = new Array(statName.length);
+  var statValues = new Array(numNormalStats);
   for (i=0; i < idinfo.length; i++) {
     var info = idinfo[i].attributes[0].nodeValue;
     var extra = '<br>';
-    for (j=0; j < statinfo.length; j++) {
-      statValues[j] = Math.floor(significance[j]*parseFloat(statinfo[j][i].childNodes[0].nodeValue))/significance[j];
-      if (statValues[j] < 0)
-        statValues[j] = 0;
+    for (j=0; j < numNormalStats; j++) {
+      statValues[j] = Math.max(0,Math.floor(significance[j]*parseFloat(statinfo[j][i].childNodes[0].nodeValue))/significance[j]);
       extra = extra + ' ' + statName[j] + ': ' + statValues[j];
     }
     setStats(statValues,i);
     setDotInfo(info,extra,i);
   }
   numLive = idinfo.length;
+  resetOverallStats();
   
   for (i=idinfo.length,j=0; j < deadinfo.length; i++,j++) {
     setDotInfo(deadinfo[j].attributes[0].nodeValue,'',i);
@@ -114,12 +113,38 @@ function handleNewData() {
 }
 
 function setStats(statValues,index) {
+  var newStats = new Array(numNormalStats+2);
+  for (j=0; j < numNormalStats; j++) {
+    if (adjustMax[j])
+      maxStatValue[j] = Math.max(statValues[j],maxStatValue[j]);
+    newStats[j] = statValues[j];
+  }
+  setOverallStats(newStats);
   if (index >= allStats.length)
-    allStats.push(new Array(statValues.length));
-  for (j=0; j < statValues.length; j++) {
-    if (adjustMax[j] && maxStatValue[j] < statValues[j])
-      maxStatValue[j] = statValues[j];
-    allStats[index][j] = statValues[j];
+    allStats.push(newStats);
+  else
+    allStats[index] = newStats;
+}
+
+function setOverallStats(statValues) {
+  avgStat = 0;
+  maxStat = 0;
+  for (j=0; j < numNormalStats; j++) {
+    normStat = statValues[j]/maxStatValue[j];
+    if (normStat > 0)
+      avgStat += normStat;
+    maxStat = Math.max(maxStat,normStat);
+  }
+  avgStat = avgStat/numNormalStats;
+  maxStat = Math.min(1,maxStat);
+  statValues[numNormalStats] = Math.floor(significance[numNormalStats]*avgStat)/significance[numNormalStats];
+  statValues[numNormalStats+1] = Math.floor(significance[numNormalStats+1]*maxStat)/significance[numNormalStats+1];
+}
+
+function resetOverallStats() {
+  for (i=0; i < numLive; i++) {
+    setOverallStats(allStats[i]);
+    extras[i] = extras[i] + ' avg: ' + allStats[i][numNormalStats] + ' max: ' + allStats[i][numNormalStats+1];
   }
 }
 
@@ -162,9 +187,7 @@ function drawDots(){
       if (dotSize[i] > maxDotRadius)
         dotSize[i] = maxDotRadius;
     } else {
-      sizeChange = allStats[i][speedStatType]/maxStatValue[speedStatType];
-      if (sizeChange > 1)
-        sizeChange = 1;
+      sizeChange = getStat(i,speedStatType);
       if (dotSizeGrowing[i]) {
         dotSize[i] = dotSize[i] + sizeChange;
         if (dotSize[i] + sizeChange > maxDotRadius) {
@@ -183,7 +206,7 @@ function drawDots(){
     if (i >= numLive)
       strokeDot(x,y,maxDotRadius-1,deadColor);
     else
-      drawDot(x,y,Math.floor(dotSize[i]),getColor(allStats[i][colorStatType]/maxStatValue[colorStatType]));
+      drawDot(x,y,Math.floor(dotSize[i]),getColor(getStat(i,colorStatType)));
   }
   if (mousedDot < numDots)
     document.getElementById('vishoverinfo').innerHTML=ids[mousedDot]+extras[mousedDot];
@@ -221,10 +244,12 @@ function strokeDot(i,j,r,c) {
     strokeSquare(x-r,y-r,(r-dotPadding)*2,c);
 }
 
+function getStat(dotIndex,statIndex) {
+  return Math.min(1,allStats[dotIndex][statIndex]/maxStatValue[statIndex]);
+}
+
 // translate color between 0 and maxObservedColor into an html color code
 function getColor(normColor) {
-  if (normColor > 1)
-    normColor = 1;
   return colorPalette[Math.round((colorPalette.length-1)*normColor)];
 }
 
@@ -303,14 +328,12 @@ function setSize(obj) {
 // callback for motion selection
 function setMotion(obj) {
   speedStatType = obj.selectedIndex;
-  drawGrid();
   setState();
 }
 
 // callback for color selection
 function setColor(obj) {
   colorStatType = obj.selectedIndex;
-  drawGrid();
   setState();
 }
 



Mime
View raw message