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

#include <userver/ydb/topic_writer_component.hpp>

Detailed Description

userver component for YDB topic writer

Static options of ydb::TopicWriterComponent :

Name Description Default value
topics.* Settings for a single topic writer.
topics.*.topic Topic path used for message writing.
topics.*.database Database name from ydb component configuration.
topics.*.internal-workers-num Number of internal workers for a single topic writer. Note that using several workers violates message ordering. 1
topics.*.internal-msg-queue-size Size of the internal queue for incoming messages from the client. When the queue is full, WriteMessage returns kResourceExhausted. 1000
topics.*.internal-ydb-control-queue-size Size of the internal queue for control events received from YDB. When the queue is full, the worker stops reading new events from the session. 10

Options inherited from components::ComponentBase :

Name Description Default value
load-enabled Set to false to disable loading of the component. true

Definition at line 26 of file topic_writer_component.hpp.

+ Inheritance diagram for ydb::TopicWriterComponent:

Public Member Functions

 TopicWriterComponent (const components::ComponentConfig &, const components::ComponentContext &)
 
TopicWriterManagerGetTopicWriterManager ()
 Returns the underlying TopicWriterManager instance.
 
ComponentHealth GetComponentHealth () const override
 
void OnLoadingCancelled () override
 
void OnAllComponentsLoaded () override
 
void OnGracefulShutdown (engine::Deadline) override
 
void OnAllComponentsAreStopping () override
 

Static Public Member Functions

static yaml_config::Schema GetStaticConfigSchema ()
 

Static Public Attributes

static constexpr std::string_view kName = "ydb-topic-writer"
 Component name for use in static config.
 

Protected Types

using LoggableComponentBase = ComponentBase
 

Member Typedef Documentation

◆ LoggableComponentBase

using components::ComponentBase::LoggableComponentBase = ComponentBase
protectedinherited
Deprecated
use components::ComponentBase instead.

Definition at line 79 of file component_base.hpp.

Member Function Documentation

◆ GetComponentHealth()

ComponentHealth components::ComponentBase::GetComponentHealth ( ) const
inlineoverridevirtualinherited

Override this function to inform the world of the state of your component.

Warning
The function is called concurrently from multiple threads.

Reimplemented from components::RawComponentBase.

Reimplemented in server::handlers::Restart.

Definition at line 35 of file component_base.hpp.

◆ OnAllComponentsAreStopping()

void components::ComponentBase::OnAllComponentsAreStopping ( )
inlineoverridevirtualinherited

Component may use this function to stop doing work before the stop of the components that depend on it.

Base components may override it and make final to do some work before the derived object constructor is called. Don't use it otherwise.

Reimplemented from components::RawComponentBase.

Reimplemented in components::Server, and urabbitmq::ConsumerComponentBase.

Definition at line 70 of file component_base.hpp.

◆ OnAllComponentsLoaded()

void components::ComponentBase::OnAllComponentsLoaded ( )
inlineoverridevirtualinherited

Component may use this function to finalize registration of other components that depend on it (for example, handler components register in server component, and the latter uses OnAllComponentsLoaded() to start processing requests).

Base components may override it and make final to do some work after the derived object constructor is called. Don't use it otherwise.

Reimplemented from components::RawComponentBase.

Reimplemented in components::Server, server::handlers::Ping, and urabbitmq::ConsumerComponentBase.

Definition at line 51 of file component_base.hpp.

◆ OnGracefulShutdown()

void components::ComponentBase::OnGracefulShutdown ( engine::Deadline )
overridevirtualinherited

Serving components like HTTP and gRPC servers may use this function to stop accepting new requests and shutdown serving in the given time interval. Application components likely do not need to override it.

Parameters
[in]serving_shutdown_deadlineThe deadline until already running requests should be allowed to complete. The component is supposed to stop accepting new requests and continue processing of already active requests until this deadline (unless those requests finish earlier). And it might completely shutdown requests processing when the deadline is reached (or when no active requests left).

Reimplemented from components::RawComponentBase.

Reimplemented in components::Server.

◆ OnLoadingCancelled()

void components::ComponentBase::OnLoadingCancelled ( )
inlineoverridevirtualinherited

Called once if the creation of any other component failed. If the current component expects some other component to take any action with the current component, this call is a signal that such action may never happen due to components loading was cancelled. Application components might not want to override it.

Reimplemented from components::RawComponentBase.

Definition at line 42 of file component_base.hpp.

Member Data Documentation

◆ kName

std::string_view ydb::TopicWriterComponent::kName = "ydb-topic-writer"
staticconstexpr

Component name for use in static config.

Definition at line 29 of file topic_writer_component.hpp.


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