#include <userver/ydb/topic_writer.hpp>
Takes messages provided by the user and sends them to a YDB topic.
This class can be created directly, or you can use TopicWriterManager. If created via TopicWriterManager, it will take care of collecting and writing statistics for you. Otherwise, behaviour is unchanged.
Definition at line 86 of file topic_writer.hpp.
Inheritance diagram for ydb::TopicWriter:Public Member Functions | |
| TopicWriter (std::string name, TopicWriterSettings settings) | |
| Creates a new topic writer. | |
| TopicWriteResult | WriteMessage (std::string message, const TopicWriterMetadata &meta) override |
| Writes a message to YDB. | |
| ydb::TopicWriter::TopicWriter | ( | std::string | name, |
| TopicWriterSettings | settings ) |
Creates a new topic writer.
| [in] | name | identifier used for statistics labeling; should be unique across the service to avoid metric collisions |
| [in] | settings | controls which topic to write into and tuning parameters such as worker count and queue sizes |
|
nodiscardoverridevirtual |
Writes a message to YDB.
Internally a worker is selected for the message sending in round-robin fashion across all configured workers.
Implements ydb::TopicWriterBase.
|
friend |
Dumps metrics for a TopicWriter into the statistics writer.
| writer | statistics writer to dump into |
| topic_writer | the topic writer whose metrics to dump |