cortex.client.client_utils package

Submodules

cortex.client.client_utils.cortex_pb2 module

cortex.client.client_utils.reader module

class cortex.client.client_utils.reader.ProtoReaderDriver(fd)

Bases: object

next_snapshot_exists()

this function returns True if there exists another snapshot to read, while at the same time putting in the instance field that length in bytes (after reading it), if not it returns False. implemented this way cause of proto-buf/format of file

read_all()
read_next_snapshot()

reads next snapshot, by reading a uint32_t determining length of next snapshot and then reading that many bytes and putting it in a snapshot object that was pre-defined in a proto_file

read_user_information()
class cortex.client.client_utils.reader.Reader(url)

Bases: object

this class defined an abstraction to a Reader reading a file. it supports differnet compression formats, as well as different sample formats Usage:

Reader object is initiated with a URL like: ‘SCHEME://PATH/?compressor=COMP’ SCHEME being the sample format, example: Protobuf PATH being the path to the sample format COMP being the compression format of the file, example : gzip or uncompressed (for non-compressed files)

to add another sample parsing foramt (SCHEME), you have to implement read_user_information, read_next_snapshot and next_snapshot_exists() functions. object needs to be initiated by opened file-descriptor

to add another compression format (COMP), you have to implement a decompressing object, that implements open and close function. open fucking allowing to read byte-by-bye

close_file()
debug_read_all()

debugging purposes

open_file()
property user_id
cortex.client.client_utils.reader.find_compressor(furl_object)

returns the compressed file format is supported. returns None if not supported

cortex.client.client_utils.reader.find_reader_driver(furl_object)

Module contents