[jira] [Updated] (RANGER-4784) Tag-Based - default policy is not created for tag added to security zone

2024-05-06 Thread Subhrat Chaudhary (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-4784?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Subhrat Chaudhary updated RANGER-4784:
--
Summary: Tag-Based - default policy is not created for tag added to 
security zone  (was: Tag-Based - default policy is not created for 
privacera_tag added to security zone)

> Tag-Based - default policy is not created for tag added to security zone
> 
>
> Key: RANGER-4784
> URL: https://issues.apache.org/jira/browse/RANGER-4784
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Vanita Shankar Ubale
>Assignee: Subhrat Chaudhary
>Priority: Major
>
> *Steps:* 
>  * Create  security zone, add privacera_tag service while creating security 
> zone
>  * Go to tag based policy->Select Security zone from the dropdown
>  * Confirm that default policy EXPIRES_ON is created in the security zone 
> *Expected Response:*
> Default Tag based policy EXPIRES_ON should get created in security zone
> *Actual Response:*
> Default Tag based policy EXPIRES_ON is not getting created in security zone 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (RANGER-4784) Tag-Based - default policy is not created for tag added to security zone

2024-05-06 Thread Subhrat Chaudhary (Jira)


 [ 
https://issues.apache.org/jira/browse/RANGER-4784?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Subhrat Chaudhary updated RANGER-4784:
--
Description: 
*Steps:* 
 * Create  security zone, add tag service while creating security zone
 * Go to tag based policy->Select Security zone from the dropdown
 * Confirm that default policy EXPIRES_ON is created in the security zone 

*Expected Response:*

Default Tag based policy EXPIRES_ON should get created in security zone

*Actual Response:*

Default Tag based policy EXPIRES_ON is not getting created in security zone 

  was:
*Steps:* 
 * Create  security zone, add privacera_tag service while creating security zone
 * Go to tag based policy->Select Security zone from the dropdown
 * Confirm that default policy EXPIRES_ON is created in the security zone 

*Expected Response:*

Default Tag based policy EXPIRES_ON should get created in security zone

*Actual Response:*

Default Tag based policy EXPIRES_ON is not getting created in security zone 


> Tag-Based - default policy is not created for tag added to security zone
> 
>
> Key: RANGER-4784
> URL: https://issues.apache.org/jira/browse/RANGER-4784
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Vanita Shankar Ubale
>Assignee: Subhrat Chaudhary
>Priority: Major
>
> *Steps:* 
>  * Create  security zone, add tag service while creating security zone
>  * Go to tag based policy->Select Security zone from the dropdown
>  * Confirm that default policy EXPIRES_ON is created in the security zone 
> *Expected Response:*
> Default Tag based policy EXPIRES_ON should get created in security zone
> *Actual Response:*
> Default Tag based policy EXPIRES_ON is not getting created in security zone 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Review Request 74975: RANGER-4784: default tag-based policy is not created for the tag-service added to security zone

2024-05-06 Thread Subhrat Chaudhary via Review Board

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

Review request for ranger, Anand Nadar, Asit Vadhavkar, Madhan Neethiraj, 
Monika Kachhadiya, and Siddhesh Phatak.


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


Repository: ranger


Description
---

When a service is added to a security zone, deafult resource policies are 
created for the service in the zone. For tag service, default policy is not 
getting created in the security zone.


Diffs
-

  
security-admin/src/main/java/org/apache/ranger/service/RangerSecurityZoneServiceService.java
 a6cb2ae74 


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


Testing
---

Validations done:
1. All the junits are pssing.
2. For the tag service added in the secruity zone, default tag policy 
EXPIRES_ON, is getting created.


Thanks,

Subhrat Chaudhary



Re: [PR] RANGER-3409: remove org.codehaus.jackson ver 1.9 / add com.fasterxml.jackson ver 2.17 [ranger]

2024-05-06 Thread via GitHub


nblagodarnyi commented on PR #312:
URL: https://github.com/apache/ranger/pull/312#issuecomment-2095991206

   Hello Sercan! Thanks for your reply. I didn't manage to reproduce your issue 
with UI. I used this command to rebuild ranger from my branch and everything 
works fine in Docker. 
   `export RANGER_REBUILD=1 && export DOCKER_MAVEN_BUILD=0 && 
./ranger_in_docker up`
   
   https://github.com/apache/ranger/assets/57439616/1766488e-a74e-47aa-8a9f-25bef67aac74";>
   
   https://github.com/apache/ranger/assets/57439616/46cf3436-7ce7-48bc-9291-33ff31edd188";>
   
   https://github.com/apache/ranger/assets/57439616/f452c3aa-c895-468a-b094-1fddae7042ec";>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@ranger.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Commented] (RANGER-4225) Possible Jackson serialization issue due to not comply with Java bean standards

2024-05-06 Thread Nikita Blagodarnyi (Jira)


[ 
https://issues.apache.org/jira/browse/RANGER-4225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17843744#comment-17843744
 ] 

Nikita Blagodarnyi commented on RANGER-4225:


[~bpatel] please refer to [https://github.com/apache/ranger/pull/312] . This PR 
completely removes the jackson-1.x dependency from Ranger. 

> Possible Jackson serialization issue due to not comply with Java bean 
> standards
> ---
>
> Key: RANGER-4225
> URL: https://issues.apache.org/jira/browse/RANGER-4225
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Affects Versions: 2.4.0
>Reporter: Sercan Tekin
>Assignee: Sercan Tekin
>Priority: Major
> Fix For: 3.0.0
>
> Attachments: RANGER-4225.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> +*PROBLEM:*+
> Transitive Jackson-2 dependencies are included into Ranger's classpath in my 
> env and conflicted with Jackson-1 dependencies.
> Jackson-2 uses Javabean naming conventions to figure out the Json properties 
> in a Java class, and some of the Ranger's model classes don't comply with the 
> convention.
> For example, when the leading camelcase word is only one letter in length, 
> then deserialized response is broken. The following is what I observed in 
> Ranger v2.4.0;
> On Ranger UI side, this 
> [code-block|https://github.com/apache/ranger/blob/ranger-1.2/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js#L224-L229]
>  attempts to read vXStrings key in map, but the corresponding response has 
> vxstrings instead:
> {code:java}
> {
> "startIndex": 0,
> "pageSize": 200,
> "totalCount": 11,
> "resultSize": 11,
> "sortType": "asc",
> "sortBy": "id",
> "listSize": 11,
> "vxstrings": [< here! This has to be vXStrings
> {
> "value": "public",
> ... {code}
> And this difference causes below error while reading the property, therefore 
> the corresponding dropdown has no values as excepted;
> {code:java}
> PermissionList.js?ver=build.version:226 Uncaught TypeError: Cannot read 
> properties of undefined (reading 'map')
> at Object.results (PermissionList.js?ver=build.version:226:34)
> at Object.success (select2.js?ver=build.version:450:47)
> at u (jquery-3.3.1.min.js?ver=build.version:2:27457)
> at Object.fireWith [as resolveWith] 
> (jquery-3.3.1.min.js?ver=build.version:2:28202)
> at k (jquery-3.3.1.min.js?ver=build.version:2:77651)
> at XMLHttpRequest. 
> (jquery-3.3.1.min.js?ver=build.version:2:79907){code}
> +*REFERENCES:*+
> Please see this reference related to capital letters 
> [http://futuretask.blogspot.com/2005/01/java-tip-6-dont-capitalize-first-two.html]
> "Don't capitalize first two letters of a bean property name. This is in our 
> java standards. You should not create a java bean property name that begins 
> with a capital letter in the 1st two places."
> Also you can see the same issue is reported here 
> [https://stackoverflow.com/questions/30205006/why-does-jackson-2-not-recognize-the-first-capital-letter-if-the-leading-camel-c]
>  
> +*SOLUTION:*+
> {{@JsonProperty}} annotation needs to be added for mapping the properties 
> with their corresponding getter/setter methods. This will not effect Ranger's 
> functionality directly, but it will provide consistency even if Jackson-2 is 
> included into classpath.
> I have tested it locally after adding {{@JsonProperty}} and everything worked 
> well.
> The PR is attached.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (RANGER-3409) Update Jackson and remove Codehaus version

2024-05-06 Thread Nikita Blagodarnyi (Jira)


[ 
https://issues.apache.org/jira/browse/RANGER-3409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17843745#comment-17843745
 ] 

Nikita Blagodarnyi commented on RANGER-3409:


[~bpatel] please refer to [https://github.com/apache/ranger/pull/312] . This PR 
completely removes the jackson-1.x dependency from Ranger. 

> Update Jackson and remove Codehaus version
> --
>
> Key: RANGER-3409
> URL: https://issues.apache.org/jira/browse/RANGER-3409
> Project: Ranger
>  Issue Type: Improvement
>  Components: Ranger
>Affects Versions: 3.0.0
>Reporter: Andrew Charneski
>Priority: Blocker
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> An old version of Jackson (Codehaus Jackson 1.9.13) is still being used. 
> Jackson has since moved namespaces with a reorganized library structure. 
> Update all references to the older version to use the newer version (which is 
> currently used in some modules).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: Review Request 74975: RANGER-4784: default tag-based policy is not created for the tag-service added to security zone

2024-05-06 Thread Madhan Neethiraj

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


Ship it!




Ship It!

- Madhan Neethiraj


On May 6, 2024, 11:19 a.m., Subhrat Chaudhary wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74975/
> ---
> 
> (Updated May 6, 2024, 11:19 a.m.)
> 
> 
> Review request for ranger, Anand Nadar, Asit Vadhavkar, Madhan Neethiraj, 
> Monika Kachhadiya, and Siddhesh Phatak.
> 
> 
> Bugs: RANGER-4784
> https://issues.apache.org/jira/browse/RANGER-4784
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> When a service is added to a security zone, deafult resource policies are 
> created for the service in the zone. For tag service, default policy is not 
> getting created in the security zone.
> 
> 
> Diffs
> -
> 
>   
> security-admin/src/main/java/org/apache/ranger/service/RangerSecurityZoneServiceService.java
>  a6cb2ae74 
> 
> 
> Diff: https://reviews.apache.org/r/74975/diff/1/
> 
> 
> Testing
> ---
> 
> Validations done:
> 1. All the junits are pssing.
> 2. For the tag service added in the secruity zone, default tag policy 
> EXPIRES_ON, is getting created.
> 
> 
> Thanks,
> 
> Subhrat Chaudhary
> 
>



Re: Review Request 74974: RANGER-4789: Admin audits for security-zone are blank for new and old value, when compression is enabled

2024-05-06 Thread Madhan Neethiraj

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



> For the change only in security-zone resource name (resource count of the 
> zone is same), admin audit is not generated.
Subhrat - instead of skipping admin audit in this scenario, I suggest audit to 
indicate that resources have been updated in services - with text like '{ 
"dev_hdfs": "resources updated", "dev_hbase": "resources updated" }

if (oldValue == null || oldValue.equalsIgnoreCase(value)) { // existing line 
#357
  Map resourceUpdateSummary = 
getResourceUpdateSummary(securityZoneDB.getServices(), 
vSecurityZone.getServices());

  if (MapUtils.isNotEmpty(resourceUpdateSummary)) {
oldValue = "";
value= new Gson().toJson(resourceUpdateSummary, Map.class);
  } else {
continue;
  }
} else {
  continue; // existing line #358
} // existing line #359

- Madhan Neethiraj


On May 3, 2024, 12:45 p.m., Subhrat Chaudhary wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74974/
> ---
> 
> (Updated May 3, 2024, 12:45 p.m.)
> 
> 
> Review request for ranger, Anand Nadar, Asit Vadhavkar, Madhan Neethiraj, 
> Monika Kachhadiya, and Siddhesh Phatak.
> 
> 
> Bugs: RANGER-4789
> https://issues.apache.org/jira/browse/RANGER-4789
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> In security-zone when resource name is updated, admin audit is generated for 
> same, with details about old and new value.
> 
> When the json data compression is enabled in the security-zone with the 
> property:
> 
> ranger.admin.store.security.zone.compress.json_data
> 
> the old and new value in the generated admin audit is blank, when only the 
> resource name is changed. The reason for this is, if compression is enabled, 
> only the resource count is added in the new and old values. Hence if the 
> resource count does not change, change details in the admin audit is blank.
> 
> In the code flow to update security-zone, when no change is noticed in the 
> new and old values, a dummy admin audit is being added with null for old and 
> new values. In this fix, removing the that code block.
> 
> 
> Diffs
> -
> 
>   security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java 
> 5534c8056 
>   
> security-admin/src/main/java/org/apache/ranger/service/RangerSecurityZoneServiceService.java
>  a6cb2ae74 
> 
> 
> Diff: https://reviews.apache.org/r/74974/diff/1/
> 
> 
> Testing
> ---
> 
> Validations done:
> 1. For the change only in security-zone resource name (resource count of the 
> zone is same), admin audit is not generated.
> 2. For above case x_service_version_info.policy_version is incremented (same 
> as existing behavior).
> 3. If a resource is added or removed from the security-zone, admin audit is 
> generated for same.
> 4. All the existing Junits are passing
> 
> 
> Thanks,
> 
> Subhrat Chaudhary
> 
>



Re: [PR] RANGER-4783: remove duplicates for users/groups/roles during policy validation [ranger]

2024-05-06 Thread via GitHub


fateh288 commented on code in PR #311:
URL: https://github.com/apache/ranger/pull/311#discussion_r1591489218


##
agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerPolicyValidator.java:
##
@@ -958,6 +958,22 @@ private String getDuplicate(List values) {
}
return duplicate;
}
+   private void removeDuplicates(List values){
+   if (values==null || values.isEmpty()){
+   return;
+   }
+   Iterator itr = values.iterator();
+   HashSet uniqueElements = new HashSet<>();

Review Comment:
   Fixed in latest patch



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@ranger.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] RANGER-4761: make lazy memory allocation for family map instead … [ranger]

2024-05-06 Thread via GitHub


kumaab merged PR #307:
URL: https://github.com/apache/ranger/pull/307


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@ranger.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] RANGER-4783: remove duplicates for users/groups/roles during policy validation [ranger]

2024-05-06 Thread via GitHub


mneethiraj merged PR #311:
URL: https://github.com/apache/ranger/pull/311


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@ranger.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] RANGER-4761: Add License [ranger]

2024-05-06 Thread via GitHub


fateh288 opened a new pull request, #313:
URL: https://github.com/apache/ranger/pull/313

   ## What changes were proposed in this pull request?
   Add license 
   
   
   ## How was this patch tested?
   
   mvn clean install 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@ranger.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] RANGER-4761: Add License [ranger]

2024-05-06 Thread via GitHub


mneethiraj merged PR #313:
URL: https://github.com/apache/ranger/pull/313


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@ranger.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: Review Request 74966: RANGER-4787: reduce plugin memory footprint by avoiding unnecessary creation of collections

2024-05-06 Thread Abhay Kulkarni

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


Fix it, then Ship it!





agents-common/src/main/java/org/apache/ranger/plugin/model/RangerBaseModelObject.java
Lines 276 (patched)


Did you mean to name the class OptimalNullSafeSupplier?



agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
Lines 96 (patched)


The default value seems to be OptimalNullSafeSupplier. Should it be 
DefaultNullSafeSupplier?


- Abhay Kulkarni


On May 5, 2024, 8:43 a.m., Madhan Neethiraj wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74966/
> ---
> 
> (Updated May 5, 2024, 8:43 a.m.)
> 
> 
> Review request for ranger, Abhishek  Kumar, Asit Vadhavkar, Fateh Singh, 
> Kishor Gollapalliwar, Abhay Kulkarni, Pradeep Agrawal, Ramesh Mani, Sailaja 
> Polavarapu, Subhrat Chaudhary, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4787
> https://issues.apache.org/jira/browse/RANGER-4787
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Model package classes like RangerPolicy initialize collection members with a 
> new collection object (ArrayList/HashMap/HashSet). Many of these members 
> would likely remain empty, resulting in the initialization to be unnecessary. 
> Instead of creating a new collection object, it will help to initialize with 
> Collections.emptyList()/emptySet()/emptyMap() - to save memory while 
> retaining non-null value for collection members.
> 
> Also, set() on these members currently create a new collection object with a 
> copy of the value to be set. This can be avoided by using the given value.
> 
> Updated RangerPolicy and RangerOptimizedPolicyEvaluator classes with above 
> optimizations, and updated all refereces to collection members to safely add 
> items to the collections.
> 
> 
> Diffs
> -
> 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/model/RangerBaseModelObject.java
>  e59ea2345 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java 
> ec0618421 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAbstractPolicyItemEvaluator.java
>  2190ad281 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
>  9745dc64f 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerOptimizedPolicyEvaluator.java
>  6d6169309 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
>  97da473a8 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBaseService.java
>  eaee00b80 
>   
> agents-common/src/test/java/org/apache/ranger/plugin/model/TestRangerPolicy.java
>  57e710e61 
>   
> agents-common/src/test/java/org/apache/ranger/plugin/util/ServiceDefUtilTest.java
>  36f0b6af6 
>   
> hbase-agent/src/main/java/org/apache/ranger/services/hbase/RangerServiceHBase.java
>  962be1a55 
>   
> hdfs-agent/src/main/java/org/apache/ranger/services/hdfs/RangerServiceHdfs.java
>  e6411b3b0 
>   
> hive-agent/src/main/java/org/apache/ranger/services/hive/RangerServiceHive.java
>  a8d71772a 
>   
> knox-agent/src/main/java/org/apache/ranger/services/knox/RangerServiceKnox.java
>  eafd0e3fe 
>   
> plugin-atlas/src/main/java/org/apache/ranger/services/atlas/RangerServiceAtlas.java
>  fee2179b5 
>   
> plugin-elasticsearch/src/main/java/org/apache/ranger/services/elasticsearch/RangerServiceElasticsearch.java
>  a8953e1e7 
>   
> plugin-kafka/src/main/java/org/apache/ranger/services/kafka/RangerServiceKafka.java
>  f683e608e 
>   
> plugin-kms/src/main/java/org/apache/ranger/services/kms/RangerServiceKMS.java 
> d0c2e260a 
>   
> plugin-ozone/src/main/java/org/apache/ranger/services/ozone/RangerServiceOzone.java
>  704412246 
>   
> plugin-presto/src/main/java/org/apache/ranger/services/presto/RangerServicePresto.java
>  9e773f160 
>   
> plugin-solr/src/main/java/org/apache/ranger/services/solr/RangerServiceSolr.java
>  3a8f9b462 
>   
> plugin-trino/src/main/java/org/apache/ranger/services/trino/RangerServiceTrino.java
>  936fb7ac8 
>   
> plugin-yarn/src/main/java/org/apache/ranger/services/yarn/RangerServiceYarn.java
>  48a63ff56 
>   ranger-tools/src/main/java/org/apache/ranger/sizing/PerfMemTimeTracker.java 
> 917c0da9c 
>   
> security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyAdminImpl.java 
> 84ee31ba2 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java 
> 47fbe 
>   security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java d202b2184 
>   security-admin/src/ma

Re: Review Request 74966: RANGER-4787: reduce plugin memory footprint by avoiding unnecessary creation of collections

2024-05-06 Thread Madhan Neethiraj


> On May 6, 2024, 11:15 p.m., Abhay Kulkarni wrote:
> > agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
> > Lines 96 (patched)
> > 
> >
> > The default value seems to be OptimalNullSafeSupplier. Should it be 
> > DefaultNullSafeSupplier?

I suggest to use OptimalNullSafeSupplier as the default. Any application that 
requires the current behavior, which would use more memory, can set the 
configuration to switch to current behavior.

Also, to avoid potential confustion, I will rename DefaultNullSafeSupplier => 
NullSafeSupplierV1, OptimalNullSafeSupplier => NullSafeSupplierV2


- Madhan


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


On May 5, 2024, 8:43 a.m., Madhan Neethiraj wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74966/
> ---
> 
> (Updated May 5, 2024, 8:43 a.m.)
> 
> 
> Review request for ranger, Abhishek  Kumar, Asit Vadhavkar, Fateh Singh, 
> Kishor Gollapalliwar, Abhay Kulkarni, Pradeep Agrawal, Ramesh Mani, Sailaja 
> Polavarapu, Subhrat Chaudhary, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4787
> https://issues.apache.org/jira/browse/RANGER-4787
> 
> 
> Repository: ranger
> 
> 
> Description
> ---
> 
> Model package classes like RangerPolicy initialize collection members with a 
> new collection object (ArrayList/HashMap/HashSet). Many of these members 
> would likely remain empty, resulting in the initialization to be unnecessary. 
> Instead of creating a new collection object, it will help to initialize with 
> Collections.emptyList()/emptySet()/emptyMap() - to save memory while 
> retaining non-null value for collection members.
> 
> Also, set() on these members currently create a new collection object with a 
> copy of the value to be set. This can be avoided by using the given value.
> 
> Updated RangerPolicy and RangerOptimizedPolicyEvaluator classes with above 
> optimizations, and updated all refereces to collection members to safely add 
> items to the collections.
> 
> 
> Diffs
> -
> 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/model/RangerBaseModelObject.java
>  e59ea2345 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java 
> ec0618421 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAbstractPolicyItemEvaluator.java
>  2190ad281 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
>  9745dc64f 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerOptimizedPolicyEvaluator.java
>  6d6169309 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
>  97da473a8 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBaseService.java
>  eaee00b80 
>   
> agents-common/src/test/java/org/apache/ranger/plugin/model/TestRangerPolicy.java
>  57e710e61 
>   
> agents-common/src/test/java/org/apache/ranger/plugin/util/ServiceDefUtilTest.java
>  36f0b6af6 
>   
> hbase-agent/src/main/java/org/apache/ranger/services/hbase/RangerServiceHBase.java
>  962be1a55 
>   
> hdfs-agent/src/main/java/org/apache/ranger/services/hdfs/RangerServiceHdfs.java
>  e6411b3b0 
>   
> hive-agent/src/main/java/org/apache/ranger/services/hive/RangerServiceHive.java
>  a8d71772a 
>   
> knox-agent/src/main/java/org/apache/ranger/services/knox/RangerServiceKnox.java
>  eafd0e3fe 
>   
> plugin-atlas/src/main/java/org/apache/ranger/services/atlas/RangerServiceAtlas.java
>  fee2179b5 
>   
> plugin-elasticsearch/src/main/java/org/apache/ranger/services/elasticsearch/RangerServiceElasticsearch.java
>  a8953e1e7 
>   
> plugin-kafka/src/main/java/org/apache/ranger/services/kafka/RangerServiceKafka.java
>  f683e608e 
>   
> plugin-kms/src/main/java/org/apache/ranger/services/kms/RangerServiceKMS.java 
> d0c2e260a 
>   
> plugin-ozone/src/main/java/org/apache/ranger/services/ozone/RangerServiceOzone.java
>  704412246 
>   
> plugin-presto/src/main/java/org/apache/ranger/services/presto/RangerServicePresto.java
>  9e773f160 
>   
> plugin-solr/src/main/java/org/apache/ranger/services/solr/RangerServiceSolr.java
>  3a8f9b462 
>   
> plugin-trino/src/main/java/org/apache/ranger/services/trino/RangerServiceTrino.java
>  936fb7ac8 
>   
> plugin-yarn/src/main/java/org/apache/ranger/services/yarn/RangerServiceYarn.java
>  48a63ff56 
>   ranger-tools/src/main/java/org/apache/ranger/sizing/PerfMemTimeTracker.java 
> 917c0da9c 
>   
> security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyAdminImpl.java 
> 84ee31ba2 
>   sec

Re: Review Request 74966: RANGER-4787: reduce plugin memory footprint by avoiding unnecessary creation of collections

2024-05-06 Thread Madhan Neethiraj

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

(Updated May 6, 2024, 11:53 p.m.)


Review request for ranger, Abhishek  Kumar, Asit Vadhavkar, Fateh Singh, Kishor 
Gollapalliwar, Abhay Kulkarni, Pradeep Agrawal, Ramesh Mani, Sailaja 
Polavarapu, Subhrat Chaudhary, and Velmurugan Periasamy.


Changes
---

addressed review comments


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


Repository: ranger


Description
---

Model package classes like RangerPolicy initialize collection members with a 
new collection object (ArrayList/HashMap/HashSet). Many of these members would 
likely remain empty, resulting in the initialization to be unnecessary. Instead 
of creating a new collection object, it will help to initialize with 
Collections.emptyList()/emptySet()/emptyMap() - to save memory while retaining 
non-null value for collection members.

Also, set() on these members currently create a new collection object with a 
copy of the value to be set. This can be avoided by using the given value.

Updated RangerPolicy and RangerOptimizedPolicyEvaluator classes with above 
optimizations, and updated all refereces to collection members to safely add 
items to the collections.


Diffs (updated)
-

  
agents-common/src/main/java/org/apache/ranger/plugin/model/RangerBaseModelObject.java
 e59ea2345 
  agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java 
ec0618421 
  
agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAbstractPolicyItemEvaluator.java
 2190ad281 
  
agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
 9745dc64f 
  
agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerOptimizedPolicyEvaluator.java
 6d6169309 
  
agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
 97da473a8 
  
agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBaseService.java
 eaee00b80 
  
agents-common/src/test/java/org/apache/ranger/plugin/model/TestRangerPolicy.java
 57e710e61 
  
agents-common/src/test/java/org/apache/ranger/plugin/util/ServiceDefUtilTest.java
 36f0b6af6 
  
hbase-agent/src/main/java/org/apache/ranger/services/hbase/RangerServiceHBase.java
 962be1a55 
  
hdfs-agent/src/main/java/org/apache/ranger/services/hdfs/RangerServiceHdfs.java 
e6411b3b0 
  
hive-agent/src/main/java/org/apache/ranger/services/hive/RangerServiceHive.java 
a8d71772a 
  
knox-agent/src/main/java/org/apache/ranger/services/knox/RangerServiceKnox.java 
eafd0e3fe 
  
plugin-atlas/src/main/java/org/apache/ranger/services/atlas/RangerServiceAtlas.java
 fee2179b5 
  
plugin-elasticsearch/src/main/java/org/apache/ranger/services/elasticsearch/RangerServiceElasticsearch.java
 a8953e1e7 
  
plugin-kafka/src/main/java/org/apache/ranger/services/kafka/RangerServiceKafka.java
 f683e608e 
  plugin-kms/src/main/java/org/apache/ranger/services/kms/RangerServiceKMS.java 
d0c2e260a 
  
plugin-ozone/src/main/java/org/apache/ranger/services/ozone/RangerServiceOzone.java
 704412246 
  
plugin-presto/src/main/java/org/apache/ranger/services/presto/RangerServicePresto.java
 9e773f160 
  
plugin-solr/src/main/java/org/apache/ranger/services/solr/RangerServiceSolr.java
 3a8f9b462 
  
plugin-trino/src/main/java/org/apache/ranger/services/trino/RangerServiceTrino.java
 936fb7ac8 
  
plugin-yarn/src/main/java/org/apache/ranger/services/yarn/RangerServiceYarn.java
 48a63ff56 
  ranger-tools/src/main/java/org/apache/ranger/sizing/PerfMemTimeTracker.java 
917c0da9c 
  security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyAdminImpl.java 
84ee31ba2 
  security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java 
47fbe 
  security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java d202b2184 
  security-admin/src/main/java/org/apache/ranger/common/ServiceUtil.java 
180124ca5 
  
security-admin/src/main/java/org/apache/ranger/patch/PatchForAtlasToAddTypeRead_J10040.java
 31fb1b1d3 
  
security-admin/src/main/java/org/apache/ranger/patch/PatchForHBaseDefaultPolicyUpdate_J10045.java
 302a26602 
  
security-admin/src/main/java/org/apache/ranger/patch/PatchForOzoneDefaultPoliciesUpdate_J10044.java
 d686be485 
  
security-admin/src/main/java/org/apache/ranger/patch/PatchForOzoneServiceDefUpdate_J10041.java
 0a085f659 
  
security-admin/src/main/java/org/apache/ranger/patch/PatchForUpdatingPolicyJson_J10019.java
 e7d10883d 
  
security-admin/src/main/java/org/apache/ranger/patch/PatchForUpdatingTagsJson_J10020.java
 c8516d2b7 
  
security-admin/src/main/java/org/apache/ranger/patch/PatchMigration_J10002.java 
c8cd92c7e 
  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
a6c759234 
  security-admin/src/main/java/org/apache/ranger/rest/ServiceRESTUtil.java 
60e34c0c7 
  s