> On May 7, 2015, 1:26 p.m., Tom Beerbower wrote: > > ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProviderProxy.java, > > lines 87-95 > > <https://reviews.apache.org/r/33923/diff/2/?file=951820#file951820line87> > > > > This is good but a little unfortunate that it's required. > > > > It's a little hacky to pass the padding info through a property id > > since we aren't really requesting a property of that name. > > > > It would have been nice if the renderer had a way to set a request info > > property through finalizeProperties(). Then we wouldn't have to worry > > about this check and you could simply get the padding info through > > Request.getRequestInfoProperties(). > > > > I think that way would be cleaner but might require a change to the > > Renderer interface and updates to all the existing Renderer impls. > > > > Up to you... if you want to give it a shot. Otherwise this approach is > > fine.
Agree with you on doing this through requestInfoProperties. I haven't made those changes for the sake of getting this patch in lieu of time contraints. > On May 7, 2015, 1:26 p.m., Tom Beerbower wrote: > > ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java, > > line 129 > > <https://reviews.apache.org/r/33923/diff/2/?file=951817#file951817line129> > > > > Might want to be explicit here and have two cases (null_padding and > > no_padding). Otherwise if someone adds another renderer that happens to > > contain the word '_padding', they will have to come and change this code. > > They might not even realize this is here if they aren't adding the renderer > > to the BaseResourceDefinition. Made these changes. - Sid ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33923/#review82820 ----------------------------------------------------------- On May 7, 2015, 5:35 p.m., Sid Wagle wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/33923/ > ----------------------------------------------------------- > > (Updated May 7, 2015, 5:35 p.m.) > > > Review request for Ambari, Alejandro Fernandez, Mahadev Konar, Sumit Mohanty, > and Tom Beerbower. > > > Bugs: AMBARI-10987 > https://issues.apache.org/jira/browse/AMBARI-10987 > > > Repository: ambari > > > Description > ------- > > If I add ¶ms/padding=nulls to the metrics API request > > /api/v1/clusters/c1/hosts/c6401.ambari.apache.org/host_components/NAMENODE?fields=metrics/cpu/cpu_system[1430833471,1430837071,15],metrics/cpu/cpu_user[1430833471,1430837071,15],metrics/cpu/cpu_nice[1430833471,1430837071,15],metrics/cpu/cpu_idle[1430833471,1430837071,15],metrics/cpu/cpu_wio[1430833471,1430837071,15],metrics/memory/mem_total[1430833471,1430837071,15],metrics/memory/mem_free[1430833471,1430837071,15],metrics/memory/mem_cached[1430833471,1430837071,15]¶ms/padding=nulls > > fails: > > { > "status" : 500, > "message" : "org.apache.ambari.server.controller.spi.SystemException: Error > loading deferred resources" > } > > > Diffs > ----- > > > ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java > e27d9a9 > > ambari-server/src/main/java/org/apache/ambari/server/api/query/render/MetricsPaddingRenderer.java > PRE-CREATION > > ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java > e63f7eb > > ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java > a53e26d > > ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProvider.java > 8360f5e > > ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProviderProxy.java > 24f1851 > > ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MetricsPaddingRendererTest.java > PRE-CREATION > > Diff: https://reviews.apache.org/r/33923/diff/ > > > Testing > ------- > > Manually verified. > Related unit tests: ClusterControllerImplTest, All Renderer tests pass. > > > Thanks, > > Sid Wagle > >
