You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Sitakant Mishra <si...@gmail.com> on 2017/10/19 01:01:36 UTC

Regarding storage of Storm Output

Hi,

I have a bolt written in python which tries to open a file and store the
*storm.emit* output to a file. I do not see any errors while running, but I
am not able to find the location of file. Below are some portion of the
code.

class PythonPredictBolt(storm.BasicBolt):

    def process(self, tup):
        f = open('output.txt', 'w')
        data = tup.values[0].split(':')

       # Some Work

            result = "Predicted: " + str(rms)
            f.write(result)
            storm.emit([result])
        f.close()

PythonPredictBolt().run()

I am not sure how to proceed with this. Please help me with this.



Thanks and Regards,
Sitakanta Mishra

Re: Regarding storage of Storm Output

Posted by Sitakant Mishra <si...@gmail.com>.
Hi Dmitry,

Thank you very much for replying. I found the stormdist folder of my
supervisor. The file was there only if I create it before hand in
multilang/resources folder. My python code never creates it on its own.
Apart from that even if I create it nothing gets written down to it from
this statement "storm.emit([result])".

I am really stuck with this and have no clue. Please help.

Thanks in advance.


Regards,
Sitakanta Mishra


On Wed, Oct 18, 2017 at 7:09 PM, Dmitry Semenov <dm...@saritasa.com> wrote:

> the file should be inside stormdist folder of your supervisor
>
> On Wed, Oct 18, 2017 at 6:01 PM, Sitakant Mishra <
> sitakanta.mishra@gmail.com> wrote:
>
>> Hi,
>>
>> I have a bolt written in python which tries to open a file and store the
>> *storm.emit* output to a file. I do not see any errors while running,
>> but I am not able to find the location of file. Below are some portion of
>> the code.
>>
>> class PythonPredictBolt(storm.BasicBolt):
>>
>>     def process(self, tup):
>>         f = open('output.txt', 'w')
>>         data = tup.values[0].split(':')
>>
>>        # Some Work
>>
>>             result = "Predicted: " + str(rms)
>>             f.write(result)
>>             storm.emit([result])
>>         f.close()
>>
>> PythonPredictBolt().run()
>>
>> I am not sure how to proceed with this. Please help me with this.
>>
>>
>>
>> Thanks and Regards,
>> Sitakanta Mishra
>>
>>
>
>
> --
> ------------------------------
> <http://www.saritasa.com/>
> Dmitry Semenov
> dmitry@saritasa.com | 949.200.6839 | www.saritasa.com
> 20411 Birch St., Suite 330, Newport Beach, CA 92660
> <https://maps.google.com/?q=20411+Birch+St.,+Suite+330,+Newport+Beach,+CA+92660&entry=gmail&source=g>
>

Re: Regarding storage of Storm Output

Posted by Dmitry Semenov <dm...@saritasa.com>.
the file should be inside stormdist folder of your supervisor

On Wed, Oct 18, 2017 at 6:01 PM, Sitakant Mishra <sitakanta.mishra@gmail.com
> wrote:

> Hi,
>
> I have a bolt written in python which tries to open a file and store the
> *storm.emit* output to a file. I do not see any errors while running, but
> I am not able to find the location of file. Below are some portion of the
> code.
>
> class PythonPredictBolt(storm.BasicBolt):
>
>     def process(self, tup):
>         f = open('output.txt', 'w')
>         data = tup.values[0].split(':')
>
>        # Some Work
>
>             result = "Predicted: " + str(rms)
>             f.write(result)
>             storm.emit([result])
>         f.close()
>
> PythonPredictBolt().run()
>
> I am not sure how to proceed with this. Please help me with this.
>
>
>
> Thanks and Regards,
> Sitakanta Mishra
>
>


-- 
------------------------------
<http://www.saritasa.com/>
Dmitry Semenov
dmitry@saritasa.com | 949.200.6839 | www.saritasa.com
20411 Birch St., Suite 330, Newport Beach, CA 92660