MemManager.h 1.5 KB
Newer Older
J
jinhai 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you 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.


Z
zhiru 已提交
19 20
#pragma once

G
groot 已提交
21
#include "utils/Status.h"
G
groot 已提交
22
#include "db/Types.h"
Z
zhiru 已提交
23

G
groot 已提交
24 25
#include <set>
#include <memory>
Z
update  
zhiru 已提交
26

Z
zhiru 已提交
27 28 29 30
namespace zilliz {
namespace milvus {
namespace engine {

G
groot 已提交
31
class MemManager {
Z
update  
zhiru 已提交
32
 public:
Z
zhiru 已提交
33

Z
update  
zhiru 已提交
34 35
    virtual Status InsertVectors(const std::string &table_id,
                                 size_t n, const float *vectors, IDNumbers &vector_ids) = 0;
Z
zhiru 已提交
36

Z
update  
zhiru 已提交
37
    virtual Status Serialize(std::set<std::string> &table_ids) = 0;
Z
zhiru 已提交
38

Z
update  
zhiru 已提交
39
    virtual Status EraseMemVector(const std::string &table_id) = 0;
Z
zhiru 已提交
40

Z
zhiru 已提交
41 42 43 44 45 46
    virtual size_t GetCurrentMutableMem() = 0;

    virtual size_t GetCurrentImmutableMem() = 0;

    virtual size_t GetCurrentMem() = 0;

Z
zhiru 已提交
47 48
}; // MemManagerAbstract

G
groot 已提交
49
using MemManagerPtr = std::shared_ptr<MemManager>;
Z
zhiru 已提交
50 51 52 53

} // namespace engine
} // namespace milvus
} // namespace zilliz