[
https://issues.apache.org/jira/browse/HADOOP-19525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17942190#comment-17942190
]
ASF GitHub Bot commented on HADOOP-19525:
-----------------------------------------
pan3793 commented on code in PR #7570:
URL: https://github.com/apache/hadoop/pull/7570#discussion_r2035327543
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/PlanFollower.java:
##########
@@ -17,10 +17,10 @@
*******************************************************************************/
package org.apache.hadoop.yarn.server.resourcemanager.reservation;
+import java.time.Clock;
import java.util.Collection;
import
org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
-import org.apache.hadoop.util.Clock;
Review Comment:
I just took a closer look, `org.apache.hadoop.util.Clock` was actually
exposed to the public API, such changes bring unnecessary compatibility issues.
Given Hadoop is already in a post-mature state, I would avoid such changes as
much as possible.
Back to the original intention of the changes, how about leaving the
`org.apache.hadoop.yarn.util.Clock` as-is (which means reverting YARN-11765),
and introducing a new Clock implementation in the Common module based on the
JDK `Clock`?
> Use java.time.Clock instead of org.apache.hadoop.util.Clock
> -----------------------------------------------------------
>
> Key: HADOOP-19525
> URL: https://issues.apache.org/jira/browse/HADOOP-19525
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: hadoop-common, mapreduce, yarn
> Reporter: Yaniv Kunda
> Assignee: Yaniv Kunda
> Priority: Major
> Labels: pull-request-available
>
> Hadoop's {{Clock}} interface was recently moved from
> {{org.apache.hadoop.yarn.util}} (in hadoop-yarn) to
> {{org.apache.hadoop.util}} (in hadoop-common) as part of YARN-11765.
> I propose to seize the opportunity of this being targeted done for 3.5.0 to
> modernize it usage:
> # Deprecate {{org.apache.hadoop.util.Clock}}
> # Replace all of its usages with {{java.time.Clock}}
> # Replace existing usages of its simple implementations, e.g.
> {{SystemClock}}/{{UTCClock}} with standard {{java.time.Clock}} subclasses,
> e.g. {{Clock.systemUTC()}}
> # Re-implement other implementations, e.g.
> {{MonotonicClock}}/{{ControllerClock}}, as {{java.time.Clock}} subclasses.
> The standard {{java.time.Clock}} has a richer API supports modern
> {{java.time}} classes such as {{Instant}} and {{ZoneId}}, and migration would
> be straightforward:
> Just changing {{org.apache.hadoop.util.Clock.getTime()}} to
> {{java.time.Clock.millis()}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]