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


Java WorkflowAction类代码示例

本文整理汇总了Java中org.apache.oozie.client.WorkflowAction的典型用法代码示例。如果您正苦于以下问题:Java WorkflowAction类的具体用法?Java WorkflowAction怎么用?Java WorkflowAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: asAction

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
/**
 * Copy WorkflowAction information in OOZIE to OozieAction we defined
 *
 * @param temp WorkflowAction in OOZIE
 * @param jobid Oozie job id
 * @return OozieAction
 */
public static OozieAction asAction(WorkflowAction temp, String jobid) {
	OozieAction tempAct = new OozieAction();
	tempAct.setJobId( jobid );
	tempAct.setName(temp.getName());
	tempAct.setType(temp.getType());
	tempAct.setConf(temp.getConf());
	tempAct.setStatus(temp.getStatus().toString());
	tempAct.setRetries(temp.getRetries());
	tempAct.setStartTime(temp.getStartTime());
	tempAct.setEndTime(temp.getEndTime());
	tempAct.setTransition(temp.getTransition());
	tempAct.setData(temp.getData());
	tempAct.setStats(temp.getStats());
	tempAct.setExternalChildIDs(temp.getExternalChildIDs());
	tempAct.setExternalId(temp.getExternalId());
	tempAct.setExternalStatus(temp.getExternalStatus());
	tempAct.setTrackerUri(temp.getTrackerUri());
	tempAct.setConsoleUrl(temp.getConsoleUrl());
	tempAct.setErrorCode(temp.getErrorCode());
	tempAct.setErrorMessage(temp.getErrorMessage());
	return tempAct;
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:30,代码来源:OozieUtil.java

示例2: setWorkflowjob

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
/**
 * Copy WorkflowJob information in OOZIE to Oozie we defined
 * @param job WorkflowJob
 * @return OozieJob
 */
public static OozieJob setWorkflowjob(WorkflowJob job) {
	OozieJob oozieJob = new OozieJob();
	oozieJob.setAcl(job.getAcl());
	for (WorkflowAction temp : job.getActions()) {
		OozieAction a = asAction(temp, job.getId() );
		oozieJob.addAction(a);
	}
	oozieJob.setAppName(job.getAppName());
	oozieJob.setAppPath(job.getAppPath());
	oozieJob.setConf(job.getConf());
	oozieJob.setConsoleUrl(job.getConsoleUrl());
	oozieJob.setCreatedTime(job.getCreatedTime());
	oozieJob.setEndTime(job.getEndTime());
	oozieJob.setExternalId(job.getExternalId());
	oozieJob.setGroup(job.getGroup());
	oozieJob.setId(job.getId());
	oozieJob.setLastModifiedTime(job.getLastModifiedTime());
	oozieJob.setParentId(job.getParentId());
	oozieJob.setRun(job.getRun());
	oozieJob.setStartTime(job.getStartTime());
	oozieJob.setStatus(job.getStatus().toString());
	oozieJob.setUser(job.getUser());
	return oozieJob;
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:30,代码来源:OozieUtil.java

示例3: copyTTlogs

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
private void copyTTlogs(ARGS args, FileSystem fs, Path path,
		WorkflowAction action) throws Exception {
	String ttLogURL = getTTlogURL(action.getExternalId());
	if (ttLogURL != null) {
		LOG.info("Fetching log for action: " + action.getExternalId()
				+ " from url: " + ttLogURL);
		InputStream in = getURLinputStream(new URL(ttLogURL));
		OutputStream out = fs.create(new Path(path, action.getName() + "_"
				+ getMappedStatus(action.getStatus()) + ".log"));
		IOUtils.copyBytes(in, out, 4096, true);
		LOG.info("Copied log to " + path);
	}
}
 
开发者ID:sriksun,项目名称:ivry-security,代码行数:14,代码来源:LogMover.java

示例4: getMappedStatus

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
private String getMappedStatus(WorkflowAction.Status status) {
	if (status == WorkflowAction.Status.FAILED
			|| status == WorkflowAction.Status.KILLED
			|| status == WorkflowAction.Status.ERROR) {
		return "FAILED";
	} else {
		return "SUCCEEDED";
	}
}
 
开发者ID:sriksun,项目名称:ivry-security,代码行数:10,代码来源:LogMover.java

示例5: getWorkflowActionInfo

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
@Override
public WorkflowAction getWorkflowActionInfo(String actionId)
    throws OozieClientException {
  synchronized (lock) {
    return client.getWorkflowActionInfo(actionId);
  }
}
 
开发者ID:blackberry,项目名称:hadoop-logdriver,代码行数:8,代码来源:SynchronizedOozieClient.java

示例6: copyTTlogs

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
private void copyTTlogs(ARGS args, FileSystem fs, Path path,
                        WorkflowAction action) throws Exception {
    String ttLogURL = getTTlogURL(action.getExternalId());
    if (ttLogURL != null) {
        LOG.info("Fetching log for action: " + action.getExternalId()
                + " from url: " + ttLogURL);
        InputStream in = getURLinputStream(new URL(ttLogURL));
        OutputStream out = fs.create(new Path(path, action.getName() + "_"
                + getMappedStatus(action.getStatus()) + ".log"));
        IOUtils.copyBytes(in, out, 4096, true);
        LOG.info("Copied log to " + path);
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:14,代码来源:LogMover.java

示例7: getMappedStatus

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
private String getMappedStatus(WorkflowAction.Status status) {
    if (status == WorkflowAction.Status.FAILED
            || status == WorkflowAction.Status.KILLED
            || status == WorkflowAction.Status.ERROR) {
        return "FAILED";
    } else {
        return "SUCCEEDED";
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:10,代码来源:LogMover.java

示例8: fetchActionDuration

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
private long fetchActionDuration(List<WorkflowAction> actions, String actionName) {
    
    for (WorkflowAction action : actions) {
        
        if (actionName.equals(action.getName())) {
            
            Date startDate = action.getStartTime();
            Date endDate = action.getEndTime();
            
            return endDate.getTime() - startDate.getTime();
        }
        
    }
    
    log.warn("no action with the name has been specified or executed: " + actionName);
    
    return 0;
}
 
开发者ID:openaire,项目名称:iis,代码行数:19,代码来源:OozieTimeReportGenerator.java

示例9: run

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
@Override
public void run(PortBindings portBindings, Configuration conf, Map<String, String> parameters) throws Exception {
    
    List<WorkflowAction> actions = fetchWorkflowActions(parameters.get(OOZIE_SERVICE_LOC_PARAM), parameters.get(WORKFLOW_JOB_ID_PARAM));
    
    Map<String, List<String>> reportKeysToActionNames = mapReportKeysToActionNames(parameters);
    
    
    List<ReportEntry> reportEntries = Lists.newArrayList();
    
    for (Map.Entry<String, List<String>> reportKeyToActionNamesEntry : reportKeysToActionNames.entrySet()) {
        
        long totalDuration = 0L;
        
        for (String actionName : reportKeyToActionNamesEntry.getValue()) {
            
            totalDuration += fetchActionDuration(actions, actionName);
        }
        
        if (totalDuration > 0) {
            reportEntries.add(ReportEntryFactory.createDurationReportEntry(reportKeyToActionNamesEntry.getKey(), totalDuration));
        }
    }
    
    
    
    FileSystem fs = FileSystem.get(conf);
    
    Path reportPath = portBindings.getOutput().get(REPORT_PORT_OUT_NAME);
    
    DataStore.create(reportEntries, new FileSystemPath(fs, reportPath));
}
 
开发者ID:openaire,项目名称:iis,代码行数:33,代码来源:OozieTimeReportGenerator.java

示例10: fetchWorkflowActions

import org.apache.oozie.client.WorkflowAction; //导入依赖的package包/类
private List<WorkflowAction> fetchWorkflowActions(String oozieUrl, String workflowId) throws OozieClientException {
    
    OozieClient oozieClient = oozieClientFactory.createOozieClient(oozieUrl);
    
    WorkflowJob job = oozieClient.getJobInfo(workflowId);
    
    return job.getActions();
}
 
开发者ID:openaire,项目名称:iis,代码行数:9,代码来源:OozieTimeReportGenerator.java


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