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


Java Trans.getErrors方法代碼示例

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


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

示例1: iMessage

import org.pentaho.di.trans.Trans; //導入方法依賴的package包/類
/**
 * job動態監控
 * 
 * @param job
 * @param entity
 * @throws KettleException
 */
private void iMessage(Trans trans, T entity, String exception) {
	if (null != trans && null != entity) {
		String title = entity.getName();
		if (null != entity.getTid() && !"".equals(entity.getTid())) {
			entity.setName(entity.getTid());
		}
		entity.setName(title);
		String id = iMonitor(trans, entity);
		entity.setId(id);
		iLogging(trans, entity, exception);
		if (trans.getErrors() > 0) {
			iEmail(trans, entity, exception);
		}
	}
	trans = null;
}
 
開發者ID:jiangzongyao,項目名稱:kettle_support_kettle8.0,代碼行數:24,代碼來源:KettleTransServiceImpl.java

示例2: iLogging

import org.pentaho.di.trans.Trans; //導入方法依賴的package包/類
/**
	 * 記錄job日誌信息
	 * 
	 * @param job
	 * @param entity
	 * @throws KettleException
	 */
	private void iLogging(Trans trans, T entity, String exception) {
		if (entity.isTest() || trans.getErrors() > 0) {
			String logChannelId = trans.getLogChannelId();
//			Log4jBufferAppender appender = CentralLogStore.getAppender();
			String logText ="";// appender.getBuffer(logChannelId, true).toString();
//			CentralLogStore.discardLines(logChannelId, true);
			if (null == logText || "".equals(logText)) {
				logText = exception;
			}
			KettleLogs log = new KettleLogs();
			log.setId(ObjectID.id());
			log.setMid(entity.getId());
			log.setLogs(logText);
			log.setCreator("Kettle");
			log.setCreated(DateUtils.getTime24());
			// service.iKettleLogsService.insert(log);
		}
	}
 
開發者ID:jiangzongyao,項目名稱:kettle_support_kettle8.0,代碼行數:26,代碼來源:KettleTransServiceImpl.java

示例3: iLogging

import org.pentaho.di.trans.Trans; //導入方法依賴的package包/類
/**
 * 記錄job日誌信息
 * 
 * @param job
 * @param entity
 * @throws KettleException
 */
private void iLogging(Trans trans, T entity, String exception) {
	if (entity.isTest() || trans.getErrors() > 0) {
		String logChannelId = trans.getLogChannelId();
		Log4jBufferAppender appender = CentralLogStore.getAppender();
		String logText = appender.getBuffer(logChannelId, true).toString();
		CentralLogStore.discardLines(logChannelId, true);
		if (null == logText || "".equals(logText)) {
			logText = exception;
		}
		KettleLogs log = new KettleLogs();
		log.setId(ObjectID.id());
		log.setMid(entity.getId());
		log.setLogs(logText);
		log.setCreator("Kettle");
		log.setCreated(DateUtils.getTime24());
		// service.iKettleLogsService.insert(log);
	}
}
 
開發者ID:839536,項目名稱:kettle,代碼行數:26,代碼來源:KettleTransServiceImpl.java

示例4: jButton1ActionPerformed

import org.pentaho.di.trans.Trans; //導入方法依賴的package包/類
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

        this.app.waitCursorBegin();
        jPanelRows.setVisible(true);
        Trans t = runTransformationFromResource(getTransformation(), getTransVaribles());
        // retrieve logging appender        
        LoggingBuffer appender = KettleLogStore.getAppender();        
        // retrieve logging lines for job
        String logText = appender.getBuffer(t.getLogChannelId(), true).toString();

        if (t.nrActiveSteps() == 0) {
            t.cleanup();
        }

        if (t.isFinished()) {
            jMessage.setEnabled(true);
            int errors = t.getErrors();
            if (errors > 0) {
                jMessage.setText(AppLocal.getIntString("label.TransformationError"));
                jMessage.setBackground(Color.RED);
            } else {
                jMessage.setText(AppLocal.getIntString("label.TransformationComplete"));
                jMessage.setBackground(Color.GREEN);
            }

            jLogArea.setText(logText);
            appender.clear();
            appender.close();
        }

        this.app.waitCursorEnd();

    }
 
開發者ID:nordpos,項目名稱:nordpos,代碼行數:34,代碼來源:JPanelTransformation.java

示例5: executeTransformation

import org.pentaho.di.trans.Trans; //導入方法依賴的package包/類
public Map<String, Object> executeTransformation(String ktrPath) {

		Map<String, Object> executionResult = new HashMap<String, Object>();

		try {
			KettleEnvironment.init();
			EnvUtil.environmentInit();

			TransMeta transMeta = new TransMeta(ktrPath);

			List<DatabaseMeta> dbMetaList = transMeta.getDatabases();

			for (DatabaseMeta dbMeta : dbMetaList) {
				if (dbMeta.getName().equals(this.connectionName)) {
					dbMeta.setHostname(this.dbHostName);
					dbMeta.setUsername(this.dbUerName);
					dbMeta.setPassword(this.dbPassword);
					dbMeta.setDBPort(this.dbPort);
					dbMeta.setDBName(this.dbName);
				}
			}

			Trans transformation = new Trans(transMeta);

			if (this.parameters != null) {
				for (Map.Entry<String, String> entry : this.parameters.entrySet()) {
					transformation.setParameterValue((String) entry.getKey(), (String) entry.getValue());
				}
			}

			transformation.execute(null);
			transformation.waitUntilFinished();

			for (StepMetaDataCombi combi : transformation.getSteps()) {

				StepDTO stepDTO = new StepDTO();

				stepDTO.setStepName(combi.step.getStepname());
				stepDTO.setLinesInput(Long.valueOf(combi.step.getLinesInput()));
				stepDTO.setLinesOutput(Long.valueOf(combi.step.getLinesOutput()));
				stepDTO.setLinesRead(Long.valueOf(combi.step.getLinesRead()));
				stepDTO.setLinesRejected(Long.valueOf(combi.step.getLinesRejected()));
				stepDTO.setLinesUpdated(Long.valueOf(combi.step.getLinesUpdated()));

				stepDTO.setStepDestinationNameList(new ArrayList<String>());

				for (RowSet rowSet : combi.step.getOutputRowSets()) {
					stepDTO.getStepDestinationNameList().add(rowSet.getDestinationStepName());
				}

				this.getStepDTOList().add(stepDTO);
			}

			if (transformation.getErrors() > 0) {
				System.out.println("Erroruting Transformation");

				executionResult.put("transformationExecuted", false);
				return executionResult;
			} else {

				executionResult.put("transformationExecuted", true);
				return executionResult;
			}
		} catch (Exception e) {
			e.printStackTrace();

			executionResult.put("transformationExecuted", false);
			return executionResult;
		}
	}
 
開發者ID:rodrifmed,項目名稱:pentaho-data-integration,代碼行數:71,代碼來源:TransformationManager.java


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