[jira] [Commented] (KYLIN-3259) When a cube is deleted, remove it from the hybrid cube definition
[ https://issues.apache.org/jira/browse/KYLIN-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16556763#comment-16556763 ] ASF GitHub Bot commented on KYLIN-3259: --- shaofengshi closed pull request #176: KYLIN-3259 when delete cube, remove it from hybrid URL: https://github.com/apache/kylin/pull/176 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-storage/src/main/java/org/apache/kylin/storage/hybrid/HybridInstance.java b/core-storage/src/main/java/org/apache/kylin/storage/hybrid/HybridInstance.java index 9fbb7f3fbe..286af5f360 100644 --- a/core-storage/src/main/java/org/apache/kylin/storage/hybrid/HybridInstance.java +++ b/core-storage/src/main/java/org/apache/kylin/storage/hybrid/HybridInstance.java @@ -108,7 +108,7 @@ private void init() { return; if (realizationEntries == null || realizationEntries.size() == 0) -throw new IllegalArgumentException(); +return; RealizationRegistry registry = RealizationRegistry.getInstance(config); List realizationList = Lists.newArrayList(); @@ -301,7 +301,7 @@ public boolean supportsLimitPushDown() { public IRealization[] getRealizations() { init(); -return realizations; +return realizations == null ? new IRealization[0] : realizations; } public String getResourcePath() { diff --git a/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java b/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java index 72ae1ce270..1c8a46acb9 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java +++ b/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java @@ -65,6 +65,8 @@ private static final Option OPTION_CUBES = OptionBuilder.withArgName("cubes").hasArg().isRequired(false).withDescription("the cubes used in HybridCube, seperated by comma, empty if to delete HybridCube").create("cubes"); +private static final Option OPTION_CHECK = OptionBuilder.withArgName("check").hasArg().isRequired(false).withDescription("whether to check cube size, default true.").create("check"); + private final Options options; private KylinConfig kylinConfig; @@ -80,6 +82,7 @@ public HybridCubeCLI() { options.addOption(OPTION_PROJECT); options.addOption(OPTION_MODEL); options.addOption(OPTION_CUBES); +options.addOption(OPTION_CHECK); this.kylinConfig = KylinConfig.getInstanceFromEnv(); this.store = ResourceStore.getStore(kylinConfig); @@ -105,6 +108,8 @@ protected void execute(OptionsHelper optionsHelper) throws Exception { String projectName = optionsHelper.getOptionValue(OPTION_PROJECT); String modelName = optionsHelper.getOptionValue(OPTION_MODEL); String cubeNamesStr = optionsHelper.getOptionValue(OPTION_CUBES); +boolean checkCubeSize = optionsHelper.hasOption(OPTION_CHECK) ? Boolean.valueOf(optionsHelper.getOptionValue(OPTION_CHECK)) : true; + String[] cubeNames = new String[] {}; if (cubeNamesStr != null) cubeNames = cubeNamesStr.split(","); @@ -141,7 +146,7 @@ protected void execute(OptionsHelper optionsHelper) throws Exception { throw new RuntimeException("The Hybrid Cube doesn't exist, could not update: " + hybridName); } // Update the Hybrid -update(hybridInstance, realizationEntries, projectName, owner); +update(hybridInstance, realizationEntries, projectName, owner, checkCubeSize); } else if ("delete".equals(action)) { if (hybridInstance == null) { throw new RuntimeException("The Hybrid Cube doesn't exist, could not delete: " + hybridName); @@ -162,8 +167,9 @@ private HybridInstance create(String hybridName, List realizat return hybridInstance; } -private void update(HybridInstance hybridInstance, List realizationEntries, String projectName, String owner) throws IOException { -checkSegmentOffset(realizationEntries); +private void update(HybridInstance hybridInstance, List realizationEntries, String projectName, String owner, boolean checkCubeSize) throws IOException { +if (checkCubeSize) +checkSegmentOffset(realizationEntries); hybridInstance.setRealizationEntries(realizationEntries); store.putResource(hybridInstance.getResourcePath(), hybridInstance, HybridManager.HYBRID_SERIALIZER); ProjectManager.getInstance(kylinConfig).moveRealizationToProject(RealizationType.HYBRID, hybridInstance.getName(), projectName, owner); diff
[jira] [Commented] (KYLIN-3259) When a cube is deleted, remove it from the hybrid cube definition
[ https://issues.apache.org/jira/browse/KYLIN-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16556764#comment-16556764 ] ASF subversion and git services commented on KYLIN-3259: Commit f27a92b648b891ac682c5527cfb4cd0266a33863 in kylin's branch refs/heads/master from chao long [ https://gitbox.apache.org/repos/asf?p=kylin.git;h=f27a92b ] KYLIN-3259 when delete cube, remove it from hybrid > When a cube is deleted, remove it from the hybrid cube definition > - > > Key: KYLIN-3259 > URL: https://issues.apache.org/jira/browse/KYLIN-3259 > Project: Kylin > Issue Type: Improvement > Components: Metadata >Affects Versions: v2.2.0 > Environment: HDP 2.5.6, Kylin 2.2 >Reporter: Vsevolod Ostapenko >Assignee: Kaige Liu >Priority: Major > Fix For: v2.5.0 > > > When a cube is deleted, its references are not automatically removed from > existing hybrid cube definition. That can lead to errors down the road, if > user (or application) retrieves the list of cubes via REST API call and later > tries to update the hybrid cube. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KYLIN-3259) When a cube is deleted, remove it from the hybrid cube definition
[ https://issues.apache.org/jira/browse/KYLIN-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16555845#comment-16555845 ] ASF GitHub Bot commented on KYLIN-3259: --- codecov-io commented on issue #176: KYLIN-3259 when delete cube, remove it from hybrid URL: https://github.com/apache/kylin/pull/176#issuecomment-407798828 # [Codecov](https://codecov.io/gh/apache/kylin/pull/176?src=pr=h1) Report > Merging [#176](https://codecov.io/gh/apache/kylin/pull/176?src=pr=desc) into [master](https://codecov.io/gh/apache/kylin/commit/c9d9b2ed3e2f1c0fe9bf6c94ad87ed2a80758a18?src=pr=desc) will **decrease** coverage by `0.03%`. > The diff coverage is `0%`. [![Impacted file tree graph](https://codecov.io/gh/apache/kylin/pull/176/graphs/tree.svg?token=JawVgbgsVo=650=150=pr)](https://codecov.io/gh/apache/kylin/pull/176?src=pr=tree) ```diff @@ Coverage Diff @@ ## master #176 +/- ## - Coverage 22.49% 22.45% -0.04% + Complexity 4238 4237 -1 Files 1050 1050 Lines 6274362785 +42 Branches 8962 8970 +8 - Hits 1411114100 -11 - Misses4728247330 +48 - Partials 1350 1355 +5 ``` | [Impacted Files](https://codecov.io/gh/apache/kylin/pull/176?src=pr=tree) | Coverage Δ | Complexity Δ | | |---|---|---|---| | [.../java/org/apache/kylin/rest/job/HybridCubeCLI.java](https://codecov.io/gh/apache/kylin/pull/176/diff?src=pr=tree#diff-c2VydmVyLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL3Jlc3Qvam9iL0h5YnJpZEN1YmVDTEkuamF2YQ==) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: | | [...a/org/apache/kylin/rest/service/HybridService.java](https://codecov.io/gh/apache/kylin/pull/176/diff?src=pr=tree#diff-c2VydmVyLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL3Jlc3Qvc2VydmljZS9IeWJyaWRTZXJ2aWNlLmphdmE=) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: | | [...ava/org/apache/kylin/rest/service/CubeService.java](https://codecov.io/gh/apache/kylin/pull/176/diff?src=pr=tree#diff-c2VydmVyLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL3Jlc3Qvc2VydmljZS9DdWJlU2VydmljZS5qYXZh) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: | | [...rg/apache/kylin/storage/hybrid/HybridInstance.java](https://codecov.io/gh/apache/kylin/pull/176/diff?src=pr=tree#diff-Y29yZS1zdG9yYWdlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9zdG9yYWdlL2h5YnJpZC9IeWJyaWRJbnN0YW5jZS5qYXZh) | `39.37% <0%> (-0.79%)` | `13 <0> (ø)` | | | [...org/apache/kylin/rest/util/QueryRequestLimits.java](https://codecov.io/gh/apache/kylin/pull/176/diff?src=pr=tree#diff-c2VydmVyLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL3Jlc3QvdXRpbC9RdWVyeVJlcXVlc3RMaW1pdHMuamF2YQ==) | `35.71% <0%> (-4.77%)` | `5% <0%> (-1%)` | | | [...rg/apache/kylin/cube/inmemcubing/MemDiskStore.java](https://codecov.io/gh/apache/kylin/pull/176/diff?src=pr=tree#diff-Y29yZS1jdWJlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9jdWJlL2lubWVtY3ViaW5nL01lbURpc2tTdG9yZS5qYXZh) | `66.56% <0%> (-3.65%)` | `7% <0%> (ø)` | | | [...lin/dict/lookup/cache/RocksDBLookupTableCache.java](https://codecov.io/gh/apache/kylin/pull/176/diff?src=pr=tree#diff-Y29yZS1kaWN0aW9uYXJ5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9kaWN0L2xvb2t1cC9jYWNoZS9Sb2Nrc0RCTG9va3VwVGFibGVDYWNoZS5qYXZh) | `76.68% <0%> (+0.51%)` | `27% <0%> (ø)` | :arrow_down: | | [.../apache/kylin/cube/cuboid/TreeCuboidScheduler.java](https://codecov.io/gh/apache/kylin/pull/176/diff?src=pr=tree#diff-Y29yZS1jdWJlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9jdWJlL2N1Ym9pZC9UcmVlQ3Vib2lkU2NoZWR1bGVyLmphdmE=) | `66.15% <0%> (+2.3%)` | `0% <0%> (ø)` | :arrow_down: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/kylin/pull/176?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/kylin/pull/176?src=pr=footer). Last update [c9d9b2e...44b8055](https://codecov.io/gh/apache/kylin/pull/176?src=pr=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). 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: us...@infra.apache.org > When a cube is deleted, remove it from the hybrid cube definition > - > >
[jira] [Commented] (KYLIN-3259) When a cube is deleted, remove it from the hybrid cube definition
[ https://issues.apache.org/jira/browse/KYLIN-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16555819#comment-16555819 ] ASF GitHub Bot commented on KYLIN-3259: --- Wayne1c opened a new pull request #176: KYLIN-3259 when delete cube, remove it from hybrid URL: https://github.com/apache/kylin/pull/176 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: us...@infra.apache.org > When a cube is deleted, remove it from the hybrid cube definition > - > > Key: KYLIN-3259 > URL: https://issues.apache.org/jira/browse/KYLIN-3259 > Project: Kylin > Issue Type: Improvement > Components: Metadata >Affects Versions: v2.2.0 > Environment: HDP 2.5.6, Kylin 2.2 >Reporter: Vsevolod Ostapenko >Assignee: Kaige Liu >Priority: Major > Fix For: v2.5.0 > > > When a cube is deleted, its references are not automatically removed from > existing hybrid cube definition. That can lead to errors down the road, if > user (or application) retrieves the list of cubes via REST API call and later > tries to update the hybrid cube. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KYLIN-3259) When a cube is deleted, remove it from the hybrid cube definition
[ https://issues.apache.org/jira/browse/KYLIN-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16555820#comment-16555820 ] ASF GitHub Bot commented on KYLIN-3259: --- asfgit commented on issue #176: KYLIN-3259 when delete cube, remove it from hybrid URL: https://github.com/apache/kylin/pull/176#issuecomment-407790746 Can one of the admins verify this patch? 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: us...@infra.apache.org > When a cube is deleted, remove it from the hybrid cube definition > - > > Key: KYLIN-3259 > URL: https://issues.apache.org/jira/browse/KYLIN-3259 > Project: Kylin > Issue Type: Improvement > Components: Metadata >Affects Versions: v2.2.0 > Environment: HDP 2.5.6, Kylin 2.2 >Reporter: Vsevolod Ostapenko >Assignee: Kaige Liu >Priority: Major > Fix For: v2.5.0 > > > When a cube is deleted, its references are not automatically removed from > existing hybrid cube definition. That can lead to errors down the road, if > user (or application) retrieves the list of cubes via REST API call and later > tries to update the hybrid cube. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KYLIN-3259) When a cube is deleted, remove it from the hybrid cube definition
[ https://issues.apache.org/jira/browse/KYLIN-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16554113#comment-16554113 ] Chao Long commented on KYLIN-3259: -- Hi [~liukaige], are you working on this? I would like to contribute a patch.:) > When a cube is deleted, remove it from the hybrid cube definition > - > > Key: KYLIN-3259 > URL: https://issues.apache.org/jira/browse/KYLIN-3259 > Project: Kylin > Issue Type: Improvement > Components: Metadata >Affects Versions: v2.2.0 > Environment: HDP 2.5.6, Kylin 2.2 >Reporter: Vsevolod Ostapenko >Assignee: Kaige Liu >Priority: Major > Fix For: v2.5.0 > > > When a cube is deleted, its references are not automatically removed from > existing hybrid cube definition. That can lead to errors down the road, if > user (or application) retrieves the list of cubes via REST API call and later > tries to update the hybrid cube. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (KYLIN-3259) When a cube is deleted, remove it from the hybrid cube definition
[ https://issues.apache.org/jira/browse/KYLIN-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16368215#comment-16368215 ] Billy Liu commented on KYLIN-3259: -- Nice found. > When a cube is deleted, remove it from the hybrid cube definition > - > > Key: KYLIN-3259 > URL: https://issues.apache.org/jira/browse/KYLIN-3259 > Project: Kylin > Issue Type: Improvement > Components: Metadata >Affects Versions: v2.2.0 > Environment: HDP 2.5.6, Kylin 2.2 >Reporter: Vsevolod Ostapenko >Priority: Major > > When a cube is deleted, its references are not automatically removed from > existing hybrid cube definition. That can lead to errors down the road, if > user (or application) retrieves the list of cubes via REST API call and later > tries to update the hybrid cube. -- This message was sent by Atlassian JIRA (v7.6.3#76005)