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