diff --git a/source/dnode/vnode/src/inc/metaDef.h b/source/dnode/vnode/src/inc/meta.h
similarity index 94%
rename from source/dnode/vnode/src/inc/metaDef.h
rename to source/dnode/vnode/src/inc/meta.h
index 8d624945b2..b04364daf8 100644
--- a/source/dnode/vnode/src/inc/metaDef.h
+++ b/source/dnode/vnode/src/inc/meta.h
@@ -13,11 +13,8 @@
* along with this program. If not, see .
*/
-#ifndef _TD_META_DEF_H_
-#define _TD_META_DEF_H_
-
-#include "tmallocator.h"
-#include "vnode.h"
+#ifndef _TD_VNODE_META_H_
+#define _TD_VNODE_META_H_
#ifdef __cplusplus
extern "C" {
@@ -77,4 +74,4 @@ struct SMeta {
}
#endif
-#endif /*_TD_META_DEF_H_*/
+#endif /*_TD_VNODE_META_H_*/
\ No newline at end of file
diff --git a/source/dnode/vnode/src/inc/tqCommit.h b/source/dnode/vnode/src/inc/tq.h
similarity index 81%
rename from source/dnode/vnode/src/inc/tqCommit.h
rename to source/dnode/vnode/src/inc/tq.h
index f2f48bbc8a..573fc78df0 100644
--- a/source/dnode/vnode/src/inc/tqCommit.h
+++ b/source/dnode/vnode/src/inc/tq.h
@@ -12,3 +12,16 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+
+#ifndef _TD_VNODE_TQ_H_
+#define _TD_VNODE_TQ_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_TD_VNODE_TQ_H_*/
\ No newline at end of file
diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h
new file mode 100644
index 0000000000..0ed2a6dc11
--- /dev/null
+++ b/source/dnode/vnode/src/inc/tsdb.h
@@ -0,0 +1,27 @@
+/*
+ * 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 _TD_VNODE_TSDB_H_
+#define _TD_VNODE_TSDB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_TD_VNODE_TSDB_H_*/
\ No newline at end of file
diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h
index 598c8c07bc..8b9f0d9a8a 100644
--- a/source/dnode/vnode/src/inc/vnodeInt.h
+++ b/source/dnode/vnode/src/inc/vnodeInt.h
@@ -205,6 +205,12 @@ int32_t tqProcessStreamTrigger(STQ* pTq, void* data, int32_t dataLen, int32_t wo
// sma
void smaHandleRes(void* pVnode, int64_t smaId, const SArray* data);
+#include "meta.h"
+
+#include "tsdb.h"
+
+#include "tq.h"
+
#ifdef __cplusplus
}
#endif
diff --git a/source/dnode/vnode/src/meta/metaCache.c b/source/dnode/vnode/src/meta/metaCache.c
index aeb7dfc039..e1507a3757 100644
--- a/source/dnode/vnode/src/meta/metaCache.c
+++ b/source/dnode/vnode/src/meta/metaCache.c
@@ -13,8 +13,7 @@
* along with this program. If not, see .
*/
-#include "vnode.h"
-#include "metaDef.h"
+#include "vnodeInt.h"
struct SMetaCache {
// TODO
diff --git a/source/dnode/vnode/src/meta/metaCfg.c b/source/dnode/vnode/src/meta/metaCfg.c
index cbaac1c409..a5fcb32698 100644
--- a/source/dnode/vnode/src/meta/metaCfg.c
+++ b/source/dnode/vnode/src/meta/metaCfg.c
@@ -13,7 +13,7 @@
* along with this program. If not, see .
*/
-#include "metaDef.h"
+#include "vnodeInt.h"
const SMetaCfg defaultMetaOptions = {.lruSize = 0};
diff --git a/source/dnode/vnode/src/meta/metaIdx.c b/source/dnode/vnode/src/meta/metaIdx.c
index 818da14738..9a566f788c 100644
--- a/source/dnode/vnode/src/meta/metaIdx.c
+++ b/source/dnode/vnode/src/meta/metaIdx.c
@@ -16,7 +16,7 @@
#ifdef USE_INVERTED_INDEX
#include "index.h"
#endif
-#include "metaDef.h"
+#include "vnodeInt.h"
struct SMetaIdx {
#ifdef USE_INVERTED_INDEX
diff --git a/source/dnode/vnode/src/meta/metaMain.c b/source/dnode/vnode/src/meta/metaMain.c
index 690b96bbb0..ac47c32cbf 100644
--- a/source/dnode/vnode/src/meta/metaMain.c
+++ b/source/dnode/vnode/src/meta/metaMain.c
@@ -15,7 +15,7 @@
#include "tcoding.h"
-#include "metaDef.h"
+#include "vnodeInt.h"
static SMeta *metaNew(const char *path, const SMetaCfg *pMetaCfg, SMemAllocatorFactory *pMAF);
static void metaFree(SMeta *pMeta);
diff --git a/source/dnode/vnode/src/meta/metaTDBImpl.c b/source/dnode/vnode/src/meta/metaTDBImpl.c
index 36b3b53ccd..c78691e7c2 100644
--- a/source/dnode/vnode/src/meta/metaTDBImpl.c
+++ b/source/dnode/vnode/src/meta/metaTDBImpl.c
@@ -13,7 +13,7 @@
* along with this program. If not, see .
*/
-#include "metaDef.h"
+#include "vnodeInt.h"
#include "tdbInt.h"
typedef struct SPoolMem {
diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c
index 5977ad832c..7f06ba8855 100644
--- a/source/dnode/vnode/src/meta/metaTable.c
+++ b/source/dnode/vnode/src/meta/metaTable.c
@@ -13,7 +13,7 @@
* along with this program. If not, see .
*/
-#include "metaDef.h"
+#include "vnodeInt.h"
int metaCreateTable(SMeta *pMeta, STbCfg *pTbCfg) {
// Validate the tbOptions
diff --git a/source/dnode/vnode/src/meta/metaTbCfg.c b/source/dnode/vnode/src/meta/metaTbCfg.c
index d71d319a79..8ecc808786 100644
--- a/source/dnode/vnode/src/meta/metaTbCfg.c
+++ b/source/dnode/vnode/src/meta/metaTbCfg.c
@@ -13,7 +13,7 @@
* along with this program. If not, see .
*/
-#include "metaDef.h"
+#include "vnodeInt.h"
#include "tcoding.h"
int metaValidateTbCfg(SMeta *pMeta, const STbCfg *pTbOptions) {
diff --git a/source/dnode/vnode/src/meta/metaTbUid.c b/source/dnode/vnode/src/meta/metaTbUid.c
index e4ab36ec03..27a2ecfb19 100644
--- a/source/dnode/vnode/src/meta/metaTbUid.c
+++ b/source/dnode/vnode/src/meta/metaTbUid.c
@@ -13,8 +13,7 @@
* along with this program. If not, see .
*/
-#include "vnode.h"
-#include "metaDef.h"
+#include "vnodeInt.h"
int metaOpenUidGnrt(SMeta *pMeta) {
// Init a generator
diff --git a/source/dnode/vnode/test/tsdbSmaTest.cpp b/source/dnode/vnode/test/tsdbSmaTest.cpp
index 37e2f188cd..208493bdf6 100644
--- a/source/dnode/vnode/test/tsdbSmaTest.cpp
+++ b/source/dnode/vnode/test/tsdbSmaTest.cpp
@@ -20,7 +20,7 @@
#include
#include
-#include
+#include
#include
#pragma GCC diagnostic push