Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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 use unit test case test in package: be org.ibridgepentaho.kettledi.testtrans.rowproducerRowProducerTest
    • Use this type of code:
      Code Block
      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:
    Code Block
    trans.startThreads();
    ...
    rp.putRow(Row SomeRowYouHaveToInjectsome 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.