Kettle conversion and job plug-in development and commissioning

Source: Internet
Author: User

This is a document that was written a few years ago and recently intended to rewrite the kettle plugin tutorial based on this document. Results for various reasons, a push and then push. Today, simply publish this document, share to everyone, examples and so on to fill up. This is a kettle plugin document based on kettle3.2. But now the latest version of the Kettle interface has completely changed, but those components are still familiar. A little bit familiar with the data processing should not be unfamiliar to kettle, Kettle is a quick format and data extraction tool. Well, in the following:

If you are interested in Kettle plug-ins can go to the official website to see more information: http://www.pentaho.com/product/data-integration.

Latest Source: https://github.com/pentaho/pentaho-kettle/

kettle3.2 Source: http://sourceforge.net/projects/pentaho/files/Data%20Integration/3.2.0-stable/

  First, the development environment:

Tools: Eclipse, MyEclipse

JDK1.5 or above

Dependency Package: Lib/kettle-core.jar

Lib/kettle-db.jar

Lib/kettle-engine.jar

Lib/kettle-ui-swt.jar

Libswt/win32/swt.jar

  Second, the transformation of the development process:

1. Copy the Org.pentaho.di.trans.steps.dummytrans package to the specified package name. The Dummytrans package consists of 4 files. Dummytrans.java, Dummytransdata.java, Dummytransmeta.java, Messages.java.

2. Use the refactor (refactoring) function in Eclipse to rename dummytrans*. java to Mytrans *.java. Then the corresponding method can be implemented.

(1) Mytransdialog.java: The object that generated the dialog box.

(2) Mytrans.java: Responsible for data processing and conversion, the main conversion logic is implemented here.

(3) Mytransmeta.java: Responsible for meta data processing. Includes the load XML transform file, checksum.

(4) Mytransdata.java: Contains the specific data that is involved in data processing.

3. Create the messages directory under the Org.pentaho.di.trans.steps.mytrans package and add the relevant resource files. For example, messages_en_us.properties,messages_zh_cn.properties and so on.

4, the program into a jar package.

5. Prepare a picture in PNG format.

6. Write plug-in XML (Plugin.xml)

<?XML version= "1.0" encoding= "UTF-8"?><pluginID= "Mytransexample"              -->Component ID (must be unique) iconfile= "Icon.png"-Display picture description= "My Trans Example"-Convert description tooltip    = "This is a trans example!" --Hint message category= "Input"---> Plug-in position classname= "Com.test.mytrans.MyTransMeta" >---> Entrance class<Libraries>            <Libraryname= "Kettle-plugin.jar"/>---> Plug-in jar packages</Libraries>    <localized_category>---> Plugin display location<categorylocale= "en_US">Input</category>     <categorylocale= "ZH_CN">Input</category>   </localized_category>   <localized_description>---> Plugin description<Descriptionlocale= "en_US">This is a trans plugin example!</Description>     <Descriptionlocale= "ZH_CN">This is an example of a plugin conversion</Description>   </localized_description>   <Localized_tooltip>---> Tip information<tooltiplocale= "en_US">This is a trans plugin example!</tooltip>     <tooltiplocale= "ZH_CN">Plugin Conversion Example</tooltip>   </Localized_tooltip></plugin>

Place the compiled jar packages, PNG images, and XML files under the Kettle installation directory./plugins/steps/myforder (Customize a folder), restart the kettle.

  Third, the Operation Development steps:

1, respectively, copy Org.pentaho.di.job.entries.abort, Org.pentaho.di.job.entries.abort.messages and Org.pentaho.di.ui.job.entries.abort package to the specified package name

2. Use the refactor (refactoring) function in Eclipse to rename jobentry*. java to Myjobentry *.java. Then the corresponding method can be implemented.

3, modify the internationalization configuration file. For example, messages_en_us.properties,messages_zh_cn.properties and so on.

4, the program reached the corresponding jar package.

5. Prepare a picture in PNG format.

6. Write plug-in XML (Plugin.xml)

Similar to conversion plugin.xml. Refer to the Kettle installation directory: Plugin.xml file under the/plugins/jobentries/dummyjob directory

7. Place the compiled jar package, PNG image, and XML file under the Kettle installation directory./plugins/jobentries/myforder (Customize a folder), restart the kettle.

  Iv. plug-in development and commissioning

1, Link source debugging:

(1) Under the Kettle3.2 project, into the Plugins->steps directory, found inside there is a dummyplugin directory, which is kettle the official provision of external conversion plug-ins, dpl.png, Dummy.jar, Plugin.xml, is what a complete plugin needs.

(2) in the same directory with Dummyplugin, set up folder Templatestep, Templatestepplugin project under the Icon.png, plugin.xml files Copy here, jar package will not be

(3) The most important step is to right-click on the Project Kettle 3.2, select Properties, then select Java Build Path on the left-hand side, then select Source in the tab above, then there are a few buttons on the right.

Click the link Source button, set up your plugin source directory and directory name, see:

Run. After the association, we find kettle The entrance run class Spoon.java, you can find this type of selection through the shortcut key Ctrl+shift+r debugging run, enter the Kettle Workbench, open the test file TEST.KTR.

2, Kettle remote debugging

(1) The key to remote debugging is to first set the remote debugging parameters in the Kettle boot configuration, then set the port number of remote debugging monitoring in eclipse, so it is OK.

(2) Enter the Pdi-ce-3.2.0-stable.zip extracted from the directory, edit the boot configuration file Spoon.bat,linux of course is spoon.sh

Add this sentence to the file:

Set opt=-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8285 

Location See:


Click Spoon.bat to enter the Kettle Workbench

(3) Open Eclipse, go to the menu run-->debug configurations, select the remote Java application on the left, right-click to create a new debugging application, set such as,

Port is the above parameter in the Port 8285, all OK, select the following Debug button.

(4) in the Kettle Workbench, run just the test conversion file Test.ktr,eclipse start listening debugging, you can set breakpoints.

Note: Part of the content from the Internet, because the time is not recorded in the original source. If you know you can contact me plus. Thank you!

Kettle conversion and job plug-in development and commissioning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.