[ https://issues.apache.org/jira/browse/YARN-4455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16087323#comment-16087323 ]
Varun Saxena commented on YARN-4455: ------------------------------------ Thanks [~rohithsharma] for the review. bq. Just for curiosity, what are we writing and reading with supplemented Timestamp ? Primarily used to distinguish between metrics written in flow run table from different apps. So that we have 2 different puts for different apps and one does not overwrite metric of other just because the timestamps were same. Not really required for entity and app tables but multiplying it by a factor ensures that code path is common while writing. bq. Method setMetricsTimeRange has conditional statement in each line. Can it be optimized by implicitly assuming that tsBegin will not be less than 0 since TimelineDataManager validates it? Similarly for tsEnd? The code below is to handle overflow. When we calculate supplemented timestamp (i.e. multiply tsBegin and tsEnd by a factor of 1000), overflow can potentially occur. Actual timestamps would not be in that range but if input from user is wrong, the value can become negative due to overflow after multiplication. Hence, the check. {code} query.setColumnFamilyTimeRange(metricsCf, ((supplementedTsBegin < 0) ? 0 : supplementedTsBegin), ((supplementedTsEnd < 0) ? Long.MAX_VALUE : supplementedTsEnd)); {code} Will fix the nit. > Support fetching metrics by time range > -------------------------------------- > > Key: YARN-4455 > URL: https://issues.apache.org/jira/browse/YARN-4455 > Project: Hadoop YARN > Issue Type: Sub-task > Components: timelineserver > Affects Versions: YARN-5355 > Reporter: Varun Saxena > Assignee: Varun Saxena > Labels: YARN-5355, yarn-5355-merge-blocker > Attachments: YARN-4455-YARN-5355.01.patch, > YARN-4455-YARN-5355.02.patch > > -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org