You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2016/08/17 10:37:13 UTC

[1/2] kylin git commit: KYLIN-1963 globally remove dependency on log4j and slf4j-log4j to allow environment to specify impl

Repository: kylin
Updated Branches:
  refs/heads/master 0badf49fd -> 322b44085


KYLIN-1963 globally remove dependency on log4j and slf4j-log4j to allow environment to specify impl


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/69aaae2a
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/69aaae2a
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/69aaae2a

Branch: refs/heads/master
Commit: 69aaae2a31689bd65413f8f8a1a99dbb9325a879
Parents: 0badf49
Author: Hongbin Ma <ma...@apache.org>
Authored: Wed Aug 17 18:30:42 2016 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Wed Aug 17 18:30:42 2016 +0800

----------------------------------------------------------------------
 assembly/pom.xml                                | 16 ---------
 core-common/pom.xml                             | 19 +----------
 .../kylin/common/util/Log4jConfigurer.java      | 15 --------
 jdbc/pom.xml                                    |  4 ---
 kylin-it/pom.xml                                | 12 -------
 pom.xml                                         | 36 ++++++++++++++++++--
 query/pom.xml                                   | 13 -------
 server/pom.xml                                  | 21 ------------
 8 files changed, 34 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/69aaae2a/assembly/pom.xml
----------------------------------------------------------------------
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 36076d2..76ca0d8 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -52,22 +52,6 @@
             <artifactId>kylin-engine-streaming</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        
         <!-- Env & Test -->
         <dependency>
             <groupId>org.apache.kylin</groupId>

http://git-wip-us.apache.org/repos/asf/kylin/blob/69aaae2a/core-common/pom.xml
----------------------------------------------------------------------
diff --git a/core-common/pom.xml b/core-common/pom.xml
index b12dd76..087a8e7 100644
--- a/core-common/pom.xml
+++ b/core-common/pom.xml
@@ -78,25 +78,8 @@
             <artifactId>jsch</artifactId>
         </dependency>
 
-        <!-- Logging -->
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-        </dependency>
+    
         <!-- Env & Test -->
-
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>

http://git-wip-us.apache.org/repos/asf/kylin/blob/69aaae2a/core-common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java
----------------------------------------------------------------------
diff --git a/core-common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java b/core-common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java
index 8b89180..a3a3e52 100644
--- a/core-common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java
+++ b/core-common/src/main/java/org/apache/kylin/common/util/Log4jConfigurer.java
@@ -19,12 +19,8 @@
 package org.apache.kylin.common.util;
 
 import java.io.InputStream;
-import java.util.Enumeration;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PropertyConfigurator;
 
 public class Log4jConfigurer {
     private static boolean INITIALIZED = false;
@@ -33,23 +29,12 @@ public class Log4jConfigurer {
         if (!INITIALIZED && !isConfigured()) {
             System.out.println("Initing the logger");
             InputStream is = Log4jConfigurer.class.getClassLoader().getResourceAsStream("kylin-log4j.properties");
-            PropertyConfigurator.configure(is);
             IOUtils.closeQuietly(is);
         }
         INITIALIZED = true;
     }
 
     private static boolean isConfigured() {
-        if (LogManager.getRootLogger().getAllAppenders().hasMoreElements()) {
-            return true;
-        } else {
-            Enumeration<?> loggers = LogManager.getCurrentLoggers();
-            while (loggers.hasMoreElements()) {
-                Logger logger = (Logger) loggers.nextElement();
-                if (logger.getAllAppenders().hasMoreElements())
-                    return true;
-            }
-        }
         return false;
     }
 }

http://git-wip-us.apache.org/repos/asf/kylin/blob/69aaae2a/jdbc/pom.xml
----------------------------------------------------------------------
diff --git a/jdbc/pom.xml b/jdbc/pom.xml
index 6e25801..c003f9d 100644
--- a/jdbc/pom.xml
+++ b/jdbc/pom.xml
@@ -47,10 +47,6 @@
             <artifactId>httpclient</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/kylin/blob/69aaae2a/kylin-it/pom.xml
----------------------------------------------------------------------
diff --git a/kylin-it/pom.xml b/kylin-it/pom.xml
index 4be3dc5..6c924b0 100644
--- a/kylin-it/pom.xml
+++ b/kylin-it/pom.xml
@@ -72,18 +72,6 @@
             <artifactId>calcite-linq4j</artifactId>
         </dependency>
         <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
             <groupId>commons-cli</groupId>
             <artifactId>commons-cli</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/kylin/blob/69aaae2a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b3c3c6b..03fd0ea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -537,26 +537,31 @@
                 <artifactId>commons-daemon</artifactId>
                 <version>${commons-daemon.version}</version>
             </dependency>
+
+            <!-- Logging -->
             <dependency>
                 <groupId>log4j</groupId>
                 <artifactId>log4j</artifactId>
                 <version>${log4j.version}</version>
+                <scope>test</scope>
             </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>
-                <artifactId>jcl-over-slf4j</artifactId>
+                <artifactId>slf4j-log4j12</artifactId>
                 <version>${slf4j.version}</version>
+                <scope>test</scope>
             </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>
-                <artifactId>slf4j-api</artifactId>
+                <artifactId>jcl-over-slf4j</artifactId>
                 <version>${slf4j.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>
-                <artifactId>slf4j-log4j12</artifactId>
+                <artifactId>slf4j-api</artifactId>
                 <version>${slf4j.version}</version>
             </dependency>
+
             <dependency>
                 <groupId>com.fasterxml.jackson.core</groupId>
                 <artifactId>jackson-databind</artifactId>
@@ -760,6 +765,31 @@
         </dependencies>
     </dependencyManagement>
 
+    <dependencies>
+        
+        <!-- the logging dependencies are inherited by all modules for their generality
+            log4j and slf4j-log4j12 test scope only for UT/IT use
+        -->
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+    </dependencies>
+
     <repositories>
         <repository>
             <id>central</id>

http://git-wip-us.apache.org/repos/asf/kylin/blob/69aaae2a/query/pom.xml
----------------------------------------------------------------------
diff --git a/query/pom.xml b/query/pom.xml
index 225667d..0937b5a 100644
--- a/query/pom.xml
+++ b/query/pom.xml
@@ -51,24 +51,11 @@
             <artifactId>calcite-core</artifactId>
         </dependency>
         <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
             <groupId>commons-cli</groupId>
             <artifactId>commons-cli</artifactId>
         </dependency>
 
         <!-- Env & Test -->
-
         <dependency>
             <groupId>org.apache.kylin</groupId>
             <artifactId>kylin-core-common</artifactId>

http://git-wip-us.apache.org/repos/asf/kylin/blob/69aaae2a/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index d72a40d..abe10db 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -83,27 +83,6 @@
             </exclusions>
         </dependency>
 
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-        </dependency>
-        
-
         <!-- Test & Env -->
         <dependency>
             <groupId>org.apache.kylin</groupId>


[2/2] kylin git commit: KYLIN-1962: move kylin.security.profile back to kylin.properties

Posted by ma...@apache.org.
KYLIN-1962: move kylin.security.profile back to kylin.properties

Signed-off-by: Hongbin Ma <ma...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/322b4408
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/322b4408
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/322b4408

Branch: refs/heads/master
Commit: 322b44085372ed188f2c92f1c1a7675c126510bb
Parents: 69aaae2
Author: Yiming Liu <li...@gmail.com>
Authored: Wed Aug 17 18:27:46 2016 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Wed Aug 17 18:32:39 2016 +0800

----------------------------------------------------------------------
 build/conf/kylin.properties                            | 11 +++++++++++
 build/conf/kylin_account.properties                    |  8 --------
 examples/test_case_data/localmeta/kylin.properties     |  2 ++
 .../test_case_data/localmeta/kylin_account.properties  |  8 --------
 examples/test_case_data/sandbox/kylin.properties       | 10 ----------
 .../test_case_data/sandbox/kylin_account.properties    | 13 +++++++++++++
 6 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/322b4408/build/conf/kylin.properties
----------------------------------------------------------------------
diff --git a/build/conf/kylin.properties b/build/conf/kylin.properties
index 9cc0ec1..5607336 100644
--- a/build/conf/kylin.properties
+++ b/build/conf/kylin.properties
@@ -140,6 +140,17 @@ kylin.query.security.enabled=true
 
 kylin.query.cache.enabled=true
 
+### SECURITY ###
+
+# Spring security profile, options: testing, ldap, saml
+# with "testing" profile, user can use pre-defined name/pwd like KYLIN/ADMIN to login
+kylin.security.profile=testing
+
+### MAIL ###
+
+# If true, will send email notification;
+mail.enabled=false
+
 ### WEB ###
 
 # Help info, format{name|displayName|link}, optional

http://git-wip-us.apache.org/repos/asf/kylin/blob/322b4408/build/conf/kylin_account.properties
----------------------------------------------------------------------
diff --git a/build/conf/kylin_account.properties b/build/conf/kylin_account.properties
index 39efd89..e98c142 100644
--- a/build/conf/kylin_account.properties
+++ b/build/conf/kylin_account.properties
@@ -7,11 +7,6 @@ kylin.job.remote.cli.username=
 kylin.job.remote.cli.password=
 
 ### SECURITY ###
-
-# Spring security profile, options: testing, ldap, saml
-# with "testing" profile, user can use pre-defined name/pwd like KYLIN/ADMIN to login
-kylin.security.profile=testing
-
 # Default roles and admin roles in LDAP, for ldap and saml
 acl.defaultRole=ROLE_ANALYST,ROLE_MODELER
 acl.adminRole=ROLE_ADMIN
@@ -41,9 +36,6 @@ saml.context.serverPort=443
 saml.context.contextPath=/kylin
 
 ### MAIL ###
-
-# If true, will send email notification;
-mail.enabled=false
 mail.host=
 mail.username=
 mail.password=

http://git-wip-us.apache.org/repos/asf/kylin/blob/322b4408/examples/test_case_data/localmeta/kylin.properties
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/kylin.properties b/examples/test_case_data/localmeta/kylin.properties
index 47d9577..50dd0b6 100644
--- a/examples/test_case_data/localmeta/kylin.properties
+++ b/examples/test_case_data/localmeta/kylin.properties
@@ -82,6 +82,8 @@ kylin.job.yarn.app.rest.check.interval.seconds=10
 kylin.security.profile=testing
 
 ### MAIL ###
+# If true, will send email notification;
+mail.enabled=false
 mail.host=origin.mail.com
 
 ### OTHER ###

http://git-wip-us.apache.org/repos/asf/kylin/blob/322b4408/examples/test_case_data/localmeta/kylin_account.properties
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/kylin_account.properties b/examples/test_case_data/localmeta/kylin_account.properties
index 6350d7f..67bbb16 100644
--- a/examples/test_case_data/localmeta/kylin_account.properties
+++ b/examples/test_case_data/localmeta/kylin_account.properties
@@ -7,11 +7,6 @@ kylin.job.remote.cli.username=
 kylin.job.remote.cli.password=
 
 ### SECURITY ###
-
-# Spring security profile, options: testing, ldap, saml
-# with "testing" profile, user can use pre-defined name/pwd like KYLIN/ADMIN to login
-kylin.security.profile=testing
-
 # Default roles and admin roles in LDAP, for ldap and saml
 acl.defaultRole=ROLE_ANALYST,ROLE_MODELER
 acl.adminRole=ROLE_ADMIN
@@ -41,9 +36,6 @@ saml.context.serverPort=443
 saml.context.contextPath=/kylin
 
 ### MAIL ###
-
-# If true, will send email notification;
-mail.enabled=false
 mail.host=override.mail.com
 mail.username=
 mail.password=need_reset

http://git-wip-us.apache.org/repos/asf/kylin/blob/322b4408/examples/test_case_data/sandbox/kylin.properties
----------------------------------------------------------------------
diff --git a/examples/test_case_data/sandbox/kylin.properties b/examples/test_case_data/sandbox/kylin.properties
index b674a83..996b2b8 100644
--- a/examples/test_case_data/sandbox/kylin.properties
+++ b/examples/test_case_data/sandbox/kylin.properties
@@ -67,12 +67,6 @@ kylin.job.run.as.remote.cmd=false
 # Only necessary when kylin.job.run.as.remote.cmd=true
 kylin.job.remote.cli.hostname=sandbox
 
-# Only necessary when kylin.job.run.as.remote.cmd=true
-kylin.job.remote.cli.username=root
-
-# Only necessary when kylin.job.run.as.remote.cmd=true
-kylin.job.remote.cli.password=hadoop
-
 # Used by test cases to prepare synthetic data for sample cube
 kylin.job.remote.cli.working.dir=/tmp/kylin
 
@@ -131,10 +125,6 @@ acl.adminRole=ROLE_ADMIN
 
 # If true, will send email notification;
 mail.enabled=false
-mail.host=
-mail.username=
-mail.password=
-mail.sender=
 
 ### WEB ###
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/322b4408/examples/test_case_data/sandbox/kylin_account.properties
----------------------------------------------------------------------
diff --git a/examples/test_case_data/sandbox/kylin_account.properties b/examples/test_case_data/sandbox/kylin_account.properties
new file mode 100644
index 0000000..0dfa5f7
--- /dev/null
+++ b/examples/test_case_data/sandbox/kylin_account.properties
@@ -0,0 +1,13 @@
+### JOB ###
+
+# Only necessary when kylin.job.run.as.remote.cmd=true
+kylin.job.remote.cli.username=root
+
+# Only necessary when kylin.job.run.as.remote.cmd=true
+kylin.job.remote.cli.password=hadoop
+
+### MAIL ###
+mail.host=
+mail.username=
+mail.password=
+mail.sender=