提交 8ccd079f 编写于 作者: S Shengliang Guan

rename tulog.h ulog.h

上级 f50bd07c
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
extern "C" { extern "C" {
#endif #endif
#include <stdint.h>
#include <stdbool.h>
#define TAOS_DEF_ERROR_CODE(mod, code) ((int32_t)((0x80000000 | ((mod)<<16) | (code)))) #define TAOS_DEF_ERROR_CODE(mod, code) ((int32_t)((0x80000000 | ((mod)<<16) | (code))))
#define TAOS_SYSTEM_ERROR(code) (0x80ff0000 | (code)) #define TAOS_SYSTEM_ERROR(code) (0x80ff0000 | (code))
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
extern "C" { extern "C" {
#endif #endif
#include <stdbool.h>
#include <stdint.h>
#include "taosdef.h" #include "taosdef.h"
#include "taoserror.h" #include "taoserror.h"
#include "tdataformat.h" #include "tdataformat.h"
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
extern "C" { extern "C" {
#endif #endif
#include <stdbool.h>
#include <stdint.h>
#include "taosdef.h" #include "taosdef.h"
// this data type is internally used only in 'in' query to hold the values // this data type is internally used only in 'in' query to hold the values
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
extern "C" { extern "C" {
#endif #endif
struct SRpcEpSet;
struct SRpcMsg;
struct Dnode;
/** /**
* Initialize and start the dnode module. * Initialize and start the dnode module.
* *
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#ifndef _TD_UTIL_DEF_H #ifndef _TD_UTIL_DEF_H
#define _TD_UTIL_DEF_H #define _TD_UTIL_DEF_H
#include "os.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "tdataformat.h" #include "tdataformat.h"
#include "tulog.h" #include "ulog.h"
#include "talgo.h" #include "talgo.h"
#include "tcoding.h" #include "tcoding.h"
#include "wchar.h" #include "wchar.h"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "os.h" #include "os.h"
#include "taosdef.h" #include "taosdef.h"
#include "taoserror.h" #include "taoserror.h"
#include "tulog.h" #include "ulog.h"
#include "tlog.h" #include "tlog.h"
#include "tconfig.h" #include "tconfig.h"
#include "tglobal.h" #include "tglobal.h"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
#include "tglobal.h" #include "tglobal.h"
#include "tconfig.h" #include "tconfig.h"
#include "tutil.h" #include "tutil.h"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
#include "tglobal.h" #include "tglobal.h"
#include "tconfig.h" #include "tconfig.h"
#include "tutil.h" #include "tutil.h"
......
...@@ -13,11 +13,22 @@ ...@@ -13,11 +13,22 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
#include "trpc.h"
#include "dnode.h" #include "dnode.h"
static bool stop = false;
static void sigintHandler(int32_t signum, void *info, void *ctx) { stop = true; }
static void setSignalHandler() {
taosSetSignal(SIGTERM, sigintHandler);
taosSetSignal(SIGHUP, sigintHandler);
taosSetSignal(SIGINT, sigintHandler);
taosSetSignal(SIGABRT, sigintHandler);
taosSetSignal(SIGBREAK, sigintHandler);
}
int main(int argc, char const *argv[]) { int main(int argc, char const *argv[]) {
setSignalHandler();
struct Dnode *dnode = dnodeCreateInstance(); struct Dnode *dnode = dnodeCreateInstance();
if (dnode == NULL) { if (dnode == NULL) {
uInfo("Failed to start TDengine, please check the log at:%s", tsLogDir); uInfo("Failed to start TDengine, please check the log at:%s", tsLogDir);
...@@ -26,12 +37,12 @@ int main(int argc, char const *argv[]) { ...@@ -26,12 +37,12 @@ int main(int argc, char const *argv[]) {
uInfo("Started TDengine service successfully."); uInfo("Started TDengine service successfully.");
// if (tsem_wait(&exitSem) != 0) { while (!stop) {
// syslog(LOG_ERR, "failed to wait exit semphore: %s", strerror(errno)); taosMsleep(100);
// } }
dnodeDropInstance(dnode);
uInfo("TDengine is shut down!"); uInfo("TDengine is shut down!");
dnodeDropInstance(dnode);
return 0; return 0;
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "os.h" #include "os.h"
#include "hash.h" #include "hash.h"
#include "tulog.h" #include "ulog.h"
#include "tdef.h" #include "tdef.h"
#define EXT_SIZE 1024 #define EXT_SIZE 1024
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
#include "ttimer.h" #include "ttimer.h"
#include "tutil.h" #include "tutil.h"
#include "tcache.h" #include "tcache.h"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "tcompare.h" #include "tcompare.h"
#include "tulog.h" #include "ulog.h"
#include "hash.h" #include "hash.h"
#include "regex.h" #include "regex.h"
#include "os.h" #include "os.h"
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#include "td_sz.h" #include "td_sz.h"
#endif #endif
#include "tscompression.h" #include "tscompression.h"
#include "tulog.h" #include "ulog.h"
static const int TEST_NUMBER = 1; static const int TEST_NUMBER = 1;
#define is_bigendian() ((*(char *)&TEST_NUMBER) == 0) #define is_bigendian() ((*(char *)&TEST_NUMBER) == 0)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "tconfig.h" #include "tconfig.h"
#include "tulog.h" #include "ulog.h"
#include "tutil.h" #include "tutil.h"
SGlobalCfg tsGlobalConfig[TSDB_CFG_MAX_NUM] = {{0}}; SGlobalCfg tsGlobalConfig[TSDB_CFG_MAX_NUM] = {{0}};
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "taoserror.h" #include "taoserror.h"
#include "tulog.h" #include "ulog.h"
#include "tutil.h" #include "tutil.h"
#include "tref.h" #include "tref.h"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
typedef struct { typedef struct {
int maxId; int maxId;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
#include "tlog.h" #include "tlog.h"
#include "tnote.h" #include "tnote.h"
#include "tutil.h" #include "tutil.h"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "os.h" #include "os.h"
#include "tlosertree.h" #include "tlosertree.h"
#include "tulog.h" #include "ulog.h"
// set initial value for loser tree // set initial value for loser tree
void tLoserTreeInit(SLoserTreeInfo* pTree) { void tLoserTreeInit(SLoserTreeInfo* pTree) {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
#include "tmempool.h" #include "tmempool.h"
#include "tutil.h" #include "tutil.h"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
#include "taoserror.h" #include "taoserror.h"
#include "tqueue.h" #include "tqueue.h"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "os.h" #include "os.h"
#include "taoserror.h" #include "taoserror.h"
#include "tulog.h" #include "ulog.h"
#include "tutil.h" #include "tutil.h"
#define TSDB_REF_OBJECTS 50 #define TSDB_REF_OBJECTS 50
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "os.h" #include "os.h"
#include "tdef.h" #include "tdef.h"
#include "tutil.h" #include "tutil.h"
#include "tulog.h" #include "ulog.h"
#include "tsched.h" #include "tsched.h"
#include "ttimer.h" #include "ttimer.h"
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "tskiplist.h" #include "tskiplist.h"
#include "os.h" #include "os.h"
#include "tcompare.h" #include "tcompare.h"
#include "tulog.h" #include "ulog.h"
#include "tutil.h" #include "tutil.h"
static int initForwardBackwardPtr(SSkipList *pSkipList); static int initForwardBackwardPtr(SSkipList *pSkipList);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
#include "tstep.h" #include "tstep.h"
SSteps *taosStepInit(int32_t maxsize) { SSteps *taosStepInit(int32_t maxsize) {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "tthread.h" #include "tthread.h"
#include "tdef.h" #include "tdef.h"
#include "tutil.h" #include "tutil.h"
#include "tulog.h" #include "ulog.h"
#include "taoserror.h" #include "taoserror.h"
// create new thread // create new thread
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "tcrc32c.h" #include "tcrc32c.h"
#include "tdef.h" #include "tdef.h"
#include "tutil.h" #include "tutil.h"
#include "tulog.h" #include "ulog.h"
#include "taoserror.h" #include "taoserror.h"
int32_t strdequote(char *z) { int32_t strdequote(char *z) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "tulog.h" #include "ulog.h"
#include "tqueue.h" #include "tqueue.h"
#include "tworker.h" #include "tworker.h"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "tlog.h" #include "tlog.h"
#include "tglobal.h" #include "tglobal.h"
#include "taoserror.h" #include "taoserror.h"
#include "tulog.h" #include "ulog.h"
typedef struct { typedef struct {
int refNum; int refNum;
......
/*
* 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_MODULE
#define TDENGINE_MODULE
#ifdef __cplusplus
extern "C" {
#endif
int32_t moduleStart();
void moduleStop();
#ifdef __cplusplus
}
#endif
#endif
/*
* 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_VNODE_H
#define TDENGINE_VNODE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "trpc.h"
#include "twal.h"
typedef struct {
int32_t len;
void * rsp;
void * qhandle; // used by query and retrieve msg
} SRspRet;
typedef struct {
int32_t code;
int32_t contLen;
void * rpcHandle;
void * rpcAhandle;
void * qhandle;
void * pVnode;
int8_t qtype;
int8_t msgType;
SRspRet rspRet;
char pCont[];
} SVReadMsg;
typedef struct {
int32_t code;
int32_t processedCount;
int32_t qtype;
void * pVnode;
SRpcMsg rpcMsg;
SRspRet rspRet;
char reserveForSync[24];
SWalHead walHead;
} SVWriteMsg;
// vnodeStatus
extern char *vnodeStatus[];
// vnodeMain
int32_t vnodeCreate(SCreateVnodeMsg *pVnodeCfg);
int32_t vnodeDrop(int32_t vgId);
int32_t vnodeOpen(int32_t vgId);
int32_t vnodeAlter(void *pVnode, SCreateVnodeMsg *pVnodeCfg);
int32_t vnodeSync(int32_t vgId);
int32_t vnodeClose(int32_t vgId);
int32_t vnodeCompact(int32_t vgId);
// vnodeMgmt
int32_t vnodeInitMgmt();
void vnodeCleanupMgmt();
void* vnodeAcquire(int32_t vgId);
void vnodeRelease(void *pVnode);
void* vnodeAcquireNotClose(int32_t vgId);
void* vnodeGetWal(void *pVnode);
int32_t vnodeGetVnodeList(int32_t vnodeList[], int32_t *numOfVnodes);
void vnodeBuildStatusMsg(void *pStatus);
void vnodeSetAccess(SVgroupAccess *pAccess, int32_t numOfVnodes);
// vnodeWrite
int32_t vnodeWriteToWQueue(void *pVnode, void *pHead, int32_t qtype, void *pRpcMsg);
void vnodeFreeFromWQueue(void *pVnode, SVWriteMsg *pWrite);
int32_t vnodeProcessWrite(void *pVnode, void *pHead, int32_t qtype, void *pRspRet);
// vnodeSync
void vnodeConfirmForward(void *pVnode, uint64_t version, int32_t code, bool force);
// vnodeRead
int32_t vnodeWriteToRQueue(void *pVnode, void *pCont, int32_t contLen, int8_t qtype, void *rparam);
void vnodeFreeFromRQueue(void *pVnode, SVReadMsg *pRead);
int32_t vnodeProcessRead(void *pVnode, SVReadMsg *pRead);
#ifdef __cplusplus
}
#endif
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册