mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Update Cache code format
This commit is contained in:
parent
6a4147ddbe
commit
745ce13f46
13
core/src/cache/Cache.h
vendored
13
core/src/cache/Cache.h
vendored
@ -40,12 +40,15 @@ class Cache {
|
||||
return usage_;
|
||||
}
|
||||
|
||||
// unit: BYTE
|
||||
int64_t
|
||||
capacity() const {
|
||||
return capacity_;
|
||||
} // unit: BYTE
|
||||
}
|
||||
|
||||
// unit: BYTE
|
||||
void
|
||||
set_capacity(int64_t capacity); // unit: BYTE
|
||||
set_capacity(int64_t capacity);
|
||||
|
||||
double
|
||||
freemem_percent() const {
|
||||
@ -59,16 +62,22 @@ class Cache {
|
||||
|
||||
size_t
|
||||
size() const;
|
||||
|
||||
bool
|
||||
exists(const std::string& key);
|
||||
|
||||
ItemObj
|
||||
get(const std::string& key);
|
||||
|
||||
void
|
||||
insert(const std::string& key, const ItemObj& item);
|
||||
|
||||
void
|
||||
erase(const std::string& key);
|
||||
|
||||
void
|
||||
print();
|
||||
|
||||
void
|
||||
clear();
|
||||
|
||||
|
||||
7
core/src/cache/CacheMgr.h
vendored
7
core/src/cache/CacheMgr.h
vendored
@ -53,14 +53,19 @@ class CacheMgr {
|
||||
|
||||
int64_t
|
||||
CacheUsage() const;
|
||||
|
||||
int64_t
|
||||
CacheCapacity() const;
|
||||
|
||||
void
|
||||
SetCapacity(int64_t capacity);
|
||||
|
||||
protected:
|
||||
|
||||
CacheMgr();
|
||||
virtual ~CacheMgr();
|
||||
|
||||
virtual
|
||||
~CacheMgr();
|
||||
|
||||
protected:
|
||||
using CachePtr = std::shared_ptr<Cache<ItemObj>>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user