Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Aws::FileManagement::FileUploadStreamer< T > Class Template Reference

#include <file_upload_streamer.h>

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

Public Member Functions

void addStatusMonitor (std::shared_ptr< StatusMonitor > &status_monitor)
 
 FileUploadStreamer (std::shared_ptr< DataReader< T >> data_reader, FileUploadStreamerOptions options)
 
void forceWork ()
 
bool initialize ()
 
void onComplete (const Aws::DataFlow::UploadStatus &upload_status, const FileObject< T > &message)
 
void onPublisherStateChange (const Aws::DataFlow::Status &status)
 
void setStatusMonitorTimeout (std::chrono::milliseconds new_timeout)
 
bool shutdown () override
 
bool start () override
 
 ~FileUploadStreamer () override=default
 
- Public Member Functions inherited from Aws::DataFlow::OutputStage< O >
std::shared_ptr< Sink< O > > getSink ()
 
std::enable_if< std::is_base_of< Sink< O >, T >::value, std::shared_ptr< T > >::type setSink (std::shared_ptr< T > sink)
 
- Public Member Functions inherited from RunnableService
std::string getStatusString () override
 
virtual bool isRunning ()
 
void join ()
 
 RunnableService ()
 
void waitForShutdown (std::chrono::milliseconds millis)
 
void waitForShutdown ()
 
 ~RunnableService () override=default
 
- Public Member Functions inherited from Service
ServiceState getState ()
 
 Service ()
 
virtual ~Service ()=default
 

Protected Member Functions

void work () override
 
- Protected Member Functions inherited from RunnableService
virtual void run ()
 
virtual bool startWorkerThread ()
 
virtual bool stopWorkerThread ()
 
- Protected Member Functions inherited from Service
void setState (ServiceState new_state)
 

Private Attributes

size_t batch_size_
 
std::shared_ptr< DataReader< T > > data_reader_
 
std::shared_ptr< StatusMonitornetwork_monitor_
 
MultiStatusConditionMonitor status_condition_monitor_
 
std::chrono::milliseconds status_monitor_timeout_
 
std::shared_ptr< FileUploadTask< T > > stored_task_
 
size_t total_logs_uploaded = 0
 

Detailed Description

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

File upload manager handles reading data from the file manager and placing it in the observed queue.

Template Parameters
T

Definition at line 60 of file file_upload_streamer.h.

Constructor & Destructor Documentation

template<typename T >
Aws::FileManagement::FileUploadStreamer< T >::FileUploadStreamer ( std::shared_ptr< DataReader< T >>  data_reader,
FileUploadStreamerOptions  options 
)
inlineexplicit

Create a file upload manager.

Parameters
status_condition_monitor
file_manager
observed_queue
batch_size

Definition at line 71 of file file_upload_streamer.h.

template<typename T >
Aws::FileManagement::FileUploadStreamer< T >::~FileUploadStreamer ( )
overridedefault

Member Function Documentation

template<typename T >
void Aws::FileManagement::FileUploadStreamer< T >::addStatusMonitor ( std::shared_ptr< StatusMonitor > &  status_monitor)
inline

Add a status monitor for the file upload manager to wait for work on.

Parameters
status_monitorto add

Definition at line 93 of file file_upload_streamer.h.

template<typename T >
void Aws::FileManagement::FileUploadStreamer< T >::forceWork ( )
inline

Definition at line 133 of file file_upload_streamer.h.

template<typename T >
bool Aws::FileManagement::FileUploadStreamer< T >::initialize ( )
inline

Definition at line 111 of file file_upload_streamer.h.

template<typename T >
void Aws::FileManagement::FileUploadStreamer< T >::onComplete ( const Aws::DataFlow::UploadStatus upload_status,
const FileObject< T > &  message 
)
inline

Definition at line 115 of file file_upload_streamer.h.

template<typename T >
void Aws::FileManagement::FileUploadStreamer< T >::onPublisherStateChange ( const Aws::DataFlow::Status status)
inline

Definition at line 104 of file file_upload_streamer.h.

template<typename T >
void Aws::FileManagement::FileUploadStreamer< T >::setStatusMonitorTimeout ( std::chrono::milliseconds  new_timeout)
inline

Definition at line 137 of file file_upload_streamer.h.

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

Reimplemented from RunnableService.

Definition at line 97 of file file_upload_streamer.h.

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

Start the upload thread.

Reimplemented from RunnableService.

Definition at line 125 of file file_upload_streamer.h.

template<typename T >
void Aws::FileManagement::FileUploadStreamer< T >::work ( )
inlineoverrideprotectedvirtual

Attempt to start uploading.

  1. First wait for work on all the status conditions. (i.e wait until files are available to upload)
  2. Read a batch of data from the file_manager
  3. Queue up the task to be worked on.
  4. Delete older logs if user option is enabled.
  5. Wait for the upload task to be completed to continue.

Implements RunnableService.

Definition at line 152 of file file_upload_streamer.h.

Member Data Documentation

template<typename T >
size_t Aws::FileManagement::FileUploadStreamer< T >::batch_size_
private

The configured batch size to use when uploading.

Definition at line 221 of file file_upload_streamer.h.

template<typename T >
std::shared_ptr<DataReader<T> > Aws::FileManagement::FileUploadStreamer< T >::data_reader_
private

The file manager to read data from.

Definition at line 226 of file file_upload_streamer.h.

template<typename T >
std::shared_ptr<StatusMonitor> Aws::FileManagement::FileUploadStreamer< T >::network_monitor_
private

Network status monitor.

Definition at line 231 of file file_upload_streamer.h.

template<typename T >
MultiStatusConditionMonitor Aws::FileManagement::FileUploadStreamer< T >::status_condition_monitor_
private

The status condition monitor to wait on before uploading.

Definition at line 206 of file file_upload_streamer.h.

template<typename T >
std::chrono::milliseconds Aws::FileManagement::FileUploadStreamer< T >::status_monitor_timeout_
private

Timeout to wait for work.

Definition at line 236 of file file_upload_streamer.h.

template<typename T >
std::shared_ptr<FileUploadTask<T> > Aws::FileManagement::FileUploadStreamer< T >::stored_task_
private

Current task to upload.

Definition at line 211 of file file_upload_streamer.h.

template<typename T >
size_t Aws::FileManagement::FileUploadStreamer< T >::total_logs_uploaded = 0
private

Metric on number of logs queued in the TaskObservedQueue.

Definition at line 216 of file file_upload_streamer.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