Repository: incubator-ranger
Updated Branches:
  refs/heads/master 9b1fa33ce -> 66c303489


RANGER-895: RangerHiveAuthorizer adds stub implementation of the new methods in 
HiveAuthorizer


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/66c30348
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/66c30348
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/66c30348

Branch: refs/heads/master
Commit: 66c3034891958bc7038af960e155bdaeb6b0c559
Parents: 9b1fa33
Author: Madhan Neethiraj <[email protected]>
Authored: Wed Mar 23 04:08:34 2016 -0700
Committer: Madhan Neethiraj <[email protected]>
Committed: Wed Mar 23 04:08:34 2016 -0700

----------------------------------------------------------------------
 .../hive/authorizer/RangerHiveAuthorizer.java   | 21 ++++++++++++++++++++
 .../authorizer/RangerHiveAuthorizerBase.java    |  8 ++------
 pom.xml                                         |  2 +-
 3 files changed, 24 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/66c30348/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
----------------------------------------------------------------------
diff --git 
a/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
 
b/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
index 93b23e3..f6f9324 100644
--- 
a/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
+++ 
b/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsAction;
 import org.apache.hadoop.hive.common.FileUtils;
 import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.parse.SemanticException;
 import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider;
 import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAccessControlException;
 import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzContext;
@@ -459,6 +460,26 @@ public class RangerHiveAuthorizer extends 
RangerHiveAuthorizerBase {
                return ret;
        }
 
+       @Override
+       public String getRowFilterExpression(String databaseName, String 
tableOrViewName) throws SemanticException {
+               return null;
+       }
+
+       @Override
+       public boolean needTransform() {
+               return false;
+       }
+
+       @Override
+       public boolean needTransform(String databaseName, String 
tableOrViewName) {
+               return false;
+       }
+
+       @Override
+       public String getCellValueTransformer(String databaseName, String 
tableOrViewName, String columnName) throws SemanticException {
+               return columnName;
+       }
+
        RangerHiveResource createHiveResource(HivePrivilegeObject 
privilegeObject) {
                RangerHiveResource resource = null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/66c30348/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizerBase.java
----------------------------------------------------------------------
diff --git 
a/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizerBase.java
 
b/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizerBase.java
index 132849b..fff5afe 100644
--- 
a/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizerBase.java
+++ 
b/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizerBase.java
@@ -28,7 +28,7 @@ import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
 import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider;
 import 
org.apache.hadoop.hive.ql.security.authorization.plugin.DisallowTransformHook;
 import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAccessControlException;
-import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthorizer;
+import 
org.apache.hadoop.hive.ql.security.authorization.plugin.AbstractHiveAuthorizer;
 import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzPluginException;
 import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzSessionContext;
 import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzSessionContext.CLIENT_TYPE;
@@ -41,7 +41,7 @@ import 
org.apache.hadoop.hive.ql.security.authorization.plugin.SettableConfigUpd
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.ranger.authorization.utils.StringUtil;
 
-public abstract class RangerHiveAuthorizerBase implements HiveAuthorizer {
+public abstract class RangerHiveAuthorizerBase extends AbstractHiveAuthorizer {
 
        private static final Log LOG = 
LogFactory.getLog(RangerHiveAuthorizerBase.class);
 
@@ -217,10 +217,6 @@ public abstract class RangerHiveAuthorizerBase implements 
HiveAuthorizer {
                throwNotImplementedException("setCurrentRole");
        }
 
-       public  Object getHiveAuthorizationTranslator() throws 
HiveAuthzPluginException {
-               return null;
-       }
-
        private void throwNotImplementedException(String method) throws 
HiveAuthzPluginException {
                throw new HiveAuthzPluginException(method + "() not implemented 
in Ranger HiveAuthorizer");
        }

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/66c30348/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6deb4f8..2e0366a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -144,7 +144,7 @@
         <htrace-core.version>3.1.0-incubating</htrace-core.version>
         <hamcrest.all.version>1.3</hamcrest.all.version>
         <hbase.version>1.1.3</hbase.version>
-        <hive.version>1.2.0</hive.version>
+        <hive.version>2.1.0-SNAPSHOT</hive.version>
         <storm.version>0.9.2-incubating</storm.version>
         <httpcomponent.httpmime.version>4.2.5</httpcomponent.httpmime.version>
         
<httpcomponent.httpclient.version>4.2.5</httpcomponent.httpclient.version>

Reply via email to