add tq files, fix cmake file

This commit is contained in:
Liu Jicong 2021-10-28 15:55:52 +08:00
parent 825239081f
commit 775da462d4
9 changed files with 96 additions and 14 deletions

View File

@ -17,6 +17,7 @@
#define _TD_TQ_H_
#include "os.h"
#include "tutil.h"
#ifdef __cplusplus
extern "C" {
@ -79,14 +80,14 @@ typedef struct TmqConsumeRsp {
typedef struct TmqSubscribeReq {
TmqMsgHead head;
int64_t topicLen;
char topic[];
int32_t topicNum;
int64_t topic[];
} TmqSubscribeReq;
typedef struct tmqSubscribeRsp {
TmqMsgHead head;
int64_t vgId;
char ep[]; //TSDB_EP_LEN
char ep[TSDB_EP_LEN]; //TSDB_EP_LEN
} TmqSubscribeRsp;
typedef struct TmqHeartbeatReq {
@ -98,17 +99,17 @@ typedef struct TmqHeartbeatRsp {
} TmqHeartbeatRsp;
typedef struct TqTopicVhandle {
//name
//
int64_t topicId;
//executor for filter
//
void* filterExec;
//callback for mnode
//
//trigger when vnode list associated topic change
void* (*mCallback)(void*, void*);
} TqTopicVhandle;
typedef struct STQ {
//the collection of group handle
//the handle of kvstore
} STQ;
#define TQ_BUFFER_SIZE 8

View File

@ -4,9 +4,9 @@ target_include_directories(
wal
PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/wal"
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
PRIVATE "${CMAKE_SOURCE_DIR}/include/os"
)
target_link_libraries(
os
wal
PUBLIC os
)

View File

@ -64,6 +64,7 @@ SMeta *metaOpen(SMetaOpts *pMetaOpts) {
// TODO: need to figure out how to persist the START UID
tableUidGeneratorInit(&(pMeta->uidGenerator), IVLD_TB_UID);
return pMeta;
}
void metaClose(SMeta *pMeta) {

View File

@ -3,11 +3,12 @@ add_library(tq ${TQ_SRC})
target_include_directories(
tq
PUBLIC "${CMAKE_SOURCE_DIR}/include/server/vnode/tq"
PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/wal"
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
PRIVATE "${CMAKE_SOURCE_DIR}/include/os"
)
target_link_libraries(
wal
tq
PUBLIC wal
PUBLIC os
PUBLIC util
)

View File

@ -0,0 +1,14 @@
/*
* 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/>.
*/

View File

@ -18,7 +18,6 @@
#include "tq.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -0,0 +1,38 @@
/*
* 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 _TQ_META_STORE_H_
#define _TQ_META_STORE_H_
#include "os.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct TqKvHandle {
int64_t key;
int64_t offset;
void *valueInUse;
void *valueInTxn;
//serializer
} TqKvHandle;
#ifdef __cplusplus
}
#endif
#endif /* ifndef _TQ_META_STORE_H_ */

View File

@ -0,0 +1,14 @@
/*
* 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/>.
*/

View File

@ -0,0 +1,14 @@
/*
* 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/>.
*/