On the Life cycle Problem of Storm’s Spout Component

  java, question

Hello, everyone, just started to learnStormFull stop
According to the article “Storm Begins,” I wrote aWordCountThe program.
thereinSpoutThe content of is:

 public void nextTuple(){
 String str;
 try {
 while((str =reader.readLine())!  =null) {
 this._collection.emit(new Values(str),str);  //Transmit the lines read from the file
 } catch (IOException ex) {
 throw new RuntimeException("error reading tuple");

The main function of this program is to read lines from files and send them out. Because ..nextTuple()Methods will be called continuously, then data will be transmitted continuously. But every callnextTupleWill you read this file again from the beginning? The file size is good. What should I do if I have a few T files?

The concept is still unclear, please explain it. Thank you

Oh. . I understand myself
Because ..readerThe object is in theopen()The initialized in the method. So it is initialized once and then called every timenextTuple()Methods are not read from the beginning, but from the current location.