> On Feb. 9, 2015, 1:07 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java,
> >  lines 39-40
> > <https://reviews.apache.org/r/30799/diff/1/?file=858566#file858566line39>
> >
> >     Why store these? Can't you just query the metainfo XML provider 
> > directly when needed?
> 
> Nate Cole wrote:
>     Doing so meant I had to pass around the ambariMetaInfo instance, which 
> got me thinking about injecting into or using guice to get an instance of 
> UpgradeContext.  I didn't feel like doing all that.

I agree about not using guice to get an UpgradeContext; it's a context and 
shouldn't really be injected. Injecting AmbariMetaInfo seems like it would work 
and would allow you to lookup the values in realtime instead of storing them. I 
dug a little and found this lovely gem:

```
    for (ServiceInfo service : services) {
      if (service.getName().equals(name)) {
        return service;
      }
    }
```

Ewwwwww ... so I'm guessing that your local lookup is faster. I'm fine with it; 
just wanted to know if there was a reason.


- Jonathan


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


On Feb. 9, 2015, 11:45 a.m., Nate Cole wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30799/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2015, 11:45 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley and Tom Beerbower.
> 
> 
> Bugs: AMBARI-9533
>     https://issues.apache.org/jira/browse/AMBARI-9533
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> * Use AmbariMetaInfo in UpgradeHelper to get the display names for 
> services/components and store them with the UpgradeContext for use in the 
> StageWrapperBuilder classes.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
>  908e2d0 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
>  bc53b37 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java 
> 129baa6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
>  6213de1 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java
>  fc51eb1 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Direction.java
>  376de14 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java
>  ba4dca1 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
>  ac8b5dd 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapperBuilder.java
>  3bf9098 
> 
> Diff: https://reviews.apache.org/r/30799/diff/
> 
> 
> Testing
> -------
> 
> Tests run: 2655, Failures: 0, Errors: 0, Skipped: 15
> 
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 23:05.563s
> [INFO] Finished at: Mon Feb 09 10:51:40 EST 2015
> [INFO] Final Memory: 34M/363M
> [INFO] 
> ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Nate Cole
> 
>

Reply via email to