diff --git a/ydb/include/userver/ydb/coordination.hpp b/ydb/include/userver/ydb/coordination.hpp index 016f5d11c59f..1239aacbce4d 100644 --- a/ydb/include/userver/ydb/coordination.hpp +++ b/ydb/include/userver/ydb/coordination.hpp @@ -61,13 +61,13 @@ class CoordinationSession final { ); /// Create semaphore - void CreateSemaphore(std::string_view name, std::uint64_t limit); + void CreateSemaphore(std::string_view name, std::uint64_t limit, std::string_view data = {}); /// Update semaphore void UpdateSemaphore(std::string_view name, std::string_view data); /// Delete semaphore - void DeleteSemaphore(std::string_view name); + void DeleteSemaphore(std::string_view name, bool force = false); private: NYdb::NCoordination::TSession session_; diff --git a/ydb/src/ydb/coordination.cpp b/ydb/src/ydb/coordination.cpp index 178f6b24a4c2..acb232b99a06 100644 --- a/ydb/src/ydb/coordination.cpp +++ b/ydb/src/ydb/coordination.cpp @@ -56,16 +56,16 @@ NYdb::NCoordination::TSemaphoreDescription CoordinationSession::DescribeSemaphor return ExtractResult(session_.DescribeSemaphore(impl::ToString(name), settings), "DescribeSemaphore"); } -void CoordinationSession::CreateSemaphore(std::string_view name, std::uint64_t limit) { - ExtractResult(session_.CreateSemaphore(impl::ToString(name), limit), "CreateSemaphore"); +void CoordinationSession::CreateSemaphore(std::string_view name, std::uint64_t limit, std::string_view data) { + ExtractResult(session_.CreateSemaphore(impl::ToString(name), limit, impl::ToString(data)), "CreateSemaphore"); } void CoordinationSession::UpdateSemaphore(std::string_view name, std::string_view data) { ExtractResult(session_.UpdateSemaphore(impl::ToString(name), impl::ToString(data)), "UpdateSemaphore"); } -void CoordinationSession::DeleteSemaphore(std::string_view name) { - ExtractResult(session_.DeleteSemaphore(impl::ToString(name)), "DeleteSemaphore"); +void CoordinationSession::DeleteSemaphore(std::string_view name, bool force) { + ExtractResult(session_.DeleteSemaphore(impl::ToString(name), force), "DeleteSemaphore"); } CoordinationClient::CoordinationClient(std::shared_ptr driver)