This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch kylin5
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 3111d4c94f2432f65d81c636dcff08a52742e71c
Author: Yaguang Jia <jiayagu...@foxmail.com>
AuthorDate: Tue Dec 13 16:27:32 2022 +0800

    [DIRTY] add management prefix to KylinConfigCheckCLI
---
 .../java/org/apache/kylin/tool/KylinConfigCheckCLI.java    |  4 +++-
 .../org/apache/kylin/tool/KylinConfigCheckCLITest.java     | 14 +++-----------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git 
a/src/tool/src/main/java/org/apache/kylin/tool/KylinConfigCheckCLI.java 
b/src/tool/src/main/java/org/apache/kylin/tool/KylinConfigCheckCLI.java
index bd939e2934..da74639966 100644
--- a/src/tool/src/main/java/org/apache/kylin/tool/KylinConfigCheckCLI.java
+++ b/src/tool/src/main/java/org/apache/kylin/tool/KylinConfigCheckCLI.java
@@ -33,6 +33,7 @@ public class KylinConfigCheckCLI {
     private static final String SPRING_CONFIG_PREFIX = "spring.";
     private static final String KYLIN_CONFIG_PREFIX = "kylin.";
     private static final String ARTHAS_CONFIG_PREFIX = "arthas.";
+    private static final String MANAGEMENT_CONFIG_PREFIX = "management.";
     /**
      * Not recommended set the configuration items at the beginning with kap
      */
@@ -49,7 +50,8 @@ public class KylinConfigCheckCLI {
             if (!StringUtils.startsWith(key, KYLIN_CONFIG_PREFIX) && 
!StringUtils.startsWith(key, SERVER_CONFIG_PREFIX)
                     && !StringUtils.startsWith(key, SPRING_CONFIG_PREFIX)
                     && !StringUtils.startsWith(key, KAP_CONFIG_PREFIX)
-                    && !StringUtils.startsWith(key, ARTHAS_CONFIG_PREFIX)) {
+                    && !StringUtils.startsWith(key, ARTHAS_CONFIG_PREFIX)
+                    && !StringUtils.startsWith(key, MANAGEMENT_CONFIG_PREFIX)) 
{
                 System.out.println(key);
                 break;
             }
diff --git 
a/src/tool/src/test/java/org/apache/kylin/tool/KylinConfigCheckCLITest.java 
b/src/tool/src/test/java/org/apache/kylin/tool/KylinConfigCheckCLITest.java
index b3323b6b53..5419b7eefe 100644
--- a/src/tool/src/test/java/org/apache/kylin/tool/KylinConfigCheckCLITest.java
+++ b/src/tool/src/test/java/org/apache/kylin/tool/KylinConfigCheckCLITest.java
@@ -40,19 +40,11 @@ public class KylinConfigCheckCLITest extends 
NLocalFileMetadataTestCase {
     public void testCorrectConfig() throws IOException {
         final File kylinConfDir = KylinConfig.getKylinConfDir();
         File kylin_properties_override = new File(kylinConfDir, 
"kylin.properties.override");
-        IOUtils.copy(new 
ByteArrayInputStream("kylin.kerberos.platform=FI".getBytes(Charset.defaultCharset())),
-                new FileOutputStream(kylin_properties_override));
-        IOUtils.copy(new 
ByteArrayInputStream("spring.xxx.xxx=xx".getBytes(Charset.defaultCharset())),
-                new FileOutputStream(kylin_properties_override));
-        IOUtils.copy(new 
ByteArrayInputStream("arthas.xxx.xxx=xx".getBytes(Charset.defaultCharset())),
-                new FileOutputStream(kylin_properties_override));
-        IOUtils.copy(new 
ByteArrayInputStream("server.xxx=xx".getBytes(Charset.defaultCharset())),
-                new FileOutputStream(kylin_properties_override));
-
         // `kap.xx.xx` is not recommended, but it still works for 
compatibility reasons
-        IOUtils.copy(new 
ByteArrayInputStream("kap.xxx.xxx=xx".getBytes(Charset.defaultCharset())),
+        String overrideProps = "kylin.kerberos.platform=FI\n" + 
"spring.xxx.xxx=xx\n" + "arthas.xxx.xxx=xx\n"
+                + "server.xxx=xx\n" + "management.xxx=xx\n" + 
"kap.xxx.xxx=xx\n";
+        IOUtils.copy(new 
ByteArrayInputStream(overrideProps.getBytes(Charset.defaultCharset())),
                 new FileOutputStream(kylin_properties_override));
-
         PrintStream o = System.out;
         File f = File.createTempFile("check", ".tmp");
         PrintStream tmpOut = new PrintStream(new FileOutputStream(f), false, 
Charset.defaultCharset().name());

Reply via email to