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


Java Trans類代碼示例

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


Trans類屬於org.pentaho.di.trans包,在下文中一共展示了Trans類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: startTransformation

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
protected void startTransformation( Repository repository, IMetaStore metaStore, final StreamingService service ) {
  try {

    TransMeta transMeta = StreamingConst.loadTransMeta( repository, metaStore, service );
    Trans trans = new Trans( transMeta );
    String carteObjectId = UUID.randomUUID().toString();
    trans.setContainerObjectId( carteObjectId );
    
    if (service.getLogLevel()!=null) {
      trans.setLogLevel(service.getLogLevel());
    }
    TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration();
    TransConfiguration transConfiguration = new TransConfiguration( transMeta, transExecutionConfiguration );
    transformationMap.addTransformation( transMeta.getName(), carteObjectId, trans, transConfiguration );
    trans.prepareExecution( null );

    // Start the transformation

    trans.startThreads();
    
    // This transformation routinely never ends so we won't wait for it...
    
  } catch ( Exception e ) {
    throw new RuntimeException( "Unable to start transformation for streaming service '" + service.getName() + "'", e );
  }
}
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-streaming,代碼行數:27,代碼來源:ListStreamingServicesServlet.java

示例4: 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

示例5: iMonitor

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
/**
 * 記錄job操作信息
 * 
 * @param job
 * @param entity
 * @throws KettleException
 */
private String iMonitor(Trans trans, T entity) {
	KettleResult result = new KettleResult();
	result.setName(entity.getName());
	result.setParams(JSONObject.fromObject(entity.getValue()).toString());
	result.setStartTime(entity.getCreated());
	result.setEndTime(DateUtils.getTime24());
	result.setDeleted(String.valueOf(trans.getResult().getNrLinesDeleted()));
	result.setInput(String.valueOf(trans.getResult().getNrLinesInput()));
	result.setError(String.valueOf(trans.getErrors()));
	result.setOutput(String.valueOf(trans.getResult().getNrLinesOutput()));
	result.setRead(String.valueOf(trans.getResult().getNrLinesRead()));
	result.setUpdated(String.valueOf(trans.getResult().getNrLinesUpdated()));
	result.setWritten(String.valueOf(trans.getResult().getNrLinesWritten()));
	result.setRetrieved(String.valueOf(trans.getResult()
			.getNrFilesRetrieved()));
	result.setRejected(String.valueOf(trans.getResult()
			.getNrLinesRejected()));
	result.setCreator("Kettle");
	result.setCreated(DateUtils.getTime24());
	result.setType("Running");
	result.setHost(ServerUtils.getName() + ":" + ServerUtils.getHost());
	if (entity.isTest()) {
		result.setType("Testing");
	}
	return (String) service.iKettleResultService.insert(result);
}
 
開發者ID:jiangzongyao,項目名稱:kettle_support_kettle8.0,代碼行數:34,代碼來源:KettleTransServiceImpl.java

示例6: iEmail

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
/**
 * 郵件預警
 * 
 * @param job
 * @param entity
 */
private void iEmail(Trans trans, T entity, String exception) {
	if (null != entity) {
		String content = null;
		if (null != trans.getResult().getLogText()
				&& !"".equals(trans.getResult().getLogText())) {
			content = trans.getResult().getLogText();
		} else if (null != exception && !"".equals(exception)) {
			content = exception;
		}
		if (null != content && !"".equals(content)) {
			User u = new User();
			u.setType("KETTLE");
			u.setStatus(Constant.STATUS_ENABLED);
			@SuppressWarnings("all")
			List<User> list = (List<User>) service.iUserService
					.selectByWhere(u);
			if (null != list && list.size() > 0) {
				for (User user : list) {
					try {
						Message.iMessage(Constant.MAIL_USERNAME,
								Constant.MAIL_PASSWORD, Constant.MAIL_SMTP,
								Integer.valueOf(Constant.MAIL_PORT),
								Constant.MAIL_SENDER, user.getEmail(),
								entity.getName(), content);
					} catch (Exception e) {
						e.printStackTrace();
					}
				}
			}

		}
	}
}
 
開發者ID:jiangzongyao,項目名稱:kettle_support_kettle8.0,代碼行數:40,代碼來源:KettleTransServiceImpl.java

示例7: preview

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
private void preview() {
    CassandraInputMeta oneMeta = new CassandraInputMeta();
    getInfo(oneMeta, true);

    TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(this.transMeta, oneMeta, this.wStepname.getText());

    EnterNumberDialog numberDialog = new EnterNumberDialog(this.shell, this.props.getDefaultPreviewSize(),
            BaseMessages.getString(PKG, "AutSoftCassandraInputDialog.EnterPreviewSize"),
            BaseMessages.getString(PKG, "AutSoftCassandraInputDialog.NumberOfRowsToPreview"));
    int previewSize = numberDialog.open();

    if (previewSize > 0) {
        TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(this.shell, previewMeta,
                new String[]{this.wStepname.getText()}, new int[]{previewSize});
        progressDialog.open();

        Trans trans = progressDialog.getTrans();
        String loggingText = progressDialog.getLoggingText();

        if (!progressDialog.isCancelled()) {
            if ((trans.getResult() != null) && (trans.getResult().getNrErrors() > 0L)) {
                EnterTextDialog etd = new EnterTextDialog(this.shell,
                        BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"),
                        BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"), loggingText, true);
                etd.setReadOnly();
                etd.open();
            } else {
                PreviewRowsDialog prd = new PreviewRowsDialog(this.shell, this.transMeta, 0, this.wStepname.getText(),
                        progressDialog.getPreviewRowsMeta(this.wStepname.getText()),
                        progressDialog.getPreviewRows(this.wStepname.getText()), loggingText);
                prd.open();
            }
        }
    }
}
 
開發者ID:bcolas,項目名稱:pentaho-cassandra-plugin,代碼行數:36,代碼來源:CassandraInputDialog.java

示例8: setVariableRootJob

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
/**
* 設置變量到根作業 <br/>
* @author jingma
* @param variableName 變量名
* @param variableValue 變量值
*/
public void setVariableRootJob(String variableName,String variableValue){
    ku.setVariable(variableName, variableValue);
    Trans trans = ku.getTrans();
    while(trans.getParentTrans()!=null){
        trans.setVariable(variableName, variableValue);
        trans = trans.getParentTrans();
    }
    trans.setVariable(variableName, variableValue);
    Job job = trans.getParentJob();
    while(job!=null){
        job.setVariable(variableName, variableValue);
        job = job.getParentJob();
    }
}
 
開發者ID:majinju,項目名稱:KettleEasyExpand,代碼行數:21,代碼來源:EasyExpandRunBase.java

示例9: testExecuteTrans

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
@Test
public void testExecuteTrans() {
  try {
    Trans trans = KettleUtils.executeTrans("第一課作業", rep, false);
    while (trans.isRunning()) {
      System.out.println(trans.getStatus());
      Thread.sleep(1000);
    }
    System.err.println(trans.getStatus());
  } catch (Exception e) {
    e.printStackTrace();
  }
}
 
開發者ID:classtag,項目名稱:easier_kettle_web,代碼行數:14,代碼來源:KettleUtilsTest.java

示例10: getStep

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
@Override
public StepInterface getStep(StepMeta stepMeta,
    StepDataInterface stepDataInterface, int cnr, TransMeta transMeta,
    Trans trans) {
  return new DOMConcatFields(stepMeta, stepDataInterface, cnr, transMeta,
      trans);
}
 
開發者ID:griddynamics,項目名稱:xml-dom-kettle-etl-plugin,代碼行數:8,代碼來源:DOMConcatFieldsMeta.java

示例11: init

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
public boolean init(StepMetaInterface smi, StepDataInterface sdi)
{
	meta=(GPBulkLoaderMeta)smi;
	data=(GPBulkLoaderData)sdi;
	
	Trans trans = getTrans();
	preview = trans.isPreview();
	
	if (super.init(smi, sdi))
	{			
		return true;
	}
	return false;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:15,代碼來源:GPBulkLoader.java

示例12: preview

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
private void preview()
{
	IntuitivusSpreadsheetStepMeta meta = new IntuitivusSpreadsheetStepMeta();
	getInfo(meta);

	if (!meta.hasDataToConnect())
		return;

	boolean useDefinedOutput = fieldsTable.table.getItemCount() > 0;
	meta.setAdoptOutput(useDefinedOutput);

	String stepName = wStepname.getText();

	TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, meta, stepName);

	TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta, new String[] { stepName }, new int[] { Integer.MAX_VALUE });
	progressDialog.open();

	Trans trans = progressDialog.getTrans();
	String loggingText = progressDialog.getLoggingText();

	if (!progressDialog.isCancelled())
	{
		if (trans.getResult() != null && trans.getResult().getNrErrors() > 0)
		{
			EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"), BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"),
					loggingText, true);
			etd.setReadOnly();
			etd.open();
		}
	}

	PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, stepName, progressDialog.getPreviewRowsMeta(stepName), progressDialog.getPreviewRows(stepName), loggingText);
	prd.open();
}
 
開發者ID:intuitivus,項目名稱:pdi-spreadsheet-plugin,代碼行數:36,代碼來源:IntuitivusSpreadsheetStepDialog.java

示例13: executeTrans

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
protected void executeTrans(Trans trans) throws KettleException { 
   trans.prepareExecution(null);
   trans.startThreads();
   trans.waitUntilFinished();
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:6,代碼來源:ExecuteTransServlet.java

示例14: preview

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
private void preview()
{
	// Create the XML input step
	GetSubFoldersMeta oneMeta = new GetSubFoldersMeta();
	getInfo(oneMeta);

	TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname
			.getText());

	EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), Messages.getString("GetSubFoldersDialog.PreviewSize.DialogTitle"), Messages.getString("GetSubFoldersDialog.PreviewSize.DialogMessage"));
	int previewSize = numberDialog.open();
	if (previewSize > 0)
	{
		TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta,
				new String[] { wStepname.getText() }, new int[] { previewSize });
		progressDialog.open();

		if (!progressDialog.isCancelled())
		{
			Trans trans = progressDialog.getTrans();
			String loggingText = progressDialog.getLoggingText();

			if (trans.getResult() != null && trans.getResult().getNrErrors() > 0)
			{
				EnterTextDialog etd = new EnterTextDialog(shell, Messages.getString("System.Dialog.Error.Title"), Messages.getString("GetSubFoldersDialog.ErrorInPreview.DialogMessage"), loggingText, true);
				etd.setReadOnly();
				etd.open();
			}
			
			
			PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, wStepname.getText(),progressDialog.getPreviewRowsMeta(wStepname.getText()),
					progressDialog.getPreviewRows(wStepname.getText()), loggingText);
			prd.open();
		}
	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:37,代碼來源:GetSubFoldersDialog.java

示例15: FilesFromResult

import org.pentaho.di.trans.Trans; //導入依賴的package包/類
public FilesFromResult(StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr,
		TransMeta transMeta, Trans trans)
{
	super(stepMeta, stepDataInterface, copyNr, transMeta, trans);

	meta = (FilesFromResultMeta) getStepMeta().getStepMetaInterface();
	data = (FilesFromResultData) stepDataInterface;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:9,代碼來源:FilesFromResult.java


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