kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [06/11] kylin git commit: KYLIN-2921 Refactor DataModelDesc, split DataModelManager
Date Sun, 08 Oct 2017 15:04:20 GMT
http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
index ccc8edc..d56cf6c 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
@@ -36,9 +36,10 @@ import org.apache.kylin.cube.CubeInstance;
 import org.apache.kylin.cube.CubeManager;
 import org.apache.kylin.cube.CubeSegment;
 import org.apache.kylin.cube.model.CubeDesc;
-import org.apache.kylin.metadata.MetadataManager;
+import org.apache.kylin.metadata.TableMetadataManager;
 import org.apache.kylin.metadata.cachesync.Broadcaster;
 import org.apache.kylin.metadata.model.DataModelDesc;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.apache.kylin.metadata.model.JoinTableDesc;
 import org.apache.kylin.metadata.model.SegmentRange.TSRange;
 import org.apache.kylin.metadata.model.TableDesc;
@@ -182,8 +183,8 @@ public class CacheServiceTest extends LocalFileMetadataTestCase {
         return CubeDescManager.getInstance(config);
     }
 
-    private static MetadataManager getMetadataManager(KylinConfig config) throws Exception
{
-        return MetadataManager.getInstance(config);
+    private static DataModelManager getMetadataManager(KylinConfig config) throws Exception
{
+        return DataModelManager.getInstance(config);
     }
 
     @Test
@@ -300,42 +301,44 @@ public class CacheServiceTest extends LocalFileMetadataTestCase {
 
     @Test
     public void testMetaCRUD() throws Exception {
-        final MetadataManager metadataManager = MetadataManager.getInstance(configA);
-        final MetadataManager metadataManagerB = MetadataManager.getInstance(configB);
+        final TableMetadataManager tableMgr = TableMetadataManager.getInstance(configA);
+        final TableMetadataManager tableMgrB = TableMetadataManager.getInstance(configB);
+        final DataModelManager modelMgr = DataModelManager.getInstance(configA);
+        final DataModelManager modelMgrB = DataModelManager.getInstance(configB);
         final Broadcaster broadcaster = Broadcaster.getInstance(configA);
         broadcaster.getCounterAndClear();
 
         TableDesc tableDesc = createTestTableDesc();
-        assertTrue(metadataManager.getTableDesc(tableDesc.getIdentity(), "default") == null);
-        assertTrue(metadataManagerB.getTableDesc(tableDesc.getIdentity(), "default") == null);
-        metadataManager.saveSourceTable(tableDesc, "default");
+        assertTrue(tableMgr.getTableDesc(tableDesc.getIdentity(), "default") == null);
+        assertTrue(tableMgrB.getTableDesc(tableDesc.getIdentity(), "default") == null);
+        tableMgr.saveSourceTable(tableDesc, "default");
         //only one for table insert
         assertEquals(1, broadcaster.getCounterAndClear());
         waitForCounterAndClear(1);
-        assertNotNull(metadataManager.getTableDesc(tableDesc.getIdentity(), "default"));
-        assertNotNull(metadataManagerB.getTableDesc(tableDesc.getIdentity(), "default"));
+        assertNotNull(tableMgr.getTableDesc(tableDesc.getIdentity(), "default"));
+        assertNotNull(tableMgrB.getTableDesc(tableDesc.getIdentity(), "default"));
 
         final String dataModelName = "test_data_model";
-        DataModelDesc dataModelDesc = metadataManager.getDataModelDesc("test_kylin_left_join_model_desc");
+        DataModelDesc dataModelDesc = modelMgr.getDataModelDesc("test_kylin_left_join_model_desc");
         dataModelDesc.setName(dataModelName);
         dataModelDesc.setLastModified(0);
-        assertTrue(metadataManager.getDataModelDesc(dataModelName) == null);
-        assertTrue(metadataManagerB.getDataModelDesc(dataModelName) == null);
+        assertTrue(modelMgr.getDataModelDesc(dataModelName) == null);
+        assertTrue(modelMgrB.getDataModelDesc(dataModelName) == null);
 
         dataModelDesc.setName(dataModelName);
-        metadataManager.createDataModelDesc(dataModelDesc, "default", "ADMIN");
+        modelMgr.createDataModelDesc(dataModelDesc, "default", "ADMIN");
         //one for data model creation, one for project meta update
         assertEquals(2, broadcaster.getCounterAndClear());
         waitForCounterAndClear(2);
-        assertEquals(dataModelDesc.getName(), metadataManagerB.getDataModelDesc(dataModelName).getName());
+        assertEquals(dataModelDesc.getName(), modelMgrB.getDataModelDesc(dataModelName).getName());
 
         final JoinTableDesc[] lookups = dataModelDesc.getJoinTables();
         assertTrue(lookups.length > 0);
-        metadataManager.updateDataModelDesc(dataModelDesc);
+        modelMgr.updateDataModelDesc(dataModelDesc);
         //only one for data model update
         assertEquals(1, broadcaster.getCounterAndClear());
         waitForCounterAndClear(1);
-        assertEquals(dataModelDesc.getJoinTables().length, metadataManagerB.getDataModelDesc(dataModelName).getJoinTables().length);
+        assertEquals(dataModelDesc.getJoinTables().length, modelMgrB.getDataModelDesc(dataModelName).getJoinTables().length);
 
     }
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/server/src/test/java/org/apache/kylin/rest/service/CubeServiceTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/service/CubeServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/CubeServiceTest.java
index 769d9d1..6cdd626 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/CubeServiceTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/CubeServiceTest.java
@@ -50,7 +50,7 @@ public class CubeServiceTest extends ServiceTestBase {
     public void testBasics() throws JsonProcessingException, JobException, UnknownHostException,
SQLException {
         Assert.assertNotNull(cubeService.getConfig());
         Assert.assertNotNull(cubeService.getConfig());
-        Assert.assertNotNull(cubeService.getMetadataManager());
+        Assert.assertNotNull(cubeService.getDataModelManager());
         Assert.assertNotNull(QueryConnection.getConnection(ProjectInstance.DEFAULT_PROJECT_NAME));
 
         List<CubeInstance> cubes = cubeService.listAllCubes(null, null, null, true);

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/server/src/test/java/org/apache/kylin/rest/service/JobServiceTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/service/JobServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/JobServiceTest.java
index 44a30f1..65ad7fb 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/JobServiceTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/JobServiceTest.java
@@ -57,7 +57,7 @@ public class JobServiceTest extends ServiceTestBase {
     public void testBasics() throws JobException, IOException, SQLException {
         Assert.assertNotNull(jobService.getConfig());
         Assert.assertNotNull(jobService.getConfig());
-        Assert.assertNotNull(jobService.getMetadataManager());
+        Assert.assertNotNull(jobService.getDataModelManager());
         Assert.assertNotNull(QueryConnection.getConnection(ProjectInstance.DEFAULT_PROJECT_NAME));
         Assert.assertNull(jobService.getJobInstance("job_not_exist"));
         Assert.assertNotNull(jobService.searchJobs(null, null, null, 0, 0, JobTimeFilterEnum.ALL));

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/server/src/test/java/org/apache/kylin/rest/service/ModelServiceTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/service/ModelServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/ModelServiceTest.java
index fb44b6c..760b6e3 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/ModelServiceTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/ModelServiceTest.java
@@ -23,12 +23,10 @@ import java.io.ByteArrayOutputStream;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.lang.reflect.Field;
 import java.util.List;
 
+import org.apache.kylin.common.persistence.Serializer;
 import org.apache.kylin.job.exception.JobException;
-import org.apache.kylin.metadata.MetadataManager;
-import org.apache.kylin.metadata.model.ComputedColumnDesc;
 import org.apache.kylin.metadata.model.DataModelDesc;
 import org.apache.kylin.metadata.model.ModelDimensionDesc;
 import org.junit.Assert;
@@ -49,13 +47,15 @@ public class ModelServiceTest extends ServiceTestBase {
 
     @Test
     public void testSuccessModelUpdate() throws IOException, JobException {
+        Serializer<DataModelDesc> serializer = modelService.getDataModelManager().getDataModelSerializer();
+        
         List<DataModelDesc> dataModelDescs = modelService.listAllModels("ci_inner_join_model",
"default", true);
         Assert.assertTrue(dataModelDescs.size() == 1);
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        MetadataManager.MODELDESC_SERIALIZER.serialize(dataModelDescs.get(0), new DataOutputStream(baos));
+        serializer.serialize(dataModelDescs.get(0), new DataOutputStream(baos));
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-        DataModelDesc deserialize = MetadataManager.MODELDESC_SERIALIZER.deserialize(new
DataInputStream(bais));
+        DataModelDesc deserialize = serializer.deserialize(new DataInputStream(bais));
 
         deserialize.setOwner("somebody");
         DataModelDesc dataModelDesc = modelService.updateModelAndDesc("default", deserialize);
@@ -63,66 +63,6 @@ public class ModelServiceTest extends ServiceTestBase {
     }
 
     @Test
-    public void testSuccessModelUpdateOnComputedColumn()
-            throws IOException, JobException, NoSuchFieldException, IllegalAccessException
{
-
-        List<DataModelDesc> dataModelDescs = modelService.listAllModels("ci_left_join_model",
"default", true);
-        Assert.assertTrue(dataModelDescs.size() == 1);
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        MetadataManager.MODELDESC_SERIALIZER.serialize(dataModelDescs.get(0), new DataOutputStream(baos));
-        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-        DataModelDesc deserialize = MetadataManager.MODELDESC_SERIALIZER.deserialize(new
DataInputStream(bais));
-
-        Field field = ComputedColumnDesc.class.getDeclaredField("comment");
-        field.setAccessible(true);
-        field.set(deserialize.getComputedColumnDescs().get(0), "change on comment is okay");
-        DataModelDesc dataModelDesc = modelService.updateModelAndDesc("default", deserialize);
-    }
-
-    @Test
-    public void testFailureModelUpdateDueToComputedColumnConflict()
-            throws IOException, JobException, NoSuchFieldException, IllegalAccessException
{
-        expectedEx.expect(IllegalArgumentException.class);
-        expectedEx.expectMessage(
-                "Column name for computed column DEFAULT.TEST_KYLIN_FACT.DEAL_AMOUNT is already
used in model ci_inner_join_model, you should apply the same expression ' PRICE * ITEM_COUNT
' here, or use a different column name.");
-
-        List<DataModelDesc> dataModelDescs = modelService.listAllModels("ci_left_join_model",
"default", true);
-        Assert.assertTrue(dataModelDescs.size() == 1);
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        MetadataManager.MODELDESC_SERIALIZER.serialize(dataModelDescs.get(0), new DataOutputStream(baos));
-        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-        DataModelDesc deserialize = MetadataManager.MODELDESC_SERIALIZER.deserialize(new
DataInputStream(bais));
-
-        Field field = ComputedColumnDesc.class.getDeclaredField("expression");
-        field.setAccessible(true);
-        field.set(deserialize.getComputedColumnDescs().get(0), "another expression");
-        DataModelDesc dataModelDesc = modelService.updateModelAndDesc("default", deserialize);
-    }
-
-    @Test
-    public void testFailureModelUpdateDueToComputedColumnConflict2()
-            throws IOException, JobException, NoSuchFieldException, IllegalAccessException
{
-        expectedEx.expect(IllegalArgumentException.class);
-        expectedEx.expectMessage(
-                "There is already a column named cal_dt on table DEFAULT.TEST_KYLIN_FACT,
please change your computed column name");
-
-        List<DataModelDesc> dataModelDescs = modelService.listAllModels("ci_left_join_model",
"default", true);
-        Assert.assertTrue(dataModelDescs.size() == 1);
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        MetadataManager.MODELDESC_SERIALIZER.serialize(dataModelDescs.get(0), new DataOutputStream(baos));
-        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-        DataModelDesc deserialize = MetadataManager.MODELDESC_SERIALIZER.deserialize(new
DataInputStream(bais));
-
-        Field field = ComputedColumnDesc.class.getDeclaredField("columnName");
-        field.setAccessible(true);
-        field.set(deserialize.getComputedColumnDescs().get(0), "cal_dt");
-        DataModelDesc dataModelDesc = modelService.updateModelAndDesc("default", deserialize);
-    }
-
-    @Test
     public void testRevisableModelInCaseOfDeleteMeasure() throws IOException {
         List<DataModelDesc> dataModelDescs = modelService.listAllModels("ci_left_join_model",
"default", true);
         Assert.assertTrue(dataModelDescs.size() == 1);
@@ -136,7 +76,7 @@ public class ModelServiceTest extends ServiceTestBase {
 
         expectedEx.expect(org.apache.kylin.rest.exception.BadRequestException.class);
         expectedEx.expectMessage(
-                "Measure: TEST_KYLIN_FACT.DEAL_AMOUNT can't be removed, It is referred in
Cubes: [ci_left_join_cube]");
+                "Measure: TEST_KYLIN_FACT.ITEM_COUNT can't be removed, It is referred in
Cubes: [ci_left_join_cube]");
         modelService.updateModelToResourceStore(revisableModel, "default");
     }
 
@@ -148,13 +88,14 @@ public class ModelServiceTest extends ServiceTestBase {
         DataModelDesc revisableModel = dataModelDescs.get(0);
 
         List<ModelDimensionDesc> originDims = revisableModel.getDimensions();
-        String[] reviseDims = cutItems(originDims.get(0).getColumns(), 2);
+        String[] reviseDims = cutItems(originDims.get(0).getColumns(), 1);
         originDims.get(0).setColumns(reviseDims);
         revisableModel.setDimensions(originDims);
 
+        // actually the TEST_COUNT_DISTINCT_BITMAP was defined in dimension (not measure)
         expectedEx.expect(org.apache.kylin.rest.exception.BadRequestException.class);
         expectedEx.expectMessage(
-                "Dimension: TEST_KYLIN_FACT.SELLER_ID_AND_COUNTRY_NAME can't be removed,
It is referred in Cubes: [ci_left_join_cube]");
+                "Measure: TEST_KYLIN_FACT.TEST_COUNT_DISTINCT_BITMAP can't be removed, It
is referred in Cubes: [ci_left_join_cube]");
         modelService.updateModelToResourceStore(revisableModel, "default");
     }
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/server/src/test/java/org/apache/kylin/rest/service/QueryServiceTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/service/QueryServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/QueryServiceTest.java
index c980959..884c3c8 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/QueryServiceTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/QueryServiceTest.java
@@ -48,7 +48,7 @@ public class QueryServiceTest extends ServiceTestBase {
     public void testBasics() throws JobException, IOException, SQLException {
         Assert.assertNotNull(queryService.getConfig());
         Assert.assertNotNull(queryService.getConfig());
-        Assert.assertNotNull(queryService.getMetadataManager());
+        Assert.assertNotNull(queryService.getDataModelManager());
         Assert.assertNotNull(QueryConnection.getConnection(ProjectInstance.DEFAULT_PROJECT_NAME));
 
         //        Assert.assertTrue(queryService.getQueries("ADMIN").size() == 0);

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMRInput.java
----------------------------------------------------------------------
diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMRInput.java b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMRInput.java
index 096134c..12916ec 100644
--- a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMRInput.java
+++ b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMRInput.java
@@ -48,7 +48,7 @@ import org.apache.kylin.job.execution.AbstractExecutable;
 import org.apache.kylin.job.execution.DefaultChainedExecutable;
 import org.apache.kylin.job.execution.ExecutableContext;
 import org.apache.kylin.job.execution.ExecuteResult;
-import org.apache.kylin.metadata.MetadataManager;
+import org.apache.kylin.metadata.TableMetadataManager;
 import org.apache.kylin.metadata.model.IJoinedFlatTableDesc;
 import org.apache.kylin.metadata.model.ISegment;
 import org.apache.kylin.metadata.model.JoinTableDesc;
@@ -195,7 +195,7 @@ public class HiveMRInput implements IMRInput {
             step.setName(ExecutableConstants.STEP_NAME_MATERIALIZE_HIVE_VIEW_IN_LOOKUP);
 
             KylinConfig kylinConfig = ((CubeSegment) flatDesc.getSegment()).getConfig();
-            MetadataManager metadataManager = MetadataManager.getInstance(kylinConfig);
+            TableMetadataManager metadataManager = TableMetadataManager.getInstance(kylinConfig);
             final Set<TableDesc> lookupViewsTables = Sets.newHashSet();
 
             String prj = flatDesc.getDataModel().getProject();

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMetadataExplorer.java
----------------------------------------------------------------------
diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMetadataExplorer.java
b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMetadataExplorer.java
index 229a6d7..55e6267 100644
--- a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMetadataExplorer.java
+++ b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMetadataExplorer.java
@@ -25,7 +25,7 @@ import java.util.UUID;
 
 import org.apache.kylin.common.KylinConfig;
 import org.apache.kylin.common.util.Pair;
-import org.apache.kylin.metadata.MetadataManager;
+import org.apache.kylin.metadata.TableMetadataManager;
 import org.apache.kylin.metadata.model.ColumnDesc;
 import org.apache.kylin.metadata.model.TableDesc;
 import org.apache.kylin.metadata.model.TableExtDesc;
@@ -49,7 +49,7 @@ public class HiveMetadataExplorer implements ISourceMetadataExplorer, ISampleDat
     @Override
     public Pair<TableDesc, TableExtDesc> loadTableMetadata(String database, String
tableName, String prj) {
         KylinConfig config = KylinConfig.getInstanceFromEnv();
-        MetadataManager metaMgr = MetadataManager.getInstance(config);
+        TableMetadataManager metaMgr = TableMetadataManager.getInstance(config);
 
         HiveTableMeta hiveTableMeta;
         try {

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/ColumnCardinalityMapper.java
----------------------------------------------------------------------
diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/ColumnCardinalityMapper.java
b/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/ColumnCardinalityMapper.java
index 1cadec4..da44ea5 100644
--- a/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/ColumnCardinalityMapper.java
+++ b/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/ColumnCardinalityMapper.java
@@ -37,7 +37,7 @@ import org.apache.kylin.engine.mr.common.AbstractHadoopJob;
 import org.apache.kylin.engine.mr.common.BatchConstants;
 import org.apache.kylin.measure.BufferedMeasureCodec;
 import org.apache.kylin.measure.hllc.HLLCounter;
-import org.apache.kylin.metadata.MetadataManager;
+import org.apache.kylin.metadata.TableMetadataManager;
 import org.apache.kylin.metadata.model.ColumnDesc;
 import org.apache.kylin.metadata.model.TableDesc;
 
@@ -63,7 +63,7 @@ public class ColumnCardinalityMapper<T> extends KylinMapper<T,
Object, IntWritab
 
         String project = conf.get(BatchConstants.CFG_PROJECT_NAME);
         String tableName = conf.get(BatchConstants.CFG_TABLE_NAME);
-        tableDesc = MetadataManager.getInstance(config).getTableDesc(tableName, project);
+        tableDesc = TableMetadataManager.getInstance(config).getTableDesc(tableName, project);
         tableInputFormat = MRUtil.getTableInputFormat(tableDesc);
     }
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityJob.java
----------------------------------------------------------------------
diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityJob.java
b/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityJob.java
index 5b3435f..3942a68 100644
--- a/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityJob.java
+++ b/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityJob.java
@@ -35,7 +35,7 @@ import org.apache.kylin.engine.mr.MRUtil;
 import org.apache.kylin.engine.mr.common.AbstractHadoopJob;
 import org.apache.kylin.engine.mr.common.BatchConstants;
 import org.apache.kylin.job.engine.JobEngineConfig;
-import org.apache.kylin.metadata.MetadataManager;
+import org.apache.kylin.metadata.TableMetadataManager;
 import org.apache.kylin.metadata.model.TableDesc;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -108,7 +108,7 @@ public class HiveColumnCardinalityJob extends AbstractHadoopJob {
 
         logger.info("Going to submit HiveColumnCardinalityJob for table '" + table + "'");
 
-        TableDesc tableDesc = MetadataManager.getInstance(kylinConfig).getTableDesc(table,
project);
+        TableDesc tableDesc = TableMetadataManager.getInstance(kylinConfig).getTableDesc(table,
project);
         attachTableMetadata(tableDesc, job.getConfiguration());
         int result = waitForCompletion(job);
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityUpdateJob.java
----------------------------------------------------------------------
diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityUpdateJob.java
b/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityUpdateJob.java
index 7058ad8..be7b901 100644
--- a/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityUpdateJob.java
+++ b/source-hive/src/main/java/org/apache/kylin/source/hive/cardinality/HiveColumnCardinalityUpdateJob.java
@@ -39,7 +39,7 @@ import org.apache.hadoop.io.compress.CompressionCodecFactory;
 import org.apache.kylin.common.KylinConfig;
 import org.apache.kylin.common.util.HadoopUtil;
 import org.apache.kylin.engine.mr.common.AbstractHadoopJob;
-import org.apache.kylin.metadata.MetadataManager;
+import org.apache.kylin.metadata.TableMetadataManager;
 import org.apache.kylin.metadata.model.TableExtDesc;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -117,7 +117,7 @@ public class HiveColumnCardinalityUpdateJob extends AbstractHadoopJob
{
         String scardi = cardi.toString();
         if (scardi.length() > 0) {
             scardi = scardi.substring(0, scardi.length() - 1);
-            MetadataManager metaMgr = MetadataManager.getInstance(KylinConfig.getInstanceFromEnv());
+            TableMetadataManager metaMgr = TableMetadataManager.getInstance(KylinConfig.getInstanceFromEnv());
             TableExtDesc tableExt = metaMgr.getTableExt(tableName, prj);
             tableExt.setCardinality(scardi);
             metaMgr.saveTableExt(tableExt, prj);

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseStorage.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseStorage.java
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseStorage.java
index fc6f878..46879b1 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseStorage.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/HBaseStorage.java
@@ -22,9 +22,9 @@ import org.apache.kylin.common.KylinConfig;
 import org.apache.kylin.cube.CubeInstance;
 import org.apache.kylin.engine.mr.IMROutput;
 import org.apache.kylin.engine.mr.IMROutput2;
-import org.apache.kylin.metadata.MetadataManager;
 import org.apache.kylin.metadata.model.DataModelDesc;
 import org.apache.kylin.metadata.model.IStorageAware;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.apache.kylin.metadata.model.PartitionDesc;
 import org.apache.kylin.metadata.model.TblColRef;
 import org.apache.kylin.metadata.realization.IRealization;
@@ -70,7 +70,7 @@ public class HBaseStorage implements IStorage {
 
     private static TblColRef getPartitionCol(IRealization realization) {
         String modelName = realization.getModel().getName();
-        DataModelDesc dataModelDesc = MetadataManager.getInstance(KylinConfig.getInstanceFromEnv()).getDataModelDesc(modelName);
+        DataModelDesc dataModelDesc = DataModelManager.getInstance(KylinConfig.getInstanceFromEnv()).getDataModelDesc(modelName);
         PartitionDesc partitionDesc = dataModelDesc.getPartitionDesc();
         Preconditions.checkArgument(partitionDesc != null, "PartitionDesc for " + realization
+ " is null!");
         TblColRef partitionColRef = partitionDesc.getPartitionDateColumnRef();

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
index ff8c487..7f55895 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/ExtendCubeToHybridCLI.java
@@ -41,10 +41,10 @@ import org.apache.kylin.cube.CubeInstance;
 import org.apache.kylin.cube.CubeManager;
 import org.apache.kylin.cube.CubeSegment;
 import org.apache.kylin.cube.model.CubeDesc;
-import org.apache.kylin.metadata.MetadataManager;
 import org.apache.kylin.metadata.model.DataModelDesc;
 import org.apache.kylin.metadata.model.IEngineAware;
 import org.apache.kylin.metadata.model.IStorageAware;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.apache.kylin.metadata.model.Segments;
 import org.apache.kylin.metadata.project.ProjectInstance;
 import org.apache.kylin.metadata.project.ProjectManager;
@@ -74,7 +74,7 @@ public class ExtendCubeToHybridCLI {
     private KylinConfig kylinConfig;
     private CubeManager cubeManager;
     private CubeDescManager cubeDescManager;
-    private MetadataManager metadataManager;
+    private DataModelManager metadataManager;
     private ResourceStore store;
 
     public ExtendCubeToHybridCLI() {
@@ -82,7 +82,7 @@ public class ExtendCubeToHybridCLI {
         this.store = ResourceStore.getStore(kylinConfig);
         this.cubeManager = CubeManager.getInstance(kylinConfig);
         this.cubeDescManager = CubeDescManager.getInstance(kylinConfig);
-        this.metadataManager = MetadataManager.getInstance(kylinConfig);
+        this.metadataManager = DataModelManager.getInstance(kylinConfig);
     }
 
     public static void main(String[] args) throws Exception {

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/cube/MeasureTypeOnlyAggrInBaseTest.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/cube/MeasureTypeOnlyAggrInBaseTest.java
b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/cube/MeasureTypeOnlyAggrInBaseTest.java
index 7d089ac..befe8a1 100644
--- a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/cube/MeasureTypeOnlyAggrInBaseTest.java
+++ b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/cube/MeasureTypeOnlyAggrInBaseTest.java
@@ -35,9 +35,9 @@ import org.apache.kylin.cube.model.CubeDesc;
 import org.apache.kylin.measure.MeasureAggregator;
 import org.apache.kylin.measure.MeasureIngester;
 import org.apache.kylin.measure.MeasureType;
-import org.apache.kylin.metadata.MetadataManager;
 import org.apache.kylin.metadata.model.FunctionDesc;
 import org.apache.kylin.metadata.model.MeasureDesc;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.apache.kylin.metadata.model.TblColRef;
 import org.junit.After;
 import org.junit.Before;
@@ -65,7 +65,7 @@ public class MeasureTypeOnlyAggrInBaseTest extends LocalFileMetadataTestCase
{
     @Before
     public void setUp() throws Exception {
         this.createTestMetadata();
-        MetadataManager.clearCache();
+        DataModelManager.clearCache();
 
         cube = getTestKylinCubeWithSeller();
         cubeDesc = cube.getDescriptor();

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/steps/RowValueDecoderTest.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/steps/RowValueDecoderTest.java
b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/steps/RowValueDecoderTest.java
index 9b1a00d..5bd5499 100644
--- a/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/steps/RowValueDecoderTest.java
+++ b/storage-hbase/src/test/java/org/apache/kylin/storage/hbase/steps/RowValueDecoderTest.java
@@ -30,9 +30,9 @@ import org.apache.kylin.cube.CubeManager;
 import org.apache.kylin.cube.model.CubeDesc;
 import org.apache.kylin.cube.model.HBaseColumnDesc;
 import org.apache.kylin.measure.BufferedMeasureCodec;
-import org.apache.kylin.metadata.MetadataManager;
 import org.apache.kylin.metadata.model.FunctionDesc;
 import org.apache.kylin.metadata.model.MeasureDesc;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -42,7 +42,7 @@ public class RowValueDecoderTest extends LocalFileMetadataTestCase {
     @Before
     public void setUp() throws Exception {
         this.createTestMetadata();
-        MetadataManager.clearCache();
+        DataModelManager.clearCache();
     }
 
     @After

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
----------------------------------------------------------------------
diff --git a/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java b/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
index 865c0bc..9d8139d 100644
--- a/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
+++ b/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
@@ -39,9 +39,9 @@ import org.apache.kylin.cube.model.CubeDesc;
 import org.apache.kylin.job.dao.ExecutableDao;
 import org.apache.kylin.job.dao.ExecutablePO;
 import org.apache.kylin.job.exception.PersistentException;
-import org.apache.kylin.metadata.MetadataManager;
 import org.apache.kylin.metadata.badquery.BadQueryHistoryManager;
 import org.apache.kylin.metadata.model.DataModelDesc;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.apache.kylin.metadata.model.SegmentStatusEnum;
 import org.apache.kylin.metadata.model.TableDesc;
 import org.apache.kylin.metadata.model.TableExtDesc;
@@ -105,7 +105,7 @@ public class CubeMetaExtractor extends AbstractInfoExtractor {
     private static final Option OPTION_INCLUDE_SEGMENT_DETAILS = OptionBuilder.withArgName("includeSegmentDetails").hasArg().isRequired(false).withDescription("set
this to true if want to extract segment details too, such as dict, tablesnapshot. Default
false").create("includeSegmentDetails");
 
     private KylinConfig kylinConfig;
-    private MetadataManager metadataManager;
+    private DataModelManager metadataManager;
     private ProjectManager projectManager;
     private HybridManager hybridManager;
     private CubeManager cubeManager;
@@ -157,7 +157,7 @@ public class CubeMetaExtractor extends AbstractInfoExtractor {
         engineType = optionsHelper.hasOption(OPTION_ENGINE_TYPE) ? optionsHelper.getOptionValue(OPTION_ENGINE_TYPE)
: null;
 
         kylinConfig = KylinConfig.getInstanceFromEnv();
-        metadataManager = MetadataManager.getInstance(kylinConfig);
+        metadataManager = DataModelManager.getInstance(kylinConfig);
         projectManager = ProjectManager.getInstance(kylinConfig);
         hybridManager = HybridManager.getInstance(kylinConfig);
         cubeManager = CubeManager.getInstance(kylinConfig);

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/tool/src/main/java/org/apache/kylin/tool/CubeMetaIngester.java
----------------------------------------------------------------------
diff --git a/tool/src/main/java/org/apache/kylin/tool/CubeMetaIngester.java b/tool/src/main/java/org/apache/kylin/tool/CubeMetaIngester.java
index 999e703..40f68d0 100644
--- a/tool/src/main/java/org/apache/kylin/tool/CubeMetaIngester.java
+++ b/tool/src/main/java/org/apache/kylin/tool/CubeMetaIngester.java
@@ -35,12 +35,13 @@ import org.apache.kylin.cube.CubeDescManager;
 import org.apache.kylin.cube.CubeInstance;
 import org.apache.kylin.cube.CubeManager;
 import org.apache.kylin.cube.model.CubeDesc;
-import org.apache.kylin.metadata.MetadataManager;
+import org.apache.kylin.metadata.TableMetadataManager;
+import org.apache.kylin.metadata.cachesync.Broadcaster;
 import org.apache.kylin.metadata.model.DataModelDesc;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.apache.kylin.metadata.model.TableDesc;
 import org.apache.kylin.metadata.project.ProjectInstance;
 import org.apache.kylin.metadata.project.ProjectManager;
-import org.apache.kylin.metadata.realization.RealizationRegistry;
 import org.apache.kylin.metadata.realization.RealizationType;
 import org.apache.kylin.storage.hybrid.HybridManager;
 import org.slf4j.Logger;
@@ -72,11 +73,6 @@ public class CubeMetaIngester extends AbstractApplication {
     private static final Option OPTION_OVERWRITE_TABLES = OptionBuilder.withArgName("overwriteTables").hasArg().isRequired(false).withDescription("If
table meta conflicts, overwrite the one in metadata store with the one in srcPath. Use in
caution because it might break existing cubes! Suggest to backup metadata store first").create("overwriteTables");
 
     private KylinConfig kylinConfig;
-    private MetadataManager metadataManager;
-    private ProjectManager projectManager;
-    private CubeManager cubeManager;
-    private CubeDescManager cubeDescManager;
-    private RealizationRegistry realizationRegistry;
 
     Set<String> requiredResources = Sets.newLinkedHashSet();
     private String targetProjectName;
@@ -96,11 +92,6 @@ public class CubeMetaIngester extends AbstractApplication {
     @Override
     protected void execute(OptionsHelper optionsHelper) throws Exception {
         kylinConfig = KylinConfig.getInstanceFromEnv();
-        metadataManager = MetadataManager.getInstance(kylinConfig);
-        projectManager = ProjectManager.getInstance(kylinConfig);
-        cubeManager = CubeManager.getInstance(kylinConfig);
-        cubeDescManager = CubeDescManager.getInstance(kylinConfig);
-        realizationRegistry = RealizationRegistry.getInstance(kylinConfig);
 
         if (optionsHelper.hasOption(OPTION_FORCE_INGEST)) {
             forceIngest = Boolean.valueOf(optionsHelper.getOptionValue(OPTION_FORCE_INGEST));
@@ -135,17 +126,19 @@ public class CubeMetaIngester extends AbstractApplication {
 
     private void injest(File metaRoot) throws IOException {
         KylinConfig srcConfig = KylinConfig.createInstanceFromUri(metaRoot.getAbsolutePath());
-        MetadataManager srcMetadataManager = MetadataManager.getInstance(srcConfig);
+        TableMetadataManager srcMetadataManager = TableMetadataManager.getInstance(srcConfig);
+        DataModelManager srcModelManager = DataModelManager.getInstance(srcConfig);
         HybridManager srcHybridManager = HybridManager.getInstance(srcConfig);
         CubeManager srcCubeManager = CubeManager.getInstance(srcConfig);
         CubeDescManager srcCubeDescManager = CubeDescManager.getInstance(srcConfig);
 
-        checkAndMark(srcMetadataManager, srcHybridManager, srcCubeManager, srcCubeDescManager);
+        checkAndMark(srcMetadataManager, srcModelManager, srcHybridManager, srcCubeManager,
srcCubeDescManager);
         ResourceTool.copy(srcConfig, kylinConfig, Lists.newArrayList(requiredResources));
 
-        //clear the cache
-        metadataManager.reload();
-
+        // clear the cache
+        Broadcaster.getInstance(kylinConfig).notifyClearAll();
+        
+        ProjectManager projectManager = ProjectManager.getInstance(kylinConfig);
         for (TableDesc tableDesc : srcMetadataManager.listAllTables(null)) {
             logger.info("add " + tableDesc + " to " + targetProjectName);
             projectManager.addTableDescToProject(Lists.newArrayList(tableDesc.getIdentity()).toArray(new
String[0]), targetProjectName);
@@ -159,16 +152,18 @@ public class CubeMetaIngester extends AbstractApplication {
 
     }
 
-    private void checkAndMark(MetadataManager srcMetadataManager, HybridManager srcHybridManager,
CubeManager srcCubeManager, CubeDescManager srcCubeDescManager) {
+    private void checkAndMark(TableMetadataManager srcMetadataManager, DataModelManager srcModelManager,
HybridManager srcHybridManager, CubeManager srcCubeManager, CubeDescManager srcCubeDescManager)
{
         if (srcHybridManager.listHybridInstances().size() > 0) {
             throw new IllegalStateException("Does not support ingest hybrid yet");
         }
 
+        ProjectManager projectManager = ProjectManager.getInstance(kylinConfig);
         ProjectInstance targetProject = projectManager.getProject(targetProjectName);
         if (targetProject == null) {
             throw new IllegalStateException("Target project does not exist in target metadata:
" + targetProjectName);
         }
 
+        TableMetadataManager metadataManager = TableMetadataManager.getInstance(kylinConfig);
         for (TableDesc tableDesc : srcMetadataManager.listAllTables(null)) {
             TableDesc existing = metadataManager.getTableDesc(tableDesc.getIdentity(), targetProjectName);
             if (existing != null && !existing.equals(tableDesc)) {
@@ -185,8 +180,9 @@ public class CubeMetaIngester extends AbstractApplication {
             requiredResources.add(tableDesc.getResourcePath());
         }
 
-        for (DataModelDesc dataModelDesc : srcMetadataManager.listDataModels()) {
-            DataModelDesc existing = metadataManager.getDataModelDesc(dataModelDesc.getName());
+        DataModelManager modelManager = DataModelManager.getInstance(kylinConfig);
+        for (DataModelDesc dataModelDesc : srcModelManager.listDataModels()) {
+            DataModelDesc existing = modelManager.getDataModelDesc(dataModelDesc.getName());
             if (existing != null) {
                 if (!forceIngest) {
                     throw new IllegalStateException("Already exist a model called " + dataModelDesc.getName());
@@ -197,6 +193,7 @@ public class CubeMetaIngester extends AbstractApplication {
             requiredResources.add(DataModelDesc.concatResourcePath(dataModelDesc.getName()));
         }
 
+        CubeDescManager cubeDescManager = CubeDescManager.getInstance(kylinConfig);
         for (CubeDesc cubeDesc : srcCubeDescManager.listAllDesc()) {
             CubeDesc existing = cubeDescManager.getCubeDesc(cubeDesc.getName());
             if (existing != null) {
@@ -209,6 +206,7 @@ public class CubeMetaIngester extends AbstractApplication {
             requiredResources.add(CubeDesc.concatResourcePath(cubeDesc.getName()));
         }
 
+        CubeManager cubeManager = CubeManager.getInstance(kylinConfig);
         for (CubeInstance cube : srcCubeManager.listAllCubes()) {
             CubeInstance existing = cubeManager.getCube(cube.getName());
             if (existing != null) {

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/tool/src/main/java/org/apache/kylin/tool/ExtendCubeToHybridCLI.java
----------------------------------------------------------------------
diff --git a/tool/src/main/java/org/apache/kylin/tool/ExtendCubeToHybridCLI.java b/tool/src/main/java/org/apache/kylin/tool/ExtendCubeToHybridCLI.java
index d048dd7..7517c07 100644
--- a/tool/src/main/java/org/apache/kylin/tool/ExtendCubeToHybridCLI.java
+++ b/tool/src/main/java/org/apache/kylin/tool/ExtendCubeToHybridCLI.java
@@ -41,10 +41,10 @@ import org.apache.kylin.cube.CubeInstance;
 import org.apache.kylin.cube.CubeManager;
 import org.apache.kylin.cube.CubeSegment;
 import org.apache.kylin.cube.model.CubeDesc;
-import org.apache.kylin.metadata.MetadataManager;
 import org.apache.kylin.metadata.model.DataModelDesc;
 import org.apache.kylin.metadata.model.IEngineAware;
 import org.apache.kylin.metadata.model.IStorageAware;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.apache.kylin.metadata.model.Segments;
 import org.apache.kylin.metadata.project.ProjectInstance;
 import org.apache.kylin.metadata.project.ProjectManager;
@@ -72,7 +72,7 @@ public class ExtendCubeToHybridCLI {
     private KylinConfig kylinConfig;
     private CubeManager cubeManager;
     private CubeDescManager cubeDescManager;
-    private MetadataManager metadataManager;
+    private DataModelManager metadataManager;
     private ResourceStore store;
 
     public ExtendCubeToHybridCLI() {
@@ -80,7 +80,7 @@ public class ExtendCubeToHybridCLI {
         this.store = ResourceStore.getStore(kylinConfig);
         this.cubeManager = CubeManager.getInstance(kylinConfig);
         this.cubeDescManager = CubeDescManager.getInstance(kylinConfig);
-        this.metadataManager = MetadataManager.getInstance(kylinConfig);
+        this.metadataManager = DataModelManager.getInstance(kylinConfig);
     }
 
     public static void main(String[] args) throws Exception {

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/tool/src/main/java/org/apache/kylin/tool/KylinLogExtractor.java
----------------------------------------------------------------------
diff --git a/tool/src/main/java/org/apache/kylin/tool/KylinLogExtractor.java b/tool/src/main/java/org/apache/kylin/tool/KylinLogExtractor.java
index 6555c4d..1471832 100644
--- a/tool/src/main/java/org/apache/kylin/tool/KylinLogExtractor.java
+++ b/tool/src/main/java/org/apache/kylin/tool/KylinLogExtractor.java
@@ -29,7 +29,7 @@ import org.apache.kylin.common.KylinConfig;
 import org.apache.kylin.common.util.OptionsHelper;
 import org.apache.kylin.cube.CubeDescManager;
 import org.apache.kylin.cube.CubeManager;
-import org.apache.kylin.metadata.MetadataManager;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.apache.kylin.metadata.project.ProjectManager;
 import org.apache.kylin.tool.util.ToolUtil;
 import org.slf4j.Logger;
@@ -64,8 +64,8 @@ public class KylinLogExtractor extends AbstractInfoExtractor {
         CubeManager.getInstance(config);
         CubeDescManager.clearCache();
         CubeDescManager.getInstance(config);
-        MetadataManager.clearCache();
-        MetadataManager.getInstance(config);
+        DataModelManager.clearCache();
+        DataModelManager.getInstance(config);
         ProjectManager.clearCache();
         ProjectManager.getInstance(config);
     }

http://git-wip-us.apache.org/repos/asf/kylin/blob/f45d8133/tool/src/test/java/org/apache/kylin/tool/CubeMetaIngesterTest.java
----------------------------------------------------------------------
diff --git a/tool/src/test/java/org/apache/kylin/tool/CubeMetaIngesterTest.java b/tool/src/test/java/org/apache/kylin/tool/CubeMetaIngesterTest.java
index ff12084..d974009 100644
--- a/tool/src/test/java/org/apache/kylin/tool/CubeMetaIngesterTest.java
+++ b/tool/src/test/java/org/apache/kylin/tool/CubeMetaIngesterTest.java
@@ -25,7 +25,7 @@ import org.apache.kylin.common.util.LocalFileMetadataTestCase;
 import org.apache.kylin.cube.CubeDescManager;
 import org.apache.kylin.cube.CubeInstance;
 import org.apache.kylin.cube.CubeManager;
-import org.apache.kylin.metadata.MetadataManager;
+import org.apache.kylin.metadata.model.DataModelManager;
 import org.apache.kylin.metadata.project.ProjectInstance;
 import org.apache.kylin.metadata.project.ProjectManager;
 import org.apache.kylin.metadata.project.RealizationEntry;
@@ -66,7 +66,7 @@ public class CubeMetaIngesterTest extends LocalFileMetadataTestCase {
         Assert.assertTrue(project.getModels().contains("cloned_model"));
         Assert.assertTrue(project.getRealizationEntries().contains(RealizationEntry.create(RealizationType.CUBE,
"cloned_cube")));
 
-        MetadataManager.clearCache();
+        DataModelManager.clearCache();
         CubeDescManager.clearCache();
         CubeManager.clearCache();
         CubeInstance instance = CubeManager.getInstance(KylinConfig.getInstanceFromEnv()).getCube("cloned_cube");
@@ -83,7 +83,7 @@ public class CubeMetaIngesterTest extends LocalFileMetadataTestCase {
         Assert.assertTrue(project.getModels().contains("benchmark_model"));
         Assert.assertTrue(project.getRealizationEntries().contains(RealizationEntry.create(RealizationType.CUBE,
"benchmark_cube")));
 
-        MetadataManager.clearCache();
+        DataModelManager.clearCache();
         CubeDescManager.clearCache();
         CubeManager.clearCache();
         CubeInstance instance = CubeManager.getInstance(KylinConfig.getInstanceFromEnv()).getCube("benchmark_cube");


Mime
View raw message