提交 d9b73f35 编写于 作者: C Cary Xu

code optimization

上级 aa616815
......@@ -247,7 +247,8 @@ bool taosCheckBalanceCfgOptions(const char *option, int32_t *vnodeId, int32_t
void taosAddDataDir(int index, char *v1, int level, int primary);
void taosReadDataDirCfg(char *v1, char *v2, char *v3);
void taosPrintDataDirCfg();
bool taosPrintCreateTable();
#define TAOS_PRINT_CREATE_TABLE (tsSpecificLogType & LOG_CREATE_TABLE)
#ifdef __cplusplus
}
......
......@@ -1831,5 +1831,3 @@ bool taosCheckBalanceCfgOptions(const char *option, int32_t *vnodeId, int32_t *d
return true;
}
bool taosPrintCreateTable() { return (tsSpecificLogType & LOG_CREATE_TABLE) ? true : false; }
......@@ -203,7 +203,7 @@ static void *dnodeProcessVWriteQueue(void *wparam) {
bool forceFsync = false;
for (int32_t i = 0; i < numOfMsgs; ++i) {
taosGetQitem(pWorker->qall, &qtype, (void **)&pWrite);
if ((pWrite->walHead.msgType == TSDB_MSG_TYPE_MD_CREATE_TABLE) && taosPrintCreateTable()) {
if ((pWrite->walHead.msgType == TSDB_MSG_TYPE_MD_CREATE_TABLE) && TAOS_PRINT_CREATE_TABLE) {
SMDCreateTableMsg *pMsg = (SMDCreateTableMsg *)pWrite->walHead.cont;
dInfo("msg:%p, app:%p type:%s for uid:%" PRIu64 ", tid:%" PRIu32
" will be processed in vwrite queue, qtype:%s hver:%" PRIu64,
......
......@@ -1161,7 +1161,7 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead, SRpcReqConte
rpcAddRef(pRpc); // add the refCount for requests
// notify the server app
if ((rpcMsg.msgType == TSDB_MSG_TYPE_MD_CREATE_TABLE) && taosPrintCreateTable()) {
if ((rpcMsg.msgType == TSDB_MSG_TYPE_MD_CREATE_TABLE) && TAOS_PRINT_CREATE_TABLE) {
SMDCreateTableMsg *pMsg = (SMDCreateTableMsg *)rpcMsg.pCont;
tInfo("%p, msg:%s received, uid:%" PRIu64 ", tid:%" PRIu32, rpcMsg.ahandle, taosMsg[rpcMsg.msgType],
htobe64(pMsg->uid), htonl(pMsg->tid));
......@@ -1353,7 +1353,7 @@ static void rpcSendMsgToPeer(SRpcConn *pConn, void *msg, int msgLen) {
}
//tTrace("connection type is: %d", pConn->connType);
if ((pConn->outType == TSDB_MSG_TYPE_MD_CREATE_TABLE) && taosPrintCreateTable()) {
if ((pConn->outType == TSDB_MSG_TYPE_MD_CREATE_TABLE) && TAOS_PRINT_CREATE_TABLE) {
tInfo("%s, msg:%s is sent to 0x%x:%hu, code:0x%x len:%d sig:0x%08x:0x%08x:%d", pConn->info, taosMsg[pHead->msgType],
pConn->peerIp, pConn->peerPort, htonl(pHead->code), msgLen, pHead->sourceId, pHead->destId, pHead->tranId);
}
......
......@@ -191,7 +191,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
ASSERT(code != 0);
}
if (taosPrintCreateTable()) {
if (TAOS_PRINT_CREATE_TABLE) {
vInfo("vgId:%d, table[%s], uid:%" PRIu64 ", tid:%" PRIu32 " is created successfully", pVnode->vgId,
pMsg->tableFname, htobe64(pMsg->uid), htonl(pMsg->tid));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册