chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r761004 - /hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Iostat.java
Date Wed, 01 Apr 2009 18:31:59 GMT
Author: eyang
Date: Wed Apr  1 18:31:58 2009
New Revision: 761004

URL: http://svn.apache.org/viewvc?rev=761004&view=rev
Log:
CHUKWA-75. Filter out iostat value which is greater than 1+e10.

Modified:
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Iostat.java

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Iostat.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Iostat.java?rev=761004&r1=761003&r2=761004&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Iostat.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Iostat.java
Wed Apr  1 18:31:58 2009
@@ -100,7 +100,17 @@
             while (j < data.length) {
               log.debug("header:" + headers[j] + " data:" + data[j]);
               if (!headers[j].equals("avg-cpu:")) {
-                record.add(headers[j], data[j]);
+                try {
+                  // Filter out overflow values for older linux systems
+                  long x=Long.parseLong(data[j]);
+                  if(x>1000000000L) {
+                    record.add(headers[j],"0");
+                  } else {
+                    record.add(headers[j],data[j]);
+                  }
+                } catch(NumberFormatException ex) {
+                  record.add(headers[j],data[j]);
+                }
               }
               j++;
             }
@@ -132,4 +142,4 @@
   public String getDataType() {
     return recordType;
   }
-}
\ No newline at end of file
+}



Mime
View raw message