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