Re: Review Request 27435: Views: 400 error on redeploy

2014-10-31 Thread Jonathan Hurley

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



ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
https://reviews.apache.org/r/27435/#comment100649

If a view is not fully deployed and the sub resources are requested, this 
seems like it will return an empty collection.

Would that mean that on subsequent calls after the view is deployed, it 
would return the cached empty collection instead of calling 
getSubResourceDefinitions?


- Jonathan Hurley


On Oct. 31, 2014, 2:29 p.m., Tom Beerbower wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/27435/
 ---
 
 (Updated Oct. 31, 2014, 2:29 p.m.)
 
 
 Review request for Ambari, Jonathan Hurley and Nate Cole.
 
 
 Bugs: AMBARI-8069
 https://issues.apache.org/jira/browse/AMBARI-8069
 
 
 Repository: ambari
 
 
 Description
 ---
 
 The view registry lazily caches the sub-resources of each view/version.  If a 
 request for the sub-resources is made before the view is fully deployed, the 
 cached set of sub-resource may be incomplete.
 
 STR:
 1. deployed a view
 2. created an instance
 3. stopped server, deleted JAR and work dir
 4. put jar in place, start server
 5. deploy occurs
 6. when deploy is complete, in the admin ui, the existing instance (from step 
 #2) shows up
 7. i click on the instance and it fails (get a 400). No errors in logs
 
 {code}
 http://c6401.ambari.apache.org:8080/api/v1/views/FILES/versions/0.1.0/instances/FILES_1?_=1414708973511fields=privileges%2FPrivilegeInfo,ViewInstanceInfo,resources
 {code}
 
 {code}
 {
   status : 400,
   message : The properties [resources] specified in the request or 
 predicate are not supported for the resource type ViewInstance.
 }
 {code}
 
 
 Diffs
 -
 
   
 ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
  b53147b 
   ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java 
 f2173ac 
   
 ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
  1bd47f3 
 
 Diff: https://reviews.apache.org/r/27435/diff/
 
 
 Testing
 ---
 
 Manually tested the steps above.  
 
 All tests pass ...
 
 Results :
 
 Tests run: 2126, Failures: 0, Errors: 0, Skipped: 15
 
 ...
 
 [INFO] 
 
 [INFO] BUILD SUCCESS
 [INFO] 
 
 [INFO] Total time: 18:54 min
 [INFO] Finished at: 2014-10-31T14:09:54-04:00
 [INFO] Final Memory: 39M/334M
 [INFO] 
 
 
 
 Thanks,
 
 Tom Beerbower
 




Re: Review Request 27435: Views: 400 error on redeploy

2014-10-31 Thread Tom Beerbower


 On Oct. 31, 2014, 6:39 p.m., Jonathan Hurley wrote:
  ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java,
   line 417
  https://reviews.apache.org/r/27435/diff/1/?file=745686#file745686line417
 
  If a view is not fully deployed and the sub resources are requested, 
  this seems like it will return an empty collection.
  
  Would that mean that on subsequent calls after the view is deployed, it 
  would return the cached empty collection instead of calling 
  getSubResourceDefinitions?

Thanks for the review.

No. That's actually what this patch fixes.  The caching 
(subResourceDefinitionsMap.put(viewName, subResourceDefinitions);) is done 
inside the block that checks isDeployed().  The caller should see the empty 
collection until the view is fully deployed.  After that the complete 
sub-resource collection should be cached and returned.


- Tom


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


On Oct. 31, 2014, 6:29 p.m., Tom Beerbower wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/27435/
 ---
 
 (Updated Oct. 31, 2014, 6:29 p.m.)
 
 
 Review request for Ambari, Jonathan Hurley and Nate Cole.
 
 
 Bugs: AMBARI-8069
 https://issues.apache.org/jira/browse/AMBARI-8069
 
 
 Repository: ambari
 
 
 Description
 ---
 
 The view registry lazily caches the sub-resources of each view/version.  If a 
 request for the sub-resources is made before the view is fully deployed, the 
 cached set of sub-resource may be incomplete.
 
 STR:
 1. deployed a view
 2. created an instance
 3. stopped server, deleted JAR and work dir
 4. put jar in place, start server
 5. deploy occurs
 6. when deploy is complete, in the admin ui, the existing instance (from step 
 #2) shows up
 7. i click on the instance and it fails (get a 400). No errors in logs
 
 {code}
 http://c6401.ambari.apache.org:8080/api/v1/views/FILES/versions/0.1.0/instances/FILES_1?_=1414708973511fields=privileges%2FPrivilegeInfo,ViewInstanceInfo,resources
 {code}
 
 {code}
 {
   status : 400,
   message : The properties [resources] specified in the request or 
 predicate are not supported for the resource type ViewInstance.
 }
 {code}
 
 
 Diffs
 -
 
   
 ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
  b53147b 
   ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java 
 f2173ac 
   
 ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
  1bd47f3 
 
 Diff: https://reviews.apache.org/r/27435/diff/
 
 
 Testing
 ---
 
 Manually tested the steps above.  
 
 All tests pass ...
 
 Results :
 
 Tests run: 2126, Failures: 0, Errors: 0, Skipped: 15
 
 ...
 
 [INFO] 
 
 [INFO] BUILD SUCCESS
 [INFO] 
 
 [INFO] Total time: 18:54 min
 [INFO] Finished at: 2014-10-31T14:09:54-04:00
 [INFO] Final Memory: 39M/334M
 [INFO] 
 
 
 
 Thanks,
 
 Tom Beerbower
 




Re: Review Request 27435: Views: 400 error on redeploy

2014-10-31 Thread Jonathan Hurley

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

Ship it!


Thanks for the explanation.

- Jonathan Hurley


On Oct. 31, 2014, 2:29 p.m., Tom Beerbower wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/27435/
 ---
 
 (Updated Oct. 31, 2014, 2:29 p.m.)
 
 
 Review request for Ambari, Jonathan Hurley and Nate Cole.
 
 
 Bugs: AMBARI-8069
 https://issues.apache.org/jira/browse/AMBARI-8069
 
 
 Repository: ambari
 
 
 Description
 ---
 
 The view registry lazily caches the sub-resources of each view/version.  If a 
 request for the sub-resources is made before the view is fully deployed, the 
 cached set of sub-resource may be incomplete.
 
 STR:
 1. deployed a view
 2. created an instance
 3. stopped server, deleted JAR and work dir
 4. put jar in place, start server
 5. deploy occurs
 6. when deploy is complete, in the admin ui, the existing instance (from step 
 #2) shows up
 7. i click on the instance and it fails (get a 400). No errors in logs
 
 {code}
 http://c6401.ambari.apache.org:8080/api/v1/views/FILES/versions/0.1.0/instances/FILES_1?_=1414708973511fields=privileges%2FPrivilegeInfo,ViewInstanceInfo,resources
 {code}
 
 {code}
 {
   status : 400,
   message : The properties [resources] specified in the request or 
 predicate are not supported for the resource type ViewInstance.
 }
 {code}
 
 
 Diffs
 -
 
   
 ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
  b53147b 
   ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java 
 f2173ac 
   
 ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
  1bd47f3 
 
 Diff: https://reviews.apache.org/r/27435/diff/
 
 
 Testing
 ---
 
 Manually tested the steps above.  
 
 All tests pass ...
 
 Results :
 
 Tests run: 2126, Failures: 0, Errors: 0, Skipped: 15
 
 ...
 
 [INFO] 
 
 [INFO] BUILD SUCCESS
 [INFO] 
 
 [INFO] Total time: 18:54 min
 [INFO] Finished at: 2014-10-31T14:09:54-04:00
 [INFO] Final Memory: 39M/334M
 [INFO] 
 
 
 
 Thanks,
 
 Tom Beerbower
 




Re: Review Request 27435: Views: 400 error on redeploy

2014-10-31 Thread Nate Cole

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

Ship it!


Ship It!

- Nate Cole


On Oct. 31, 2014, 2:29 p.m., Tom Beerbower wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/27435/
 ---
 
 (Updated Oct. 31, 2014, 2:29 p.m.)
 
 
 Review request for Ambari, Jonathan Hurley and Nate Cole.
 
 
 Bugs: AMBARI-8069
 https://issues.apache.org/jira/browse/AMBARI-8069
 
 
 Repository: ambari
 
 
 Description
 ---
 
 The view registry lazily caches the sub-resources of each view/version.  If a 
 request for the sub-resources is made before the view is fully deployed, the 
 cached set of sub-resource may be incomplete.
 
 STR:
 1. deployed a view
 2. created an instance
 3. stopped server, deleted JAR and work dir
 4. put jar in place, start server
 5. deploy occurs
 6. when deploy is complete, in the admin ui, the existing instance (from step 
 #2) shows up
 7. i click on the instance and it fails (get a 400). No errors in logs
 
 {code}
 http://c6401.ambari.apache.org:8080/api/v1/views/FILES/versions/0.1.0/instances/FILES_1?_=1414708973511fields=privileges%2FPrivilegeInfo,ViewInstanceInfo,resources
 {code}
 
 {code}
 {
   status : 400,
   message : The properties [resources] specified in the request or 
 predicate are not supported for the resource type ViewInstance.
 }
 {code}
 
 
 Diffs
 -
 
   
 ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
  b53147b 
   ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java 
 f2173ac 
   
 ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java
  1bd47f3 
 
 Diff: https://reviews.apache.org/r/27435/diff/
 
 
 Testing
 ---
 
 Manually tested the steps above.  
 
 All tests pass ...
 
 Results :
 
 Tests run: 2126, Failures: 0, Errors: 0, Skipped: 15
 
 ...
 
 [INFO] 
 
 [INFO] BUILD SUCCESS
 [INFO] 
 
 [INFO] Total time: 18:54 min
 [INFO] Finished at: 2014-10-31T14:09:54-04:00
 [INFO] Final Memory: 39M/334M
 [INFO] 
 
 
 
 Thanks,
 
 Tom Beerbower