virajjasani commented on a change in pull request #3198:
URL: https://github.com/apache/hadoop/pull/3198#discussion_r671091992



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcMetrics.java
##########
@@ -49,7 +51,7 @@
   final String name;
   final boolean rpcQuantileEnable;
   /** The time unit used when storing/accessing time durations. */
-  public final static TimeUnit TIMEUNIT = TimeUnit.MILLISECONDS;
+  private static TimeUnit metricsTimeUnit = TimeUnit.MILLISECONDS;

Review comment:
       Since this is static, setting in constructor might not be that accurate 
(also it produces spotbugs, as per first QA result
   e.g `Write to static field 
org.apache.hadoop.ipc.metrics.RpcMetrics.metricsTimeUnit from instance method 
new org.apache.hadoop.ipc.metrics.RpcMetrics(Server, Configuration) At 
RpcMetrics.java:from instance method new 
org.apache.hadoop.ipc.metrics.RpcMetrics(Server, Configuration) At 
RpcMetrics.java:[line 70]`
   ).
   And `static final` will always require us to provide value in static context 
outside constructor, that's why we are not able to use it as `final` 
unfortunately.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to