Utils.h 1.8 KB
Newer Older
1
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
J
jinhai 已提交
2
//
3 4
// 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
J
jinhai 已提交
5
//
6 7 8 9 10
// 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.
J
jinhai 已提交
11

X
Xu Peng 已提交
12 13
#pragma once

S
starlord 已提交
14
#include "Options.h"
15
#include "db/Types.h"
S
starlord 已提交
16
#include "db/meta/MetaTypes.h"
S
starlord 已提交
17

18
#include <ctime>
S
starlord 已提交
19
#include <string>
X
Xu Peng 已提交
20

J
jinhai 已提交
21
namespace milvus {
X
Xu Peng 已提交
22 23 24
namespace engine {
namespace utils {

S
starlord 已提交
25 26
int64_t
GetMicroSecTimeStamp();
X
Xu Peng 已提交
27

S
starlord 已提交
28
Status
S
starlord 已提交
29
CreateTablePath(const DBMetaOptions& options, const std::string& table_id);
S
starlord 已提交
30
Status
S
starlord 已提交
31
DeleteTablePath(const DBMetaOptions& options, const std::string& table_id, bool force = true);
S
starlord 已提交
32

S
starlord 已提交
33
Status
S
starlord 已提交
34
CreateTableFilePath(const DBMetaOptions& options, meta::TableFileSchema& table_file);
S
starlord 已提交
35
Status
S
starlord 已提交
36
GetTableFilePath(const DBMetaOptions& options, meta::TableFileSchema& table_file);
S
starlord 已提交
37
Status
S
starlord 已提交
38
DeleteTableFilePath(const DBMetaOptions& options, meta::TableFileSchema& table_file);
S
starlord 已提交
39

S
starlord 已提交
40
bool
S
starlord 已提交
41
IsSameIndex(const TableIndex& index1, const TableIndex& index2);
42

S
starlord 已提交
43
meta::DateT
S
starlord 已提交
44
GetDate(const std::time_t& t, int day_delta = 0);
S
starlord 已提交
45 46 47 48
meta::DateT
GetDate();
meta::DateT
GetDateWithDelta(int day_delta);
49

50 51 52 53 54 55 56 57 58
struct MetaUriInfo {
    std::string dialect_;
    std::string username_;
    std::string password_;
    std::string host_;
    std::string port_;
    std::string db_name_;
};

S
starlord 已提交
59
Status
S
starlord 已提交
60
ParseMetaUri(const std::string& uri, MetaUriInfo& info);
61

S
starlord 已提交
62 63 64
}  // namespace utils
}  // namespace engine
}  // namespace milvus