MemTableFile.h 866 字节
Newer Older
Z
zhiru 已提交
1 2 3 4 5
#pragma once

#include "Status.h"
#include "Meta.h"
#include "VectorSource.h"
Z
update  
zhiru 已提交
6
#include "ExecutionEngine.h"
Z
zhiru 已提交
7

Z
update  
zhiru 已提交
8

Z
zhiru 已提交
9 10 11 12 13 14
namespace zilliz {
namespace milvus {
namespace engine {

class MemTableFile {

Z
update  
zhiru 已提交
15
 public:
Z
zhiru 已提交
16 17 18 19

    using Ptr = std::shared_ptr<MemTableFile>;
    using MetaPtr = meta::Meta::Ptr;

Z
update  
zhiru 已提交
20
    MemTableFile(const std::string &table_id, const std::shared_ptr<meta::Meta> &meta, const Options &options);
Z
zhiru 已提交
21

Z
update  
zhiru 已提交
22
    Status Add(const VectorSource::Ptr &source);
Z
zhiru 已提交
23 24 25 26 27

    size_t GetCurrentMem();

    size_t GetMemLeft();

Z
zhiru 已提交
28 29 30
    bool IsFull();

    Status Serialize();
Z
zhiru 已提交
31

Z
update  
zhiru 已提交
32
 private:
Z
zhiru 已提交
33 34 35 36 37 38 39 40 41

    Status CreateTableFile();

    const std::string table_id_;

    meta::TableFileSchema table_file_schema_;

    MetaPtr meta_;

Z
zhiru 已提交
42 43
    Options options_;

Z
zhiru 已提交
44 45
    size_t current_mem_;

Z
update  
zhiru 已提交
46 47
    ExecutionEnginePtr execution_engine_;

Z
zhiru 已提交
48 49 50 51 52
}; //MemTableFile

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