Fix style

This commit is contained in:
kssenii 2023-02-01 17:44:30 +01:00
parent 3075a496cb
commit a083178eec
4 changed files with 9 additions and 51 deletions

View File

@ -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>;
}

View File

@ -9,6 +9,10 @@ namespace fs = std::filesystem;
namespace DB
{
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
}
LockedKeyPtr LockedKeyCreator::create()
{

View File

@ -3,6 +3,10 @@
namespace DB
{
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
}
static bool isQueryInitialized()
{

View File

@ -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
{