當前位置: 首頁>>代碼示例>>Java>>正文


Java JobStatusEnum類代碼示例

本文整理匯總了Java中org.apache.kylin.job.constant.JobStatusEnum的典型用法代碼示例。如果您正苦於以下問題:Java JobStatusEnum類的具體用法?Java JobStatusEnum怎麽用?Java JobStatusEnum使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JobStatusEnum類屬於org.apache.kylin.job.constant包,在下文中一共展示了JobStatusEnum類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateKylinCubeDesc

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
public static CubeDesc generateKylinCubeDesc(String tableName, int storageType,
        List<DimensionDesc> dimensionDescList, List<MeasureDesc> measureDescList, RowKeyDesc rowKeyDesc,
        AggregationGroup aggGroup, HBaseMappingDesc hBaseMapping, Map<String, String> overrideProperties) {
    CubeDesc desc = new CubeDesc();
    desc.setName(tableName.replace('.', '_'));
    desc.setModelName(tableName.replace('.', '_'));
    desc.setDescription("");
    desc.setLastModified(0L);
    desc.setDimensions(dimensionDescList);
    desc.setMeasures(measureDescList);
    desc.setRowkey(rowKeyDesc);
    desc.setHbaseMapping(hBaseMapping);
    desc.setNotifyList(Lists.<String> newArrayList());
    desc.setStatusNeedNotify(Lists.newArrayList(JobStatusEnum.ERROR.toString()));
    desc.setAutoMergeTimeRanges(new long[] { 86400000L, 604800000L, 2419200000L });
    desc.setEngineType(IEngineAware.ID_MR_V2);
    desc.setStorageType(storageType);
    desc.setAggregationGroups(Lists.newArrayList(aggGroup));
    desc.getOverrideKylinProps().putAll(overrideProperties);
    desc.setSignature(desc.calculateSignature());
    desc.updateRandomUuid();
    return desc;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:24,代碼來源:CubeDescCreator.java

示例2: parseToJobStatus

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
private JobStatusEnum parseToJobStatus(ExecutableState state) {
    switch (state) {
    case READY:
        return JobStatusEnum.PENDING;
    case RUNNING:
        return JobStatusEnum.RUNNING;
    case ERROR:
        return JobStatusEnum.ERROR;
    case DISCARDED:
        return JobStatusEnum.DISCARDED;
    case SUCCEED:
        return JobStatusEnum.FINISHED;
    case STOPPED:
    default:
        throw new RuntimeException("invalid state:" + state);
    }
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:18,代碼來源:JobInstanceExtractor.java

示例3: parseToJobStatus

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
public static JobStatusEnum parseToJobStatus(ExecutableState state) {
    switch (state) {
    case READY:
        return JobStatusEnum.PENDING;
    case RUNNING:
        return JobStatusEnum.RUNNING;
    case ERROR:
        return JobStatusEnum.ERROR;
    case DISCARDED:
        return JobStatusEnum.DISCARDED;
    case SUCCEED:
        return JobStatusEnum.FINISHED;
    case STOPPED:
        return JobStatusEnum.STOPPED;
    default:
        throw new RuntimeException("invalid state:" + state);
    }
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:19,代碼來源:JobInfoConverter.java

示例4: parseToExecutableState

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
private ExecutableState parseToExecutableState(JobStatusEnum status) {
    Message msg = MsgPicker.getMsg();

    switch (status) {
    case DISCARDED:
        return ExecutableState.DISCARDED;
    case ERROR:
        return ExecutableState.ERROR;
    case FINISHED:
        return ExecutableState.SUCCEED;
    case NEW:
        return ExecutableState.READY;
    case PENDING:
        return ExecutableState.READY;
    case RUNNING:
        return ExecutableState.RUNNING;
    case STOPPED:
        return ExecutableState.STOPPED;
    default:
        throw new BadRequestException(String.format(msg.getILLEGAL_EXECUTABLE_STATE(), status));
    }
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:23,代碼來源:JobService.java

示例5: searchJobs

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
/**
 * currently only support substring match
 *
 * @return
 */
public List<JobInstance> searchJobs(final String cubeNameSubstring, final String projectName,
        final List<JobStatusEnum> statusList, final Integer limitValue, final Integer offsetValue,
        final JobTimeFilterEnum timeFilter) {
    Integer limit = (null == limitValue) ? 30 : limitValue;
    Integer offset = (null == offsetValue) ? 0 : offsetValue;
    List<JobInstance> jobs = searchJobsByCubeName(cubeNameSubstring, projectName, statusList, timeFilter);

    Collections.sort(jobs);

    if (jobs.size() <= offset) {
        return Collections.emptyList();
    }

    if ((jobs.size() - offset) < limit) {
        return jobs.subList(offset, jobs.size());
    }

    return jobs.subList(offset, offset + limit);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:25,代碼來源:JobService.java

示例6: innerSearchJobs

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
public List<JobInstance> innerSearchJobs(final String cubeName, final String jobName, final String projectName,
        final List<JobStatusEnum> statusList, final JobTimeFilterEnum timeFilter, JobSearchMode jobSearchMode) {
    List<JobInstance> result = Lists.newArrayList();
    switch (jobSearchMode) {
    case CUBING_ONLY:
        result.addAll(innerSearchCubingJobs(cubeName, jobName, projectName, statusList, timeFilter));
        break;
    case CHECKPOINT_ONLY:
        result.addAll(innerSearchCheckpointJobs(cubeName, jobName, projectName, statusList, timeFilter));
        break;
    case ALL:
    default:
        result.addAll(innerSearchCubingJobs(cubeName, jobName, projectName, statusList, timeFilter));
        result.addAll(innerSearchCheckpointJobs(cubeName, jobName, projectName, statusList, timeFilter));
    }
    return result;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:18,代碼來源:JobService.java

示例7: innerSearchCheckpointJobs

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
public List<JobInstance> innerSearchCheckpointJobs(final String cubeName, final String jobName,
        final String projectName, final List<JobStatusEnum> statusList, final JobTimeFilterEnum timeFilter) {
    // prepare time range
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(new Date());
    long timeStartInMillis = getTimeStartInMillis(calendar, timeFilter);
    long timeEndInMillis = Long.MAX_VALUE;
    Set<ExecutableState> states = convertStatusEnumToStates(statusList);
    final Map<String, Output> allOutputs = getExecutableManager().getAllOutputs(timeStartInMillis, timeEndInMillis);

    return Lists
            .newArrayList(FluentIterable
                    .from(innerSearchCheckpointJobs(cubeName, jobName, states, timeStartInMillis, timeEndInMillis,
                            allOutputs, false, projectName))
                    .transform(new Function<CheckpointExecutable, JobInstance>() {
                        @Override
                        public JobInstance apply(CheckpointExecutable checkpointExecutable) {
                            return JobInfoConverter.parseToJobInstanceQuietly(checkpointExecutable, allOutputs);
                        }
                    }));
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:22,代碼來源:JobService.java

示例8: parseState

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
private ExecutableState parseState(JobStatusEnum state) {
    switch (state) {
        case NEW:
        case PENDING:
            return ExecutableState.READY;
        case RUNNING:
            return ExecutableState.RUNNING;
        case FINISHED:
            return ExecutableState.SUCCEED;
        case ERROR:
            return ExecutableState.ERROR;
        case DISCARDED:
            return ExecutableState.DISCARDED;
        default:
            return ExecutableState.DISCARDED;
    }
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:18,代碼來源:CubeMetadataUpgrade.java

示例9: list

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
/**
 * get all cube jobs
 * 
 * @return
 * @throws IOException
 */
@RequestMapping(value = "", method = { RequestMethod.GET })
@ResponseBody
public List<JobInstance> list(JobListRequest jobRequest) {

    List<JobInstance> jobInstanceList = Collections.emptyList();
    List<JobStatusEnum> statusList = new ArrayList<JobStatusEnum>();

    if (null != jobRequest.getStatus()) {
        for (int status : jobRequest.getStatus()) {
            statusList.add(JobStatusEnum.getByCode(status));
        }
    }

    try {
        jobInstanceList = jobService.listAllJobs(jobRequest.getCubeName(), jobRequest.getProjectName(), statusList, jobRequest.getLimit(), jobRequest.getOffset());
    } catch (Exception e) {
        logger.error(e.getLocalizedMessage(), e);
        throw new InternalErrorException(e);
    }
    return jobInstanceList;
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:28,代碼來源:JobController.java

示例10: listAllJobs

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
public List<JobInstance> listAllJobs(final String cubeName, final String projectName, final List<JobStatusEnum> statusList, final Integer limitValue, final Integer offsetValue) throws IOException, JobException {
    Integer limit = (null == limitValue) ? 30 : limitValue;
    Integer offset = (null == offsetValue) ? 0 : offsetValue;
    List<JobInstance> jobs = listAllJobs(cubeName, projectName, statusList);
    Collections.sort(jobs);

    if (jobs.size() <= offset) {
        return Collections.emptyList();
    }

    if ((jobs.size() - offset) < limit) {
        return jobs.subList(offset, jobs.size());
    }

    return jobs.subList(offset, offset + limit);
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:17,代碼來源:JobService.java

示例11: listCubeJobInstance

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
private List<JobInstance> listCubeJobInstance(final String cubeName, final String projectName, List<JobStatusEnum> statusList) {
    Set<ExecutableState> states;
    if (statusList == null || statusList.isEmpty()) {
        states = EnumSet.allOf(ExecutableState.class);
    } else {
        states = Sets.newHashSet();
        for (JobStatusEnum status : statusList) {
            states.add(parseToExecutableState(status));
        }
    }
    return Lists.newArrayList(FluentIterable.from(listAllCubingJobs(cubeName, projectName, states)).transform(new Function<CubingJob, JobInstance>() {
        @Override
        public JobInstance apply(CubingJob cubingJob) {
            return parseToJobInstance(cubingJob);
        }
    }));
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:18,代碼來源:JobService.java

示例12: parseToExecutableState

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
private ExecutableState parseToExecutableState(JobStatusEnum status) {
    switch (status) {
        case DISCARDED:
            return ExecutableState.DISCARDED;
        case ERROR:
            return ExecutableState.ERROR;
        case FINISHED:
            return ExecutableState.SUCCEED;
        case NEW:
            return ExecutableState.READY;
        case PENDING:
            return ExecutableState.READY;
        case RUNNING:
            return ExecutableState.RUNNING;
        default:
            throw new RuntimeException("illegal status:" + status);
    }
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:19,代碼來源:JobService.java

示例13: parseToJobStatus

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
private JobStatusEnum parseToJobStatus(ExecutableState state) {
    switch (state) {
        case READY:
            return JobStatusEnum.PENDING;
        case RUNNING:
            return JobStatusEnum.RUNNING;
        case ERROR:
            return JobStatusEnum.ERROR;
        case DISCARDED:
            return JobStatusEnum.DISCARDED;
        case SUCCEED:
            return JobStatusEnum.FINISHED;
        case STOPPED:
        default:
            throw new RuntimeException("invalid state:" + state);
    }
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:18,代碼來源:JobService.java

示例14: list

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
/**
 * get all cube jobs
 * 
 * @return
 * @throws IOException
 */
@RequestMapping(value = "", method = { RequestMethod.GET }, produces = { "application/json" })
@ResponseBody
public List<JobInstance> list(JobListRequest jobRequest) {

    List<JobInstance> jobInstanceList = Collections.emptyList();
    List<JobStatusEnum> statusList = new ArrayList<JobStatusEnum>();

    if (null != jobRequest.getStatus()) {
        for (int status : jobRequest.getStatus()) {
            statusList.add(JobStatusEnum.getByCode(status));
        }
    }

    JobTimeFilterEnum timeFilter = JobTimeFilterEnum.LAST_ONE_WEEK;
    if (null != jobRequest.getTimeFilter()) {
        timeFilter = JobTimeFilterEnum.getByCode(jobRequest.getTimeFilter());
    }

    try {
        jobInstanceList = jobService.searchJobs(jobRequest.getCubeName(), jobRequest.getProjectName(), statusList,
                jobRequest.getLimit(), jobRequest.getOffset(), timeFilter);
    } catch (Exception e) {
        logger.error(e.getLocalizedMessage(), e);
        throw new InternalErrorException(e);
    }
    return jobInstanceList;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:34,代碼來源:JobController.java

示例15: convertStatusEnumToStates

import org.apache.kylin.job.constant.JobStatusEnum; //導入依賴的package包/類
private Set<ExecutableState> convertStatusEnumToStates(List<JobStatusEnum> statusList) {
    Set<ExecutableState> states;
    if (statusList == null || statusList.isEmpty()) {
        states = EnumSet.allOf(ExecutableState.class);
    } else {
        states = Sets.newHashSet();
        for (JobStatusEnum status : statusList) {
            states.add(parseToExecutableState(status));
        }
    }
    return states;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:13,代碼來源:JobService.java


注:本文中的org.apache.kylin.job.constant.JobStatusEnum類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。