<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to get GlobalMap content from start block in tJavaFlex in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313524#M84366</link>
    <description>OK, I think I misunderstood before. This is quite complicated since you are not able to query by batch of 10000 records. You have also not mentioned in what format you need to pass the data to your external Jar. You say a List, but I am assuming that you are talking about a List of rows. So how will the rows be held in the List? 
&lt;BR /&gt;What you could do is use a tJavaFlex to iterate over the records and add them to a List in the Main Code. Keep a count in the Main Code and for every 10000 records use an IF condition to send the List to your External Jar. In that IF also empty the List so that a fresh List can be built over the next 10000 records. In the IF also add the returned List to a Collection class (whichever you prefer) and store that Collection class in the GlobalMap variable.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;Every time that IF condition is accessed (for every 10000 records), send the List to the External Jar, retrieve the Collection class from the GlobalMap, add the return from the External Jar to the globalMap. Keep doing this until all of the data has been processed and is in a List inside the Collection class inside the GlobalMap. 
&lt;BR /&gt; 
&lt;BR /&gt;Then in another subjob, start with a tJavaFlex. In the Start Code retrieve the Collection class from the globalMap and initiate a For Loop based on the size of the Collection class. Then for each iteration of the loop (still in the Start Code) retrieve the List that was returned by the External Jar. Then create another For Loop (still inside the Start Code section) based on the number of rows in that particular List. The rest of the code takes place in the Main Code. 
&lt;BR /&gt;In the Main Code what you are dealing with is the each iteration of the inner loop (the List from the External Jar). Extract the column data and send it to the next component (you will need to create a suitable schema for the tJavaFlex). 
&lt;BR /&gt; 
&lt;BR /&gt;Then in the End Code, you will need to close both the loops initiated in the Start Code. 
&lt;BR /&gt; 
&lt;BR /&gt;By doing this, you are first (in the first subjob) building a massive collection of data (be careful as memory may be an issue). In the second subjob (starting with the tJavaFlex) you are extracting the rows and returning them to a normal flow.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;As I said, this is quite complicated and the sort of thing that I would normally have to demonstrate. I am hoping you are able to extract enough from this brief description to do something similar. But struggling through a problem is far better than being given one I guess &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Fri, 27 Nov 2015 01:17:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-11-27T01:17:22Z</dc:date>
    <item>
      <title>Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313516#M84358</link>
      <description>&lt;P&gt;Job flow is shown with screenshot.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;tJavaFlex code:&lt;BR /&gt;&lt;BR /&gt;Startcode:&lt;BR /&gt;int currentId = (Integer)globalMap.get("out1.ID");&lt;BR /&gt;String LogRowIn = (String)globalMap.get("out1.LogRowIn");&lt;BR /&gt;for(int i=0; i&amp;lt;((Long)globalMap.get("out1.iterations")); i++) {&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;MainCode:&lt;BR /&gt;row2.ID = currentId;&lt;BR /&gt;row2.LogRowOut = LogRowIn;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;EndCode:&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;---------------------------------------------&lt;BR /&gt;While execution log showing these exception why?&lt;BR /&gt;&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;at wurfl_smutility_connector.tflowiteratejob_0_1.tFlowiterateJob.tFileInputRegex_1Process(tFlowiterateJob.java:1391)&lt;BR /&gt;at wurfl_smutility_connector.tflowiteratejob_0_1.tFlowiterateJob.tLibraryLoad_1Process(tFlowiterateJob.java:412)&lt;BR /&gt;at wurfl_smutility_connector.tflowiteratejob_0_1.tFlowiterateJob.runJobInTOS(tFlowiterateJob.java:1857)&lt;BR /&gt;at wurfl_smutility_connector.tflowiteratejob_0_1.tFlowiterateJob.main(tFlowiterateJob.java:1714)&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGvs.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142827iD51682339B5C0CBB/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGvs.jpg" alt="0683p000009MGvs.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 17:14:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313516#M84358</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-23T17:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313517#M84359</link>
      <description>This is because the globalMap variables have not been set at the time the start code is fired. You need to use these variables in the main code.</description>
      <pubDate>Mon, 23 Nov 2015 23:52:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313517#M84359</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-23T23:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313518#M84360</link>
      <description>Thanks Rilhia for you reply, how can i change my tjavaflex code to run the above job.&amp;nbsp;</description>
      <pubDate>Tue, 24 Nov 2015 03:48:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313518#M84360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-24T03:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313519#M84361</link>
      <description>Is there any chance to read the component column data from start code... Because i want read the all data from start code then will do process from main code using loop</description>
      <pubDate>Tue, 24 Nov 2015 03:57:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313519#M84361</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-24T03:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313520#M84362</link>
      <description>I'm not sure what you are trying to achieve here. Why are you using the tFlowToIterate? Why not connect the tMap to the tJavaFlex? What is the point of iterating over the dataset? I feel there might be a better way of achieving your goal, but would need to know what that goal is to go further.&amp;nbsp;</description>
      <pubDate>Tue, 24 Nov 2015 09:19:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313520#M84362</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-24T09:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313521#M84363</link>
      <description>Thanks to considering my post.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;I designed a job using tJavaFlex. In main code these are the steps I followed 
&lt;BR /&gt; 
&lt;BR /&gt;1) Read data from input file 
&lt;BR /&gt;2) if readLines=10000, store them into List then process list with externalJar and get outputList . 
&lt;BR /&gt;3) store outputList in 'GlobalMap' 
&lt;BR /&gt;4) clear list. 
&lt;BR /&gt;5) Repeat 2, 3, 4 until EOF and store outputLists to GlobalMap. 
&lt;BR /&gt;6) write records to outputfile 
&lt;BR /&gt; 
&lt;BR /&gt;In End code: 
&lt;BR /&gt;I processed last records and stored in GlobalMap 
&lt;BR /&gt;--- 
&lt;BR /&gt;Now we have GlobalMap which has list data 
&lt;BR /&gt; 
&lt;BR /&gt;But I'm facing issue to process big file(~&amp;gt;1GB) using tJavaFlex because GlobalMap depends on JVM Hap(Ram), I increased Heap(min-4Gb, Max-7Gb). 
&lt;BR /&gt; 
&lt;BR /&gt;Can you tell me any component/Process to mitigate my issue?</description>
      <pubDate>Thu, 26 Nov 2015 16:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313521#M84363</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-26T16:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313522#M84364</link>
      <description>You don't appear to be using the functionality supplied by the Jar unless you are using this in the tMap. Why is it only processing 10000 rows at a time? You need to break this down into more components. I think you will need a tLoop to do this. I have an example of a tLoop being used in a relatively dynamic way 
&lt;A href="https://www.rilhia.com/tutorials/using-talend-get-your-spotify-listening-history-facebook" target="_blank" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;. It's not what you are doing which will be looping on every 10000 records (without knowing the total number of records), but it does loop on an unknown number of service calls. The looping mechanism should give you an idea how to achieve this.</description>
      <pubDate>Thu, 26 Nov 2015 17:26:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313522#M84364</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-26T17:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313523#M84365</link>
      <description>I like your tutorials, got basic things from your tutorial.
&lt;BR /&gt;
&lt;BR /&gt;This is the flow I want to do:
&lt;BR /&gt;
&lt;BR /&gt;tFileInput(Column: Record) ---&amp;gt; tMap(Column: Seq_id,Record)--(iterate)--&amp;gt;tLoop(what can we define here?)---&amp;gt;Get records and process with externaljar----&amp;gt;tFileOutputDelimited
&lt;BR /&gt;
&lt;BR /&gt;How can I iterate records using tLoop, what components can i use with it?
&lt;BR /&gt;
&lt;BR /&gt;for example I have 1 billion records,&amp;nbsp;
&lt;BR /&gt;First I want to iterate loop for 1 million records(iterate loop until seq_id is 1billion) ----&amp;gt;tJavaFlex to Save records in list then list into GlobalMap---&amp;gt; tJavaFlex to process GlobalMap's List---&amp;gt;tJavaFlex to save records output----&amp;gt;tFileOutput
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;Is it possible? can you give me brief design to do this?&amp;nbsp;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;&amp;nbsp;</description>
      <pubDate>Thu, 26 Nov 2015 19:56:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313523#M84365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-26T19:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313524#M84366</link>
      <description>OK, I think I misunderstood before. This is quite complicated since you are not able to query by batch of 10000 records. You have also not mentioned in what format you need to pass the data to your external Jar. You say a List, but I am assuming that you are talking about a List of rows. So how will the rows be held in the List? 
&lt;BR /&gt;What you could do is use a tJavaFlex to iterate over the records and add them to a List in the Main Code. Keep a count in the Main Code and for every 10000 records use an IF condition to send the List to your External Jar. In that IF also empty the List so that a fresh List can be built over the next 10000 records. In the IF also add the returned List to a Collection class (whichever you prefer) and store that Collection class in the GlobalMap variable.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;Every time that IF condition is accessed (for every 10000 records), send the List to the External Jar, retrieve the Collection class from the GlobalMap, add the return from the External Jar to the globalMap. Keep doing this until all of the data has been processed and is in a List inside the Collection class inside the GlobalMap. 
&lt;BR /&gt; 
&lt;BR /&gt;Then in another subjob, start with a tJavaFlex. In the Start Code retrieve the Collection class from the globalMap and initiate a For Loop based on the size of the Collection class. Then for each iteration of the loop (still in the Start Code) retrieve the List that was returned by the External Jar. Then create another For Loop (still inside the Start Code section) based on the number of rows in that particular List. The rest of the code takes place in the Main Code. 
&lt;BR /&gt;In the Main Code what you are dealing with is the each iteration of the inner loop (the List from the External Jar). Extract the column data and send it to the next component (you will need to create a suitable schema for the tJavaFlex). 
&lt;BR /&gt; 
&lt;BR /&gt;Then in the End Code, you will need to close both the loops initiated in the Start Code. 
&lt;BR /&gt; 
&lt;BR /&gt;By doing this, you are first (in the first subjob) building a massive collection of data (be careful as memory may be an issue). In the second subjob (starting with the tJavaFlex) you are extracting the rows and returning them to a normal flow.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;As I said, this is quite complicated and the sort of thing that I would normally have to demonstrate. I am hoping you are able to extract enough from this brief description to do something similar. But struggling through a problem is far better than being given one I guess &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Fri, 27 Nov 2015 01:17:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313524#M84366</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-27T01:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get GlobalMap content from start block in tJavaFlex</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313525#M84367</link>
      <description>Thanks for your reply, I found another flow, instead of using RAM why don't I use InMemory with Disk. 
&lt;BR /&gt;&amp;nbsp;I used to store all 2 billion data in GlobalMap and system got hung because of huge JVM heap. 
&lt;BR /&gt;&amp;nbsp;So i got other idea which follows as&amp;nbsp; 
&lt;BR /&gt;tInputFile(Column:Record)---- Split the record into 'n' files ---- Using tJavaFlex read every file, call externalJar(it has method by passby parameter as file) then write back result values into file. 
&lt;BR /&gt;Finally every input splits will interact with tJavaFlex and get n target files in disk. 
&lt;BR /&gt;Then combine all n input records to target file. 
&lt;BR /&gt; 
&lt;BR /&gt;What component I can use to split the file into n files? 
&lt;BR /&gt;If possible, What component I can use to combine n files into target files &amp;nbsp;? 
&lt;BR /&gt;If possible, How to append target data for every file? 
&lt;BR /&gt;Please give me the brief design to proceed.</description>
      <pubDate>Fri, 27 Nov 2015 15:46:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-get-GlobalMap-content-from-start-block-in-tJavaFlex/m-p/2313525#M84367</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-27T15:46:21Z</dc:date>
    </item>
  </channel>
</rss>

