userver: ydb::TopicWriter Class Reference
Loading...
Searching...
No Matches
ydb::TopicWriter Class Referencefinal

#include <userver/ydb/topic_writer.hpp>

Detailed Description

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.
 

Constructor & Destructor Documentation

◆ TopicWriter()

ydb::TopicWriter::TopicWriter ( std::string name,
TopicWriterSettings settings )

Creates a new topic writer.

Parameters
[in]nameidentifier used for statistics labeling; should be unique across the service to avoid metric collisions
[in]settingscontrols which topic to write into and tuning parameters such as worker count and queue sizes

Member Function Documentation

◆ WriteMessage()

TopicWriteResult ydb::TopicWriter::WriteMessage ( std::string message,
const TopicWriterMetadata & meta )
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.

Friends And Related Symbol Documentation

◆ DumpMetric

void DumpMetric ( utils::statistics::Writer & writer,
const TopicWriter & topic_writer )
friend

Dumps metrics for a TopicWriter into the statistics writer.

Parameters
writerstatistics writer to dump into
topic_writerthe topic writer whose metrics to dump

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