標籤:des style ar io color os sp strong on
1、通過設定KETTLE_HOME環境變數可以讓.kettle不需要在user.home下
2、預設kettle_home 為User.home,如果要自訂需要設定環境變數KETTLE_HOME
3、在.kettle目錄下可放置以下檔案或目錄:
| 檔案名稱 |
說明 |
| kettle.properties |
內部運行時的環境變數 |
| .languageChoice |
設定啟動並執行語言,方便進行介面語言的翻譯 --內容:LocaleDefault=en_US LocaleFailover=en_U |
| 其它 |
也可以放置Plugins目錄,增加自己的擴充外掛程式 |
4、外掛程式的類型:
類型 Plugin下的目錄 載入XML設定檔名
Step steps kettle-steps.xml
Partitioner steps …
JobEntry jobentries …
Repository repositories …
Database databases …
Lifecycle repositories …
Rules rules …
5、外掛程式的載入
a. 掃描目錄: <kettle_home>/plugins 、<運行目錄>/plugins、<kettle_home>/plugins/<第4點中類型對對應目錄 >、、<運行目錄>/plugins/<第4點中類型對對應目錄>
說明:前兩個掃描申明,後兩個是掃描XML定義檔案。
可以將所有定義的類路徑以逗號分隔設定到KETTLE_PLUGIN_CLASSES變數中用於調試。
b.第一種方式:定義通用Xml格式結構
(1) steps/step (見kettle-steps.xml)
下 屬性或元素:id, description, iconfile, tooltip, category(相容i18n), classname, errorhelpfile
樣本:
<step id="Injector">
<description>i18n:org.pentaho.di.trans.step:BaseStep.TypeLongDesc.Injector</description> <!--
:外掛程式的名字顯示
以i18n:開頭按:分隔,第一部分是message所在的package路徑,第二部分是它的message key.
-->
<classname>org.pentaho.di.trans.steps.injector.InjectorMeta</classname> <!--
:外掛程式對應的類
-->
<category>i18n:org.pentaho.di.trans.step:BaseStep.Category.Inline</category> <!--
:外掛程式分類的名字顯示
以i18n:開頭按:分隔,第一部分是message所在的package路徑,第二部分是它的message key.
-->
<tooltip>i18n:org.pentaho.di.trans.step:BaseStep.TypeTooltipDesc.Injector</tooltip>
<iconfile>ui/images/INJ.png</iconfile>
</step>
(2) libraries/library (外掛程式引用Jar,可多個)
下 屬性: name (相對當前外掛程式目錄的一個路徑)
(3) localized_category/category (外掛程式的分類顯示文字,可多個)
下 屬性: locale(指定國家語言代碼,如:en_US,zh_CN
值:對應的文字
(4) localized_description/description(外掛程式標題文字,可多個)
下 屬性: locale(指定國家語言代碼,如:en_US,zh_CN
值:對應的文字
(5) localized_tooltip/tooltip(外掛程式提示文字,可多個)
下 屬性: locale(指定國家語言代碼,如:en_US,zh_CN
值:對應的文字
c. 第二種方式: 掃描
<kettle_home>/plugins 、<運行目錄>/plugins、<kettle_home>/plugins/<第4點中類型對對應目錄>這三個目錄下所有的Jar包的裡面有類型對應的申明的類(這種方式就需要通過定義檔案來完成)
類型 介面 對應的申明類
Step org.pentaho.di.trans.step.StepMetaInterface org.pentaho.di.core.annotations.Step
Partitioner org.pentaho.di.core.annotations.PartitionerPlugin
JobEntry org.pentaho.di.job.entry.JobEntryInterface org.pentaho.di.core.annotations.JobEntry
Repository org.pentaho.di.core.annotations.RepositoryPlugin
Database org.pentaho.di.core.plugins.DatabaseMetaPlugin
Lifecycle org.pentaho.di.core.annotations.LifecyclePlugin
ImportRule org.pentaho.di.core.annotations.ImportRulePlugin
c. 第三種,載入內建的.xml檔案,如:kettle-engine.jar內根目錄下.xml檔案。
如:kettle-variables.xml,kettle-steps.xml,kettle-job-entries.xml
也可以通過環境變數來影響:steps(KETTLE_CORE_STEPS_FILE),JobEntry(KETTLE_CORE_JOBENTRIES_FILE)
6、效能最佳化提示:可以適當去除一些不需要用到的外掛程式,這樣就會加快Spoon開發工具的啟動速度。
如:AgileBI等,
ETL Pentaho代碼學習筆記