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

(Updated April 4, 2016, 5:46 p.m.)


Review request for Ambari, Zhe (Joe) Wang, Sumit Mohanty, Srimanth Gunturi, and 
Sid Wagle.


Changes
-------

Get the cluster object and work with it.


Bugs: AMBARI-15703
    https://issues.apache.org/jira/browse/AMBARI-15703


Repository: ambari


Description
-------

AMBARI-15703: HostResourceProvider should include ** maintenance_state ** when 
a request is made directly with the host name

** Issue **:

The property ** maintenance_state ** is not available in host response when 
making a request directly on the host instead of via the clusters.

curl -u admin:admin -H "X-Requested-By: ambari" -X GET 
http://localhost:8080/api/v1/hosts/c6403.ambari.apache.org

** Fix **:

Get the cluster id and the associated maintenance state and add it to the 
response object.


Diffs (updated)
-----

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
 1ffd3aa63e5cc0bbd40310634f0e400a2793b36a 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
 23524d7b3962a6ceb5ac4b7b0f0573cb80b929d4 

Diff: https://reviews.apache.org/r/45714/diff/


Testing
-------

** 1. mvn clean install **

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Ambari Main ....................................... SUCCESS [7.655s]
[INFO] Apache Ambari Project POM ......................... SUCCESS [0.037s]
[INFO] Ambari Web ........................................ SUCCESS [35.691s]
[INFO] Ambari Views ...................................... SUCCESS [1.301s]
[INFO] Ambari Admin View ................................. SUCCESS [7.877s]
[INFO] ambari-metrics .................................... SUCCESS [0.363s]
[INFO] Ambari Metrics Common ............................. SUCCESS [0.480s]
[INFO] Ambari Metrics Hadoop Sink ........................ SUCCESS [1.100s]
[INFO] Ambari Metrics Flume Sink ......................... SUCCESS [0.612s]
[INFO] Ambari Metrics Kafka Sink ......................... SUCCESS [0.643s]
[INFO] Ambari Metrics Storm Sink ......................... SUCCESS [1.527s]
[INFO] Ambari Metrics Collector .......................... SUCCESS [6.741s]
[INFO] Ambari Metrics Monitor ............................ SUCCESS [2.144s]
[INFO] Ambari Metrics Grafana ............................ SUCCESS [0.874s]
[INFO] Ambari Metrics Assembly ........................... SUCCESS [1:15.067s]
[INFO] Ambari Server ..................................... SUCCESS [2:39.870s]
[INFO] Ambari Functional Tests ........................... SUCCESS [2.719s]
[INFO] Ambari Agent ...................................... SUCCESS [22.670s]
[INFO] Ambari Client ..................................... SUCCESS [0.073s]
[INFO] Ambari Python Client .............................. SUCCESS [0.956s]
[INFO] Ambari Groovy Client .............................. SUCCESS [2.413s]
[INFO] Ambari Shell ...................................... SUCCESS [0.084s]
[INFO] Ambari Python Shell ............................... SUCCESS [0.695s]
[INFO] Ambari Groovy Shell ............................... SUCCESS [1.066s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5:33.331s
[INFO] Finished at: Mon Apr 04 15:54:58 PDT 2016
[INFO] Final Memory: 270M/1184M
[INFO] ------------------------------------------------------------------------

** 2. mvn test -DskipPythonTests -DTest=HostResourceProviderTest **

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Picked up _JAVA_OPTIONS: -Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true
Running org.apache.ambari.server.controller.internal.HostResourceProviderTest
Tests run: 31, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.291 sec - in 
org.apache.ambari.server.controller.internal.HostResourceProviderTest

Results :

Tests run: 31, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.600s
[INFO] Finished at: Mon Apr 04 15:59:10 PDT 2016
[INFO] Final Memory: 56M/1023M
[INFO] ------------------------------------------------------------------------

** 3. Manual tests ** 

Deploy a VM with ambari-server JAR replaced with the fix. Try the following 
request:

curl -u admin:admin -H "X-Requested-By: ambari" -X GET 
http://localhost:8080/api/v1/hosts/c6403.ambari.apache.org

Manually verify that the response contains ** maintenance_state ** property:

    "last_heartbeat_time" : 1459810855978,
    "last_registration_time" : 1459802815284,
    "maintenance_state" : "OFF",


Thanks,

Nahappan Somasundaram

Reply via email to