log_batcher.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include <aws/core/Aws.h>
19 #include <aws/logs/model/InputLogEvent.h>
21 
24 
26 
28 
29 #include <chrono>
30 #include <list>
31 #include <memory>
32 
33 namespace Aws {
34 namespace CloudWatchLogs {
35 
36 class LogBatcher :
37  public Aws::DataFlow::OutputStage<Aws::FileManagement::TaskPtr<LogCollection>>,
38  public DataBatcher<LogType>
39 {
40 public:
41 
42 
51  explicit LogBatcher(size_t max_allowable_batch_size = DataBatcher::kDefaultMaxBatchSize,
52  size_t publish_trigger_size = DataBatcher::kDefaultTriggerSize);
53 
54  LogBatcher(const LogBatcher & other) = delete;
55 
56  LogBatcher & operator=(const LogBatcher & other) = delete;
57 
61  ~LogBatcher() override;
62 
70  bool publishBatchedData() override;
71 
75  void emptyCollection() override;
76  bool start() override;
77 
84  virtual void setLogFileManager(std::shared_ptr<Aws::FileManagement::FileManager<LogCollection>> log_file_manager);
85 
86 private:
87  std::shared_ptr<Aws::FileManagement::FileManager<LogCollection>> log_file_manager_;
88 };
89 
90 } // namespace CloudWatchLogs
91 } // namespace Aws
bool publishBatchedData() override
Services the log manager by performing periodic tasks when called. Calling the Service function allow...
Definition: log_batcher.cpp:45
static const size_t kDefaultTriggerSize
std::shared_ptr< Aws::FileManagement::FileManager< LogCollection > > log_file_manager_
Definition: log_batcher.h:87
~LogBatcher() override
Tears down a LogBatcher object.
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 au...
Definition: log_batcher.cpp:38
LogBatcher & operator=(const LogBatcher &other)=delete
static const size_t kDefaultMaxBatchSize
virtual void setLogFileManager(std::shared_ptr< Aws::FileManagement::FileManager< LogCollection >> log_file_manager)
Contains Error handling functionality for ROS AWS CloudWatch Logs libraries.


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