ClickHouse/src/Interpreters/FilesystemCacheLog.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.7 KiB
C++
Raw Normal View History

2022-04-30 05:00:40 +00:00
#pragma once
#include <Core/NamesAndAliases.h>
#include <Core/NamesAndTypes.h>
#include <Core/Settings.h>
#include <DataTypes/DataTypeArray.h>
2022-04-30 13:34:28 +00:00
#include <DataTypes/DataTypeNumberBase.h>
2022-04-30 05:00:40 +00:00
#include <DataTypes/DataTypeTuple.h>
#include <Interpreters/SystemLog.h>
#include <Interpreters/TransactionVersionMetadata.h>
namespace DB
{
///
/// -------- Column --------- Type ------
/// | event_date | DateTime |
/// | event_time | UInt64 |
/// | query_id | String |
/// | remote_file_path | String |
/// | segment_range | Tuple |
/// | read_type | String |
/// -------------------------------------
///
struct FilesystemCacheLogElement
{
2022-07-18 12:09:57 +00:00
enum class CacheType
2022-04-30 05:00:40 +00:00
{
READ_FROM_CACHE,
READ_FROM_FS_AND_DOWNLOADED_TO_CACHE,
READ_FROM_FS_BYPASSING_CACHE,
2022-07-18 12:09:57 +00:00
WRITE_THROUGH_CACHE,
2022-04-30 05:00:40 +00:00
};
time_t event_time{};
String query_id;
2022-05-03 13:51:26 +00:00
String source_file_path;
2022-04-30 05:00:40 +00:00
2022-04-30 17:31:58 +00:00
std::pair<size_t, size_t> file_segment_range{};
2022-05-09 19:20:10 +00:00
std::pair<size_t, size_t> requested_range{};
2022-07-18 12:09:57 +00:00
CacheType cache_type{};
2022-05-03 13:51:26 +00:00
size_t file_segment_size;
2022-08-29 15:50:27 +00:00
bool read_from_cache_attempted;
2022-05-09 19:20:10 +00:00
String read_buffer_id;
std::shared_ptr<ProfileEvents::Counters::Snapshot> profile_counters;
2022-04-30 05:00:40 +00:00
static std::string name() { return "FilesystemCacheLog"; }
static NamesAndTypesList getNamesAndTypes();
static NamesAndAliases getNamesAndAliases() { return {}; }
void appendToBlock(MutableColumns & columns) const;
static const char * getCustomColumnList() { return nullptr; }
};
class FilesystemCacheLog : public SystemLog<FilesystemCacheLogElement>
{
using SystemLog<FilesystemCacheLogElement>::SystemLog;
};
2022-05-16 18:59:27 +00:00
}