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


Java Job.getLogDate方法代码示例

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


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

示例1: getLogRecord

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
/**
 * This method calculates all the values that are required
 * @param id the id to use or -1 if no id is needed
 * @param status the log status to use
 */
public RowMetaAndData getLogRecord(LogStatus status, Object subject, Object parent) {
	if (subject==null || subject instanceof Job) {
		Job job = (Job) subject;
		Result result = null;
		if (job!=null) result = job.getResult();
		
		RowMetaAndData row = new RowMetaAndData();
		
		for (LogTableField field : fields) {
			if (field.isEnabled()) {
				Object value = null;
				if (job!=null) {
					
					switch(ID.valueOf(field.getId())){
					case ID_JOB : value = new Long(job.getBatchId()); break;
					case CHANNEL_ID : value = job.getLogChannelId(); break;
					case JOBNAME : value = job.getJobname(); break;
					case STATUS : value = status.getStatus(); break;
					case LINES_READ : value = result==null ? null : new Long(result.getNrLinesRead()); break;
					case LINES_WRITTEN : value = result==null ? null : new Long(result.getNrLinesWritten()); break;
					case LINES_INPUT : value = result==null ? null : new Long(result.getNrLinesInput()); break;
					case LINES_OUTPUT : value = result==null ? null : new Long(result.getNrLinesOutput()); break;
					case LINES_UPDATED : value = result==null ? null : new Long(result.getNrLinesUpdated()); break;
					case LINES_REJECTED : value = result==null ? null : new Long(result.getNrLinesRejected()); break;
					case ERRORS: value = result==null ? null : new Long(result.getNrErrors()); break;
					case STARTDATE: value = job.getStartDate(); break;
					case LOGDATE: value = job.getLogDate(); break;
					case ENDDATE: value = job.getEndDate(); break;
					case DEPDATE: value = job.getDepDate(); break;
					case REPLAYDATE: value = job.getCurrentDate(); break;
                       case LOG_FIELD: 
                         value = getLogBuffer(job, job.getLogChannelId(), status, logSizeLimit);
                         break;
					}
				}

				row.addValue(field.getFieldName(), field.getDataType(), value);
				row.getRowMeta().getValueMeta(row.size()-1).setLength(field.getLength());
			}
		}
			
		return row;
	}
	else {
		return null;
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:53,代码来源:JobLogTable.java


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