Sapsi, I am not positive on this but I think the reason for this is to future proof the API. If in the future we want to add in new optional parameters, I believe that it is impossible in protocol buffers without having that request object. I could be wrong I am not an expert on PB.
--Bobby Evans On 10/9/12 11:11 PM, "Saptarshi Guha" <[email protected]> wrote: >Hello >(sorry for cross post) >I am reading the DistributedShell code and came across > > GetClusterMetricsRequest clusterMetricsReq = >Records.newRecord(GetClusterMetricsRequest.class); > GetClusterMetricsResponse clusterMetricsResp = >applicationsManager.getClusterMetrics(clusterMetricsReq); > >In the page: >http://hadoop.apache.org/docs/current/api/org/apache/hadoop/yarn/api/Clien >tRMProtocol.html#getClusterMetrics%28org.apache.hadoop.yarn.api.protocolre >cords.GetClusterMetricsRequest%29 > >I can't find any other function getClusterMetrics. > >Why was the choice made to pass a GetClusterMetricsRequest object to >getClusterMetrics? >why couldn't the programmer invoke >applicationsManager.getClusterMetrics() and the method would reply >with a GetClusterMetricsResponse? > >Regards >Sapsi >(P.S I havent used YARN or even written code with it, i'm just reading >some sources and my reading is incomplete, so apologies if this comes >across >as stupid)
