milvus/core/src/cache/CpuCacheMgr.h
BossZou 504a9e30ab
Optimize config cpu_cache_capacity / gpu_cache_capacity setter (#1572) (#1629)
* add gpu cache config handler

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* remove cpu/gpu cache mgr from Config class by using cache config handler (fix #1572)

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* remove 0.8.0 from config version map

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* clean config header reference

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* fix bug in web readme

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* reduce gpu config handler to gpu resources handler

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* add engine config

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* modify handler hook(fix #1572)

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* update changlog

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* initalize value in handler by config default

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* code style format

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* fix compile error in release mode

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* resolve faiss blas threshold init in DBWrapper

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* modify cache header

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* remove comments

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* order headers

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* convert gpu res config to lower case

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* CI retry

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* adjust header order in cpu cache mar file

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* improve config test case

Signed-off-by: Yhz <yinghao.zou@zilliz.com>

* code format

Signed-off-by: Yhz <yinghao.zou@zilliz.com>
2020-03-19 10:17:53 +08:00

43 lines
1.2 KiB
C++

// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License.
#pragma once
#include <memory>
#include <string>
#include "cache/CacheMgr.h"
#include "cache/DataObj.h"
#include "config/handler/CacheConfigHandler.h"
namespace milvus {
namespace cache {
class CpuCacheMgr : public CacheMgr<DataObjPtr>, public server::CacheConfigHandler {
private:
CpuCacheMgr();
public:
// TODO(myh): use smart pointer instead
static CpuCacheMgr*
GetInstance();
DataObjPtr
GetIndex(const std::string& key);
protected:
void
OnCpuCacheCapacityChanged(int64_t value) override;
};
} // namespace cache
} // namespace milvus