Skip to content

Any way to perform faster log truncation based on time? #634

Answered by badrishc
vangarp asked this question in Q&A
Discussion options

You must be logged in to vote

FasterLog places items sequentially on the log, based on ingestion time. If I understand you right, you want to truncate all records ingested say > 60 minutes back. One option to do this is to keep an array of say 12 TailAddress values, one element for every 5 minutes, for a total of 60 minutes. Every 5 minutes, you remove the oldest element in the array (say OldTailAddress), and replace it with a new element with value = current TailAddress. (The array is used like a circular buffer.) You can then truncate FasterLog until OldTailAddress. You can change the constants used here based on your specifics.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@vangarp
Comment options

@vangarp
Comment options

@badrishc
Comment options

@badrishc
Comment options

@vangarp
Comment options

Answer selected by vangarp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants