kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaofeng...@apache.org
Subject [1/2] kylin git commit: fix a bug in StreamingCubeBuilder.java
Date Fri, 17 Jun 2016 08:33:39 GMT
Repository: kylin
Updated Branches:
  refs/heads/master ad9586454 -> 5f2db8cc1


fix a bug in StreamingCubeBuilder.java

Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/03f40ddd
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/03f40ddd
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/03f40ddd

Branch: refs/heads/master
Commit: 03f40ddd722fc8b2c30d5987c0014ed44e89f81d
Parents: ad95864
Author: shaofengshi <shaofengshi@apache.org>
Authored: Fri Jun 17 16:33:05 2016 +0800
Committer: shaofengshi <shaofengshi@apache.org>
Committed: Fri Jun 17 16:33:05 2016 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/cube/CubeManager.java | 11 +++++++++++
 .../engine/streaming/cube/StreamingCubeBuilder.java      |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/03f40ddd/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
index 8370611..f2d3d09 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
@@ -322,23 +322,34 @@ public class CubeManager implements IRealizationProvider {
             Iterator<CubeSegment> iterator = newSegs.iterator();
             while (iterator.hasNext()) {
                 CubeSegment currentSeg = iterator.next();
+                boolean found = false;
                 for (CubeSegment toRemoveSeg : update.getToRemoveSegs()) {
                     if (currentSeg.getUuid().equals(toRemoveSeg.getUuid())) {
                         iterator.remove();
                         toRemoveResources.add(toRemoveSeg.getStatisticsResourcePath());
+                        found = true;
                     }
                 }
+                if (found == false) {
+                    logger.error("Segment '" + currentSeg.getName() + "' doesn't exist for
remove.");
+                }
             }
 
         }
 
         if (update.getToUpdateSegs() != null) {
             for (CubeSegment segment : update.getToUpdateSegs()) {
+                boolean found = false;
                 for (int i = 0; i < newSegs.size(); i++) {
                     if (newSegs.get(i).getUuid().equals(segment.getUuid())) {
                         newSegs.set(i, segment);
+                        found = true;
+                        break;
                     }
                 }
+                if (found == false) {
+                    logger.error("Segment '" + segment.getName() + "' doesn't exist for update.");
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/03f40ddd/engine-streaming/src/main/java/org/apache/kylin/engine/streaming/cube/StreamingCubeBuilder.java
----------------------------------------------------------------------
diff --git a/engine-streaming/src/main/java/org/apache/kylin/engine/streaming/cube/StreamingCubeBuilder.java
b/engine-streaming/src/main/java/org/apache/kylin/engine/streaming/cube/StreamingCubeBuilder.java
index b4790e6..3296b24 100644
--- a/engine-streaming/src/main/java/org/apache/kylin/engine/streaming/cube/StreamingCubeBuilder.java
+++ b/engine-streaming/src/main/java/org/apache/kylin/engine/streaming/cube/StreamingCubeBuilder.java
@@ -172,7 +172,7 @@ public class StreamingCubeBuilder implements StreamingBatchBuilder {
         cubeSegment.setStatus(SegmentStatusEnum.READY);
         cubeSegment.setInputRecords(processedRowCount);
         CubeUpdate cubeBuilder = new CubeUpdate(cubeSegment.getCubeInstance());
-        cubeBuilder.setToUpdateSegs(cubeSegment);
+        cubeBuilder.setToAddSegs(cubeSegment);
         try {
             CubeManager.getInstance(KylinConfig.getInstanceFromEnv()).updateCube(cubeBuilder);
         } catch (IOException e) {


Mime
View raw message