This commit is contained in:
KinderRiven 2022-06-26 20:35:02 +08:00 committed by KinderRiven
parent c5f9022510
commit 50fd740ec3
3 changed files with 6 additions and 6 deletions

View File

@ -772,7 +772,7 @@ void FileCache::removeIfReleasable(bool remove_persistent_files)
{
std::lock_guard segment_lock(file_segment->mutex);
file_segment->detach(cache_lock, segment_lock);
remove(file_segment->key(), file_segment->offset(), cache_lock, segment_lock);
to_remove.emplace_back(file_segment);
}
}
}

View File

@ -3,9 +3,9 @@
#include <list>
#include <memory>
#include <mutex>
#include <Core/Types.h>
#include <Common/Exception.h>
#include <Common/IFileCache.h>
#include <Core/Types.h>
namespace DB
{
@ -28,7 +28,7 @@ public:
String toString() const;
Key() = default;
explicit Key(const UInt128 & key_) : key(key_) {}
explicit Key(const UInt128 & key_) : key(key_) { }
bool operator==(const Key & other) const { return key == other.key; }
};
@ -80,7 +80,7 @@ public:
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Not support incrementSize() for IIterator.");
}
virtual Key & key() const = 0;
virtual Key key() const = 0;
virtual size_t offset() const = 0;

View File

@ -19,9 +19,9 @@ public:
void next() override { queue_iter++; }
bool valid() const override { return queue_iter != file_cache->queue.end(); }
bool valid() const override { return (file_cache->queue.size() && (queue_iter != file_cache->queue.end())); }
Key & key() const override { return queue_iter->key; }
Key key() const override { return queue_iter->key; }
size_t offset() const override { return queue_iter->offset; }