当前位置: 首页>>代码示例>>Java>>正文


Java ProjectInstance.getTables方法代码示例

本文整理汇总了Java中org.apache.kylin.metadata.project.ProjectInstance.getTables方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectInstance.getTables方法的具体用法?Java ProjectInstance.getTables怎么用?Java ProjectInstance.getTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.kylin.metadata.project.ProjectInstance的用法示例。


在下文中一共展示了ProjectInstance.getTables方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAllTablesMap

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
public Map<String, TableDesc> getAllTablesMap(String prj) {
    // avoid cyclic locks
    ProjectInstance project = (prj == null) ? null : ProjectManager.getInstance(config).getProject(prj);
    
    try (AutoLock lock = srcTableMapLock.lockForWrite()) {
        //TODO prj == null case is now only used by test case and CubeMetaIngester
        //should refactor these test case and tool ASAP and stop supporting null case
        if (prj == null) {
            Map<String, TableDesc> globalTables = new LinkedHashMap<>();

            for (TableDesc t : srcTableMap.values()) {
                globalTables.put(t.getIdentity(), t);
            }
            return globalTables;
        }

        Set<String> prjTableNames = project.getTables();

        Map<String, TableDesc> ret = new LinkedHashMap<>();
        for (String tableName : prjTableNames) {
            String tableIdentity = getTableIdentity(tableName);
            ret.put(tableIdentity, getProjectSpecificTableDesc(tableIdentity, prj));
        }
        return ret;
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:27,代码来源:TableMetadataManager.java

示例2: resetProjectSpecificTableDesc

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
/**
 * the project-specific table desc will be expand by computed columns from the projects' models
 * when the projects' model list changed, project-specific table should be reset and get expanded
 * again
 */
public void resetProjectSpecificTableDesc(String prj) throws IOException {
    // avoid cyclic locks
    ProjectInstance project = ProjectManager.getInstance(config).getProject(prj);
    
    try (AutoLock lock = srcTableMapLock.lockForWrite()) {
        for (String tableName : project.getTables()) {
            String tableIdentity = getTableIdentity(tableName);
            String key = mapKey(tableIdentity, prj);
            TableDesc originTableDesc = srcTableMap.get(key);
            if (originTableDesc == null) {
                continue;
            }

            if (originTableDesc.isBorrowedFromGlobal()) {
                srcTableMap.removeLocal(key);//delete it so that getProjectSpecificTableDesc will create again
            } else {
                srcTableCrud.reload(key);
            }
        }
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:27,代码来源:TableMetadataManager.java


注:本文中的org.apache.kylin.metadata.project.ProjectInstance.getTables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。