ValidationUtil.h 958 字节
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 {

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

S
starlord 已提交
15
    static ErrorCode
16
    ValidateTableDimension(int64_t dimension);
J
jinhai 已提交
17

S
starlord 已提交
18
    static ErrorCode
19 20
    ValidateTableIndexType(int32_t index_type);

S
starlord 已提交
21
    static ErrorCode
S
starlord 已提交
22 23
    ValidateTableIndexNlist(int32_t nlist);

S
starlord 已提交
24
    static ErrorCode
25
    ValidateTableIndexFileSize(int64_t index_file_size);
S
starlord 已提交
26

S
starlord 已提交
27
    static ErrorCode
S
starlord 已提交
28 29
    ValidateTableIndexMetricType(int32_t metric_type);

S
starlord 已提交
30
    static ErrorCode
31 32
    ValidateSearchTopk(int64_t top_k, const engine::meta::TableSchema& table_schema);

S
starlord 已提交
33
    static ErrorCode
34 35
    ValidateSearchNprobe(int64_t nprobe, const engine::meta::TableSchema& table_schema);

S
starlord 已提交
36
    static ErrorCode
37 38
    ValidateGpuIndex(uint32_t gpu_index);

S
starlord 已提交
39
    static ErrorCode
40 41
    GetGpuMemory(uint32_t gpu_index, size_t &memory);
};
J
jinhai 已提交
42 43 44 45

}
}
}