ValidationUtil.h 978 字节
Newer Older
J
jinhai 已提交
1 2
#pragma once

3
#include "db/meta/MetaTypes.h"
J
jinhai 已提交
4 5 6 7 8 9
#include "Error.h"

namespace zilliz {
namespace milvus {
namespace server {

G
groot 已提交
10 11 12 13
class ValidationUtil {
public:
    static ServerError
    ValidateTableName(const std::string &table_name);
J
jinhai 已提交
14

G
groot 已提交
15 16
    static ServerError
    ValidateTableDimension(int64_t dimension);
J
jinhai 已提交
17

G
groot 已提交
18 19 20
    static ServerError
    ValidateTableIndexType(int32_t index_type);

G
groot 已提交
21 22 23 24
    static ServerError
    ValidateTableIndexNlist(int32_t nlist);

    static ServerError
25
    ValidateTableIndexFileSize(int64_t index_file_size);
G
groot 已提交
26 27 28 29

    static ServerError
    ValidateTableIndexMetricType(int32_t metric_type);

30 31 32 33 34 35
    static ServerError
    ValidateSearchTopk(int64_t top_k, const engine::meta::TableSchema& table_schema);

    static ServerError
    ValidateSearchNprobe(int64_t nprobe, const engine::meta::TableSchema& table_schema);

G
groot 已提交
36 37 38 39 40 41
    static ServerError
    ValidateGpuIndex(uint32_t gpu_index);

    static ServerError
    GetGpuMemory(uint32_t gpu_index, size_t &memory);
};
J
jinhai 已提交
42 43 44 45

}
}
}