streaming: Use interval_set to sort and merge ranges
So that the ranges are sorted and have no overlaps. We can have less
ranges to deal with and it can help the mutation readers to optimize.
Here is an exmaple of ranges generated by repair:
Before:
INFO 2016-12-07 17:44:21,185 [shard 0] stream_session - cf_id =
dec9fa90-bc3b-11e6-af78-000000000001,
before ranges = {(-3383928698815274642, -3376937163195039606],
(-7260764223708720005, -7251657821052234309], (-4767213984179237293,
-4747032371925842389], (-7645879646119667643, -7589962743703481776],
(-2340199306656526861, -2320523117224780931], (-576028861239229331,
-560973674020019962], (-4070378863644120252, -3987599893827407860],
(-2551584407739673151, -2498779102482524711], (-5416061903556353312,
-5354212455975869358], (37594980457713898, 67885601051654285],
(3083778975065200884, 3091232478835418439], (3131345970514528877,
3187922544267434961], (5765437476661317163, 5778671293583720541],
(5960610072466058818, 5972289771228014343], (7749618183851698485,
7758080813117351135], (-3987599893827407860, -3899198931034439776],
(-7251657821052234309, -7131649010279865221], (-3576581915808403133,
-3383928698815274642], (-417850207760366422, -327959672080599465],
(-2671876682129336880, -2551584407739673151], (-1305178847032904465,
-1137497074548854552], (8540448858050275827, 8610171849752115483],
(-560973674020019962, -417850207760366422], (-2498779102482524711,
-2340199306656526861], (2394447940525988167, 2523396860109747637],
(-6703329224557608009, -6517757811218772762], (-3675103288021821677,
-3576581915808403133], (-5622185785296846551, -5416061903556353312],
(8610171849752115483, 8742605005068551458], (8068079250973315241,
8185655671734937642], (560264964510741191, 790641981923757238],
(5581202487214475094, 5765437476661317163], (8742605005068551458,
8923908282731801645], (-6038176423022601107, -5622185785296846551],
(5778671293583720541, 5960610072466058818], (-3899198931034439776,
-3675103288021821677], (8356739976149429222, 8540448858050275827],
(-6517757811218772762, -6038176423022601107], (-8052600134279395253,
-7645879646119667643], (-327959672080599465, 37594980457713898],
(7758080813117351135, 8019254284118543066], (4781565016737645510,
5067070718000527886], (2523396860109747637, 3083778975065200884],
(-5354212455975869358, -4767213984179237293], (6784138025918878582,
7190719703944308372], (67885601051654285, 447405341661896387],
(-2190610927722759275, -1305178847032904465], (-4747032371925842389,
-4070378863644120252]}, size=48
After:
INFO 2016-12-07 17:44:21,185 [shard 0] stream_session - cf_id =
dec9fa90-bc3b-11e6-af78-000000000001,
after ranges = {(-8052600134279395253, -7589962743703481776],
(-7260764223708720005, -7131649010279865221], (-6703329224557608009,
-3376937163195039606], (-2671876682129336880, -2320523117224780931],
(-2190610927722759275, -1137497074548854552], (-576028861239229331,
447405341661896387], (560264964510741191, 790641981923757238],
(2394447940525988167, 3091232478835418439], (3131345970514528877,
3187922544267434961], (4781565016737645510, 5067070718000527886],
(5581202487214475094, 5972289771228014343], (6784138025918878582,
7190719703944308372], (7749618183851698485, 8019254284118543066],
(8068079250973315241, 8185655671734937642], (8356739976149429222,
8923908282731801645]}, size=15