idan (2) [Avatar] Offline
#1
Hi,
I tried to run chapter 2 example code
Everything seems to works fine except the fact that the spout reading from the changelog.txt file infinte times
If my changed log look this:

b20ea50 nathan@example.com
064874b andy@example.com
28e4f8e andy@example.com
9a3e07f andy@example.com
cbb9cd1 nathan@example.com
0f663d2 jackson@example.com
0a4b984 nathan@example.com

When debugging the code the spout processing the file lines within infinite iterations.

When debugging this lines on class CommitFeedListener:

public void nextTuple() {
for (String commit : commits) {
outputCollector.emit(new Values(commit));
}
}

I can see clearly that commits=
b20ea50 nathan@example.com
064874b andy@example.com
28e4f8e andy@example.com
9a3e07f andy@example.com
cbb9cd1 nathan@example.com
0f663d2 jackson@example.com
0a4b984 nathan@example.com

but for some reason that method is invoked again and again

Any idea?

thanks.

Message was edited by:
idan
idan (2) [Avatar] Offline
#2
Re: Chapter2_the code is running infinite times
Hi,
Wondering if anyone had any chance to look at this?

thanks
sean.allen (19) [Avatar] Offline
#3
This is the intended behavior.

It simulates an unending stream of commits.
231442 (1) [Avatar] Offline
#4
Typo/bug in the code. Should be cluster.killTopology(“github-commit-count-topology”); #L

That will stop the topology after the sleep expires.
sean.allen (19) [Avatar] Offline
#5
Updated.

Thanks.