Qsimple commented on a change in pull request #629: KYLIN-3983 Add extra 
metadata for measure. Add test case and example/…
URL: https://github.com/apache/kylin/pull/629#discussion_r283127561
 
 

 ##########
 File path: core-cube/src/main/java/org/apache/kylin/measure/MeasureManager.java
 ##########
 @@ -0,0 +1,698 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kylin.measure;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import org.apache.kylin.common.KylinConfig;
+import org.apache.kylin.common.persistence.JsonSerializer;
+import org.apache.kylin.common.persistence.ResourceStore;
+import org.apache.kylin.common.persistence.Serializer;
+import org.apache.kylin.common.util.AutoReadWriteLock;
+import org.apache.kylin.cube.CubeInstance;
+import org.apache.kylin.cube.CubeManager;
+import org.apache.kylin.cube.CubeUpdate;
+import org.apache.kylin.cube.model.CubeDesc;
+import org.apache.kylin.metadata.MetadataConstants;
+import org.apache.kylin.metadata.cachesync.Broadcaster;
+import org.apache.kylin.metadata.cachesync.CachedCrudAssist;
+import org.apache.kylin.metadata.cachesync.CaseInsensitiveStringCache;
+import org.apache.kylin.metadata.model.ISegment;
+import org.apache.kylin.metadata.model.MeasureDesc;
+import org.apache.kylin.metadata.model.SegmentStatusEnum;
+import org.apache.kylin.metadata.project.ProjectInstance;
+import org.apache.kylin.metadata.project.ProjectManager;
+import org.apache.kylin.metadata.project.RealizationEntry;
+import org.apache.kylin.metadata.realization.RealizationType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import static org.apache.kylin.common.util.AutoReadWriteLock.AutoLock;
+import static org.apache.kylin.metadata.cachesync.Broadcaster.Event.CREATE;
+import static org.apache.kylin.metadata.cachesync.Broadcaster.Event.DROP;
+import static org.apache.kylin.metadata.cachesync.Broadcaster.Event.UPDATE;
+
+public class MeasureManager {
+
+    public static final Serializer<MeasureInstance> MEASURE_SERIALIZER = new 
JsonSerializer<>(MeasureInstance.class);
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(MeasureManager.class);
+    public static final String MEASURE = "measure";
+    public static final String CUBE = "cube";
+    public static final String CUBE_DESC = "cube_desc";
+    public static final String CUBE_MEASURE = "cube_measure";
 
 Review comment:
   Yes,cube_measure means the Measure Instances on same  cube have been updated 
and needed to be reloaded. The most methods in MeasureManager will batch 
process on  Measure instances on same cube and will publish an cube_measure 
entitie's events with cube's name. MeasureManager can also modify single 
Measure instance and trigger a 'measure' event,  which is seldomly called. I ll 
remove cube and cube_dese which doesn't matter any more

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


With regards,
Apache Git Services

Reply via email to