From 1e5e08d83b8dc168e636e0834584fecf5d44cb65 Mon Sep 17 00:00:00 2001 From: Rohith Sharma K S Date: Wed, 6 Feb 2019 09:30:09 +0530 Subject: [PATCH] YARN-7627. [ATSv2] When passing a non-number as metricslimit, the error message is wrong. Contributed by Charan Hebri. --- .../reader/TimelineReaderWebServices.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderWebServices.java index db483559203..279cfdc5a8e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderWebServices.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderWebServices.java @@ -350,7 +350,8 @@ public class TimelineReaderWebServices { succeeded = true; } catch (Exception e) { handleException(e, url, startTime, - "createdTime start/end or limit or flowrunid"); + "Either limit or createdtime start/end or metricslimit or metricstime" + + " start/end or fromid"); } finally { long latency = Time.monotonicNow() - startTime; METRICS.addGetEntitiesLatency(latency, succeeded); @@ -631,7 +632,8 @@ public class TimelineReaderWebServices { succeeded = true; } catch (Exception e) { handleException(e, url, startTime, - "createdTime start/end or limit or flowrunid"); + "Either flowrunid or limit or createdtime start/end or metricslimit" + + " or metricstime start/end or fromid"); } finally { long latency = Time.monotonicNow() - startTime; METRICS.addGetEntitiesLatency(latency, succeeded); @@ -725,7 +727,8 @@ public class TimelineReaderWebServices { checkAccessForGenericEntity(entity, callerUGI); succeeded = true; } catch (Exception e) { - handleException(e, url, startTime, "flowrunid"); + handleException(e, url, startTime, "Either metricslimit or metricstime" + + " start/end"); } finally { long latency = Time.monotonicNow() - startTime; METRICS.addGetEntitiesLatency(latency, succeeded); @@ -919,7 +922,8 @@ public class TimelineReaderWebServices { checkAccessForGenericEntity(entity, callerUGI); succeeded = true; } catch (Exception e) { - handleException(e, url, startTime, "flowrunid"); + handleException(e, url, startTime, "Either flowrunid or metricslimit or" + + " metricstime start/end"); } finally { long latency = Time.monotonicNow() - startTime; METRICS.addGetEntitiesLatency(latency, succeeded); @@ -1606,7 +1610,8 @@ public class TimelineReaderWebServices { checkAccessForAppEntity(entity, callerUGI); succeeded = true; } catch (Exception e) { - handleException(e, url, startTime, "flowrunid"); + handleException(e, url, startTime, "Either metricslimit or metricstime" + + " start/end"); } finally { long latency = Time.monotonicNow() - startTime; METRICS.addGetEntitiesLatency(latency, succeeded); @@ -1781,7 +1786,8 @@ public class TimelineReaderWebServices { checkAccessForAppEntity(entity, callerUGI); succeeded = true; } catch (Exception e) { - handleException(e, url, startTime, "flowrunid"); + handleException(e, url, startTime, "Either flowrunid or metricslimit or" + + " metricstime start/end"); } finally { long latency = Time.monotonicNow() - startTime; METRICS.addGetEntitiesLatency(latency, succeeded); @@ -1927,7 +1933,8 @@ public class TimelineReaderWebServices { succeeded = true; } catch (Exception e) { handleException(e, url, startTime, - "createdTime start/end or limit or flowrunid"); + "Either limit or createdtime start/end or metricslimit or" + + " metricstime start/end"); } finally { long latency = Time.monotonicNow() - startTime; METRICS.addGetEntitiesLatency(latency, succeeded); @@ -3418,7 +3425,8 @@ public class TimelineReaderWebServices { succeeded = true; } catch (Exception e) { handleException(e, url, startTime, - "createdTime start/end or limit"); + "Either limit or createdtime start/end or metricslimit or metricstime" + + " start/end or fromid"); } finally { long latency = Time.monotonicNow() - startTime; METRICS.addGetEntitiesLatency(latency, succeeded); @@ -3489,7 +3497,8 @@ public class TimelineReaderWebServices { checkAccessForSubAppEntities(entities,callerUGI); succeeded = true; } catch (Exception e) { - handleException(e, url, startTime, ""); + handleException(e, url, startTime, "Either metricslimit or metricstime" + + " start/end"); } finally { long latency = Time.monotonicNow() - startTime; METRICS.addGetEntitiesLatency(latency, succeeded);