hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rohithsharm...@apache.org
Subject hadoop git commit: YARN-8155. Improve ATSv2 client logging in RM and NM publisher. Contributed by Abhishek Modi.
Date Thu, 14 Jun 2018 08:21:52 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-3.1 934a005f7 -> 1aa6c9407


YARN-8155. Improve ATSv2 client logging in RM and NM publisher. Contributed by Abhishek Modi.

(cherry picked from commit 9119b3cf8f883aa2d5df534afc0c50249fed03c6)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1aa6c940
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1aa6c940
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1aa6c940

Branch: refs/heads/branch-3.1
Commit: 1aa6c9407c7d42c1f75e0acd9bf8342418ddffb3
Parents: 934a005
Author: Rohith Sharma K S <rohithsharmaks@apache.org>
Authored: Thu Jun 14 12:38:10 2018 +0530
Committer: Rohith Sharma K S <rohithsharmaks@apache.org>
Committed: Thu Jun 14 13:51:13 2018 +0530

----------------------------------------------------------------------
 .../timelineservice/NMTimelinePublisher.java    | 42 +++++++++++++++++---
 .../metrics/TimelineServiceV2Publisher.java     |  8 +++-
 .../collector/TimelineCollectorWebService.java  | 12 ++++--
 3 files changed, 51 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/1aa6c940/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/timelineservice/NMTimelinePublisher.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/timelineservice/NMTimelinePublisher.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/timelineservice/NMTimelinePublisher.java
index f451726..cbf3e5e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/timelineservice/NMTimelinePublisher.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/timelineservice/NMTimelinePublisher.java
@@ -190,9 +190,20 @@ public class NMTimelinePublisher extends CompositeService {
           LOG.error("Seems like client has been removed before the container"
               + " metric could be published for " + container.getContainerId());
         }
-      } catch (IOException | YarnException e) {
+      } catch (IOException e) {
         LOG.error("Failed to publish Container metrics for container "
-            + container.getContainerId(), e);
+            + container.getContainerId());
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("Failed to publish Container metrics for container "
+              + container.getContainerId(), e);
+        }
+      } catch (YarnException e) {
+        LOG.error("Failed to publish Container metrics for container "
+            + container.getContainerId(), e.getMessage());
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("Failed to publish Container metrics for container "
+              + container.getContainerId(), e);
+        }
       }
     }
   }
@@ -284,9 +295,20 @@ public class NMTimelinePublisher extends CompositeService {
         LOG.error("Seems like client has been removed before the event could be"
             + " published for " + container.getContainerId());
       }
-    } catch (IOException | YarnException e) {
+    } catch (IOException e) {
+      LOG.error("Failed to publish Container metrics for container "
+          + container.getContainerId());
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Failed to publish Container metrics for container "
+            + container.getContainerId(), e);
+      }
+    } catch (YarnException e) {
       LOG.error("Failed to publish Container metrics for container "
-          + container.getContainerId(), e);
+          + container.getContainerId(), e.getMessage());
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Failed to publish Container metrics for container "
+            + container.getContainerId(), e);
+      }
     }
   }
 
@@ -315,8 +337,16 @@ public class NMTimelinePublisher extends CompositeService {
         LOG.error("Seems like client has been removed before the entity "
             + "could be published for " + entity);
       }
-    } catch (Exception e) {
-      LOG.error("Error when publishing entity " + entity, e);
+    } catch (IOException e) {
+      LOG.error("Error when publishing entity " + entity);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Error when publishing entity " + entity, e);
+      }
+    } catch (YarnException e) {
+      LOG.error("Error when publishing entity " + entity, e.getMessage());
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Error when publishing entity " + entity, e);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1aa6c940/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
index ea286a0..89905e5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.yarn.server.resourcemanager.metrics;
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -457,8 +458,11 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher
{
       entities.addEntity(entity);
       timelineCollector.putEntities(entities,
           UserGroupInformation.getCurrentUser());
-    } catch (Exception e) {
-      LOG.error("Error when publishing entity " + entity, e);
+    } catch (IOException e) {
+      LOG.error("Error when publishing entity " + entity);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Error when publishing entity " + entity, e);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1aa6c940/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorWebService.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorWebService.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorWebService.java
index 272b478..4e51fca 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorWebService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorWebService.java
@@ -60,6 +60,9 @@ import com.google.inject.Singleton;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.util.IllegalFormatException;
+
 /**
  * The main per-node REST end point for timeline service writes. It is
  * essentially a container service that routes requests to the appropriate
@@ -165,7 +168,7 @@ public class TimelineCollectorWebService {
       TimelineCollector collector = collectorManager.get(appID);
       if (collector == null) {
         LOG.error("Application: "+ appId + " is not found");
-        throw new NotFoundException(); // different exception?
+        throw new NotFoundException("Application: "+ appId + " is not found");
       }
 
       boolean isAsync = async != null && async.trim().equalsIgnoreCase("true");
@@ -178,7 +181,10 @@ public class TimelineCollectorWebService {
       }
 
       return Response.ok().build();
-    } catch (Exception e) {
+    } catch (NotFoundException | ForbiddenException e) {
+      throw new WebApplicationException(e,
+          Response.Status.INTERNAL_SERVER_ERROR);
+    } catch (IOException e) {
       LOG.error("Error putting entities", e);
       throw new WebApplicationException(e,
           Response.Status.INTERNAL_SERVER_ERROR);
@@ -192,7 +198,7 @@ public class TimelineCollectorWebService {
       } else {
         return null;
       }
-    } catch (Exception e) {
+    } catch (IllegalFormatException e) {
       LOG.error("Invalid application ID: " + appId);
       return null;
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message