Thanks Xuan Gong,
Generally looks good, some minor comments:
- initializeQueueState: is it better to rename current to previous?
- And can we make the initializeQueueState accept 3 parameters: previous/configured/parent, with this we can do a more easier and comprehensive UT to make sure it won't break in the future.
2) Leaf(Parent)Queue#haveActiveApps can move to abstractCSQueue, or just completely remove the method since we can use getNumApplications instead.
3) AbstractCSQueue#updateQueueState, writeLock is not necessary for volatile. queueStateWriteLock can be directly removed.
4) QueueStateManager is not used by anybody now? Is it better to move to a separated patch? Which JIRA you plan to use it?