6#include <ydb-cpp-sdk/client/coordination/coordination.h>
16class CoordinationSession
final {
20 explicit CoordinationSession(NYdb::NCoordination::TSession&& session);
23 std::uint64_t GetSessionId();
25 NYdb::NCoordination::ESessionState GetSessionState();
27 NYdb::NCoordination::EConnectionState GetConnectionState();
38 std::string_view name,
39 const NYdb::NCoordination::TAcquireSemaphoreSettings& settings);
41 bool ReleaseSemaphore(std::string_view name);
49 void CreateSemaphore(std::string_view name, std::uint64_t limit);
51 void UpdateSemaphore(std::string_view name, std::string_view data);
53 void DeleteSemaphore(std::string_view name);
56 NYdb::NCoordination::TSession session_;
59class CoordinationClient
final {
63 explicit CoordinationClient(std::shared_ptr<impl::Driver> driver);
70 std::string_view path,
71 const NYdb::NCoordination::TSessionSettings& settings);
73 void CreateNode(std::string_view path,
74 const NYdb::NCoordination::TCreateNodeSettings& settings);
76 void AlterNode(std::string_view path,
77 const NYdb::NCoordination::TAlterNodeSettings& settings);
79 void DropNode(std::string_view path);
81 NYdb::NCoordination::TNodeDescription DescribeNode(std::string_view path);
90 std::shared_ptr<impl::Driver> driver_;
91 NYdb::NCoordination::TClient client_;