-
Is there a way I can truncate entries from fasterlog based on time when they were added? We can truncate based on size, but any approach we can take to truncate any entries that were added before some time etc? Any interfaces I might be able to implement to get a functionality like this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
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 |
Beta Was this translation helpful? Give feedback.
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 (sayOldTailAddress
), and replace it with a new element with value = currentTailAddress
. (The array is used like a circular buffer.) You can then truncate FasterLog untilOldTailAddress
. You can change the constants used here based on your specifics.