Skip to content

Commit

Permalink
Remove useless func
Browse files Browse the repository at this point in the history
  • Loading branch information
JaySon-Huang committed Aug 13, 2024
1 parent 6458415 commit ff13cae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
10 changes: 3 additions & 7 deletions dbms/src/Storages/S3/FileCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,22 +333,18 @@ void FileCache::removeDiskFile(const String & local_fname, bool update_fsize_met
}
}

void FileCache::remove(std::unique_lock<std::mutex> &, 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<UInt64>(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<Int64, std::list<String>::iterator> FileCache::removeImpl(
LRUFileTable & table,
const String & s3_key,
Expand Down
1 change: 0 additions & 1 deletion dbms/src/Storages/S3/FileCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::mutex> & cache_lock, const String & s3_key, bool force = false);
void remove(const String & s3_key, bool force = false);
std::pair<Int64, std::list<String>::iterator> removeImpl(
LRUFileTable & table,
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/TiDB/Schema/TiDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
#include <TiDB/Decode/Vector.h>
#include <TiDB/Schema/SchemaNameMapper.h>
#include <TiDB/Schema/TiDB.h>
#include <TiDB/Schema/VectorIndex.h>
#include <common/logger_useful.h>
#include <tipb/executor.pb.h>

#include <algorithm>
#include <cmath>
#include <magic_enum.hpp>
#include "TiDB/Schema/VectorIndex.h"

namespace DB
{
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/TiDB/Schema/VectorIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
};

Expand Down

0 comments on commit ff13cae

Please sign in to comment.