sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From linaataus...@apache.org
Subject sentry git commit: SENTRY-2184: Performance Issue: MPath is queried for each MAuthzPathsMapping in full snapshot (Na Li, reviewed by Brian Towles, Alexander Kolbasov, Kalyan Kumar Kalvagadda).
Date Wed, 21 Mar 2018 20:45:17 GMT
Repository: sentry
Updated Branches:
  refs/heads/master a8646b256 -> 5db336d79


SENTRY-2184: Performance Issue: MPath is queried for each MAuthzPathsMapping in full snapshot
(Na Li, reviewed by Brian Towles, Alexander Kolbasov, Kalyan Kumar Kalvagadda).


Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/5db336d7
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/5db336d7
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/5db336d7

Branch: refs/heads/master
Commit: 5db336d79b6f637840fc92427ae0648117f383ca
Parents: a8646b2
Author: lina.li <lina.li@cloudera.com>
Authored: Wed Mar 21 15:44:14 2018 -0500
Committer: lina.li <lina.li@cloudera.com>
Committed: Wed Mar 21 15:44:14 2018 -0500

----------------------------------------------------------------------
 .../org/apache/sentry/provider/db/service/model/package.jdo     | 3 +++
 .../sentry/provider/db/service/persistent/SentryStore.java      | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/5db336d7/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
index d883c51..9ce9cae 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
@@ -267,6 +267,9 @@
              <column name="AUTHZ_OBJ_ID"/>
            </element>
        </field>
+       <fetch-group name="includingPaths">
+         <field name="paths"/>
+       </fetch-group>
        <field name="authzSnapshotID">
          <column name="AUTHZ_SNAPSHOT_ID" jdbc-type="BIGINT" allows-null="false"/>
        </field>

http://git-wip-us.apache.org/repos/asf/sentry/blob/5db336d7/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
index 4521ad4..83c0fc4 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
@@ -2605,8 +2605,11 @@ public class SentryStore {
     query.addExtension(LOAD_RESULTS_AT_COMMIT, "false");
     query.setFilter("this.authzSnapshotID == currentSnapshotID");
     query.declareParameters("long currentSnapshotID");
+
+    // Get path in batch to improve performance. The fectch groups are defined in package.jdo
+    pm.getFetchPlan().addGroup("includingPaths");
     Collection<MAuthzPathsMapping> authzToPathsMappings =
-            (Collection<MAuthzPathsMapping>) query.execute(currentSnapshotID);
+        (Collection<MAuthzPathsMapping>) query.execute(currentSnapshotID);
 
     // Walk each MAuthzPathsMapping object, get set of paths and push them all
     // into HMSPaths object contained in UpdateableAuthzPaths.


Mime
View raw message