Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

tpk
2012-04-25 11:06:31

Hi Pedro,

Thank You very much for the brief explanation. It makes sense for me and cleared my doubts.


Thanks and Regards,
Pavan

pedro
2012-04-25 10:53:23

Hi

Code:

1. What is the difference between Iterate and OnComponent OK?
2. Why does the job failed if i use Iterate in all the components?

I will explain it in a simple way.
The difference between Iterate and OnComponentOK is that OnComponentOK(OnSubjobOk) will declare a new method in Job code for one component while using Iterate it will in the same method with previous component.
When using Iterate, it may cause the wrong execution order of these components. Or sometimes some important values are not ready.
When using OnComponentOK, the method where the first component exists will call this new method. Make sure the right order and prepare all global values...

Regards,
Pedro

tpk
2012-04-25 10:27:46

Hi Pedro,

I had done the changes which you had mentioned, in fact i had done the job the same way before but the output links which i had given to the components were wrongly given. I had given "Iterate" out put links to all the components earlier in my job. After changing the output links to "OnComponent OK" it worked. So based on this i had few questions

1. What is the difference between Iterate and OnComponent OK?

2. Why does the job failed if i use Iterate in all the components?


And coming back to the job again, the job went on smoothly for small files, but for big files the tFileUnarchive can not extract the files. We had discussed earlier about this in the below mentioned link

http://www.talendforge.org/forum/viewto … 510#p83510

So i had sent you the download links where the files are up loaded, Could you please take a look at it and give me a solution, the download links are as below

bcbackcountry_2012-04-10.tar.gz... (207.55MB) - Completed
Download:    https://sizablesend.com/file/ec3xw3/bcb … _10.tar.gz
Short URL:    http://twelio.com/zyrqmt


bcsteepandcheap_2012-04-10.tar.gz... (194.49MB) - Completed
Download:    https://sizablesend.com/file/2s5fi2/bcs … _10.tar.gz
Short URL:    http://twelio.com/izjgn6

I also attach the error which i am getting when i am using big files to extract. My development environment is as below

TOS:5.0.1
OS: Windows Server 2008 R2 data center
RAM: 8GB


pedro wrote:

Hi Pavan

Sorry for my delay to answer.

According to your description at comment #14, I create a new job.
This time i'm sure it will work fine. I simply use tFileList to loop.
Now there are two tar.gz files(abc.tar.gz and abc2.tar.gz) under C:\Test directory in my local computer.

Loop1: tFileList gets the absolute file path of abc.tar.gz.
            tFileUnarchive unzip abc.tar.gz.
            Use onComponentOK to trigger tOracleExec.
            After finishing tOracleExec, use onComponnetOk to trigger tFileCopy. Copy abc.tar.gz from C:\Test to C:\Imported and remove source file(abc.tar.gz) in C:\Test.
            Use tFileList_2 to iterate files under C:\Extraction. Then tFileDelete will delete one.csv.
Loop2 : Start to get abc2.tar.gz.

Regards,
Pedro

pedro
2012-04-25 05:49:24

Hi Pavan

Sorry for my delay to answer.

According to your description at comment #14, I create a new job.
This time i'm sure it will work fine. I simply use tFileList to loop.
Now there are two tar.gz files(abc.tar.gz and abc2.tar.gz) under C:\Test directory in my local computer.

Loop1: tFileList gets the absolute file path of abc.tar.gz.
            tFileUnarchive unzip abc.tar.gz.
            Use onComponentOK to trigger tOracleExec.
            After finishing tOracleExec, use onComponnetOk to trigger tFileCopy. Copy abc.tar.gz from C:\Test to C:\Imported and remove source file(abc.tar.gz) in C:\Test.
            Use tFileList_2 to iterate files under C:\Extraction. Then tFileDelete will delete one.csv.
Loop2 : Start to get abc2.tar.gz.

Regards,
Pedro

tpk
2012-04-24 16:46:28

Hi all,

Can any one give me a solution for the above mentioned scenario?

Thanks and Regards,
Pavan

tpk
2012-04-24 15:29:04

Hi Pedro,

Any Comments/Update on the above mentioned process of how to do the same process in a loop?

Thanks and Regards,
Pavan

tpk
2012-04-24 13:12:05

Hi Pedro,

Thanks for the pain you had taken out for doing an example job, I use tOracleBulkexec to process the unarchived file after it is unarchived. The example which you had given is good enough if the source directory i.,e C:/Test had only one zip file, but i have some 14-15 files in the source directory. So let me explain you in a more clear way in step wise manner

1. First i need to take the first file for the first iteration and pass it to tFileUnarchive so that it will unarchive the zip file


2. Now after the tFileUnarchive un-archives the zip file in C:/Extraction directory, now the tOracleBulkExec will process one .tsv file which is unzipped by the tFileUnarchive component.

3. After the tOracleBulkExec process is over now i need to remove the First processed zip file and move it to C:/Imported directory(Which means that all the processed files will be placed in this directory)

4. And also i need to delete the extracted files which are extracted in C:/Extraction (this is because when second file is processed tOracleBulkExec must not process the same files of the First zip file)

The above mentioned process should be iterated in a loop for about 14-15 times.

But the example you had given will not work in a loop. How can this be accomplished to do in a loop for the entire process for each single file at a time?

Thanks and Regards,
Pavan

pedro
2012-04-24 05:12:38

Hi

I don't know what you do with tOracleBulkExec.
According to your requirement, you can create a job as below. There is no need to use three tFileList.

Regards,
Pedro

tpk
2012-04-23 19:13:31

Hi all,

Can any one please help with a working solution?

Thanks and Regards,
Pavan

tpk
2012-04-23 16:53:47

Hi all,

Any Ideas for the above mentioned?

Thanks and Regards,
Pavan

tpk
2012-04-23 15:13:27

Hi all,

Any solution for the above mentioned scenario? Where should i change my job in order to run my job successfully with out errors

Thanks in advance

Thanks and Regards,
Pavan

tpk
2012-04-23 13:31:08

Hi Elvis,

I had done the same way you mentioned, it doesn't work, "File not Found" error is coming when i run the job after making the changes which you had specified

Thanks and Regards,
Pavan


elvis wrote:

Try putting "C:\Test" in the direcory field and context.filename+"*.tar.gz" in the file mask.

I think from what I can gather you are trying to use the directory field as directory AND filemask.

tpk
2012-04-23 13:23:35

Hi Elvis,

The value of context.filename is comming from tJava where i had declared.

Thanks and Regards,
Pavan

elvis wrote:

What is the value of context.filename? (is it the filename or the directory to look for the file?)

elvis
2012-04-23 12:34:42

Try putting "C:\Test" in the direcory field and context.filename+"*.tar.gz" in the file mask.

I think from what I can gather you are trying to use the directory field as directory AND filemask.

elvis
2012-04-23 12:30:23

What is the value of context.filename? (is it the filename or the directory to look for the file?)

Board footer

Powered by FluxBB