TDengine/source/dnode/vnode/src/inc/vnodeInt.h

115 lines
2.4 KiB
C
Raw Normal View History

2021-11-07 07:58:32 +00:00
/*
* 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/>.
*/
2022-01-14 06:55:24 +00:00
#ifndef _TD_VNODE_DEF_H_
#define _TD_VNODE_DEF_H_
2021-11-07 07:58:32 +00:00
2022-04-08 06:49:07 +00:00
#include "executor.h"
2022-04-14 02:25:49 +00:00
#include "filter.h"
#include "qworker.h"
#include "sync.h"
2022-04-08 06:49:07 +00:00
#include "tchecksum.h"
2021-12-13 08:31:39 +00:00
#include "tcoding.h"
2022-04-08 06:49:07 +00:00
#include "tcompression.h"
2022-03-28 06:55:15 +00:00
#include "tdatablock.h"
2022-04-14 08:21:27 +00:00
#include "tdbInt.h"
2022-01-14 06:33:13 +00:00
#include "tfs.h"
2022-04-08 06:49:07 +00:00
#include "tglobal.h"
2022-04-15 06:27:04 +00:00
#include "tjson.h"
2021-12-17 06:12:01 +00:00
#include "tlist.h"
2021-11-09 09:52:06 +00:00
#include "tlockfree.h"
2022-04-14 02:25:49 +00:00
#include "tlosertree.h"
2022-04-08 06:49:07 +00:00
#include "tmallocator.h"
2022-04-08 06:41:42 +00:00
#include "tskiplist.h"
2022-04-14 02:25:49 +00:00
#include "tstream.h"
2022-04-08 06:41:42 +00:00
#include "ttime.h"
2022-04-08 06:49:07 +00:00
#include "ttimer.h"
#include "wal.h"
2021-11-07 07:58:32 +00:00
2022-04-14 05:53:45 +00:00
#include "vnode.h"
2021-11-07 07:58:32 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2022-04-15 05:47:57 +00:00
typedef struct SVnodeInfo SVnodeInfo;
2022-04-14 06:16:43 +00:00
typedef struct SMeta SMeta;
typedef struct STsdb STsdb;
typedef struct STQ STQ;
2022-04-08 06:49:07 +00:00
typedef struct SVState SVState;
typedef struct SVBufPool SVBufPool;
typedef struct SQWorkerMgmt SQHandle;
2022-01-14 06:33:13 +00:00
2022-03-24 03:34:43 +00:00
typedef struct {
int8_t streamType; // sma or other
int8_t dstType;
int16_t padding;
int32_t smaId;
int64_t tbUid;
int64_t lastReceivedVer;
int64_t lastCommittedVer;
} SStreamSinkInfo;
typedef struct {
SVnode* pVnode;
SHashObj* pHash; // streamId -> SStreamSinkInfo
} SSink;
2022-01-14 06:33:13 +00:00
// SVState
struct SVState {
int64_t processed;
int64_t committed;
int64_t applied;
};
2022-04-15 05:47:57 +00:00
struct SVnodeInfo {
SVnodeCfg config;
SVState state;
};
2021-11-07 07:58:32 +00:00
struct SVnode {
2022-01-14 06:33:13 +00:00
int32_t vgId;
char* path;
SVnodeCfg config;
SVState state;
SVBufPool* pBufPool;
SMeta* pMeta;
STsdb* pTsdb;
SWal* pWal;
2022-03-24 03:34:43 +00:00
STQ* pTq;
SSink* pSink;
2022-01-14 06:33:13 +00:00
tsem_t canCommit;
SQHandle* pQuery;
2022-03-21 11:08:25 +00:00
SMsgCb msgCb;
2022-01-19 05:39:32 +00:00
STfs* pTfs;
2021-11-07 07:58:32 +00:00
};
2022-03-28 06:40:22 +00:00
// sma
2022-03-28 06:55:15 +00:00
void smaHandleRes(void* pVnode, int64_t smaId, const SArray* data);
2022-03-28 06:40:22 +00:00
2022-04-14 05:28:11 +00:00
#include "vnd.h"
2022-04-08 06:19:58 +00:00
#include "meta.h"
#include "tsdb.h"
#include "tq.h"
2021-11-07 07:58:32 +00:00
#ifdef __cplusplus
}
#endif
2022-01-20 02:45:15 +00:00
#endif /*_TD_VNODE_DEF_H_*/