diff --git a/include/server/vnode/tq/tq.h b/include/server/vnode/tq/tq.h index 495383684afef4c137697acd50f521548e81292f..3aeaf9acb6be607caea6bf60d8627875fa952df8 100644 --- a/include/server/vnode/tq/tq.h +++ b/include/server/vnode/tq/tq.h @@ -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 diff --git a/source/libs/wal/CMakeLists.txt b/source/libs/wal/CMakeLists.txt index fbcdff59eeb243cfe0c4569eae63ca8b0d8043b4..4af8bac7f94986f95b4fce1367f68e7063368dbe 100644 --- a/source/libs/wal/CMakeLists.txt +++ b/source/libs/wal/CMakeLists.txt @@ -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 ) diff --git a/source/server/vnode/meta/src/metaMain.c b/source/server/vnode/meta/src/metaMain.c index 612ef49a049833f45dbe72e23607ee4206998256..4efcd67908e05eb318d982d12862cef1b696e2b9 100644 --- a/source/server/vnode/meta/src/metaMain.c +++ b/source/server/vnode/meta/src/metaMain.c @@ -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) { diff --git a/source/server/vnode/tq/CMakeLists.txt b/source/server/vnode/tq/CMakeLists.txt index 0c15e23d337e0faac1772e27a545d5a0a4c4ccac..441fe46244587eaa2d35457db0d955a9d981dc80 100644 --- a/source/server/vnode/tq/CMakeLists.txt +++ b/source/server/vnode/tq/CMakeLists.txt @@ -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 ) diff --git a/source/server/vnode/tq/inc/tqCommit.h b/source/server/vnode/tq/inc/tqCommit.h new file mode 100644 index 0000000000000000000000000000000000000000..f2f48bbc8a69a022d0fc6b8a88c5a9a55d0b4ad6 --- /dev/null +++ b/source/server/vnode/tq/inc/tqCommit.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * 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 . + */ diff --git a/source/server/vnode/tq/inc/tqInt.h b/source/server/vnode/tq/inc/tqInt.h index d19e9ec81e3fcc6ceee3c2af43a9c9c91821122b..100149c0ea83b20ede8d5933da0618da89e64ef3 100644 --- a/source/server/vnode/tq/inc/tqInt.h +++ b/source/server/vnode/tq/inc/tqInt.h @@ -18,7 +18,6 @@ #include "tq.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/source/server/vnode/tq/inc/tqMetaStore.h b/source/server/vnode/tq/inc/tqMetaStore.h new file mode 100644 index 0000000000000000000000000000000000000000..2c752b8f8fc07e2a30a72d452ac2128d97e6924e --- /dev/null +++ b/source/server/vnode/tq/inc/tqMetaStore.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * 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 . + */ + +#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_ */ diff --git a/source/server/vnode/tq/src/tqCommit.c b/source/server/vnode/tq/src/tqCommit.c new file mode 100644 index 0000000000000000000000000000000000000000..f2f48bbc8a69a022d0fc6b8a88c5a9a55d0b4ad6 --- /dev/null +++ b/source/server/vnode/tq/src/tqCommit.c @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * 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 . + */ diff --git a/source/server/vnode/tq/src/tqMetaStore.c b/source/server/vnode/tq/src/tqMetaStore.c new file mode 100644 index 0000000000000000000000000000000000000000..f2f48bbc8a69a022d0fc6b8a88c5a9a55d0b4ad6 --- /dev/null +++ b/source/server/vnode/tq/src/tqMetaStore.c @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * 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 . + */