Pan


Pendahuluan

Pan digunakan untuk mengeksekusi file transformation yang berekstensi .ktr. Pan sendiri adalah script dalam bentuk file pan.bat (untuk Windows) dan pan.sh (untuk Unix/Linux).

Syntax Dasar

Syntax penggunaan dari pan tanpa menggunakan repository adalah :

pan -file=namafile [-version] [-log=namafilelog][-level=logging level]

Untuk logging level dapat dimasukkan nilai berikut :

Error    : Hanya menunjukkan error
Nothing  : Tidak menghasilkan output apapun
Minimal  : Menggunakan log yang minimal
Basic    : Merupakan nilai default dan berisi log yang dasa
Detailed : Memberikan output yang terinci
Debug    : Output debug, sangat rinci
Rowlevel : Log pada level baris data, dapat menghasilkan data yang sangat besar


Untuk Repository 

Repository

pan -rep=[NamaRepository] -trans=[NamaTransformation] -user=[NamaUser] -pass=[Password]


Contoh Penggunaan di Windows

  • Download file contoh.zip dari attachment di bawah atau dari link ini. Isi dari contoh.zip ini adalah file transformasi baca_propinsi.ktr dan satu contoh data propinsi.cvs.
  • Ekstrak isi file zip ini ke folder c:\contoh_kettle


  • Jalankan command prompt (Start | Run | ketik cmd | klik OK)
  • Masuk ke folder Kettle dan jalankan transformation baca_propinsi.ktr

    Contoh Perintah :
    C:\Documents and Settings\Feris>cd c:\Kettle

    C:\Kettle>pan -file=c:\contoh_kettle\baca_propinsi.ktr -level=detailed

  • Contoh rincian tampilan setelah eksekusi dari perintah di atas
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\Feris>cd c:\Kettle

    C:\Kettle>pan -file=c:\contoh_kettle\baca_propinsi.ktr -level=detail
    INFO  24-08 19:29:42,625 (LogWriter.java:println:406)  -Pan - Logging is at leve
    l : Basic logging
    INFO  24-08 19:29:42,640 (LogWriter.java:println:406)  -Pan - Start of run.
    2008/08/24 19:29:47:843 ICT [INFO] DefaultFileReplicator - Using "C:\DOCUME~1\Fe
    ris\LOCALS~1\Temp\vfs_cache" as temporary files store.
    INFO  24-08 19:29:49,031 (LogWriter.java:println:406)  -baca_propinsi - Dispatch
    ing started for transformation [baca_propinsi]
    INFO  24-08 19:29:49,031 (LogWriter.java:println:406)  -baca_propinsi - Nr of ar
    guments detected:0
    INFO  24-08 19:29:49,031 (LogWriter.java:println:406)  -baca_propinsi - This is
    not a replay transformation
    INFO  24-08 19:29:49,109 (LogWriter.java:println:406)  -baca_propinsi - This tra
    nsformation can be replayed with replay date: 2008/08/24 19:29:49
    INFO  24-08 19:29:49,109 (LogWriter.java:println:406)  -baca_propinsi - Initiali
    sing 3 steps...
    INFO  24-08 19:29:49,140 (LogWriter.java:println:406)  -Text file output.0 - Ope
    ning output stream in default encoding
    INFO  24-08 19:29:49,281 (LogWriter.java:println:406)  -CSV file input.0 - Start
    ing to run...
    INFO  24-08 19:29:49,296 (LogWriter.java:println:406)  -Modified Java Script Val
    ue.0 - Starting to run...
    INFO  24-08 19:29:49,312 (LogWriter.java:println:406)  -CSV file input.0 - Finis
    hed processing (I=34, O=0, R=0, W=33, U=0, E=0)
    INFO  24-08 19:29:49,312 (LogWriter.java:println:406)  -Text file output.0 - Sta
    rting to run...
    INFO  24-08 19:29:50,546 (LogWriter.java:println:406)  -Modified Java Script Val
    ue.0 - Finished processing (I=0, O=0, R=33, W=33, U=0, E=0)
    INFO  24-08 19:29:50,546 (LogWriter.java:println:406)  -Text file output.0 - Fin
    ished processing (I=0, O=34, R=33, W=33, U=0, E=0)
    INFO  24-08 19:29:50,625 (LogWriter.java:println:406)  -baca_propinsi - Transfor
    mation ended.
    INFO  24-08 19:29:50,625 (LogWriter.java:println:406)  -Pan - Finished!
    INFO  24-08 19:29:50,640 (LogWriter.java:println:406)  -Pan - Start=2008/08/24 1
    9:29:48.390, Stop=2008/08/24 19:29:50.640
    INFO  24-08 19:29:50,640 (LogWriter.java:println:406)  -Pan - Processing ended a
    fter 2 seconds.
    INFO  24-08 19:29:50,640 (LogWriter.java:println:406)  -baca_propinsi -
    INFO  24-08 19:29:50,640 (LogWriter.java:println:406)  -baca_propinsi - Process
    CSV file input'.0 ended successfully, processed 0 lines. ( 0 lines/s)
    INFO  24-08 19:29:50,640 (LogWriter.java:println:406)  -baca_propinsi - Process
    Modified Java Script Value'.0 ended successfully, processed 33 lines. ( 16 lines
    /s)
    INFO  24-08 19:29:50,640 (LogWriter.java:println:406)  -baca_propinsi - Process
    Text file output'.0 ended successfully, processed 33 lines. ( 16 lines/s)

    C:\Kettle>

  • Pada folder C:\contoh_kettle akan terbentuk satu file baru : propinsi.txt


  • Selesai
ċ
contoh.zip
(2k)
Feris Thia,
Aug 24, 2008, 5:26 AM
Comments