chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r783536 - in /hadoop/chukwa/trunk: CHANGES.txt src/java/org/apache/hadoop/chukwa/rest/actions/RestController.java
Date Wed, 10 Jun 2009 21:56:24 GMT
Author: eyang
Date: Wed Jun 10 21:56:24 2009
New Revision: 783536

URL: http://svn.apache.org/viewvc?rev=783536&view=rev
Log:
CHUKWA-95. Added Web Service API to export data from database. (Terence Kwan via Eric Yang)

Modified:
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/actions/RestController.java

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=783536&r1=783535&r2=783536&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Wed Jun 10 21:56:24 2009
@@ -4,6 +4,8 @@
 
   NEW FEATURES
 
+    CHUKWA-95. Added Web Service API to export data from database. (Terence Kwan via Eric
Yang)
+
     CHUKWA-281. Created pig scripts to perform down sampling. (Cheng Zhang via Eric Yang)
 
     CHUKWA-20. Added pig support for ChukwaRecords. (Jerome Boulon via Eric Yang)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/actions/RestController.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/actions/RestController.java?rev=783536&r1=783535&r2=783536&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/actions/RestController.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/rest/actions/RestController.java
Wed Jun 10 21:56:24 2009
@@ -41,9 +41,17 @@
 		String fldName = fld.getName();
 		String functionName = "get"+ fldName.substring(0,1).toUpperCase() + fldName.substring(1);
 		String value = "";
-                @SuppressWarnings("unchecked")
-		Method meth=cls.getMethod(functionName);
-		Object oret = meth.invoke(obj);
+                Object oret = null;
+		try {
+		    @SuppressWarnings("unchecked")
+		    Method meth=cls.getMethod(functionName);
+		    if (meth == null) {
+			continue;
+		    }
+		    oret = meth.invoke(obj);
+                } catch (Exception e) {
+	  	   continue;
+		}
 		if (oret == null) {
 		    value="";
 		} else if ((oret instanceof Date) || (oret instanceof java.sql.Timestamp)) {
@@ -110,12 +118,21 @@
 		Method m = methlist[i];
 		if (m.getName().startsWith("get")) {
 		    String name=m.getName();
-                    @SuppressWarnings("unchecked")
-		    Method meth=cls.getMethod(name);
-		    Object oret = meth.invoke(obj);
+		    Object oret = null;
+		    try {
+			@SuppressWarnings("unchecked")
+			Method meth=cls.getMethod(name);
+			if (meth == null) {
+			    continue;
+			}
+			oret = meth.invoke(obj);
+		    } catch (Exception e) {
+			continue;
+		    }
 		    if (count!=0) {
 			s.append(",");
 		    }
+
 		    count+=1;
 		    if (oret == null) {
 			s.append("\"\"");



Mime
View raw message