Reimplement UnsignedLongRangeSet
We are tracking simple discrete values, for which a RangeSet is an
overkill due to it being generalized utility working with all possible
ranges.
Reimplement UnsignedLongRangeSet as UnsignedLongSet, tracking discrete
closed ranges of longs, which improves both memory footprint and speed
of contains()/add() operations.
This also spots a failure to disconnect purged histories during
FrontendHistoryMetadataBuilder.toLeaderState().
JIRA: CONTROLLER-1720
Change-Id: I24fae4174201fd133a282f27589d6c274c06c8dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
19a6bcd20358c883478ee3b82e67cb147113f1c0)