ClickHouse/src/Storages/MergeTree/ZeroCopyLock.h
2023-01-20 15:48:33 +08:00

22 lines
537 B
C++

#pragma once
#include <Core/Types.h>
#include <optional>
#include <memory>
#include <Common/ZooKeeper/ZooKeeperLock.h>
#include <Common/ZooKeeper/ZooKeeper.h>
namespace DB
{
/// Very simple wrapper for zookeeper ephemeral lock. It's better to have it
/// because due to bad abstraction we use it in MergeTreeData.
struct ZeroCopyLock
{
ZeroCopyLock(const zkutil::ZooKeeperPtr & zookeeper, const std::string & lock_path, const std::string & lock_message);
/// Actual lock
std::unique_ptr<zkutil::ZooKeeperLock> lock;
};
}