Rework synchronization of SessionStateImpl
SessionStateImpl is a simple state tracker, but its lifecycle was
needlessly complex due to it not being inherently tied to its session.
Make sure SessionStateImpl is instantiated only when we have a session,
which makes a number of operations clearer: we no longer need to deal
with partial initialization and need to protect only internal state.
While we are at it, simplify all of that by keeping simple longs
instead of LongAdder -- and use saturatedOf(long) to convert these to
Uint objects, preventing possible runtime exceptions when overflows
occur.
JIRA: BGPCEP-920
Change-Id: I57b33c7dc33fe63500f5ad96a80d39889c6c5a67
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
de6df3ea177d609faf693fe5c32479ba66998b7f)