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 2022/10/19 03:39:00 UTC

[jira] [Commented] (KYLIN-5256) Add a cache for the system property get by the optional config in KylinConfigBase

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

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

hit-lacus opened a new pull request, #1999:
URL: https://github.com/apache/kylin/pull/1999

   ## Proposed changes
   
   Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
   
   ## Branch to commit
   - [ ] Branch **kylin3** for v2.x to v3.x
   - [ ] Branch **kylin4** for v4.x
   - [ ] Branch **kylin5** for v5.x
   
   ## Types of changes
   
   What types of changes does your code introduce to Kylin?
   _Put an `x` in the boxes that apply_
   
   - [ ] Bugfix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] Documentation Update (if none of the other choices apply)
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [ ] I have created an issue on [Kylin's jira](https://issues.apache.org/jira/browse/KYLIN), and have described the bug/feature there in detail
   - [ ] Commit messages in my PR start with the related jira ID, like "KYLIN-0000 Make Kylin project open-source"
   - [ ] Compiling and unit tests pass locally with my changes
   - [ ] I have added tests that prove my fix is effective or that my feature works
   - [ ] I have added necessary documentation (if appropriate)
   - [ ] Any dependent changes have been merged
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at user@kylin.apache.org or dev@kylin.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...
   




> Add a cache for the system property get by the optional config in KylinConfigBase
> ---------------------------------------------------------------------------------
>
>                 Key: KYLIN-5256
>                 URL: https://issues.apache.org/jira/browse/KYLIN-5256
>             Project: Kylin
>          Issue Type: Improvement
>            Reporter: Zhenning Zhang
>            Assignee: Zhenning Zhang
>            Priority: Major
>             Fix For: 5.0-alpha
>
>
> Currently for every getOptional() in {*}KylinConfigBase{*}, it will invoke *System.getProperty* in which will be blocked by the lock of hash table. In most cases, the config will not be changed. It's better to cache them with concurrent hash map.
> [https://community.oracle.com/tech/developers/discussion/4490235/the-performance-impact-of-java-lang-system-getproperty]
> Stack:
> {code:java}
> "Query 73183025-c617-a3e5-64b9-f21aa6261c10-356" #356 daemon prio=5 os_prio=0 tid=0x00007f6900468000 nid=0x103c waiting for monitor entry [0x00007f68aa0e5000]
>    java.lang.Thread.State: BLOCKED (on object monitor)
> 	at java.util.Hashtable.get(Hashtable.java:363)
> 	- waiting to lock <0x00007f69f0034548> (a java.util.Properties)
> 	at java.util.Properties.getProperty(Properties.java:969)
> 	at org.apache.kylin.common.KylinExternalConfigLoader.getProperty(KylinExternalConfigLoader.java:164)
> 	at org.apache.kylin.common.PropertiesDelegate.getProperty(PropertiesDelegate.java:58)
> 	at org.apache.kylin.common.PropertiesDelegate.getProperty(PropertiesDelegate.java:65)
> 	at org.apache.kylin.common.KylinConfigBase.getOptional(KylinConfigBase.java:206)
> 	at org.apache.kylin.common.KapConfig.defaultDecimalScale(KapConfig.java:558)
> 	at org.apache.kylin.query.calcite.KylinRelDataTypeSystem.getDefaultScale(KylinRelDataTypeSystem.java:102)
> 	at org.apache.calcite.sql.type.BasicSqlType.generateTypeString(BasicSqlType.java:186)
> "Query 5d2f5f9b-a4ae-a919-a94f-79e5819e9dac-359" #359 daemon prio=5 os_prio=0 tid=0x00007f6902a92000 nid=0x103f waiting for monitor entry [0x00007f68a94e3000]
>    java.lang.Thread.State: BLOCKED (on object monitor)
> 	at java.util.Hashtable.get(Hashtable.java:363)
> 	- waiting to lock <0x00007f69f003dd30> (a java.util.Properties)
> 	at java.util.Properties.getProperty(Properties.java:969)
> 	at java.lang.System.getProperty(System.java:722)
> 	at org.apache.kylin.common.KylinConfigBase.getOptional(KylinConfigBase.java:204)
> 	at org.apache.kylin.common.KylinConfigBase.streamingEnabled(KylinConfigBase.java:1538)
> 	at org.apache.kylin.metadata.model.NTableMetadataManager.isTableAccessible(NTableMetadataManager.java:334)
> "Query 3ce57dbc-cc0d-307e-2d48-f6c969d99426-361" #361 daemon prio=5 os_prio=0 tid=0x00007f6902a96800 nid=0x1041 waiting for monitor entry [0x00007f68a8ce0000]
>    java.lang.Thread.State: BLOCKED (on object monitor)
> 	at java.util.Hashtable.get(Hashtable.java:363)
> 	- waiting to lock <0x00007f69f0034548> (a java.util.Properties)
> 	at java.util.Properties.getProperty(Properties.java:969)
> 	at org.apache.kylin.common.KylinExternalConfigLoader.getProperty(KylinExternalConfigLoader.java:164)
> 	at org.apache.kylin.common.PropertiesDelegate.getProperty(PropertiesDelegate.java:58)
> 	at org.apache.kylin.common.PropertiesDelegate.getProperty(PropertiesDelegate.java:65)
> 	at org.apache.kylin.common.KylinConfigBase.getOptional(KylinConfigBase.java:206)
> 	at org.apache.kylin.common.KylinConfigExt.getOptional(KylinConfigExt.java:86)
> 	at org.apache.kylin.common.KylinConfigBase.getSourceNameCaseSensitiveEnabled(KylinConfigBase.java:1194)
> 	at org.apache.kylin.query.schema.OLAPTable.deriveRowType(OLAPTable.java:228)
> 	at org.apache.kylin.query.schema.OLAPTable.getRowType(OLAPTable.java:208) {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)