You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by sn...@apache.org on 2014/12/10 15:50:09 UTC
[1/2] incubator-ranger git commit: RANGER-197: Fixed the source code
compilation issues related to SNAPSHOT library dependencies
Repository: incubator-ranger
Updated Branches:
refs/heads/ranger-0.4 e88740f5f -> 539e3d195
RANGER-197: Fixed the source code compilation issues related to SNAPSHOT library dependencies
Conflicts:
pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/ccba56eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/ccba56eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/ccba56eb
Branch: refs/heads/ranger-0.4
Commit: ccba56eb0c82e89241997184102edf0cf71eaddf
Parents: e88740f
Author: sneethiraj <sn...@apache.org>
Authored: Tue Dec 9 18:47:19 2014 -0500
Committer: sneethiraj <sn...@apache.org>
Committed: Wed Dec 10 09:45:45 2014 -0500
----------------------------------------------------------------------
.../security/access/XaAccessControlLists.java | 79 ++++++++++++++++++--
.../access/XaAccessControlListsTest.java | 43 +++++++++++
pom.xml | 11 +--
3 files changed, 123 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ccba56eb/hbase-agent/src/main/java/org/apache/hadoop/hbase/security/access/XaAccessControlLists.java
----------------------------------------------------------------------
diff --git a/hbase-agent/src/main/java/org/apache/hadoop/hbase/security/access/XaAccessControlLists.java b/hbase-agent/src/main/java/org/apache/hadoop/hbase/security/access/XaAccessControlLists.java
index 6dcb985..8313532 100644
--- a/hbase-agent/src/main/java/org/apache/hadoop/hbase/security/access/XaAccessControlLists.java
+++ b/hbase-agent/src/main/java/org/apache/hadoop/hbase/security/access/XaAccessControlLists.java
@@ -19,17 +19,86 @@
package org.apache.hadoop.hbase.security.access;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import org.apache.hadoop.hbase.TableExistsException;
import org.apache.hadoop.hbase.master.MasterServices;
-import org.apache.hadoop.hbase.security.access.AccessControlLists;
+import org.apache.log4j.Logger;
+
public class XaAccessControlLists {
+
+ private static final Logger LOG = Logger.getLogger(XaAccessControlLists.class) ;
+
public static void init(MasterServices master) throws IOException {
- try {
- AccessControlLists.init(master);
- } catch(TableExistsException excp) {
- // ignore
+
+ Class<AccessControlLists> accessControlListsClass = AccessControlLists.class ;
+ String cName = accessControlListsClass.getName() ;
+
+ Class<?>[] params = new Class[1] ;
+ params[0] = MasterServices.class ;
+
+ for (String mname : new String[] { "init", "createACLTable" } ) {
+ try {
+ try {
+ Method m = accessControlListsClass.getDeclaredMethod(mname, params) ;
+ if (m != null) {
+ try {
+
+ try {
+ m.invoke(null, master) ;
+ logInfo("Execute method name [" + mname + "] in Class [" + cName + "] is successful.");
+ } catch (InvocationTargetException e) {
+ Throwable cause = e ;
+ boolean tableExistsExceptionFound = false ;
+ if (e != null) {
+ Throwable ecause = e.getTargetException() ;
+ if (ecause != null) {
+ cause = ecause ;
+ if (ecause instanceof TableExistsException) {
+ tableExistsExceptionFound = true ;
+ }
+ }
+ }
+ if (! tableExistsExceptionFound) {
+ logError("Unable to execute the method [" + mname + "] on [" + cName + "] due to exception", cause) ;
+ throw new IOException(cause) ;
+ }
+ }
+ return ;
+ } catch (IllegalArgumentException e) {
+ logError("Unable to execute method name [" + mname + "] in Class [" + cName + "].", e);
+ throw new IOException(e) ;
+ } catch (IllegalAccessException e) {
+ logError("Unable to execute method name [" + mname + "] in Class [" + cName + "].", e);
+ throw new IOException(e) ;
+ }
+ }
+ }
+ catch(NoSuchMethodException nsme) {
+ logInfo("Unable to get method name [" + mname + "] in Class [" + cName + "]. Ignoring the exception");
+ }
+ } catch (SecurityException e) {
+ logError("Unable to get method name [" + mname + "] in Class [" + cName + "].", e);
+ throw new IOException(e) ;
+ }
}
+ throw new IOException("Unable to initialize() [" + cName + "]") ;
+ }
+
+
+ private static void logInfo(String msg) {
+ // System.out.println(msg) ;
+ LOG.info(msg) ;
}
+
+ private static void logError(String msg, Throwable t) {
+// System.err.println(msg) ;
+// if (t != null) {
+// t.printStackTrace(System.err);
+// }
+ LOG.error(msg, t);
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ccba56eb/hbase-agent/src/test/java/org/apache/hadoop/hbase/security/access/XaAccessControlListsTest.java
----------------------------------------------------------------------
diff --git a/hbase-agent/src/test/java/org/apache/hadoop/hbase/security/access/XaAccessControlListsTest.java b/hbase-agent/src/test/java/org/apache/hadoop/hbase/security/access/XaAccessControlListsTest.java
new file mode 100644
index 0000000..4035ab4
--- /dev/null
+++ b/hbase-agent/src/test/java/org/apache/hadoop/hbase/security/access/XaAccessControlListsTest.java
@@ -0,0 +1,43 @@
+package org.apache.hadoop.hbase.security.access;
+
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.master.MasterServices;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class XaAccessControlListsTest {
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testInit() {
+ IOException exceptionFound = null ;
+ try {
+ MasterServices service = null ;
+ XaAccessControlLists.init(service) ;
+ } catch (IOException e) {
+ exceptionFound = e ;
+ }
+ Assert.assertFalse("Expected to get a NullPointerExecution after init method Execution - Found [" + exceptionFound + "]", (!(exceptionFound != null && exceptionFound.getCause() instanceof NullPointerException))) ;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ccba56eb/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6c56a05..835507f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,11 +78,11 @@
<google.guava.version>17.0</google.guava.version>
<gson.version>2.2.4</gson.version>
<guava.version>11.0.2</guava.version>
- <hadoop-auth.version>3.0.0-SNAPSHOT</hadoop-auth.version>
- <hadoop-common.version>3.0.0-SNAPSHOT</hadoop-common.version>
- <hadoop.version>3.0.0-SNAPSHOT</hadoop.version>
+ <hadoop-auth.version>2.6.0</hadoop-auth.version>
+ <hadoop-common.version>2.6.0</hadoop-common.version>
+ <hadoop.version>2.6.0</hadoop.version>
<hamcrest.all.version>1.3</hamcrest.all.version>
- <hbase.version>0.99.2-SNAPSHOT</hbase.version>
+ <hbase.version>0.99.2</hbase.version>
<hive.version>0.14.0-SNAPSHOT</hive.version>
<javassist.version>3.12.1.GA</javassist.version>
<javax.persistence.version>2.1.0</javax.persistence.version>
@@ -91,7 +91,8 @@
<jersey-bundle.version>1.17.1</jersey-bundle.version>
<junit.version>4.11</junit.version>
<mockito.version>1.8.4</mockito.version>
- <knox.gateway.version>0.5.0-SNAPSHOT</knox.gateway.version>
+ <hamcrest-version>1.3</hamcrest-version>
+ <knox.gateway.version>0.5.0</knox.gateway.version>
<local.lib.dir>${project.basedir}/../lib/local</local.lib.dir>
<log4j.version>1.2.17</log4j.version>
<mysql-connector-java.version>5.1.31</mysql-connector-java.version>
[2/2] incubator-ranger git commit: Added Apache Copyright
Posted by sn...@apache.org.
Added Apache Copyright
Signed-off-by: sneethiraj <sn...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/539e3d19
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/539e3d19
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/539e3d19
Branch: refs/heads/ranger-0.4
Commit: 539e3d195a8b6a9a7ae8f3d8b8ab2666621efe5a
Parents: ccba56e
Author: Don Bosco Durai <bo...@apache.org>
Authored: Wed Dec 10 00:14:57 2014 -0800
Committer: sneethiraj <sn...@apache.org>
Committed: Wed Dec 10 09:47:01 2014 -0500
----------------------------------------------------------------------
.../security/access/XaAccessControlListsTest.java | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/539e3d19/hbase-agent/src/test/java/org/apache/hadoop/hbase/security/access/XaAccessControlListsTest.java
----------------------------------------------------------------------
diff --git a/hbase-agent/src/test/java/org/apache/hadoop/hbase/security/access/XaAccessControlListsTest.java b/hbase-agent/src/test/java/org/apache/hadoop/hbase/security/access/XaAccessControlListsTest.java
index 4035ab4..0b8afbb 100644
--- a/hbase-agent/src/test/java/org/apache/hadoop/hbase/security/access/XaAccessControlListsTest.java
+++ b/hbase-agent/src/test/java/org/apache/hadoop/hbase/security/access/XaAccessControlListsTest.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.hadoop.hbase.security.access;
import java.io.IOException;