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


Java Trans.getBatchId方法代碼示例

本文整理匯總了Java中org.pentaho.di.trans.Trans.getBatchId方法的典型用法代碼示例。如果您正苦於以下問題:Java Trans.getBatchId方法的具體用法?Java Trans.getBatchId怎麽用?Java Trans.getBatchId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.pentaho.di.trans.Trans的用法示例。


在下文中一共展示了Trans.getBatchId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getLogRecord

import org.pentaho.di.trans.Trans; //導入方法依賴的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
 * @param subject the subject to query, in this case a Trans object
 */
public RowMetaAndData getLogRecord(LogStatus status, Object subject, Object parent) {
	if (subject==null || subject instanceof Trans) {
		Trans trans = (Trans) subject;
		Result result = null;
		if (trans!=null) result = trans.getResult();
		
		RowMetaAndData row = new RowMetaAndData();
		
		for (LogTableField field : fields) {
			if (field.isEnabled()) {
				Object value = null;
				if (trans!=null) {
					
					switch(ID.valueOf(field.getId())){
					case ID_BATCH : value = new Long(trans.getBatchId()); break;
					case CHANNEL_ID : value = trans.getLogChannelId(); break;
					case TRANSNAME : value = trans.getName(); break;
					case STATUS : value = status.getStatus(); break;
					case LINES_READ : value = new Long(result.getNrLinesRead()); break;
					case LINES_WRITTEN : value = new Long(result.getNrLinesWritten()); break;
					case LINES_INPUT : value = new Long(result.getNrLinesInput()); break;
					case LINES_OUTPUT : value = new Long(result.getNrLinesOutput()); break;
					case LINES_UPDATED : value = new Long(result.getNrLinesUpdated()); break;
					case LINES_REJECTED : value = new Long(result.getNrLinesRejected()); break;
					case ERRORS: value = new Long(result.getNrErrors()); break;
					case STARTDATE: value = trans.getStartDate(); break;
					case LOGDATE: value = trans.getLogDate(); break;
					case ENDDATE: value = trans.getEndDate(); break;
					case DEPDATE: value = trans.getDepDate(); break;
					case REPLAYDATE: value = trans.getCurrentDate(); break;
                       case LOG_FIELD: 
                         value = getLogBuffer(trans, trans.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,代碼行數:54,代碼來源:TransLogTable.java


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