Public Member Functions | Protected Attributes | List of all members
Aws::FileManagement::FileManager< T > Class Template Referenceabstract

#include <file_manager.h>

Inheritance diagram for Aws::FileManagement::FileManager< T >:
Inheritance graph
[legend]

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< DataManagerStrategyfile_manager_strategy_
 
std::shared_ptr< StatusMonitorfile_status_monitor_
 
std::vector< FileManagement::DataTokenstale_data_
 
size_t total_logs_uploaded_ = 0
 

Additional Inherited Members

- Protected Member Functions inherited from Service
void setState (ServiceState new_state)
 

Detailed Description

template<typename T>
class Aws::FileManagement::FileManager< T >

File manager specific to the type of data to write to files.

Template Parameters
Ttype of data to handle

Definition at line 81 of file file_manager.h.

Constructor & Destructor Documentation

template<typename T >
Aws::FileManagement::FileManager< T >::FileManager ( )
inline

Default constructor.

Definition at line 89 of file file_manager.h.

template<typename T >
Aws::FileManagement::FileManager< T >::FileManager ( const FileManagerStrategyOptions options)
inline

Constructor that takes in FileManagerStrategyOptions.

Parameters
optionsfor the FileManagerStrategy

Definition at line 99 of file file_manager.h.

template<typename T >
Aws::FileManagement::FileManager< T >::FileManager ( std::shared_ptr< DataManagerStrategy file_manager_strategy)
inlineexplicit

Initialize the file manager with a custom file manager strategy.

Exceptions
invalidargument for null DataManagerStrategy
Parameters
file_manager_strategycustom strategy.

Definition at line 109 of file file_manager.h.

template<typename T >
virtual Aws::FileManagement::FileManager< T >::~FileManager ( )
virtualdefault

Member Function Documentation

template<typename T >
void Aws::FileManagement::FileManager< T >::deleteStaleData ( )
inlinevirtual

Implements Aws::FileManagement::DataReader< T >.

Definition at line 220 of file file_manager.h.

template<typename T >
void Aws::FileManagement::FileManager< T >::fileUploadCompleteStatus ( const Aws::DataFlow::UploadStatus upload_status,
const FileObject< T > &  log_messages 
)
inlineoverridevirtual

Handle an upload complete status.

Parameters
upload_statusthe status of an attempted upload of data
log_messagesthe data which was attempted to be uploaded

Implements Aws::FileManagement::DataReader< T >.

Definition at line 167 of file file_manager.h.

template<typename T >
bool Aws::FileManagement::FileManager< T >::isDataAvailableToRead ( )
inlineoverridevirtual

Return if data is available to read.

Returns

Implements Aws::FileManagement::DataReader< T >.

Definition at line 207 of file file_manager.h.

template<typename T >
DataToken Aws::FileManagement::FileManager< T >::read ( std::string &  data)
inline

Read data from file and get the file info related to the data.

Parameters
data[out] to fill with info
Returns
FileInfo meta info

Definition at line 145 of file file_manager.h.

template<typename T >
void Aws::FileManagement::FileManager< T >::setStatusMonitor ( std::shared_ptr< StatusMonitor status_monitor)
inlineoverridevirtual

Add a file status monitor to notify observers when there

Parameters
status_monitor

Implements Aws::FileManagement::DataReader< T >.

Definition at line 198 of file file_manager.h.

template<typename T >
bool Aws::FileManagement::FileManager< T >::shutdown ( )
inlineoverridevirtual

Reimplemented from Service.

Definition at line 128 of file file_manager.h.

template<typename T >
bool Aws::FileManagement::FileManager< T >::start ( )
inlineoverridevirtual

Reimplemented from Service.

Definition at line 116 of file file_manager.h.

template<typename T >
virtual void Aws::FileManagement::FileManager< T >::write ( const T &  data)
pure virtual

Write data to the appropriate file.

Parameters
datato write.

Member Data Documentation

template<typename T >
std::mutex Aws::FileManagement::FileManager< T >::active_delete_stale_data_mutex_
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.

template<typename T >
std::shared_ptr<DataManagerStrategy> Aws::FileManagement::FileManager< T >::file_manager_strategy_
protected

The file manager strategy to use for handling files.

Definition at line 254 of file file_manager.h.

template<typename T >
std::shared_ptr<StatusMonitor> Aws::FileManagement::FileManager< T >::file_status_monitor_
protected

The status monitor for notifying an observer when files are available.

Definition at line 259 of file file_manager.h.

template<typename T >
std::vector<FileManagement::DataToken> Aws::FileManagement::FileManager< T >::stale_data_
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.

template<typename T >
size_t Aws::FileManagement::FileManager< T >::total_logs_uploaded_ = 0
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.


The documentation for this class was generated from the following file:


file_management
Author(s): AWS RoboMaker
autogenerated on Fri May 7 2021 02:18:23