> On May 23, 2014, 7:37 a.m., Tom Beerbower wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java,
> >  lines 890-892
> > <https://reviews.apache.org/r/21835/diff/1/?file=588609#file588609line890>
> >
> >     Can a resource have a null key property value?
> 
> Nate Cole wrote:
>     Let's discuss.  This happened to be a place where a NPE was being thrown 
> for the Task subresource because the cluster name was null.

After discussion with Tom, this code path is valid because it's the first case 
of checking for a key property's existence in a subresource where it may not 
exist.  This works in the case of root-level hosts because they have no 
subresources. (Cluster level-hosts have a subresource of HostComponent, root 
level Hosts do not).


- Nate


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


On May 22, 2014, 9:17 p.m., Nate Cole wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/21835/
> -----------------------------------------------------------
> 
> (Updated May 22, 2014, 9:17 p.m.)
> 
> 
> Review request for Ambari, Mahadev Konar, Sid Wagle, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-5856
>     https://issues.apache.org/jira/browse/AMBARI-5856
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> * Add the endpoint /api/v1/requests that will allow custom actions against a 
> host without a cluster
> * Involves, mostly, checking for the existence of a cluster indicator and 
> taking the necessary steps to produce an action.
> 
> THIS PATCH IS STILL IN PROGRESS.  See test notes.  I wanted to publish the 
> code to get this addressed/approved ASAP.  Sorry for the late notice.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/ActionQueue.py c9d3200 
>   
> ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
>  0264fb3 
>   
> ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
>  eaac6b9 
>   
> ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java
>  a3a4763 
>   
> ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java 
> bab6bf9 
>   
> ambari-server/src/main/java/org/apache/ambari/server/actionmanager/StageFactory.java
>  c0e2e6e 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java 
> 1dcd5ba 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/RequestResourceDefinition.java
>  a2099a4 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestService.java
>  4ed3a9d 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
>  bfcf3a8 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
>  9796336 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
>  3d76b52 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskResourceProvider.java
>  9ccc261 
>   
> ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
>  67b6855 
>   ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java 
> 2c3bdcd 
>   
> ambari-server/src/main/resources/custom_action_definitions/system_action_definitions.xml
>  c8765b3 
>   
> ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
>  183c126 
>   
> ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
>  efcdd9b 
>   
> ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionManager.java
>  27da600 
>   
> ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
>  3e1d286 
>   
> ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestStage.java
>  4c835ec 
>   
> ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
>  a04e2e1 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
>  ceda98c 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
>  2312383 
> 
> Diff: https://reviews.apache.org/r/21835/diff/
> 
> 
> Testing
> -------
> 
> The code is complete, but test cases are expected to be finished in the next 
> day or so.  Existing tests still pass, output below.  Currently manual 
> testing on a deployed cluster confirms that commands are invoked (even though 
> the python scripts are being worked separately).
> 
> Existing tests:
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 14:40.563s
> [INFO] Finished at: Thu May 22 21:12:10 EDT 2014
> [INFO] Final Memory: 20M/123M
> [INFO] 
> ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Nate Cole
> 
>

Reply via email to