Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-15 Thread Abhay Kulkarni

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

Review request for ranger and Madhan Neethiraj.


Bugs: RANGER-1581
https://issues.apache.org/jira/browse/RANGER-1581


Repository: ranger


Description
---

Ranger plugins interpret tag attributes of type 'date' using an internal Ranger 
date-format string. Now, in addition to the internal Ranger date-format string 
("/MM/dd"), plugins also support a comma-separated list of data-format 
strings, based on the value of the plugin configuration parameter 
"ranger.plugin.tag.attr.additional.date.formats". A special value string 
"ATLAS_DATE_FORMAT" is supported to refer to default date-format used by Atlas.


Diffs
-

  
agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
 923c188 
  
agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
 5948a74 
  agents-common/src/test/resources/policyengine/test_policyengine_tag_hive.json 
1c7662d 


Diff: https://reviews.apache.org/r/59296/diff/1/


Testing
---

Developed a unit test for testing specification and use of 
"ranger.plugin.tag.attr.additional.date.formats" configuration variable.


Thanks,

Abhay Kulkarni



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-16 Thread Madhan Neethiraj

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




agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
Lines 43 (patched)


USE_DEFAULT_ATLAS_TAG_ATTRIBUTE_DATE_FORMAT ==> 
DEFAULT_ATLAS_TAG_ATTRIBUTE_DATE_FORMAT_NAME



agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
Lines 230 (patched)


Instead of creating a SimpleDateFormat in every call, consider receiving 
SimpleDateFormat as argument to this method. getAsDate(String value) should be 
updated to create a thread-local array of SimpleDateFormat objects and pass 
each to this method.



agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
Lines 233 (patched)


This warn log should be generated only after all formats have been tried, 
in getAsDate(String value). Else this might generate excessive, unnecessary 
warning messages.


- Madhan Neethiraj


On May 15, 2017, 9:25 p.m., Abhay Kulkarni wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59296/
> ---
> 
> (Updated May 15, 2017, 9:25 p.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-1581
> https://issues.apache.org/jira/browse/RANGER-1581
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Ranger plugins interpret tag attributes of type 'date' using an internal 
> Ranger date-format string. Now, in addition to the internal Ranger 
> date-format string ("/MM/dd"), plugins also support a comma-separated 
> list of data-format strings, based on the value of the plugin configuration 
> parameter "ranger.plugin.tag.attr.additional.date.formats". A special value 
> string "ATLAS_DATE_FORMAT" is supported to refer to default date-format used 
> by Atlas.
> 
> 
> Diffs
> -
> 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
>  923c188 
>   
> agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
>  5948a74 
>   
> agents-common/src/test/resources/policyengine/test_policyengine_tag_hive.json 
> 1c7662d 
> 
> 
> Diff: https://reviews.apache.org/r/59296/diff/1/
> 
> 
> Testing
> ---
> 
> Developed a unit test for testing specification and use of 
> "ranger.plugin.tag.attr.additional.date.formats" configuration variable.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-16 Thread Abhay Kulkarni

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

(Updated May 16, 2017, 9:17 p.m.)


Review request for ranger and Madhan Neethiraj.


Changes
---

Addressed review comments


Bugs: RANGER-1581
https://issues.apache.org/jira/browse/RANGER-1581


Repository: ranger


Description
---

Ranger plugins interpret tag attributes of type 'date' using an internal Ranger 
date-format string. Now, in addition to the internal Ranger date-format string 
("/MM/dd"), plugins also support a comma-separated list of data-format 
strings, based on the value of the plugin configuration parameter 
"ranger.plugin.tag.attr.additional.date.formats". A special value string 
"ATLAS_DATE_FORMAT" is supported to refer to default date-format used by Atlas.


Diffs (updated)
-

  
agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
 923c188 
  
agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
 5948a74 
  agents-common/src/test/resources/policyengine/test_policyengine_tag_hive.json 
1c7662d 


Diff: https://reviews.apache.org/r/59296/diff/2/

Changes: https://reviews.apache.org/r/59296/diff/1-2/


Testing
---

Developed a unit test for testing specification and use of 
"ranger.plugin.tag.attr.additional.date.formats" configuration variable.


Thanks,

Abhay Kulkarni



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-16 Thread Madhan Neethiraj

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


Ship it!




Ship It!

- Madhan Neethiraj


On May 16, 2017, 9:17 p.m., Abhay Kulkarni wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59296/
> ---
> 
> (Updated May 16, 2017, 9:17 p.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-1581
> https://issues.apache.org/jira/browse/RANGER-1581
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Ranger plugins interpret tag attributes of type 'date' using an internal 
> Ranger date-format string. Now, in addition to the internal Ranger 
> date-format string ("/MM/dd"), plugins also support a comma-separated 
> list of data-format strings, based on the value of the plugin configuration 
> parameter "ranger.plugin.tag.attr.additional.date.formats". A special value 
> string "ATLAS_DATE_FORMAT" is supported to refer to default date-format used 
> by Atlas.
> 
> 
> Diffs
> -
> 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
>  923c188 
>   
> agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
>  5948a74 
>   
> agents-common/src/test/resources/policyengine/test_policyengine_tag_hive.json 
> 1c7662d 
> 
> 
> Diff: https://reviews.apache.org/r/59296/diff/2/
> 
> 
> Testing
> ---
> 
> Developed a unit test for testing specification and use of 
> "ranger.plugin.tag.attr.additional.date.formats" configuration variable.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-17 Thread Abhay Kulkarni

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

(Updated May 17, 2017, 9:33 p.m.)


Review request for ranger and Madhan Neethiraj.


Changes
---

Added Atlas's date-format string as one of the default formats, changed format 
strings separator string to somewhat uncommon combination


Bugs: RANGER-1581
https://issues.apache.org/jira/browse/RANGER-1581


Repository: ranger


Description
---

Ranger plugins interpret tag attributes of type 'date' using an internal Ranger 
date-format string. Now, in addition to the internal Ranger date-format string 
("/MM/dd"), plugins also support a comma-separated list of data-format 
strings, based on the value of the plugin configuration parameter 
"ranger.plugin.tag.attr.additional.date.formats". A special value string 
"ATLAS_DATE_FORMAT" is supported to refer to default date-format used by Atlas.


Diffs (updated)
-

  
agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
 c46f527 
  
agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
 e556f16 


Diff: https://reviews.apache.org/r/59296/diff/3/

Changes: https://reviews.apache.org/r/59296/diff/2-3/


Testing
---

Developed a unit test for testing specification and use of 
"ranger.plugin.tag.attr.additional.date.formats" configuration variable.


Thanks,

Abhay Kulkarni



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-17 Thread Madhan Neethiraj

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


Ship it!




Ship It!

- Madhan Neethiraj


On May 17, 2017, 9:33 p.m., Abhay Kulkarni wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59296/
> ---
> 
> (Updated May 17, 2017, 9:33 p.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-1581
> https://issues.apache.org/jira/browse/RANGER-1581
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Ranger plugins interpret tag attributes of type 'date' using an internal 
> Ranger date-format string. Now, in addition to the internal Ranger 
> date-format string ("/MM/dd"), plugins also support a comma-separated 
> list of data-format strings, based on the value of the plugin configuration 
> parameter "ranger.plugin.tag.attr.additional.date.formats". A special value 
> string "ATLAS_DATE_FORMAT" is supported to refer to default date-format used 
> by Atlas.
> 
> 
> Diffs
> -
> 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
>  c46f527 
>   
> agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
>  e556f16 
> 
> 
> Diff: https://reviews.apache.org/r/59296/diff/3/
> 
> 
> Testing
> ---
> 
> Developed a unit test for testing specification and use of 
> "ranger.plugin.tag.attr.additional.date.formats" configuration variable.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-17 Thread Abhay Kulkarni

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

(Updated May 18, 2017, 1:35 a.m.)


Review request for ranger and Madhan Neethiraj.


Changes
---

If multiple date-format strings are used, ensure that the format-string that 
matches the most number of characters is used for parsing date-string into Java 
Date object


Bugs: RANGER-1581
https://issues.apache.org/jira/browse/RANGER-1581


Repository: ranger


Description
---

Ranger plugins interpret tag attributes of type 'date' using an internal Ranger 
date-format string. Now, in addition to the internal Ranger date-format string 
("/MM/dd"), plugins also support a comma-separated list of data-format 
strings, based on the value of the plugin configuration parameter 
"ranger.plugin.tag.attr.additional.date.formats". A special value string 
"ATLAS_DATE_FORMAT" is supported to refer to default date-format used by Atlas.


Diffs (updated)
-

  
agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
 c46f527 
  
agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
 e556f16 
  agents-common/src/test/resources/policyengine/test_policyengine_tag_hive.json 
34ccaac 


Diff: https://reviews.apache.org/r/59296/diff/4/

Changes: https://reviews.apache.org/r/59296/diff/3-4/


Testing
---

Developed a unit test for testing specification and use of 
"ranger.plugin.tag.attr.additional.date.formats" configuration variable.


Thanks,

Abhay Kulkarni



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-17 Thread Madhan Neethiraj

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




agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
Line 253 (original), 274 (patched)


Wouldn't it be enough to parse the given value using date-formats in array 
RangerScriptExecutionContext.dateFormatStrings - as long as this array is 
sorted by descending order of the format string length?


- Madhan Neethiraj


On May 18, 2017, 1:35 a.m., Abhay Kulkarni wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59296/
> ---
> 
> (Updated May 18, 2017, 1:35 a.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-1581
> https://issues.apache.org/jira/browse/RANGER-1581
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Ranger plugins interpret tag attributes of type 'date' using an internal 
> Ranger date-format string. Now, in addition to the internal Ranger 
> date-format string ("/MM/dd"), plugins also support a comma-separated 
> list of data-format strings, based on the value of the plugin configuration 
> parameter "ranger.plugin.tag.attr.additional.date.formats". A special value 
> string "ATLAS_DATE_FORMAT" is supported to refer to default date-format used 
> by Atlas.
> 
> 
> Diffs
> -
> 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
>  c46f527 
>   
> agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
>  e556f16 
>   
> agents-common/src/test/resources/policyengine/test_policyengine_tag_hive.json 
> 34ccaac 
> 
> 
> Diff: https://reviews.apache.org/r/59296/diff/4/
> 
> 
> Testing
> ---
> 
> Developed a unit test for testing specification and use of 
> "ranger.plugin.tag.attr.additional.date.formats" configuration variable.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-18 Thread Abhay Kulkarni

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

(Updated May 18, 2017, 2:55 p.m.)


Review request for ranger and Madhan Neethiraj.


Changes
---

Addressed review comments


Bugs: RANGER-1581
https://issues.apache.org/jira/browse/RANGER-1581


Repository: ranger


Description
---

Ranger plugins interpret tag attributes of type 'date' using an internal Ranger 
date-format string. Now, in addition to the internal Ranger date-format string 
("/MM/dd"), plugins also support a comma-separated list of data-format 
strings, based on the value of the plugin configuration parameter 
"ranger.plugin.tag.attr.additional.date.formats". A special value string 
"ATLAS_DATE_FORMAT" is supported to refer to default date-format used by Atlas.


Diffs (updated)
-

  
agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
 c46f527 
  
agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
 e556f16 
  agents-common/src/test/resources/policyengine/test_policyengine_tag_hive.json 
34ccaac 


Diff: https://reviews.apache.org/r/59296/diff/5/

Changes: https://reviews.apache.org/r/59296/diff/4-5/


Testing
---

Developed a unit test for testing specification and use of 
"ranger.plugin.tag.attr.additional.date.formats" configuration variable.


Thanks,

Abhay Kulkarni



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-18 Thread Madhan Neethiraj

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


Ship it!




Ship It!

- Madhan Neethiraj


On May 18, 2017, 2:55 p.m., Abhay Kulkarni wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59296/
> ---
> 
> (Updated May 18, 2017, 2:55 p.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-1581
> https://issues.apache.org/jira/browse/RANGER-1581
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Ranger plugins interpret tag attributes of type 'date' using an internal 
> Ranger date-format string. Now, in addition to the internal Ranger 
> date-format string ("/MM/dd"), plugins also support a comma-separated 
> list of data-format strings, based on the value of the plugin configuration 
> parameter "ranger.plugin.tag.attr.additional.date.formats". A special value 
> string "ATLAS_DATE_FORMAT" is supported to refer to default date-format used 
> by Atlas.
> 
> 
> Diffs
> -
> 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
>  c46f527 
>   
> agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
>  e556f16 
>   
> agents-common/src/test/resources/policyengine/test_policyengine_tag_hive.json 
> 34ccaac 
> 
> 
> Diff: https://reviews.apache.org/r/59296/diff/5/
> 
> 
> Testing
> ---
> 
> Developed a unit test for testing specification and use of 
> "ranger.plugin.tag.attr.additional.date.formats" configuration variable.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>



Re: Review Request 59296: Ranger plugins need to support additional date formats for tag attribute values

2017-05-18 Thread Abhay Kulkarni

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

(Updated May 18, 2017, 7:29 p.m.)


Review request for ranger and Madhan Neethiraj.


Changes
---

Corrected format of the date-format strings ( changed from comma-separated to 
separated by ||).


Bugs: RANGER-1581
https://issues.apache.org/jira/browse/RANGER-1581


Repository: ranger


Description (updated)
---

Ranger plugins interpret tag attributes of type 'date' using an internal Ranger 
date-format string. Now, in addition to the internal Ranger date-format string 
("/MM/dd"), plugins also support a list of data-format strings, separated 
by ||, based on the value of the plugin configuration parameter 
"ranger.plugin.tag.attr.additional.date.formats". A special value string 
"ATLAS_DATE_FORMAT" is supported to refer to default date-format used by Atlas.


Diffs
-

  
agents-common/src/main/java/org/apache/ranger/plugin/conditionevaluator/RangerScriptExecutionContext.java
 c46f527 
  
agents-common/src/test/java/org/apache/ranger/plugin/policyengine/TestPolicyEngine.java
 e556f16 
  agents-common/src/test/resources/policyengine/test_policyengine_tag_hive.json 
34ccaac 


Diff: https://reviews.apache.org/r/59296/diff/5/


Testing
---

Developed a unit test for testing specification and use of 
"ranger.plugin.tag.attr.additional.date.formats" configuration variable.


Thanks,

Abhay Kulkarni