mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 03:12:43 +00:00
Fix style
This commit is contained in:
parent
3075a496cb
commit
a083178eec
@ -1,50 +0,0 @@
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <Interpreters/Cache/LockedFileCachePriority.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
class FileSegment;
|
||||
using FileSegmentPtr = std::shared_ptr<FileSegment>;
|
||||
|
||||
struct FileSegmentMetadata : private boost::noncopyable
|
||||
{
|
||||
FileSegmentPtr file_segment;
|
||||
|
||||
/// Iterator is put here on first reservation attempt, if successful.
|
||||
IFileCachePriority::Iterator queue_iterator;
|
||||
|
||||
/// Pointer to file segment is always hold by the cache itself.
|
||||
/// Apart from pointer in cache, it can be hold by cache users, when they call
|
||||
/// getorSet(), but cache users always hold it via FileSegmentsHolder.
|
||||
bool releasable() const { return file_segment.unique(); }
|
||||
|
||||
size_t size() const { return file_segment->reserved_size; }
|
||||
|
||||
FileSegmentMetadata(
|
||||
FileSegmentPtr file_segment_,
|
||||
KeyTransaction & key_transaction,
|
||||
LockedCachePriority * locked_queue);
|
||||
|
||||
FileSegmentMetadata(FileSegmentMetadata && other) noexcept
|
||||
: file_segment(std::move(other.file_segment)), queue_iterator(std::move(other.queue_iterator)) {}
|
||||
};
|
||||
|
||||
|
||||
struct KeyMetadata : public std::map<size_t, FileSegmentMetadata>
|
||||
{
|
||||
const FileSegmentMetadata * getByOffset(size_t offset) const;
|
||||
FileSegmentMetadata * getByOffset(size_t offset);
|
||||
|
||||
const FileSegmentMetadata * tryGetByOffset(size_t offset) const;
|
||||
FileSegmentMetadata * tryGetByOffset(size_t offset);
|
||||
|
||||
std::string toString() const;
|
||||
|
||||
KeyGuardPtr guard = std::make_shared<KeyGuard>();
|
||||
bool created_base_directory = false;
|
||||
|
||||
bool removed = false;
|
||||
};
|
||||
using KeyMetadataPtr = std::shared_ptr<KeyMetadata>;
|
||||
|
||||
}
|
@ -9,6 +9,10 @@ namespace fs = std::filesystem;
|
||||
|
||||
namespace DB
|
||||
{
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
LockedKeyPtr LockedKeyCreator::create()
|
||||
{
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
namespace DB
|
||||
{
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
static bool isQueryInitialized()
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include <Interpreters/Cache/Guards.h>
|
||||
#include <Interpreters/Cache/LockedFileCachePriority.h>
|
||||
#include <Interpreters/Cache/LRUFileCachePriority.h>
|
||||
#include <Interpreters/Cache/LRUFileCachePriority.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user