-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33923/#review82820
-----------------------------------------------------------

Ship it!


Looks good.  A couple comments ...


ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java
<https://reviews.apache.org/r/33923/#comment133649>

    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.



ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProviderProxy.java
<https://reviews.apache.org/r/33923/#comment133650>

    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.


- Tom Beerbower


On May 7, 2015, 12:48 a.m., Sid Wagle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33923/
> -----------------------------------------------------------
> 
> (Updated May 7, 2015, 12:48 a.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 &params/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]&params/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
> 
>

Reply via email to