Created
February 16, 2020 19:37
-
-
Save rbotzer/3a8f1a483cfaabc3086d8d0986f0b2dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clear all the segments that expire before today from the user u1 | |
print("Clean the stale segments for user u1") | |
if options.interactive: | |
pause() | |
ops = [ | |
mh.map_remove_by_value_range( | |
"u", | |
[0, aerospike.null()], | |
[end_ttl, aerospike.null()], | |
aerospike.MAP_RETURN_COUNT, | |
False, | |
), | |
mh.map_size("u"), | |
] | |
_, _, b = client.operate_ordered(key, ops) | |
stale_segments, segments_left = b | |
print( | |
"User u1 had {} stale segments trimmed, with {} segments remaining".format( | |
stale_segments[1], segments_left[1] | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment