Re: Review Request 49029: When requesting a Kerberos Descriptor via the REST API, 'when' clauses should optionally be processed

2016-06-23 Thread Oliver Szabo

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


Ship it!




Ship It!

- Oliver Szabo


On June 22, 2016, 5:57 p.m., Robert Levas wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49029/
> ---
> 
> (Updated June 22, 2016, 5:57 p.m.)
> 
> 
> Review request for Ambari, Di Li, Jonathan Hurley, Nate Cole, Oliver Szabo, 
> and Sandor Magyari.
> 
> 
> Bugs: AMBARI-17226
> https://issues.apache.org/jira/browse/AMBARI-17226
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> When requesting a Kerberos Descriptor via the REST API, 'when' clauses should 
> optionally be processed.  If elected to be processed, identities that contain 
> `when` clauses will be included or excluded from the resulting descriptor 
> based on the result of the evaluation. 
> 
> In the event of an _add service_ scenario, the services being added should be 
> able to be specified so that they can be included in the data used for 
> `when`-clause evaluation.  
> 
> #Solution
> Add _GET directives_ to specify whether `when` clauses are to be evaluated 
> (or not) while building the Kerberos Descriptor using the following API call:
> ```
> GET 
> /api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true
> ```
> If new services are being added, the `additional_services` directive should 
> be added to the request so the evaluation can be preformed on the _future_ 
> set of services, which may evaluate differently then the _current_ set of 
> services.
> ```
> GET 
> /api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true@additional_services=HIVE,TEZ,PIG
> ```
> 
> #Notes
> - A lot of code was moved from ClusterKerberosDescriptorResourceProvider to 
> KerberosHelper to reduce the likelyhood of duplication
> - The logic to build a Kerberos descriptor (STACK, USER, COMPOSITE) has been 
> consolidated in the KerberosHelper
> - Some duplicate code in test cases have been conslidated
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  a2aeffa 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
>  5ffc8a3 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
>  cd79e46 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProvider.java
>  1f5d1d8 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
>  79b9a55 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
>  64d9292 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptor.java
>  19d3f5e 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
>  98f8883 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorType.java
>  0677de6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java
>  2631d35 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
>  9eeb802 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
>  7281e85 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProviderTest.java
>  898cf46 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
>  9f0f7a1 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
>  004cd66 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
>  e5392c0 
> 
> Diff: https://reviews.apache.org/r/49029/diff/
> 
> 
> Testing
> ---
> 
> Manually testing...  updated unit tests...
> 
> # Local test results: 
> 
> [INFO] 
> 
> [INFO] BUILD SUCCESS
> [INFO] 
> 
> [INFO] Total time: 1:27:14.265s
> [INFO] Finished at: Tue Jun 21 12:03:08 EDT 2016
> [INFO] Final Memory: 61M/1851M
> [INFO] 
> 
> 
> # Jenkins test results: PENDING
> 
> 
> Thanks,
> 
> Robert Levas
> 
>



Re: Review Request 49029: When requesting a Kerberos Descriptor via the REST API, 'when' clauses should optionally be processed

2016-06-22 Thread Robert Levas

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

(Updated June 22, 2016, 1:57 p.m.)


Review request for Ambari, Di Li, Jonathan Hurley, Nate Cole, Oliver Szabo, and 
Sandor Magyari.


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


Repository: ambari


Description
---

When requesting a Kerberos Descriptor via the REST API, 'when' clauses should 
optionally be processed.  If elected to be processed, identities that contain 
`when` clauses will be included or excluded from the resulting descriptor based 
on the result of the evaluation. 

In the event of an _add service_ scenario, the services being added should be 
able to be specified so that they can be included in the data used for 
`when`-clause evaluation.  

#Solution
Add _GET directives_ to specify whether `when` clauses are to be evaluated (or 
not) while building the Kerberos Descriptor using the following API call:
```
GET 
/api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true
```
If new services are being added, the `additional_services` directive should be 
added to the request so the evaluation can be preformed on the _future_ set of 
services, which may evaluate differently then the _current_ set of services.
```
GET 
/api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true@additional_services=HIVE,TEZ,PIG
```

#Notes
- A lot of code was moved from ClusterKerberosDescriptorResourceProvider to 
KerberosHelper to reduce the likelyhood of duplication
- The logic to build a Kerberos descriptor (STACK, USER, COMPOSITE) has been 
consolidated in the KerberosHelper
- Some duplicate code in test cases have been conslidated


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 a2aeffa 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
 5ffc8a3 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
 cd79e46 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProvider.java
 1f5d1d8 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
 79b9a55 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
 64d9292 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptor.java
 19d3f5e 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
 98f8883 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorType.java
 0677de6 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java
 2631d35 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
 9eeb802 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
 7281e85 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProviderTest.java
 898cf46 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
 9f0f7a1 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
 004cd66 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
 e5392c0 

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


Testing
---

Manually testing...  updated unit tests...

# Local test results: 

[INFO] 
[INFO] BUILD SUCCESS
[INFO] 
[INFO] Total time: 1:27:14.265s
[INFO] Finished at: Tue Jun 21 12:03:08 EDT 2016
[INFO] Final Memory: 61M/1851M
[INFO] 

# Jenkins test results: PENDING


Thanks,

Robert Levas



Re: Review Request 49029: When requesting a Kerberos Descriptor via the REST API, 'when' clauses should optionally be processed

2016-06-22 Thread Robert Levas


> On June 22, 2016, 12:43 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProvider.java,
> >  line 335
> > 
> >
> > isBlank instead?

yup


- Robert


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


On June 22, 2016, 10:17 a.m., Robert Levas wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49029/
> ---
> 
> (Updated June 22, 2016, 10:17 a.m.)
> 
> 
> Review request for Ambari, Di Li, Jonathan Hurley, Nate Cole, Oliver Szabo, 
> and Sandor Magyari.
> 
> 
> Bugs: AMBARI-17226
> https://issues.apache.org/jira/browse/AMBARI-17226
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> When requesting a Kerberos Descriptor via the REST API, 'when' clauses should 
> optionally be processed.  If elected to be processed, identities that contain 
> `when` clauses will be included or excluded from the resulting descriptor 
> based on the result of the evaluation. 
> 
> In the event of an _add service_ scenario, the services being added should be 
> able to be specified so that they can be included in the data used for 
> `when`-clause evaluation.  
> 
> #Solution
> Add _GET directives_ to specify whether `when` clauses are to be evaluated 
> (or not) while building the Kerberos Descriptor using the following API call:
> ```
> GET 
> /api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true
> ```
> If new services are being added, the `additional_services` directive should 
> be added to the request so the evaluation can be preformed on the _future_ 
> set of services, which may evaluate differently then the _current_ set of 
> services.
> ```
> GET 
> /api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true@additional_services=HIVE,TEZ,PIG
> ```
> 
> #Notes
> - A lot of code was moved from ClusterKerberosDescriptorResourceProvider to 
> KerberosHelper to reduce the likelyhood of duplication
> - The logic to build a Kerberos descriptor (STACK, USER, COMPOSITE) has been 
> consolidated in the KerberosHelper
> - Some duplicate code in test cases have been conslidated
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  a2aeffa 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
>  5ffc8a3 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
>  cd79e46 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProvider.java
>  1f5d1d8 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
>  79b9a55 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
>  64d9292 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptor.java
>  19d3f5e 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
>  98f8883 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorType.java
>  0677de6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java
>  2631d35 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
>  9eeb802 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
>  7281e85 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProviderTest.java
>  898cf46 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
>  9f0f7a1 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
>  004cd66 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
>  e5392c0 
> 
> Diff: https://reviews.apache.org/r/49029/diff/
> 
> 
> Testing
> ---
> 
> Manually testing...  updated unit tests...
> 
> # Local test results: 
> 
> [INFO] 
> 
> [INFO] BUILD SUCCESS
> [INFO] 
> 
> [INFO] Total time: 1:27:14.265s
> [INFO] Finished at: Tue Jun 21 12:03:08 EDT 2016
> [INFO] Final Memory: 61M/1851M
> [INFO] 
> -

Re: Review Request 49029: When requesting a Kerberos Descriptor via the REST API, 'when' clauses should optionally be processed

2016-06-22 Thread Jonathan Hurley

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


Ship it!





ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProvider.java
 (line 247)


isBlank instead?


- Jonathan Hurley


On June 22, 2016, 10:17 a.m., Robert Levas wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49029/
> ---
> 
> (Updated June 22, 2016, 10:17 a.m.)
> 
> 
> Review request for Ambari, Di Li, Jonathan Hurley, Nate Cole, Oliver Szabo, 
> and Sandor Magyari.
> 
> 
> Bugs: AMBARI-17226
> https://issues.apache.org/jira/browse/AMBARI-17226
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> When requesting a Kerberos Descriptor via the REST API, 'when' clauses should 
> optionally be processed.  If elected to be processed, identities that contain 
> `when` clauses will be included or excluded from the resulting descriptor 
> based on the result of the evaluation. 
> 
> In the event of an _add service_ scenario, the services being added should be 
> able to be specified so that they can be included in the data used for 
> `when`-clause evaluation.  
> 
> #Solution
> Add _GET directives_ to specify whether `when` clauses are to be evaluated 
> (or not) while building the Kerberos Descriptor using the following API call:
> ```
> GET 
> /api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true
> ```
> If new services are being added, the `additional_services` directive should 
> be added to the request so the evaluation can be preformed on the _future_ 
> set of services, which may evaluate differently then the _current_ set of 
> services.
> ```
> GET 
> /api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true@additional_services=HIVE,TEZ,PIG
> ```
> 
> #Notes
> - A lot of code was moved from ClusterKerberosDescriptorResourceProvider to 
> KerberosHelper to reduce the likelyhood of duplication
> - The logic to build a Kerberos descriptor (STACK, USER, COMPOSITE) has been 
> consolidated in the KerberosHelper
> - Some duplicate code in test cases have been conslidated
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  a2aeffa 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
>  5ffc8a3 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
>  cd79e46 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProvider.java
>  1f5d1d8 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
>  79b9a55 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
>  64d9292 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptor.java
>  19d3f5e 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
>  98f8883 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorType.java
>  0677de6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java
>  2631d35 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
>  9eeb802 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
>  7281e85 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProviderTest.java
>  898cf46 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
>  9f0f7a1 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
>  004cd66 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
>  e5392c0 
> 
> Diff: https://reviews.apache.org/r/49029/diff/
> 
> 
> Testing
> ---
> 
> Manually testing...  updated unit tests...
> 
> # Local test results: 
> 
> [INFO] 
> 
> [INFO] BUILD SUCCESS
> [INFO] 
> 
> [INFO] Total time: 1:27:14.265s
> [INFO] Finished at: Tue Jun 21 12:03:08 EDT 2016
> [INFO] Final Memory: 61M/1851M
> [INFO] 
> 
> 
> # Jenkins test r

Re: Review Request 49029: When requesting a Kerberos Descriptor via the REST API, 'when' clauses should optionally be processed

2016-06-22 Thread Robert Levas

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

(Updated June 22, 2016, 10:17 a.m.)


Review request for Ambari, Di Li, Jonathan Hurley, Nate Cole, Oliver Szabo, and 
Sandor Magyari.


Changes
---

Fixed potential NPE when services or components are not specified in Kerberos 
descriptors.


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


Repository: ambari


Description
---

When requesting a Kerberos Descriptor via the REST API, 'when' clauses should 
optionally be processed.  If elected to be processed, identities that contain 
`when` clauses will be included or excluded from the resulting descriptor based 
on the result of the evaluation. 

In the event of an _add service_ scenario, the services being added should be 
able to be specified so that they can be included in the data used for 
`when`-clause evaluation.  

#Solution
Add _GET directives_ to specify whether `when` clauses are to be evaluated (or 
not) while building the Kerberos Descriptor using the following API call:
```
GET 
/api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true
```
If new services are being added, the `additional_services` directive should be 
added to the request so the evaluation can be preformed on the _future_ set of 
services, which may evaluate differently then the _current_ set of services.
```
GET 
/api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true@additional_services=HIVE,TEZ,PIG
```

#Notes
- A lot of code was moved from ClusterKerberosDescriptorResourceProvider to 
KerberosHelper to reduce the likelyhood of duplication
- The logic to build a Kerberos descriptor (STACK, USER, COMPOSITE) has been 
consolidated in the KerberosHelper
- Some duplicate code in test cases have been conslidated


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 a2aeffa 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
 5ffc8a3 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
 cd79e46 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProvider.java
 1f5d1d8 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
 79b9a55 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
 64d9292 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptor.java
 19d3f5e 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
 98f8883 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorType.java
 0677de6 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java
 2631d35 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
 9eeb802 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
 7281e85 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProviderTest.java
 898cf46 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
 9f0f7a1 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
 004cd66 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
 e5392c0 

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


Testing
---

Manually testing...  updated unit tests...

# Local test results: 

[INFO] 
[INFO] BUILD SUCCESS
[INFO] 
[INFO] Total time: 1:27:14.265s
[INFO] Finished at: Tue Jun 21 12:03:08 EDT 2016
[INFO] Final Memory: 61M/1851M
[INFO] 

# Jenkins test results: PENDING


Thanks,

Robert Levas



Re: Review Request 49029: When requesting a Kerberos Descriptor via the REST API, 'when' clauses should optionally be processed

2016-06-21 Thread Robert Levas

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

(Updated June 21, 2016, 12:14 p.m.)


Review request for Ambari, Di Li, Jonathan Hurley, Nate Cole, Oliver Szabo, and 
Sandor Magyari.


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


Repository: ambari


Description
---

When requesting a Kerberos Descriptor via the REST API, 'when' clauses should 
optionally be processed.  If elected to be processed, identities that contain 
`when` clauses will be included or excluded from the resulting descriptor based 
on the result of the evaluation. 

In the event of an _add service_ scenario, the services being added should be 
able to be specified so that they can be included in the data used for 
`when`-clause evaluation.  

#Solution
Add _GET directives_ to specify whether `when` clauses are to be evaluated (or 
not) while building the Kerberos Descriptor using the following API call:
```
GET 
/api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true
```
If new services are being added, the `additional_services` directive should be 
added to the request so the evaluation can be preformed on the _future_ set of 
services, which may evaluate differently then the _current_ set of services.
```
GET 
/api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true@additional_services=HIVE,TEZ,PIG
```

#Notes
- A lot of code was moved from ClusterKerberosDescriptorResourceProvider to 
KerberosHelper to reduce the likelyhood of duplication
- The logic to build a Kerberos descriptor (STACK, USER, COMPOSITE) has been 
consolidated in the KerberosHelper
- Some duplicate code in test cases have been conslidated


Diffs
-

  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 a2aeffa 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
 5ffc8a3 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
 cd79e46 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProvider.java
 1f5d1d8 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
 79b9a55 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
 64d9292 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptor.java
 19d3f5e 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
 98f8883 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorType.java
 0677de6 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java
 2631d35 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
 9eeb802 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
 7281e85 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProviderTest.java
 898cf46 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
 9f0f7a1 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
 004cd66 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
 e5392c0 

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


Testing (updated)
---

Manually testing...  updated unit tests...

# Local test results: 

[INFO] 
[INFO] BUILD SUCCESS
[INFO] 
[INFO] Total time: 1:27:14.265s
[INFO] Finished at: Tue Jun 21 12:03:08 EDT 2016
[INFO] Final Memory: 61M/1851M
[INFO] 

# Jenkins test results: PENDING


Thanks,

Robert Levas



Review Request 49029: When requesting a Kerberos Descriptor via the REST API, 'when' clauses should optionally be processed

2016-06-21 Thread Robert Levas

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

Review request for Ambari, Di Li, Jonathan Hurley, Nate Cole, Oliver Szabo, and 
Sandor Magyari.


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


Repository: ambari


Description
---

When requesting a Kerberos Descriptor via the REST API, 'when' clauses should 
optionally be processed.  If elected to be processed, identities that contain 
`when` clauses will be included or excluded from the resulting descriptor based 
on the result of the evaluation. 

In the event of an _add service_ scenario, the services being added should be 
able to be specified so that they can be included in the data used for 
`when`-clause evaluation.  

#Solution
Add _GET directives_ to specify whether `when` clauses are to be evaluated (or 
not) while building the Kerberos Descriptor using the following API call:
```
GET 
/api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true
```
If new services are being added, the `additional_services` directive should be 
added to the request so the evaluation can be preformed on the _future_ set of 
services, which may evaluate differently then the _current_ set of services.
```
GET 
/api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true@additional_services=HIVE,TEZ,PIG
```

#Notes
- A lot of code was moved from ClusterKerberosDescriptorResourceProvider to 
KerberosHelper to reduce the likelyhood of duplication
- The logic to build a Kerberos descriptor (STACK, USER, COMPOSITE) has been 
consolidated in the KerberosHelper
- Some duplicate code in test cases have been conslidated


Diffs
-

  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 a2aeffa 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
 5ffc8a3 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
 cd79e46 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProvider.java
 1f5d1d8 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
 79b9a55 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
 64d9292 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptor.java
 19d3f5e 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
 98f8883 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorType.java
 0677de6 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptor.java
 2631d35 
  
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
 9eeb802 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
 7281e85 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterKerberosDescriptorResourceProviderTest.java
 898cf46 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
 9f0f7a1 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
 004cd66 
  
ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
 e5392c0 

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


Testing
---

Manually testing...  updated unit tests...

# Local test results: PENDING

# Jenkins test results: PENDING


Thanks,

Robert Levas