YARN-3039, we add loop in TimelineClient to wait for collectorServiceAddress ready before posting any entity. In consumer of TimelineClient (like AM), we are starting a new thread for each call to get rid of potential deadlock in main thread. This way has at least 3 major defects:
1. The consumer need some additional code to wrap a thread before calling putEntities() in TimelineClient.
2. It cost many thread resources which is unnecessary.
3. The sequence of events could be out of order because each posting operation thread get out of waiting loop randomly.
We should have something like event loop in TimelineClient side, putEntities() only put related entities into a queue of entities and a separated thread handle to deliver entities in queue to collector via REST call.