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();
37 bool AcquireSemaphore(std::string_view name,
const NYdb::NCoordination::TAcquireSemaphoreSettings& settings);
39 bool ReleaseSemaphore(std::string_view name);
46 void CreateSemaphore(std::string_view name, std::uint64_t limit);
48 void UpdateSemaphore(std::string_view name, std::string_view data);
50 void DeleteSemaphore(std::string_view name);
53 NYdb::NCoordination::TSession session_;
56class CoordinationClient
final {
60 explicit CoordinationClient(std::shared_ptr<impl::Driver> driver);
66 CoordinationSession
StartSession(std::string_view path,
const NYdb::NCoordination::TSessionSettings& settings);
68 void CreateNode(std::string_view path,
const NYdb::NCoordination::TCreateNodeSettings& settings);
70 void AlterNode(std::string_view path,
const NYdb::NCoordination::TAlterNodeSettings& settings);
72 void DropNode(std::string_view path);
74 NYdb::NCoordination::TNodeDescription DescribeNode(std::string_view path);
83 std::shared_ptr<impl::Driver> driver_;
84 NYdb::NCoordination::TClient client_;