You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by dl...@apache.org on 2016/04/28 19:49:44 UTC

[3/6] incubator-quarks git commit: Keeping old logging as per review comments

Keeping old logging as per review comments


Project: http://git-wip-us.apache.org/repos/asf/incubator-quarks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quarks/commit/62950bec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quarks/tree/62950bec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quarks/diff/62950bec

Branch: refs/heads/master
Commit: 62950bec398ed3f89318c8b4c0012fa2a4187f1c
Parents: 3661bdd
Author: Saurabh Jinturkar <sa...@sjsu.edu>
Authored: Tue Apr 26 12:36:46 2016 -0700
Committer: Saurabh Jinturkar <sa...@sjsu.edu>
Committed: Tue Apr 26 12:36:46 2016 -0700

----------------------------------------------------------------------
 .../console/servlets/ConsoleJobServlet.java     |  6 +----
 .../java/quarks/console/servlets/JobUtil.java   | 12 ++++------
 .../quarks/console/servlets/MetricsUtil.java    | 23 ++++++++------------
 3 files changed, 14 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/62950bec/console/servlets/src/main/java/quarks/console/servlets/ConsoleJobServlet.java
----------------------------------------------------------------------
diff --git a/console/servlets/src/main/java/quarks/console/servlets/ConsoleJobServlet.java b/console/servlets/src/main/java/quarks/console/servlets/ConsoleJobServlet.java
index 9acb945..d5b6fa1 100644
--- a/console/servlets/src/main/java/quarks/console/servlets/ConsoleJobServlet.java
+++ b/console/servlets/src/main/java/quarks/console/servlets/ConsoleJobServlet.java
@@ -29,16 +29,12 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 
 public class ConsoleJobServlet extends HttpServlet {
     /**
 	 * This servlet looks for any running jobs in the embedded environment in which the http server was started
 	 */
 	private static final long serialVersionUID = -2939472165693224428L;
-	private static final Logger logger = LoggerFactory.getLogger(ConsoleJobServlet.class);
 
 	@Override
     public void doGet(HttpServletRequest request, HttpServletResponse response)
@@ -85,7 +81,7 @@ public class ConsoleJobServlet extends HttpServlet {
         try {
         	jobObjName = new ObjectName(sbuf.toString());
         	} catch (MalformedObjectNameException e) {
-                logger.error("Exception caught while initializing ObjectName", e);
+                e.printStackTrace();
         	}
         String jsonString = "";
         if (jobsInfo) {

http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/62950bec/console/servlets/src/main/java/quarks/console/servlets/JobUtil.java
----------------------------------------------------------------------
diff --git a/console/servlets/src/main/java/quarks/console/servlets/JobUtil.java b/console/servlets/src/main/java/quarks/console/servlets/JobUtil.java
index 1f2a770..7280195 100644
--- a/console/servlets/src/main/java/quarks/console/servlets/JobUtil.java
+++ b/console/servlets/src/main/java/quarks/console/servlets/JobUtil.java
@@ -35,13 +35,9 @@ import javax.management.ObjectInstance;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 final class JobUtil {
 	
 	static MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
-	private static final Logger logger = LoggerFactory.getLogger(JobUtil.class);
 
 	static String getJobsInfo(ObjectName jobObjName) {
         Set<ObjectInstance> jobInstances = mBeanServer.queryMBeans(jobObjName, null);
@@ -59,7 +55,7 @@ final class JobUtil {
 			try {
 				mBeanInfo = mBeanServer.getMBeanInfo(jobObjectName);
 			} catch (IntrospectionException | InstanceNotFoundException | ReflectionException e) {
-				logger.error("Exception caught while getting MBeanInfo", e);
+			    e.printStackTrace();
 			}
             
             /*
@@ -82,7 +78,7 @@ final class JobUtil {
 					s.append((String)mBeanServer.getAttribute(jobObjectName, attr));
 				} catch (AttributeNotFoundException | InstanceNotFoundException 
 						| MBeanException | ReflectionException e) {
-					logger.error("Exception caught while accessing MBean", e);
+				    e.printStackTrace();
 				}
 	    		s.append("\",\"");
 	    	}
@@ -113,7 +109,7 @@ final class JobUtil {
 			try {
 				mBeanInfo = mBeanServer.getMBeanInfo(jobObjectName);
 			} catch (IntrospectionException | InstanceNotFoundException | ReflectionException e) {
-				logger.error("Exception caught while getting MBeanInfo", e);
+			    e.printStackTrace();
 			}
 	    	/*
 	    	 * Now get the graph for the job
@@ -126,7 +122,7 @@ final class JobUtil {
 						gSnapshot = (String) mBeanServer.invoke(jobObjectName, "graphSnapshot",null, null);
 						//System.out.println(gSnapshot);
 					} catch (InstanceNotFoundException | ReflectionException | MBeanException e) {
-						logger.error("Exception caught while invoking operation on MBean", e);
+					    e.printStackTrace();
 					}
 	    		}
 	    		

http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/62950bec/console/servlets/src/main/java/quarks/console/servlets/MetricsUtil.java
----------------------------------------------------------------------
diff --git a/console/servlets/src/main/java/quarks/console/servlets/MetricsUtil.java b/console/servlets/src/main/java/quarks/console/servlets/MetricsUtil.java
index 2166bdf..d34cf98 100644
--- a/console/servlets/src/main/java/quarks/console/servlets/MetricsUtil.java
+++ b/console/servlets/src/main/java/quarks/console/servlets/MetricsUtil.java
@@ -35,16 +35,12 @@ import javax.management.ObjectInstance;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import quarks.console.servlets.MetricsGson.OpMetric;
 import quarks.console.servlets.MetricsGson.Operator;
 
 final class MetricsUtil {
 	
 	static MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
-	private static final Logger logger = LoggerFactory.getLogger(MetricsUtil.class);
 
 	static Iterator<ObjectInstance> getCounterObjectIterator(String jobId) {
 		ObjectName counterObjName = null;
@@ -56,7 +52,7 @@ final class MetricsUtil {
 		try {
 			counterObjName = new ObjectName(sbuf.toString());
 		} catch (MalformedObjectNameException e) {
-			logger.error("Error caught while initializing ObjectName", e);
+		    e.printStackTrace();
 		}
 		Set<ObjectInstance> counterInstances = mBeanServer.queryMBeans(counterObjName, null);
 		return counterInstances.iterator();
@@ -72,7 +68,7 @@ final class MetricsUtil {
 			try {
 				meterObjName = new ObjectName(sbuf1.toString());
 			} catch (MalformedObjectNameException e) {
-				logger.error("Error caught while initializing ObjectName", e);
+			    e.printStackTrace();
 			}
 			
 
@@ -97,7 +93,7 @@ final class MetricsUtil {
 					try {
 						mBeanInfo = mBeanServer.getMBeanInfo(mObjName);
 					} catch (IntrospectionException | InstanceNotFoundException | ReflectionException e) {
-						logger.error("Exception caught while getting MBeanInfo", e);
+					    e.printStackTrace();
 					}
 
 			    	for (MBeanAttributeInfo attributeInfo : mBeanInfo.getAttributes()) {
@@ -110,7 +106,7 @@ final class MetricsUtil {
 		    					aMetric.value = String.valueOf(mBeanServer.getAttribute(mObjName, aMetric.name));
 		    				} catch (AttributeNotFoundException | InstanceNotFoundException | MBeanException
 								| ReflectionException e) {
-                                logger.error("Exception caught while accessing MBean", e);
+		    				    e.printStackTrace();
 		    				}
 		    			}
 		    			// if the op associated with this metric is not in the job add it
@@ -142,7 +138,7 @@ final class MetricsUtil {
 			try {
 				mBeanInfo = mBeanServer.getMBeanInfo(cObjName);
 			} catch (IntrospectionException | InstanceNotFoundException | ReflectionException e) {
-				logger.error("Exception caught while getting MBeanInfo", e);
+			    e.printStackTrace();
 			}
 
 	    	for (MBeanAttributeInfo attributeInfo : mBeanInfo.getAttributes()) {
@@ -196,7 +192,7 @@ final class MetricsUtil {
 				try {
 					mBeanInfo = mBeanServer.getMBeanInfo(mObjName);
 				} catch (IntrospectionException | InstanceNotFoundException | ReflectionException e) {
-					logger.error("Exception caught while getting MBeanInfo", e);
+				    e.printStackTrace();
 				}
 				
 		    	for (MBeanAttributeInfo attributeInfo : mBeanInfo.getAttributes()) {
@@ -209,7 +205,7 @@ final class MetricsUtil {
 							aMetric.value = String.valueOf(mBeanServer.getAttribute(mObjName, name));
 						} catch (AttributeNotFoundException | InstanceNotFoundException | MBeanException
 								| ReflectionException e) {
-							logger.error("Exception caught while accessing MBean", e);
+						    e.printStackTrace();
 						}
     					if (!gsonJob.isOpInJob(opName)) {
     					    anOp = gsonJob.new Operator();
@@ -244,7 +240,7 @@ final class MetricsUtil {
 				try {
 					mBeanInfo = mBeanServer.getMBeanInfo(cObjName);
 				} catch (IntrospectionException | InstanceNotFoundException | ReflectionException e) {
-					logger.error("Exception caught while getting MBeanInfo", e);
+				    e.printStackTrace();
 				}
 				
 		    	for (MBeanAttributeInfo attributeInfo : mBeanInfo.getAttributes()) {
@@ -258,7 +254,7 @@ final class MetricsUtil {
 							aMetric.value = String.valueOf(mBeanServer.getAttribute(cObjName, name));
 						} catch (AttributeNotFoundException | InstanceNotFoundException | MBeanException
 								| ReflectionException e) {
-							logger.error("Exception caught while accessing MBean", e);
+						    e.printStackTrace();
 						}
     					if (!gsonJob.isOpInJob(opName1)) {
     					    anOp = gsonJob.new Operator();
@@ -277,5 +273,4 @@ final class MetricsUtil {
 		}	
 		return gsonJob;
 	}
-	
 }