[ 
https://issues.apache.org/jira/browse/HADOOP-3470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Allen Wittenauer resolved HADOOP-3470.
--------------------------------------

    Resolution: Won't Fix

Closing this as won't fix given the metrics system has been replaced.

> Bad coding style: The member fields in 
> org.apache.hadoop.ipc.metrics.RpcMetrics are public
> ------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3470
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3470
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: metrics
>            Reporter: Tsz Wo Nicholas Sze
>
> In org.apache.hadoop.ipc.metrics.RpcMetrics,
> {code}
> //the following are member fields
>   public MetricsTimeVaryingRate rpcQueueTime = new 
> MetricsTimeVaryingRate("RpcQueueTime");
>   public MetricsTimeVaryingRate rpcProcessingTime = new 
> MetricsTimeVaryingRate("RpcProcessingTime");
>   public Map <String, MetricsTimeVaryingRate> metricsList = 
> Collections.synchronizedMap(new HashMap<String, MetricsTimeVaryingRate>());
> {code}
> Then, the fields are accessed directly in other classes.  For example, 
> org.apache.hadoop.ipc.RPC.Server.call(...)
> {code}
> ...
>       MetricsTimeVaryingRate m = 
> rpcMetrics.metricsList.get(call.getMethodName());
>       if (m != null) {
>               m.inc(processingTime);
>       }
>       else {
>               rpcMetrics.metricsList.put(call.getMethodName(), new 
> MetricsTimeVaryingRate(call.getMethodName()));
>               m = rpcMetrics.metricsList.get(call.getMethodName());
>               m.inc(processingTime);
>       }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to