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


Java ExecutablePO.getType方法代码示例

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


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

示例1: parseTo

import org.apache.kylin.job.dao.ExecutablePO; //导入方法依赖的package包/类
private static AbstractExecutable parseTo(ExecutablePO executablePO) {
    if (executablePO == null) {
        return null;
    }
    String type = executablePO.getType();
    try {
        Class<? extends AbstractExecutable> clazz = ClassUtil.forName(type, AbstractExecutable.class);
        Constructor<? extends AbstractExecutable> constructor = clazz.getConstructor();
        AbstractExecutable result = constructor.newInstance();
        result.setId(executablePO.getUuid());
        result.setName(executablePO.getName());
        result.setParams(executablePO.getParams());
        List<ExecutablePO> tasks = executablePO.getTasks();
        if (tasks != null && !tasks.isEmpty()) {
            Preconditions.checkArgument(result instanceof DefaultChainedExecutable);
            for (ExecutablePO subTask: tasks) {
                ((DefaultChainedExecutable) result).addTask(parseTo(subTask));
            }
        }
        return result;
    } catch (ReflectiveOperationException e) {
        throw new IllegalArgumentException("cannot parse this job:" + executablePO.getId(), e);
    }
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:25,代码来源:ExecutableManager.java

示例2: parseTo

import org.apache.kylin.job.dao.ExecutablePO; //导入方法依赖的package包/类
private AbstractExecutable parseTo(ExecutablePO executablePO) {
    if (executablePO == null) {
        logger.warn("executablePO is null");
        return null;
    }
    String type = executablePO.getType();
    try {
        Class<? extends AbstractExecutable> clazz = ClassUtil.forName(type, AbstractExecutable.class);
        Constructor<? extends AbstractExecutable> constructor = clazz.getConstructor();
        AbstractExecutable result = constructor.newInstance();
        result.initConfig(config);
        result.setId(executablePO.getUuid());
        result.setName(executablePO.getName());
        result.setParams(executablePO.getParams());
        List<ExecutablePO> tasks = executablePO.getTasks();
        if (tasks != null && !tasks.isEmpty()) {
            Preconditions.checkArgument(result instanceof ChainedExecutable);
            for (ExecutablePO subTask : tasks) {
                ((ChainedExecutable) result).addTask(parseTo(subTask));
            }
        }
        List<ExecutablePO> tasksForCheck = executablePO.getTasksForCheck();
        if (tasksForCheck != null && !tasksForCheck.isEmpty()) {
            Preconditions.checkArgument(result instanceof CheckpointExecutable);
            for (ExecutablePO subTaskForCheck : tasksForCheck) {
                ((CheckpointExecutable) result).addTaskForCheck(parseTo(subTaskForCheck));
            }
        }
        return result;
    } catch (ReflectiveOperationException e) {
        throw new IllegalStateException("cannot parse this job:" + executablePO.getId(), e);
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:34,代码来源:ExecutableManager.java


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