Public Member Functions | Private Attributes | List of all members
Aws::CloudWatchLogs::LogBatcher Class Reference

#include <log_batcher.h>

Inheritance diagram for Aws::CloudWatchLogs::LogBatcher:
Inheritance graph
[legend]

Public Member Functions

void emptyCollection () override
 
 LogBatcher (size_t max_allowable_batch_size=DataBatcher::kDefaultMaxBatchSize, size_t publish_trigger_size=DataBatcher::kDefaultTriggerSize)
 Creates a new LogBatcher Creates a new LogBatcher that will group/buffer logs. Note: logs are only automatically published if the size is set, otherwise the publishBatchedData is necesary to push data to be published. More...
 
 LogBatcher (const LogBatcher &other)=delete
 
LogBatcheroperator= (const LogBatcher &other)=delete
 
bool publishBatchedData () override
 Services the log manager by performing periodic tasks when called. Calling the Service function allows for periodic tasks associated with the log manager, such as flushing buffered logs, to be performed. More...
 
virtual void setLogFileManager (std::shared_ptr< Aws::FileManagement::FileManager< LogCollection >> log_file_manager)
 
bool start () override
 
 ~LogBatcher () override
 Tears down a LogBatcher object. More...
 
- Public Member Functions inherited from Aws::DataFlow::OutputStage< Aws::FileManagement::TaskPtr< LogCollection > >
std::shared_ptr< Sink< Aws::FileManagement::TaskPtr< LogCollection > > > getSink ()
 
std::enable_if< std::is_base_of< Sink< Aws::FileManagement::TaskPtr< LogCollection > >, T >::value, std::shared_ptr< T > >::type setSink (std::shared_ptr< T > sink)
 
- Public Member Functions inherited from DataBatcher< LogType >
virtual bool batchData (const LogType &data_to_batch)
 
 DataBatcher (size_t max_allowable_batch_size=DataBatcher::kDefaultMaxBatchSize, size_t trigger_size=DataBatcher::kDefaultTriggerSize, std::chrono::microseconds try_enqueue_duration=std::chrono::duration_cast< std::chrono::microseconds >(std::chrono::seconds(2)))
 
size_t getCurrentBatchSize ()
 
size_t getMaxAllowableBatchSize ()
 
size_t getTriggerBatchSize ()
 
std::chrono::microseconds getTryEnqueueDuration ()
 
void resetBatchedData ()
 
void resetTriggerBatchSize ()
 
void setMaxAllowableBatchSize (int new_value)
 
void setTriggerBatchSize (size_t new_value)
 
void setTryEnqueueDuration (std::chrono::microseconds duration)
 
bool shutdown () override
 
 ~DataBatcher () override=default
 
- Public Member Functions inherited from Service
ServiceState getState ()
 
virtual std::string getStatusString ()
 
 Service ()
 
virtual ~Service ()=default
 

Private Attributes

std::shared_ptr< Aws::FileManagement::FileManager< LogCollection > > log_file_manager_
 

Additional Inherited Members

- Static Public Member Functions inherited from DataBatcher< LogType >
static void validateConfigurableSizes (size_t batch_max_queue_size, size_t batch_trigger_publish_size)
 
- Static Public Attributes inherited from DataBatcher< LogType >
static const size_t kDefaultMaxBatchSize
 
static const size_t kDefaultTriggerSize
 
- Protected Member Functions inherited from Service
void setState (ServiceState new_state)
 
- Protected Attributes inherited from DataBatcher< LogType >
std::shared_ptr< std::list< LogType > > batched_data_
 
std::recursive_mutex mtx
 

Detailed Description

Definition at line 36 of file log_batcher.h.

Constructor & Destructor Documentation

Aws::CloudWatchLogs::LogBatcher::LogBatcher ( size_t  max_allowable_batch_size = DataBatcher::kDefaultMaxBatchSize,
size_t  publish_trigger_size = DataBatcher::kDefaultTriggerSize 
)
explicit

Creates a new LogBatcher Creates a new LogBatcher that will group/buffer logs. Note: logs are only automatically published if the size is set, otherwise the publishBatchedData is necesary to push data to be published.

Exceptions
invalidargument if publish_trigger_size is strictly greater than max_allowable_batch_size
Parameters
sizeof the batched data that will trigger a publish

Definition at line 38 of file log_batcher.cpp.

Aws::CloudWatchLogs::LogBatcher::LogBatcher ( const LogBatcher other)
delete
Aws::CloudWatchLogs::LogBatcher::~LogBatcher ( )
overridedefault

Tears down a LogBatcher object.

Member Function Documentation

void Aws::CloudWatchLogs::LogBatcher::emptyCollection ( )
overridevirtual

Override default behavior to attempt to write to file to disk when emptying the collection.

Reimplemented from DataBatcher< LogType >.

Definition at line 118 of file log_batcher.cpp.

LogBatcher& Aws::CloudWatchLogs::LogBatcher::operator= ( const LogBatcher other)
delete
bool Aws::CloudWatchLogs::LogBatcher::publishBatchedData ( )
overridevirtual

Services the log manager by performing periodic tasks when called. Calling the Service function allows for periodic tasks associated with the log manager, such as flushing buffered logs, to be performed.

Returns
true of the data was succesfully published, false otherwise

Implements DataBatcher< LogType >.

Definition at line 45 of file log_batcher.cpp.

void Aws::CloudWatchLogs::LogBatcher::setLogFileManager ( std::shared_ptr< Aws::FileManagement::FileManager< LogCollection >>  log_file_manager)
virtual

Set the log file manager, used for task publishing failures (write to disk if unable to send to CloudWatch).

Exceptions
invalidargument if the input is null
Parameters
log_file_manager

Definition at line 138 of file log_batcher.cpp.

bool Aws::CloudWatchLogs::LogBatcher::start ( )
overridevirtual

Reimplemented from Service.

Definition at line 131 of file log_batcher.cpp.

Member Data Documentation

std::shared_ptr<Aws::FileManagement::FileManager<LogCollection> > Aws::CloudWatchLogs::LogBatcher::log_file_manager_
private

Definition at line 87 of file log_batcher.h.


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


cloudwatch_logs_common
Author(s): AWS RoboMaker
autogenerated on Fri May 7 2021 02:18:24