@Test public void testGetInstance() throws Exception { Assert.assertNotNull(MetadataManager.getInstance(getTestConfig())); Assert.assertNotNull(MetadataManager.getInstance(getTestConfig()).listAllTables()); Assert.assertTrue(MetadataManager.getInstance(getTestConfig()).listAllTables().size() > 0); }
public static MetadataManager getInstance(KylinConfig config) { MetadataManager r = CACHE.get(config); if (r != null) { return r; } synchronized (MetadataManager.class) { r = CACHE.get(config); if (r != null) { return r; } try { r = new MetadataManager(config); CACHE.put(config, r); if (CACHE.size() > 1) { logger.warn("More than one singleton exist"); } return r; } catch (IOException e) { throw new IllegalStateException("Failed to init MetadataManager from " + config, e); } } }
MetadataManager { public static MetadataManager getInstance(KylinConfig config) { MetadataManager r = CACHE.get(config); if (r != null) { return r; } synchronized (MetadataManager.class) { r = CACHE.get(config); if (r != null) { return r; } try { r = new MetadataManager(config); CACHE.put(config, r); if (CACHE.size() > 1) { logger.warn("More than one singleton exist"); } return r; } catch (IOException e) { throw new IllegalStateException("Failed to init MetadataManager from " + config, e); } } } }
MetadataManager { public static MetadataManager getInstance(KylinConfig config) { MetadataManager r = CACHE.get(config); if (r != null) { return r; } synchronized (MetadataManager.class) { r = CACHE.get(config); if (r != null) { return r; } try { r = new MetadataManager(config); CACHE.put(config, r); if (CACHE.size() > 1) { logger.warn("More than one singleton exist"); } return r; } catch (IOException e) { throw new IllegalStateException("Failed to init MetadataManager from " + config, e); } } } private  MetadataManager(KylinConfig config); }
MetadataManager { public static MetadataManager getInstance(KylinConfig config) { MetadataManager r = CACHE.get(config); if (r != null) { return r; } synchronized (MetadataManager.class) { r = CACHE.get(config); if (r != null) { return r; } try { r = new MetadataManager(config); CACHE.put(config, r); if (CACHE.size() > 1) { logger.warn("More than one singleton exist"); } return r; } catch (IOException e) { throw new IllegalStateException("Failed to init MetadataManager from " + config, e); } } } private  MetadataManager(KylinConfig config); static MetadataManager getInstance(KylinConfig config); static void clearCache(); void reload(); KylinConfig getConfig(); ResourceStore getStore(); List<TableDesc> listAllTables(); Map<String, TableDesc> getAllTablesMap(); Map<String, Map<String, String>> listAllTableExdMap(); TableDesc getTableDesc(String tableName); Map<String, String> getTableDescExd(String tableName); void saveSourceTable(TableDesc srcTable); void reloadSourceTableExt(String tableIdentity); void reloadSourceTable(String tableIdentity); void reloadTableCache(String tableIdentity); DataModelDesc getDataModelDesc(String name); DataModelDesc reloadDataModelDesc(String name); DataModelDesc createDataModelDesc(DataModelDesc dataModelDesc); DataModelDesc updateDataModelDesc(DataModelDesc desc); void saveTableExd(String tableId, Map<String, String> tableExdProperties); String appendDBName(String table); }
MetadataManager { public static MetadataManager getInstance(KylinConfig config) { MetadataManager r = CACHE.get(config); if (r != null) { return r; } synchronized (MetadataManager.class) { r = CACHE.get(config); if (r != null) { return r; } try { r = new MetadataManager(config); CACHE.put(config, r); if (CACHE.size() > 1) { logger.warn("More than one singleton exist"); } return r; } catch (IOException e) { throw new IllegalStateException("Failed to init MetadataManager from " + config, e); } } } private  MetadataManager(KylinConfig config); static MetadataManager getInstance(KylinConfig config); static void clearCache(); void reload(); KylinConfig getConfig(); ResourceStore getStore(); List<TableDesc> listAllTables(); Map<String, TableDesc> getAllTablesMap(); Map<String, Map<String, String>> listAllTableExdMap(); TableDesc getTableDesc(String tableName); Map<String, String> getTableDescExd(String tableName); void saveSourceTable(TableDesc srcTable); void reloadSourceTableExt(String tableIdentity); void reloadSourceTable(String tableIdentity); void reloadTableCache(String tableIdentity); DataModelDesc getDataModelDesc(String name); DataModelDesc reloadDataModelDesc(String name); DataModelDesc createDataModelDesc(DataModelDesc dataModelDesc); DataModelDesc updateDataModelDesc(DataModelDesc desc); void saveTableExd(String tableId, Map<String, String> tableExdProperties); String appendDBName(String table); static final Serializer<TableDesc> TABLE_SERIALIZER; static final Serializer<DataModelDesc> MODELDESC_SERIALIZER; }