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


Java ProjectInstance.getRealizationEntries方法代码示例

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


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

示例1: filterByProjects

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
private static List<String> filterByProjects(List<String> allTableNames, List<String> projectNames) {
    ProjectManager projectManager = ProjectManager.getInstance(KylinConfig.getInstanceFromEnv());
    CubeManager cubeManager = CubeManager.getInstance(KylinConfig.getInstanceFromEnv());

    List<String> result = Lists.newArrayList();
    for (String p : projectNames) {
        p = p.trim();
        if (p.endsWith(",")) {
            p = p.substring(0, p.length() - 1);
        }

        ProjectInstance projectInstance = projectManager.getProject(p);
        List<RealizationEntry> cubeList = projectInstance.getRealizationEntries(RealizationType.CUBE);
        for (RealizationEntry cube : cubeList) {
            CubeInstance cubeInstance = cubeManager.getCube(cube.getRealization());
            for (CubeSegment segment : cubeInstance.getSegments()) {
                String tableName = segment.getStorageLocationIdentifier();
                if (allTableNames.contains(tableName)) {
                    result.add(tableName);
                }
            }
        }
    }
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:26,代码来源:DeployCoprocessorCLI.java

示例2: listAllCubes

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
public List<CubeInstance> listAllCubes(String projectName) {
    ProjectManager projectManager = getProjectManager();
    ProjectInstance project = projectManager.getProject(projectName);
    if (project == null) {
        return Collections.emptyList();
    }
    ArrayList<CubeInstance> result = new ArrayList<CubeInstance>();
    for (RealizationEntry projectDataModel : project.getRealizationEntries()) {
        if (projectDataModel.getType() == RealizationType.CUBE) {
            CubeInstance cube = getCubeManager().getCube(projectDataModel.getRealization());
            if (cube != null)
                result.add(cube);
            else
                logger.error("Cube instance " + projectDataModel.getRealization() + " is failed to load");
        }
    }
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:19,代码来源:CubeService.java

示例3: isCubeInProject

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
protected boolean isCubeInProject(String projectName, CubeInstance target) {
    ProjectManager projectManager = getProjectManager();
    ProjectInstance project = projectManager.getProject(projectName);
    if (project == null) {
        return false;
    }
    for (RealizationEntry projectDataModel : project.getRealizationEntries()) {
        if (projectDataModel.getType() == RealizationType.CUBE) {
            CubeInstance cube = getCubeManager().getCube(projectDataModel.getRealization());
            if (cube == null) {
                logger.error("Project " + projectName + " contains realization " + projectDataModel.getRealization()
                        + " which is not found by CubeManager");
                continue;
            }
            if (cube.equals(target)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:apache,项目名称:kylin,代码行数:22,代码来源:CubeService.java

示例4: executeExtract

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
@Override
protected void executeExtract(OptionsHelper optionsHelper, File exportDir) throws Exception {
    kylinConfig = KylinConfig.getInstanceFromEnv();
    cubeManager = CubeManager.getInstance(kylinConfig);
    realizationRegistry = RealizationRegistry.getInstance(kylinConfig);
    projectManager = ProjectManager.getInstance(kylinConfig);

    if (optionsHelper.hasOption(OPTION_PROJECT)) {
        String projectNames = optionsHelper.getOptionValue(OPTION_PROJECT);
        for (String projectName: projectNames.split(",")) {
            ProjectInstance projectInstance = projectManager.getProject(projectName);
            if (projectInstance == null) {
                throw new IllegalArgumentException("Project " + projectName + " does not exist");
            }
            List<RealizationEntry> realizationEntries = projectInstance.getRealizationEntries();
            for (RealizationEntry realizationEntry : realizationEntries) {
                retrieveResourcePath(getRealization(realizationEntry));
            }
        }
    } else if (optionsHelper.hasOption(OPTION_CUBE)) {
        String cubeNames = optionsHelper.getOptionValue(OPTION_CUBE);
        for (String cubeName : cubeNames.split(",")) {
            IRealization realization = cubeManager.getRealization(cubeName);
            if (realization != null) {
                retrieveResourcePath(realization);
            } else {
                throw new IllegalArgumentException("No cube found with name of " + cubeName);
            }
        }
    }

    extractCommonInfo(exportDir);
    extractHTables(exportDir);
}
 
开发者ID:apache,项目名称:kylin,代码行数:35,代码来源:HBaseUsageExtractor.java

示例5: requireProject

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
private void requireProject(ProjectInstance projectInstance) throws IOException {
    addRequired(projectInstance.getResourcePath());
    List<RealizationEntry> realizationEntries = projectInstance.getRealizationEntries();
    for (RealizationEntry realizationEntry : realizationEntries) {
        retrieveResourcePath(getRealization(realizationEntry));
    }
    List<DataModelDesc> modelDescs = metadataManager.getModels(projectInstance.getName());
    for (DataModelDesc modelDesc : modelDescs) {
        addRequired(DataModelDesc.concatResourcePath(modelDesc.getName()));
    }
    addOptional(badQueryHistoryManager.getBadQueriesForProject(projectInstance.getName()).getResourcePath());
}
 
开发者ID:apache,项目名称:kylin,代码行数:13,代码来源:CubeMetaExtractor.java


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