#include <file_manager.h>
Public Member Functions | |
void | deleteStaleData () |
FileManager () | |
FileManager (const FileManagerStrategyOptions &options) | |
FileManager (std::shared_ptr< DataManagerStrategy > file_manager_strategy) | |
void | fileUploadCompleteStatus (const Aws::DataFlow::UploadStatus &upload_status, const FileObject< T > &log_messages) override |
bool | isDataAvailableToRead () override |
DataToken | read (std::string &data) |
void | setStatusMonitor (std::shared_ptr< StatusMonitor > status_monitor) override |
bool | shutdown () override |
bool | start () override |
virtual void | write (const T &data)=0 |
virtual | ~FileManager ()=default |
Public Member Functions inherited from Aws::FileManagement::DataReader< T > | |
virtual FileObject< T > | readBatch (size_t batch_size)=0 |
Public Member Functions inherited from Service | |
ServiceState | getState () |
virtual std::string | getStatusString () |
Service () | |
virtual | ~Service ()=default |
Protected Attributes | |
std::mutex | active_delete_stale_data_mutex_ |
std::shared_ptr< DataManagerStrategy > | file_manager_strategy_ |
std::shared_ptr< StatusMonitor > | file_status_monitor_ |
std::vector< FileManagement::DataToken > | stale_data_ |
size_t | total_logs_uploaded_ = 0 |
Additional Inherited Members | |
Protected Member Functions inherited from Service | |
void | setState (ServiceState new_state) |
File manager specific to the type of data to write to files.
T | type of data to handle |
Definition at line 81 of file file_manager.h.
|
inline |
Default constructor.
Definition at line 89 of file file_manager.h.
|
inline |
Constructor that takes in FileManagerStrategyOptions.
options | for the FileManagerStrategy |
Definition at line 99 of file file_manager.h.
|
inlineexplicit |
Initialize the file manager with a custom file manager strategy.
invalid | argument for null DataManagerStrategy |
file_manager_strategy | custom strategy. |
Definition at line 109 of file file_manager.h.
|
virtualdefault |
|
inlinevirtual |
Implements Aws::FileManagement::DataReader< T >.
Definition at line 220 of file file_manager.h.
|
inlineoverridevirtual |
Handle an upload complete status.
upload_status | the status of an attempted upload of data |
log_messages | the data which was attempted to be uploaded |
Implements Aws::FileManagement::DataReader< T >.
Definition at line 167 of file file_manager.h.
|
inlineoverridevirtual |
Return if data is available to read.
Implements Aws::FileManagement::DataReader< T >.
Definition at line 207 of file file_manager.h.
|
inline |
Read data from file and get the file info related to the data.
data | [out] to fill with info |
Definition at line 145 of file file_manager.h.
|
inlineoverridevirtual |
Add a file status monitor to notify observers when there
status_monitor |
Implements Aws::FileManagement::DataReader< T >.
Definition at line 198 of file file_manager.h.
|
inlineoverridevirtual |
Reimplemented from Service.
Definition at line 128 of file file_manager.h.
|
inlineoverridevirtual |
Reimplemented from Service.
Definition at line 116 of file file_manager.h.
|
pure virtual |
Write data to the appropriate file.
data | to write. |
|
protected |
A lock on the stale_data_ vector to prevent elements from being read or modified to stale_data_ while data is being read or modified from it.
Definition at line 265 of file file_manager.h.
|
protected |
The file manager strategy to use for handling files.
Definition at line 254 of file file_manager.h.
|
protected |
The status monitor for notifying an observer when files are available.
Definition at line 259 of file file_manager.h.
|
protected |
Store logs > 14 days old in this vector and resolve them in the delete_stale_data function after upload log task has been successfully enqueued.
Definition at line 271 of file file_manager.h.
|
protected |
The object that keeps track of which files to delete, read, or write to. Should probably be thread safe or something :)
Definition at line 249 of file file_manager.h.