Why do you want to throw IllegalStateException in inSync() method?
I don't think I get the question. do we want to fail in a different way here?
Why should syncThread be a never ending thread?
It is because sync may be required anytime due to NN failover or journal service failure. If it's not a never ending thread, journal service needs to spawn sync thread on demand and lets the sync thread exit when sync is done. Both approaches need to handle the same set of situations, such as, the journal service state changes before sync finishes. The communication between main thread and sync thread is strait forward in both cases, and the never-ending-thread approach can avoid the cost of repeated thread creation.
There are bunch of TODO items
One cause of the TODOs is that, the NN is not updated to cooperate with journal service.
Why would syncThread be not null in run() method?
removed this check. I was over cautious there.
runSync - startSync name better? valueSet may not be needed?
changed name. removed valueSet since it's redundent with another veriable.
Other comments are addressed.