org.apache.kylin.metadata.project.ProjectStatusEnum Java Examples

The following examples show how to use org.apache.kylin.metadata.project.ProjectStatusEnum. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProjectInstance.java    From Kylin with Apache License 2.0 6 votes vote down vote up
public static ProjectInstance create(String name, String owner, String description, List<String> cubes) {
    ProjectInstance projectInstance = new ProjectInstance();

    projectInstance.updateRandomUuid();
    projectInstance.setName(name);
    projectInstance.setOwner(owner);
    projectInstance.setDescription(description);
    projectInstance.setStatus(ProjectStatusEnum.ENABLED);
    projectInstance.setCreateTime(formatTime(System.currentTimeMillis()));
    if (cubes != null)
        projectInstance.setCubes(cubes);
    else
        projectInstance.setCubes(new ArrayList<String>());

    return projectInstance;
}
 
Example #2
Source File: ProjectCreator.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
public static ProjectInstance generateKylinProjectInstance(String owner, List<TableDesc> kylinTables,
        List<DataModelDesc> kylinModels, List<CubeDesc> kylinCubeDescs) {
    ProjectInstance projectInstance = new ProjectInstance();

    projectInstance.setName(MetricsManager.SYSTEM_PROJECT);
    projectInstance.setOwner(owner);
    projectInstance.setDescription(SYSTEM_PROJECT_DESC);
    projectInstance.setStatus(ProjectStatusEnum.ENABLED);
    projectInstance.setCreateTimeUTC(0L);
    projectInstance.updateRandomUuid();

    if (kylinTables != null)
        projectInstance.setTables(Sets.newHashSet(Lists.transform(kylinTables, new Function<TableDesc, String>() {
            @Nullable
            @Override
            public String apply(@Nullable TableDesc tableDesc) {
                if (tableDesc != null) {
                    return tableDesc.getIdentity();
                }
                return null;
            }
        })));
    else
        projectInstance.setTables(Sets.<String> newHashSet());

    if (kylinModels != null)
        projectInstance.setModels(Lists.transform(kylinModels, new Function<DataModelDesc, String>() {
            @Nullable
            @Override
            public String apply(@Nullable DataModelDesc modelDesc) {
                if (modelDesc != null) {
                    return modelDesc.getName();
                }
                return null;
            }
        }));
    else
        projectInstance.setModels(Lists.<String> newArrayList());

    if (kylinCubeDescs != null)
        projectInstance
                .setRealizationEntries(Lists.transform(kylinCubeDescs, new Function<CubeDesc, RealizationEntry>() {
                    @Nullable
                    @Override
                    public RealizationEntry apply(@Nullable CubeDesc cubeDesc) {
                        if (cubeDesc != null) {
                            RealizationEntry entry = new RealizationEntry();
                            entry.setRealization(cubeDesc.getName());
                            entry.setType(RealizationType.CUBE);
                            return entry;
                        }
                        return null;
                    }
                }));
    else
        projectInstance.setRealizationEntries(Lists.<RealizationEntry> newArrayList());

    return projectInstance;
}
 
Example #3
Source File: ProjectCreator.java    From kylin with Apache License 2.0 4 votes vote down vote up
public static ProjectInstance generateKylinProjectInstance(String owner, List<TableDesc> kylinTables,
        List<DataModelDesc> kylinModels, List<CubeDesc> kylinCubeDescs) {
    ProjectInstance projectInstance = new ProjectInstance();

    projectInstance.setName(MetricsManager.SYSTEM_PROJECT);
    projectInstance.setOwner(owner);
    projectInstance.setDescription(SYSTEM_PROJECT_DESC);
    projectInstance.setStatus(ProjectStatusEnum.ENABLED);
    projectInstance.setCreateTimeUTC(0L);
    projectInstance.updateRandomUuid();

    if (kylinTables != null)
        projectInstance.setTables(Sets.newHashSet(Lists.transform(kylinTables, new Function<TableDesc, String>() {
            @Nullable
            @Override
            public String apply(@Nullable TableDesc tableDesc) {
                if (tableDesc != null) {
                    return tableDesc.getIdentity();
                }
                return null;
            }
        })));
    else
        projectInstance.setTables(Sets.<String> newHashSet());

    if (kylinModels != null)
        projectInstance.setModels(Lists.transform(kylinModels, new Function<DataModelDesc, String>() {
            @Nullable
            @Override
            public String apply(@Nullable DataModelDesc modelDesc) {
                if (modelDesc != null) {
                    return modelDesc.getName();
                }
                return null;
            }
        }));
    else
        projectInstance.setModels(Lists.<String> newArrayList());

    if (kylinCubeDescs != null)
        projectInstance
                .setRealizationEntries(Lists.transform(kylinCubeDescs, new Function<CubeDesc, RealizationEntry>() {
                    @Nullable
                    @Override
                    public RealizationEntry apply(@Nullable CubeDesc cubeDesc) {
                        if (cubeDesc != null) {
                            RealizationEntry entry = new RealizationEntry();
                            entry.setRealization(cubeDesc.getName());
                            entry.setType(RealizationType.CUBE);
                            return entry;
                        }
                        return null;
                    }
                }));
    else
        projectInstance.setRealizationEntries(Lists.<RealizationEntry> newArrayList());

    return projectInstance;
}
 
Example #4
Source File: ProjectInstance.java    From Kylin with Apache License 2.0 4 votes vote down vote up
public ProjectStatusEnum getStatus() {
    return status;
}
 
Example #5
Source File: ProjectInstance.java    From Kylin with Apache License 2.0 4 votes vote down vote up
public void setStatus(ProjectStatusEnum status) {
    this.status = status;
}