Github user tedxia commented on the pull request:
https://github.com/apache/storm/pull/268#issuecomment-58614296
In this patch, Client have TimeCacheMap for cache new messages that has't
been send out. Worker only need add message to corresponding Client, and Client
will decide when to send the new arrival message. At most time Client will send
new arrival message as soon as possible, but when the connect had been lost or
there are older message. So I removed "send" in worker.clj.
For Client, there is a State machine stand for Client's current state, such
as NEW, CONNECTED, DISCONNECTED and CLOSED. At first Client' state is NEW, then
we will connect remote worker by start a timer that run connect logic (we call
it connector) immediately. If connect success, Client't state will become
CONNECTED, connector will start a periodic timer for send message to remote
worker (we call it flusher). If connect failed, it will retry a few times
until success or Client's state become CLOSED. When Client's state become
CLOSED, Client will be destoried. Flusher will send cached message
periodically, and when flush failed Client's state will become DISCONNECTED and
start connector immediately. For reduce message transfer delay, when some
message arrival, we will start flusher immediately, and of course flusher only
work when Client's state are CONNECTED.
That it the main change for this patch. I am very sorry for all of this. As
a new man for opensource, i will try my best to do better.
Thanks all.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---