<?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>question Re: How to re route flow files to 4 Different processors ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233628#M75333</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/16912/manikandanjeyabal029.html" nodeid="16912" target="_blank"&gt;@Manikandan Jeyabal&lt;BR /&gt;&lt;/A&gt;You can use RouteonAttribute with&lt;STRONG&gt; fileSize&lt;/STRONG&gt; attribute and check if the &lt;STRONG&gt;size of flowfile&lt;/STRONG&gt; is greater than 1GB. 
&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:- &lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64498-filesize.png" style="width: 1702px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/14719iD610C315B6A794B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64498-filesize.png" alt="64498-filesize.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1.filesize &amp;gt; 1gig&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt; ${fileSize:gt(1048576000)}&lt;/PRE&gt;&lt;P&gt;in the above routeonattribute processor i have added new property which can detect and transfer flowfiles size if the size is greater than 1GB. we need to keep the size of file in bytes.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2.filesize &amp;gt;100MB and &amp;lt;500MB &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;${fileSize:gt(1048576):and(${fileSize:lt(524288000) &lt;/PRE&gt;&lt;P&gt;second property will route the flowfiles which are having sizes greater than &lt;STRONG&gt;100MB and less than 500 MB&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;
Like this way you can add new properties in Routeonattribute and transfer the flowfiles to corresponding convert record processors based on Filesizes.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;**1 megabyte (1048576 bytes)**&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;**1 Gigabyte = 1000 Megabytes**&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As i'm using &lt;STRONG&gt;gt,lt&lt;/STRONG&gt;(greaterthan,lessthan) based on your requirements you can use &lt;STRONG&gt;ge,le&lt;/STRONG&gt;(greaterthan or equalto,lessthan or equalto)&lt;/P&gt;&lt;P&gt;please refer to below link for expression language usage.&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#lt" target="_blank" rel="nofollow noopener noreferrer"&gt;https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#lt&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 00:11:46 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T00:11:46Z</dc:date>
    <item>
      <title>How to re route flow files to 4 Different processors ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233627#M75332</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;please help me out to solve this issue.&lt;/P&gt;&lt;P&gt;Im having 10 Different flow files in the following size.&lt;/P&gt;&lt;P&gt;3 files size (100-500MB)&lt;/P&gt;&lt;P&gt;2 Files (1GB)&lt;/P&gt;&lt;P&gt;2 Files(1.8GB)&lt;/P&gt;&lt;P&gt;3 files (50MB)&lt;/P&gt;&lt;P&gt;I need to write some logic that should reroute these 10 files to 4 Convert Record processors running parallely ? is there any way that we could do this ?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 21:23:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233627#M75332</guid>
      <dc:creator>manikandanjeyab</dc:creator>
      <dc:date>2018-03-05T21:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to re route flow files to 4 Different processors ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233628#M75333</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/16912/manikandanjeyabal029.html" nodeid="16912" target="_blank"&gt;@Manikandan Jeyabal&lt;BR /&gt;&lt;/A&gt;You can use RouteonAttribute with&lt;STRONG&gt; fileSize&lt;/STRONG&gt; attribute and check if the &lt;STRONG&gt;size of flowfile&lt;/STRONG&gt; is greater than 1GB. 
&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:- &lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64498-filesize.png" style="width: 1702px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/14719iD610C315B6A794B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64498-filesize.png" alt="64498-filesize.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1.filesize &amp;gt; 1gig&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt; ${fileSize:gt(1048576000)}&lt;/PRE&gt;&lt;P&gt;in the above routeonattribute processor i have added new property which can detect and transfer flowfiles size if the size is greater than 1GB. we need to keep the size of file in bytes.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2.filesize &amp;gt;100MB and &amp;lt;500MB &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;${fileSize:gt(1048576):and(${fileSize:lt(524288000) &lt;/PRE&gt;&lt;P&gt;second property will route the flowfiles which are having sizes greater than &lt;STRONG&gt;100MB and less than 500 MB&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;
Like this way you can add new properties in Routeonattribute and transfer the flowfiles to corresponding convert record processors based on Filesizes.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;**1 megabyte (1048576 bytes)**&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;**1 Gigabyte = 1000 Megabytes**&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As i'm using &lt;STRONG&gt;gt,lt&lt;/STRONG&gt;(greaterthan,lessthan) based on your requirements you can use &lt;STRONG&gt;ge,le&lt;/STRONG&gt;(greaterthan or equalto,lessthan or equalto)&lt;/P&gt;&lt;P&gt;please refer to below link for expression language usage.&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#lt" target="_blank" rel="nofollow noopener noreferrer"&gt;https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#lt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 00:11:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233628#M75333</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T00:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to re route flow files to 4 Different processors ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233629#M75334</link>
      <description>&lt;P&gt;Hi Shu,&lt;/P&gt;&lt;P&gt;Tanx for replying me, My actual problem is I have files more than 200 and My file size differ from 100 MB to 4 GB. and i need to split those in to 4 Concurrent Processors. could u give some suggestion for this ? the real Problem is i cant route based on file size, i need to send like my first flow file should go to first processor, and second go to second processor, and third go to third processor and finally fourth go to fourth processor, then finally 5'th should go to again first processor and this loop should continue till my last file.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 23:21:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233629#M75334</guid>
      <dc:creator>manikandanjeyab</dc:creator>
      <dc:date>2018-03-05T23:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to re route flow files to 4 Different processors ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233630#M75335</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/16912/manikandanjeyabal029.html" nodeid="16912" target="_blank"&gt;@Manikandan Jeyabal&lt;/A&gt;&lt;P&gt;For this case we can use &lt;STRONG&gt;UpdateAttribute processor&lt;/STRONG&gt; to &lt;STRONG&gt;add some sequence numbers&lt;/STRONG&gt; to the &lt;STRONG&gt;flowfiles&lt;/STRONG&gt; then use &lt;STRONG&gt;RouteonAttribute processor &lt;/STRONG&gt;to &lt;STRONG&gt;route the flowfiles&lt;/STRONG&gt; to&lt;STRONG&gt; one of four processors&lt;/STRONG&gt; based on the&lt;STRONG&gt; sequence number.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;UpateAttribute Configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="62677-updateattribute-storestate.png" style="width: 1877px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/14716iA9BB41A5BD72B63B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="62677-updateattribute-storestate.png" alt="62677-updateattribute-storestate.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;seq
&lt;/P&gt;&lt;PRE&gt;${getStateValue('seq'):plus(1)}&lt;/PRE&gt;&lt;P&gt;so we are adding new property in update attribute processor and get the state value of seq attribute if the value is not present then it gets value as 0 and we are adding 1 to it.&lt;/P&gt;&lt;P&gt;So when &lt;STRONG&gt;first flowfile passes&lt;/STRONG&gt; througth the &lt;STRONG&gt;update attribute processor&lt;/STRONG&gt; then it get &lt;STRONG&gt;seq attribute with value 1&lt;/STRONG&gt;,second flowfile gets&lt;STRONG&gt; 2 value for seq attribute&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Now once the processor reaches to&lt;STRONG&gt; 4 as seq attribute value,&lt;/STRONG&gt; then we need to &lt;STRONG&gt;reset that value as 1 &lt;/STRONG&gt;again(i.e for 5 flowfile the seq value would be 1 again)&lt;/P&gt;&lt;P&gt;To acheive this we need to use &lt;STRONG&gt;updateattribute processor&lt;/STRONG&gt; &lt;STRONG&gt;advance usage&lt;/STRONG&gt; and &lt;STRONG&gt;create new rule &lt;/STRONG&gt;overthere as&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Right Click on UpdateAttribute processor&lt;/LI&gt;&lt;LI&gt;Click on Advanced&lt;/LI&gt;&lt;LI&gt;then add new rule in the processor as shown in the below screenshot.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="62678-updateattribute-advance-usage.png" style="width: 3678px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/14717i6AF0FC4DE3D34F91/image-size/medium?v=v2&amp;amp;px=400" role="button" title="62678-updateattribute-advance-usage.png" alt="62678-updateattribute-advance-usage.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Rules&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;reset&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;U&gt;Conditions&lt;/U&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;U&gt;RuleName&lt;/U&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;reset&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;U&gt;Expression

&lt;/U&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;${getStateValue('seq'):equals(4)} &lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;U&gt;Actions
&lt;/U&gt;&lt;/STRONG&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;U&gt;Attribute&lt;/U&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;seq&lt;BR /&gt;&lt;U&gt;Attribute
Value

&lt;/U&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;1 &lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;So now the processor will reset the seq attribute value to 1 for every fifth flowfile.&lt;/DIV&gt;&lt;DIV&gt;Then Use &lt;STRONG&gt;&lt;U&gt;RouteOnattribute processor:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="62679-routeonattribute.png" style="width: 1798px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/14718i5EE7F53025446875/image-size/medium?v=v2&amp;amp;px=400" role="button" title="62679-routeonattribute.png" alt="62679-routeonattribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So now we are checking the &lt;STRONG&gt;seq attribute value&lt;/STRONG&gt; and &lt;STRONG&gt;transfer the first flowfile&lt;/STRONG&gt; to &lt;STRONG&gt;first processor &lt;/STRONG&gt;and second to second processors..&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 18 Aug 2019 00:11:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233630#M75335</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T00:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to re route flow files to 4 Different processors ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233631#M75336</link>
      <description>&lt;P&gt;Hi Shu,&lt;/P&gt;&lt;P&gt;that Works Great. Tanx for your sollution.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 14:19:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-re-route-flow-files-to-4-Different-processors/m-p/233631#M75336</guid>
      <dc:creator>manikandanjeyab</dc:creator>
      <dc:date>2018-03-06T14:19:56Z</dc:date>
    </item>
  </channel>
</rss>

