You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Hamza Asad <ha...@gmail.com> on 2014/05/27 10:41:43 UTC

Fwd: Output of storm topology?

---------- Forwarded message ----------
From: Hamza Asad <ha...@gmail.com>
Date: Tue, May 27, 2014 at 1:34 PM
Subject: Output of storm topology?
To: user@storm.incubator.apache.org


Respected All,
I'm new to storm, started working on it of my own as i'm impressed by the
features it is providing. I have successfully deployed storm, run wordcount
example. But i want to see the result. Either on a web UI or in a file. How
can i do that? Please help me as it is very necessary to validate my future
implementation results.

Regards
-- 
*Muhammad Hamza Asad*



-- 
*Muhammad Hamza Asad*

Re: Output of storm topology?

Posted by Hamza Asad <ha...@gmail.com>.
There is no such error. locally means on my local system. Any ways i have
emailed you the code separately. Please look into them and help me out in
resolving this issue
Thanks in advance
p.s any one else knows the solution, do let me knw please.


On Tue, May 27, 2014 at 8:46 PM, Bilal Al Fartakh
<al...@gmail.com>wrote:

> I used as you see the Basicoutputcollector
> and the path to the file we want to save is set here :
>
>  output = new BufferedWriter(new FileWriter("/root/src/storm-
> starter/hh.txt", true));
>
> and what do you mean about locally ? can you show me the error so I or
> another member can detect the problem , and if it's possible send me the
> code .
>
>
> 2014-05-27 16:39 GMT+01:00 Hamza Asad <ha...@gmail.com>:
>
> I have tested that, Spout is working fine and populating file BUT bolts
>> Output is not logging into desired output file locally.. Why? Any idea why
>> this is happening? Does Bolt write in a file located on local system? Is
>> there any specific outputCollector for that?
>>
>>
>> On Tue, May 27, 2014 at 1:49 PM, Bilal Al Fartakh <
>> alfartaj.bilal@gmail.com> wrote:
>>
>>> HI hamza !
>>> if you want to see the result  you can try programming your bolt to save
>>> results emitted from the spout/bolt  on a file .
>>> as example :
>>>
>>>
>>> PrinterBolt :
>>>
>>>
>>>
>>> package storm.starter;
>>>
>>> import backtype.storm.topology.BasicOutputCollector;
>>> import backtype.storm.topology.OutputFieldsDeclarer;
>>> import backtype.storm.topology.base.BaseBasicBolt;
>>> import backtype.storm.tuple.Tuple;
>>> import java.io.File;
>>> import java.io.BufferedWriter;
>>> import java.io.FileNotFoundException;
>>> import java.io.FileWriter;
>>> import java.io.IOException;
>>>
>>>
>>>
>>>
>>>
>>> public class PrinterBolt extends BaseBasicBolt {
>>>
>>>   @Override
>>>   public void execute(Tuple tuple, BasicOutputCollector collector) {
>>>
>>> try {
>>>  BufferedWriter output;
>>> output = new BufferedWriter(new
>>> FileWriter("/root/src/storm-starter/hh.txt", true));
>>>  output.newLine();
>>> output.append(tuple.getString(0));
>>> output.close();
>>>    } catch (IOException e) {
>>> // TODO Auto-generated catch block
>>> e.printStackTrace();
>>>  }
>>>
>>>   }
>>>
>>>   @Override
>>>   public void declareOutputFields(OutputFieldsDeclarer ofd) {
>>>   }
>>>
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------------------------------------
>>>
>>>
>>> then add your bolt to the main class topology
>>>
>>>
>>>     TopologyBuilder builder = new TopologyBuilder();
>>>
>>> PrinterBolt P = new PrinterBolt();
>>>     builder.setSpout("word", new hhhhh( ), 1);
>>>     builder.setBolt("exclaim1", new ExclamationBolt(),
>>> 3).shuffleGrouping("word");
>>>     builder.setBolt("exclaim2", P , 2).shuffleGrouping("exclaim1");
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> 2014-05-27 9:42 GMT+01:00 Hamza Asad <ha...@gmail.com>:
>>>
>>> Respected All,
>>>> I'm new to storm, started working on it of my own as i'm impressed by
>>>> the features it is providing. I have successfully deployed storm, run
>>>> wordcount example. But i want to see the result. Either on a web UI or in a
>>>> file. How can i do that? Please help me as it is very necessary to validate
>>>> my future implementation results.
>>>>
>>>> Regards
>>>>
>>>>
>>>> On Tue, May 27, 2014 at 1:41 PM, Hamza Asad <ha...@gmail.com>wrote:
>>>>
>>>>>
>>>>>
>>>>> ---------- Forwarded message ----------
>>>>> From: Hamza Asad <ha...@gmail.com>
>>>>> Date: Tue, May 27, 2014 at 1:34 PM
>>>>> Subject: Output of storm topology?
>>>>> To: user@storm.incubator.apache.org
>>>>>
>>>>>
>>>>> Respected All,
>>>>> I'm new to storm, started working on it of my own as i'm impressed by
>>>>> the features it is providing. I have successfully deployed storm, run
>>>>> wordcount example. But i want to see the result. Either on a web UI or in a
>>>>> file. How can i do that? Please help me as it is very necessary to validate
>>>>> my future implementation results.
>>>>>
>>>>> Regards
>>>>> --
>>>>> *Muhammad Hamza Asad*
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Muhammad Hamza Asad*
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> *Muhammad Hamza Asad*
>>>>
>>>
>>>
>>>
>>> --
>>> *Al Fartakh Bilal*
>>>
>>
>>
>>
>> --
>> *Muhammad Hamza Asad*
>>
>
>
>
> --
> *Al Fartakh Bilal*
>



-- 
*Muhammad Hamza Asad*

Re: Output of storm topology?

Posted by Bilal Al Fartakh <al...@gmail.com>.
I used as you see the Basicoutputcollector
and the path to the file we want to save is set here :
 output = new BufferedWriter(new FileWriter("/root/src/storm-starter/hh.txt",
true));

and what do you mean about locally ? can you show me the error so I or
another member can detect the problem , and if it's possible send me the
code .


2014-05-27 16:39 GMT+01:00 Hamza Asad <ha...@gmail.com>:

> I have tested that, Spout is working fine and populating file BUT bolts
> Output is not logging into desired output file locally.. Why? Any idea why
> this is happening? Does Bolt write in a file located on local system? Is
> there any specific outputCollector for that?
>
>
> On Tue, May 27, 2014 at 1:49 PM, Bilal Al Fartakh <
> alfartaj.bilal@gmail.com> wrote:
>
>> HI hamza !
>> if you want to see the result  you can try programming your bolt to save
>> results emitted from the spout/bolt  on a file .
>> as example :
>>
>>
>> PrinterBolt :
>>
>>
>>
>> package storm.starter;
>>
>> import backtype.storm.topology.BasicOutputCollector;
>> import backtype.storm.topology.OutputFieldsDeclarer;
>> import backtype.storm.topology.base.BaseBasicBolt;
>> import backtype.storm.tuple.Tuple;
>> import java.io.File;
>> import java.io.BufferedWriter;
>> import java.io.FileNotFoundException;
>> import java.io.FileWriter;
>> import java.io.IOException;
>>
>>
>>
>>
>>
>> public class PrinterBolt extends BaseBasicBolt {
>>
>>   @Override
>>   public void execute(Tuple tuple, BasicOutputCollector collector) {
>>
>> try {
>>  BufferedWriter output;
>> output = new BufferedWriter(new
>> FileWriter("/root/src/storm-starter/hh.txt", true));
>>  output.newLine();
>> output.append(tuple.getString(0));
>> output.close();
>>    } catch (IOException e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>>  }
>>
>>   }
>>
>>   @Override
>>   public void declareOutputFields(OutputFieldsDeclarer ofd) {
>>   }
>>
>> }
>>
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------------------------------------
>>
>>
>> then add your bolt to the main class topology
>>
>>
>>     TopologyBuilder builder = new TopologyBuilder();
>>
>> PrinterBolt P = new PrinterBolt();
>>     builder.setSpout("word", new hhhhh( ), 1);
>>     builder.setBolt("exclaim1", new ExclamationBolt(),
>> 3).shuffleGrouping("word");
>>     builder.setBolt("exclaim2", P , 2).shuffleGrouping("exclaim1");
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 2014-05-27 9:42 GMT+01:00 Hamza Asad <ha...@gmail.com>:
>>
>> Respected All,
>>> I'm new to storm, started working on it of my own as i'm impressed by
>>> the features it is providing. I have successfully deployed storm, run
>>> wordcount example. But i want to see the result. Either on a web UI or in a
>>> file. How can i do that? Please help me as it is very necessary to validate
>>> my future implementation results.
>>>
>>> Regards
>>>
>>>
>>> On Tue, May 27, 2014 at 1:41 PM, Hamza Asad <ha...@gmail.com>wrote:
>>>
>>>>
>>>>
>>>> ---------- Forwarded message ----------
>>>> From: Hamza Asad <ha...@gmail.com>
>>>> Date: Tue, May 27, 2014 at 1:34 PM
>>>> Subject: Output of storm topology?
>>>> To: user@storm.incubator.apache.org
>>>>
>>>>
>>>> Respected All,
>>>> I'm new to storm, started working on it of my own as i'm impressed by
>>>> the features it is providing. I have successfully deployed storm, run
>>>> wordcount example. But i want to see the result. Either on a web UI or in a
>>>> file. How can i do that? Please help me as it is very necessary to validate
>>>> my future implementation results.
>>>>
>>>> Regards
>>>> --
>>>> *Muhammad Hamza Asad*
>>>>
>>>>
>>>>
>>>> --
>>>> *Muhammad Hamza Asad*
>>>>
>>>
>>>
>>>
>>> --
>>> *Muhammad Hamza Asad*
>>>
>>
>>
>>
>> --
>> *Al Fartakh Bilal*
>>
>
>
>
> --
> *Muhammad Hamza Asad*
>



-- 
*Al Fartakh Bilal*

Re: Output of storm topology?

Posted by Hamza Asad <ha...@gmail.com>.
I have tested that, Spout is working fine and populating file BUT bolts
Output is not logging into desired output file locally.. Why? Any idea why
this is happening? Does Bolt write in a file located on local system? Is
there any specific outputCollector for that?


On Tue, May 27, 2014 at 1:49 PM, Bilal Al Fartakh
<al...@gmail.com>wrote:

> HI hamza !
> if you want to see the result  you can try programming your bolt to save
> results emitted from the spout/bolt  on a file .
> as example :
>
>
> PrinterBolt :
>
>
>
> package storm.starter;
>
> import backtype.storm.topology.BasicOutputCollector;
> import backtype.storm.topology.OutputFieldsDeclarer;
> import backtype.storm.topology.base.BaseBasicBolt;
> import backtype.storm.tuple.Tuple;
> import java.io.File;
> import java.io.BufferedWriter;
> import java.io.FileNotFoundException;
> import java.io.FileWriter;
> import java.io.IOException;
>
>
>
>
>
> public class PrinterBolt extends BaseBasicBolt {
>
>   @Override
>   public void execute(Tuple tuple, BasicOutputCollector collector) {
>
> try {
>  BufferedWriter output;
> output = new BufferedWriter(new
> FileWriter("/root/src/storm-starter/hh.txt", true));
>  output.newLine();
> output.append(tuple.getString(0));
> output.close();
>    } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
>  }
>
>   }
>
>   @Override
>   public void declareOutputFields(OutputFieldsDeclarer ofd) {
>   }
>
> }
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------------------------------------
>
>
> then add your bolt to the main class topology
>
>
>     TopologyBuilder builder = new TopologyBuilder();
>
> PrinterBolt P = new PrinterBolt();
>     builder.setSpout("word", new hhhhh( ), 1);
>     builder.setBolt("exclaim1", new ExclamationBolt(),
> 3).shuffleGrouping("word");
>     builder.setBolt("exclaim2", P , 2).shuffleGrouping("exclaim1");
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 2014-05-27 9:42 GMT+01:00 Hamza Asad <ha...@gmail.com>:
>
> Respected All,
>> I'm new to storm, started working on it of my own as i'm impressed by the
>> features it is providing. I have successfully deployed storm, run wordcount
>> example. But i want to see the result. Either on a web UI or in a file. How
>> can i do that? Please help me as it is very necessary to validate my future
>> implementation results.
>>
>> Regards
>>
>>
>> On Tue, May 27, 2014 at 1:41 PM, Hamza Asad <ha...@gmail.com>wrote:
>>
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Hamza Asad <ha...@gmail.com>
>>> Date: Tue, May 27, 2014 at 1:34 PM
>>> Subject: Output of storm topology?
>>> To: user@storm.incubator.apache.org
>>>
>>>
>>> Respected All,
>>> I'm new to storm, started working on it of my own as i'm impressed by
>>> the features it is providing. I have successfully deployed storm, run
>>> wordcount example. But i want to see the result. Either on a web UI or in a
>>> file. How can i do that? Please help me as it is very necessary to validate
>>> my future implementation results.
>>>
>>> Regards
>>> --
>>> *Muhammad Hamza Asad*
>>>
>>>
>>>
>>> --
>>> *Muhammad Hamza Asad*
>>>
>>
>>
>>
>> --
>> *Muhammad Hamza Asad*
>>
>
>
>
> --
> *Al Fartakh Bilal*
>



-- 
*Muhammad Hamza Asad*

Re: Output of storm topology?

Posted by Bilal Al Fartakh <al...@gmail.com>.
HI hamza !
if you want to see the result  you can try programming your bolt to save
results emitted from the spout/bolt  on a file .
as example :


PrinterBolt :



package storm.starter;

import backtype.storm.topology.BasicOutputCollector;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseBasicBolt;
import backtype.storm.tuple.Tuple;
import java.io.File;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;





public class PrinterBolt extends BaseBasicBolt {

  @Override
  public void execute(Tuple tuple, BasicOutputCollector collector) {

try {
 BufferedWriter output;
output = new BufferedWriter(new
FileWriter("/root/src/storm-starter/hh.txt", true));
output.newLine();
output.append(tuple.getString(0));
output.close();
  } catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

  }

  @Override
  public void declareOutputFields(OutputFieldsDeclarer ofd) {
  }

}







------------------------------------------------------------------------------------------------------------


then add your bolt to the main class topology


    TopologyBuilder builder = new TopologyBuilder();

PrinterBolt P = new PrinterBolt();
    builder.setSpout("word", new hhhhh( ), 1);
    builder.setBolt("exclaim1", new ExclamationBolt(),
3).shuffleGrouping("word");
    builder.setBolt("exclaim2", P , 2).shuffleGrouping("exclaim1");





















2014-05-27 9:42 GMT+01:00 Hamza Asad <ha...@gmail.com>:

> Respected All,
> I'm new to storm, started working on it of my own as i'm impressed by the
> features it is providing. I have successfully deployed storm, run wordcount
> example. But i want to see the result. Either on a web UI or in a file. How
> can i do that? Please help me as it is very necessary to validate my future
> implementation results.
>
> Regards
>
>
> On Tue, May 27, 2014 at 1:41 PM, Hamza Asad <ha...@gmail.com>wrote:
>
>>
>>
>> ---------- Forwarded message ----------
>> From: Hamza Asad <ha...@gmail.com>
>> Date: Tue, May 27, 2014 at 1:34 PM
>> Subject: Output of storm topology?
>> To: user@storm.incubator.apache.org
>>
>>
>> Respected All,
>> I'm new to storm, started working on it of my own as i'm impressed by the
>> features it is providing. I have successfully deployed storm, run wordcount
>> example. But i want to see the result. Either on a web UI or in a file. How
>> can i do that? Please help me as it is very necessary to validate my future
>> implementation results.
>>
>> Regards
>> --
>> *Muhammad Hamza Asad*
>>
>>
>>
>> --
>> *Muhammad Hamza Asad*
>>
>
>
>
> --
> *Muhammad Hamza Asad*
>



-- 
*Al Fartakh Bilal*

Re: Output of storm topology?

Posted by Hamza Asad <ha...@gmail.com>.
Respected All,
I'm new to storm, started working on it of my own as i'm impressed by the
features it is providing. I have successfully deployed storm, run wordcount
example. But i want to see the result. Either on a web UI or in a file. How
can i do that? Please help me as it is very necessary to validate my future
implementation results.

Regards


On Tue, May 27, 2014 at 1:41 PM, Hamza Asad <ha...@gmail.com> wrote:

>
>
> ---------- Forwarded message ----------
> From: Hamza Asad <ha...@gmail.com>
> Date: Tue, May 27, 2014 at 1:34 PM
> Subject: Output of storm topology?
> To: user@storm.incubator.apache.org
>
>
> Respected All,
> I'm new to storm, started working on it of my own as i'm impressed by the
> features it is providing. I have successfully deployed storm, run wordcount
> example. But i want to see the result. Either on a web UI or in a file. How
> can i do that? Please help me as it is very necessary to validate my future
> implementation results.
>
> Regards
> --
> *Muhammad Hamza Asad*
>
>
>
> --
> *Muhammad Hamza Asad*
>



-- 
*Muhammad Hamza Asad*