本文整理汇总了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;
}
}
示例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);
}
}
}
}