From ff13cae37e4307856b71917509edb068e62e936d Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 13 Aug 2024 17:10:40 +0800 Subject: [PATCH] Remove useless func --- dbms/src/Storages/S3/FileCache.cpp | 10 +++------- dbms/src/Storages/S3/FileCache.h | 1 - dbms/src/TiDB/Schema/TiDB.cpp | 2 +- dbms/src/TiDB/Schema/VectorIndex.h | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dbms/src/Storages/S3/FileCache.cpp b/dbms/src/Storages/S3/FileCache.cpp index 943923baf95..ee6c11bf62a 100644 --- a/dbms/src/Storages/S3/FileCache.cpp +++ b/dbms/src/Storages/S3/FileCache.cpp @@ -333,22 +333,18 @@ void FileCache::removeDiskFile(const String & local_fname, bool update_fsize_met } } -void FileCache::remove(std::unique_lock &, const String & s3_key, bool force) +void FileCache::remove(const String & s3_key, bool force) { auto file_type = getFileType(s3_key); auto & table = tables[static_cast(file_type)]; + + std::unique_lock lock(mtx); auto f = table.get(s3_key, /*update_lru*/ false); if (f == nullptr) return; std::ignore = removeImpl(table, s3_key, f, force); } -void FileCache::remove(const String & s3_key, bool force) -{ - std::unique_lock lock(mtx); - remove(lock, s3_key, force); -} - std::pair::iterator> FileCache::removeImpl( LRUFileTable & table, const String & s3_key, diff --git a/dbms/src/Storages/S3/FileCache.h b/dbms/src/Storages/S3/FileCache.h index 56c05f6107c..dba2eacd66f 100644 --- a/dbms/src/Storages/S3/FileCache.h +++ b/dbms/src/Storages/S3/FileCache.h @@ -270,7 +270,6 @@ class FileCache void restoreTable(const std::filesystem::directory_entry & table_entry); void restoreDMFile(const std::filesystem::directory_entry & dmfile_entry); - void remove(std::unique_lock & cache_lock, const String & s3_key, bool force = false); void remove(const String & s3_key, bool force = false); std::pair::iterator> removeImpl( LRUFileTable & table, diff --git a/dbms/src/TiDB/Schema/TiDB.cpp b/dbms/src/TiDB/Schema/TiDB.cpp index 4d767be3fd5..d80823c7198 100644 --- a/dbms/src/TiDB/Schema/TiDB.cpp +++ b/dbms/src/TiDB/Schema/TiDB.cpp @@ -28,13 +28,13 @@ #include #include #include +#include #include #include #include #include #include -#include "TiDB/Schema/VectorIndex.h" namespace DB { diff --git a/dbms/src/TiDB/Schema/VectorIndex.h b/dbms/src/TiDB/Schema/VectorIndex.h index 22ad3f3e41a..2af77b2e3e6 100644 --- a/dbms/src/TiDB/Schema/VectorIndex.h +++ b/dbms/src/TiDB/Schema/VectorIndex.h @@ -31,7 +31,7 @@ struct VectorIndexDefinition UInt64 dimension = 0; tipb::VectorDistanceMetric distance_metric = tipb::VectorDistanceMetric::INVALID_DISTANCE_METRIC; - // TODO: There are possibly more fields, like efConstruct. + // TODO(vector-index): There are possibly more fields, like efConstruct. // Will be added later. };