You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ma...@apache.org on 2021/08/26 06:11:34 UTC
[ranger] branch ranger-2.0 updated (99287a2 -> 88d4030)
This is an automated email from the ASF dual-hosted git repository.
madhan pushed a change to branch ranger-2.0
in repository https://gitbox.apache.org/repos/asf/ranger.git.
discard 99287a2 RANGER-3377: HDFS plugin performance improvement - RangerHdfsResource.getAsString()
new 88d4030 RANGER-3378: HDFS plugin performance improvement - RangerHdfsResource.getAsString()
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (99287a2)
\
N -- N -- N refs/heads/ranger-2.0 (88d4030)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
[ranger] 01/01: RANGER-3378: HDFS plugin performance improvement -
RangerHdfsResource.getAsString()
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch ranger-2.0
in repository https://gitbox.apache.org/repos/asf/ranger.git
commit 88d4030531dd673fb8f8899c274bc56852e625b5
Author: cao zhiqiang <lf...@163.com>
AuthorDate: Wed Aug 25 22:16:39 2021 -0700
RANGER-3378: HDFS plugin performance improvement - RangerHdfsResource.getAsString()
Signed-off-by: Madhan Neethiraj <ma...@apache.org>
(cherry picked from commit b0e970f21f7b2bd3f591e291684014f92434a2d3)
---
.../plugin/policyengine/RangerAccessResourceImpl.java | 4 ++++
.../ranger/authorization/hadoop/RangerHdfsAuthorizer.java | 14 ++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java
index 93810ae..b4811ee 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java
@@ -261,4 +261,8 @@ public class RangerAccessResourceImpl implements RangerMutableResource {
return sb;
}
+
+ protected String getStringifiedValue() { return stringifiedValue; }
+
+ protected void setStringifiedValue(String val) { this.stringifiedValue = val; }
}
diff --git a/hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java b/hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java
index 7b2882c..6cd2a2e 100644
--- a/hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java
+++ b/hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java
@@ -30,6 +30,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.Stack;
@@ -814,6 +815,19 @@ class RangerHdfsResource extends RangerAccessResourceImpl {
super.setValue(RangerHdfsAuthorizer.KEY_RESOURCE_PATH, path);
super.setOwnerUser(owner);
}
+
+ @Override
+ public String getAsString() {
+ String ret = super.getStringifiedValue();
+
+ if (ret == null) {
+ ret = Objects.toString(super.getValue(RangerHdfsAuthorizer.KEY_RESOURCE_PATH));
+
+ super.setStringifiedValue(ret);
+ }
+
+ return ret;
+ }
}
class RangerHdfsAccessRequest extends RangerAccessRequestImpl {