dnodeVnodeMgmt.h 1.7 KB
Newer Older
S
#1177  
slguan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef TDENGINE_DNODE_VNODE_MGMT_H
#define TDENGINE_DNODE_VNODE_MGMT_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
S
slguan 已提交
24
#include <stdbool.h>
S
slguan 已提交
25
#include "taosdef.h"
S
#1177  
slguan 已提交
26
#include "taosmsg.h"
S
slguan 已提交
27
#include "tstatus.h"
S
#1177  
slguan 已提交
28 29 30 31 32 33 34 35 36

/*
 * Open all Vnodes in the local data directory
 */
int32_t dnodeOpenVnodes();

/*
 * Close all Vnodes that have been created and opened
 */
S
slguan 已提交
37
int32_t dnodeCleanupVnodes();
S
#1177  
slguan 已提交
38 39 40 41

/*
 * Check if vnode already exists
 */
S
slguan 已提交
42
bool dnodeCheckVnodeExist(int32_t vid);
S
#1177  
slguan 已提交
43 44 45

/*
 * Create vnode with specified configuration and open it
S
slguan 已提交
46
 * if exist, config it
S
#1177  
slguan 已提交
47
 */
S
slguan 已提交
48
int32_t dnodeCreateVnode(SCreateVnodeMsg *pVnode);
S
#1177  
slguan 已提交
49 50

/*
S
slguan 已提交
51
 * Remove vnode from local repository
S
#1177  
slguan 已提交
52
 */
S
slguan 已提交
53
int32_t dnodeDropVnode(int32_t vnode);
S
#1177  
slguan 已提交
54 55

/*
S
slguan 已提交
56
 * Get the vnode object that has been opened
S
#1177  
slguan 已提交
57
 */
S
slguan 已提交
58
//tsdb_repo_t* dnodeGetVnode(int vid);
S
slguan 已提交
59
void* dnodeGetVnode(int32_t vnode);
S
#1177  
slguan 已提交
60 61

/*
S
slguan 已提交
62
 * get the status of vnode
S
#1177  
slguan 已提交
63
 */
S
slguan 已提交
64
EVnodeStatus dnodeGetVnodeStatus(int32_t vnode);
S
#1177  
slguan 已提交
65 66

/*
S
slguan 已提交
67
 * Check if vnode already exists, and table exist in this vnode
S
#1177  
slguan 已提交
68
 */
S
slguan 已提交
69
bool dnodeCheckTableExist(int32_t vnode, int32_t sid, int64_t uid);
S
#1177  
slguan 已提交
70

S
#1177  
slguan 已提交
71 72 73 74 75
#ifdef __cplusplus
}
#endif

#endif