FileCacheManager
File cache manager: Class that stores events to the file system in disk
Purpose of the class: Keep synced with memory
eventToFileIdMap - Each event with unique event id is mapped to file id (unique name of the file)
uniqueFileId - Unique Id of the file (or name of the file) in which events are pushed
All the file operations are running in the background thread
Any operation failure invoke moveInMemoryDataToFile as a fallback which cleans all the disk and re sync
Functions
Get count of events in memory based on the status
Get size of events in memory in bytes based on the status
Remove list of events from the memory based on the status and then remove from the file
Fetch events from the disk
Fetch in memory events and push all the events to disk
Update status for the event to the memory and then to the file
Update status for the list of events to the memory and then to the file