EventsFileManager

class EventsFileManager(directory: File, apiKey: String, kvs: KeyValueStore)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun getEventString(filePath: String): String
Link copied to clipboard
fun read(): List<String>

Returns a comma-separated list of file paths that are not yet uploaded

Link copied to clipboard
fun remove(filePath: String): Boolean

deletes the file at filePath

Link copied to clipboard
suspend fun rollover()

closes current file, and increase the index so next write go to a new file

Link copied to clipboard
fun splitFile(filePath: String, events: JSONArray)

Split one file to two smaller file This is used to handle payload too large error response

Link copied to clipboard
suspend fun storeEvent(event: String)

closes existing file, if at capacity opens a new file, if current file is full or uncreated stores the event

Properties

Link copied to clipboard
val curFile: MutableMap<String, File>
Link copied to clipboard
val filePathSet: MutableSet<String>
Link copied to clipboard
val readMutex: Mutex
Link copied to clipboard
val writeMutex: Mutex