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

yangcao edited comment on KYLIN-3165 at 1/16/18 3:53 AM:
---------------------------------------------------------

hi,I've fixed this bug in my native code like this, and it works well. Is there 
anything wrong with this?  !image-2018-01-16-11-48-18-812.png!

 
{code:java}
//class org.apache.kylin.rest.service.CubeService
 private void mergeCubeSegment(String cubeName) {
        CubeInstance cube = getCubeManager().getCube(cubeName);
        if (!cube.needAutoMerge())
            return;

        synchronized (CubeService.class) {
            try {
                cube = getCubeManager().getCube(cubeName);
                SegmentRange offsets = cube.autoMergeCubeSegments();
                if (offsets != null) {
                 //fix auto merge fail 
                // CubeSegment newSeg = getCubeManager().mergeSegments(cube, 
null, offsets, true);
                   TSRange tsRange = new TSRange((Long)offsets.start.v, 
(Long)offsets.end.v);
                    CubeSegment newSeg = getCubeManager().mergeSegments(cube, 
tsRange, null, true);
                    logger.debug("Will submit merge job on " + newSeg);
                    DefaultChainedExecutable job = 
EngineFactory.createBatchMergeJob(newSeg, "SYSTEM");
                    getExecutableManager().addJob(job);
                } else {
                    logger.debug("Not ready for merge on cube " + cubeName);
                }
            } catch (IOException e) {
                logger.error("Failed to auto merge cube " + cubeName, e);
            }
        }
    }


{code}


was (Author: yangcao):
hi,I've fixed this bug in my native code like this, and it works well. Is there 
anything wrong with this? !image-2018-01-16-11-48-18-812.png!

> cannot auto mege 
> -----------------
>
>                 Key: KYLIN-3165
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3165
>             Project: Kylin
>          Issue Type: Bug
>          Components: Job Engine
>    Affects Versions: v2.2.0
>            Reporter: Yang Hao
>            Assignee: Shaofeng SHI
>            Priority: Major
>         Attachments: KYLIN-3165.apache-master.001.patch, 
> image-2018-01-16-11-48-18-812.png
>
>
> The function of auto merge loses efficacy after we upgrade to 2.2.0, related 
> stack is:
> 2018-01-14 11:21:10,965 ERROR [Thread-694] service.CacheService:88 : Error in 
> updateOnNewSegmentReady()
> java.lang.IllegalArgumentException
>  at com.google.common.base.Preconditions.checkArgument(Preconditions.java:76)
>  at org.apache.kylin.cube.CubeManager.mergeSegments(CubeManager.java:547)
>  at 
> org.apache.kylin.rest.service.CubeService.mergeCubeSegment(CubeService.java:646)
>  at 
> org.apache.kylin.rest.service.CubeService.updateOnNewSegmentReady(CubeService.java:594)
>  at 
> org.apache.kylin.rest.service.CubeService$$FastClassBySpringCGLIB$$17a07c0e.invoke(<generated>)
>  at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
>  at 
> org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:669)
>  at 
> org.apache.kylin.rest.service.CubeService$$EnhancerBySpringCGLIB$$eaadc7fa.updateOnNewSegmentReady(<generated>)
>  at org.apache.kylin.rest.service.CacheService$1$1.run(CacheService.java:86)



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

Reply via email to