Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Description

  • Injector was created for those people that are developing special purpose transformations and want to 'inject' rows into the transformation using the Kettle API and Java. Among other things you can build 'headless' transformations with it: transformations that have no input at design time: do not read from file or database.
  • Here is some information on how to do it:
    • You can ask a Trans object for a RowProducer object
    • Also see the unit test case: org.pentaho.di.trans.RowProducerTest
    • Use this type of code:
      Trans trans = new Trans(... TransMeta ...);
      trans.prepareExecution(args);
      RowProcuder rp = trans.addRowProducer(String stepname, int stepCopy);
      
  • After that you start the threads in the transformation. Then you can inject the rows while the transformation is running:
    trans.startThreads();
    ...
    rp.putRow(some row you need to inject);
    ...
    
  • You can also specify the rows you are expecting to be injected. This makes it easier to build transformations because you have the meta-data at design time.
  • No labels