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


Java Trans.getLogChannel方法代码示例

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


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

示例1: injectDataSetIntoStep

import org.pentaho.di.trans.Trans; //导入方法依赖的package包/类
private void injectDataSetIntoStep( final Trans trans, final TransMeta transMeta,
  final String dataSetName, final MetaStoreFactory<DataSet> dataSetFactory,
  final Repository repository, final IMetaStore metaStore, final StepMeta stepMeta, 
  TransUnitTestSetLocation inputLocation ) throws MetaStoreException, KettleException {

  final DataSet dataSet = dataSetFactory.loadElement( dataSetName );
  final DataSetGroup group = dataSet.getGroup();
  final Database database = new Database( trans, group.getDatabaseMeta() );
  final LogChannelInterface log = trans.getLogChannel();
  
  final RowMetaInterface injectRowMeta = DataSetConst.getStepOutputFields(log, transMeta, stepMeta, dataSet, inputLocation);    
  final RowProducer rowProducer = trans.addRowProducer( stepMeta.getName(), 0 );

  // Look for the step into which we'll inject rows...
  //
  StepMetaDataCombi combi = null;
  for ( StepMetaDataCombi step : trans.getSteps() ) {
    if ( step.stepname.equals( stepMeta.getName() ) ) {
      combi = step;
      break;
    }
  }

  if ( combi != null ) {

    log.logBasic( "Injecting data set '" + dataSetName + "' into step '" + stepMeta.getName() + "', fields: "+injectRowMeta.toStringMeta() );
    final List<Object[]> rows = dataSet.getAllRows(log, inputLocation, injectRowMeta);
    
    // Pass rows
    try {
      Runnable runnable = new Runnable() {
        @Override
        public void run() {
          try {
            
            for( Object[] row : rows ) {
              // pass the row with the external names
              //
              rowProducer.putRow( injectRowMeta, row );                
            }
            rowProducer.finished();
            
          } catch ( Exception e ) {
            throw new RuntimeException( "Problem injecting data set '" + dataSetName + "' row into step '" + stepMeta.getName() + "'", e );
          }
        }
      };
      Thread thread = new Thread( runnable );
      thread.start();

    } finally {
      database.disconnect();
    }
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:56,代码来源:InjectDataSetIntoTransExtensionPoint.java

示例2: DataCleanerKettleFileWriter

import org.pentaho.di.trans.Trans; //导入方法依赖的package包/类
public DataCleanerKettleFileWriter(Trans trans, StepMeta stepMeta) throws Exception {
    this.trans = trans;
    this.transMeta = trans.getTransMeta();
    this.stepMeta = stepMeta;
    this.log = trans.getLogChannel();
}
 
开发者ID:datacleaner,项目名称:pdi-datacleaner,代码行数:7,代码来源:DataCleanerKettleFileWriter.java


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