storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bilal Al Fartakh <alfartaj.bi...@gmail.com>
Subject duplicated result
Date Tue, 06 May 2014 10:38:37 GMT
I'm using a bolt that receives tuples from another bolt (exclamation bolt )
and writes it on a file , the problem I got is that I have duplicated
results four times , like when I emit a word , I found the word Written four
times . where's the problem possibly could be ?




public class PrinterBolty 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) {
  }

}


-- 
*Al Fartakh Bilal*

Mime
View raw message