hmsonline / storm-cassandra

Storm Cassandra Integration
Apache License 2.0
180 stars 90 forks source link

sync - abstract batching bolt #19

Closed mebigfatguy closed 11 years ago

mebigfatguy commented 11 years ago

Why is stopRunning synchronized, but run's use of stopRequested not? seems odd.

ptgoetz commented 11 years ago

Out of old-school habits born before the java.util.concurrent package became part of the JDK. :)

But you're right. The stopRunning() method need not be synchronized.

Since the LinkedBlockingQueue handles blocking, I didn't have to use the wait()/notify() methods. If I had used notify() in the stopRunning() then it would need to be synchronized.

In reality the cleanup() and stopRunning() methods are not likely to be called since it's more likely that storm will kill -9 the parent process.