You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/09/19 05:29:00 UTC

[jira] [Commented] (KYLIN-3439) configuration "kylin.web.timezone" is Inconsistent between kylin-defaults.properties and KylinConfigBase.java

    [ https://issues.apache.org/jira/browse/KYLIN-3439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16620128#comment-16620128 ] 

ASF GitHub Bot commented on KYLIN-3439:
---------------------------------------

shaofengshi closed pull request #164: KYLIN-3439, make default kylin.web.timezone in KylinConfigBase the same with kylin-defaults.properties
URL: https://github.com/apache/kylin/pull/164
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
index 3ae6c2d48b..3544e94145 100644
--- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
+++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
@@ -27,6 +27,7 @@
 import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.SortedSet;
+import java.util.TimeZone;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -1536,7 +1537,11 @@ public String getLDAPAdminRole() {
     // ============================================================================
 
     public String getTimeZone() {
-        return getOptional("kylin.web.timezone", "PST");
+        String timezone = getOptional("kylin.web.timezone");
+        if (StringUtils.isBlank(timezone)) {
+            timezone = TimeZone.getDefault().getID();
+        }
+        return timezone;
     }
 
     public boolean isWebCrossDomainEnabled() {
diff --git a/core-common/src/main/resources/kylin-defaults.properties b/core-common/src/main/resources/kylin-defaults.properties
index b391b5e202..9387112981 100644
--- a/core-common/src/main/resources/kylin-defaults.properties
+++ b/core-common/src/main/resources/kylin-defaults.properties
@@ -41,7 +41,7 @@ kylin.server.mode=all
 kylin.server.cluster-servers=localhost:7070
 
 # Display timezone on UI,format like[GMT+N or GMT-N]
-kylin.web.timezone=GMT+8
+kylin.web.timezone=
 
 # Timeout value for the queries submitted through the Web UI, in milliseconds
 kylin.web.query-timeout=300000
diff --git a/server/src/test/java/org/apache/kylin/rest/service/AdminServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/AdminServiceTest.java
index 99d47e25d9..4b7b13390d 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/AdminServiceTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/AdminServiceTest.java
@@ -47,6 +47,7 @@ public void testGetPublicConfig() throws IOException {
         String path = Thread.currentThread().getContextClassLoader().getResource("kylin.properties").getPath();
 
         KylinConfig config = KylinConfig.createInstanceFromUri(path);
+        String timeZone = config.getTimeZone();
         try (SetAndUnsetThreadLocalConfig autoUnset = KylinConfig.setAndUnsetThreadLocalConfig(config)) {
         
             String expected = "kylin.web.link-streaming-guide=http://kylin.apache.org/\n" +
@@ -55,7 +56,7 @@ public void testGetPublicConfig() throws IOException {
                     "kylin.query.cache-enabled=true\n" +
                     "kylin.web.link-diagnostic=\n" +
                     "kylin.web.help.length=4\n" +
-                    "kylin.web.timezone=GMT+8\n" +
+                    "kylin.web.timezone=\n" +
                     "kylin.server.external-acl-provider=\n" +
                     "kylin.tool.auto-migrate-cube.enabled=\n" +
                     "kylin.storage.default=2\n" +


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> configuration "kylin.web.timezone"  is Inconsistent between kylin-defaults.properties and KylinConfigBase.java
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-3439
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3439
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: jiatao.tao
>            Assignee: jiatao.tao
>            Priority: Minor
>             Fix For: v2.6.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)