Utils.h 2.0 KB
Newer Older
J
jinhai 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// 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.

X
Xu Peng 已提交
18 19
#pragma once

G
groot 已提交
20
#include "Options.h"
G
groot 已提交
21
#include "db/meta/MetaTypes.h"
22
#include "db/Types.h"
G
groot 已提交
23 24

#include <string>
25
#include <ctime>
X
Xu Peng 已提交
26 27

namespace zilliz {
J
jinhai 已提交
28
namespace milvus {
X
Xu Peng 已提交
29 30 31
namespace engine {
namespace utils {

G
groot 已提交
32 33
int64_t
GetMicroSecTimeStamp();
X
Xu Peng 已提交
34

G
groot 已提交
35 36 37 38
Status
CreateTablePath(const DBMetaOptions &options, const std::string &table_id);
Status
DeleteTablePath(const DBMetaOptions &options, const std::string &table_id, bool force = true);
G
groot 已提交
39

G
groot 已提交
40 41 42 43 44 45
Status
CreateTableFilePath(const DBMetaOptions &options, meta::TableFileSchema &table_file);
Status
GetTableFilePath(const DBMetaOptions &options, meta::TableFileSchema &table_file);
Status
DeleteTableFilePath(const DBMetaOptions &options, meta::TableFileSchema &table_file);
G
groot 已提交
46

G
groot 已提交
47 48
bool
IsSameIndex(const TableIndex &index1, const TableIndex &index2);
49

G
groot 已提交
50 51 52 53 54 55
meta::DateT
GetDate(const std::time_t &t, int day_delta = 0);
meta::DateT
GetDate();
meta::DateT
GetDateWithDelta(int day_delta);
56

57 58 59 60 61 62 63 64 65
struct MetaUriInfo {
    std::string dialect_;
    std::string username_;
    std::string password_;
    std::string host_;
    std::string port_;
    std::string db_name_;
};

G
groot 已提交
66 67
Status
ParseMetaUri(const std::string &uri, MetaUriInfo &info);
68

X
Xu Peng 已提交
69 70
} // namespace utils
} // namespace engine
J
jinhai 已提交
71
} // namespace milvus
X
Xu Peng 已提交
72
} // namespace zilliz