refactor: do some internal refactor.

This commit is contained in:
Haojun Liao 2022-11-23 22:08:35 +08:00
parent 611ab8b394
commit e0e55b2d65
11 changed files with 51 additions and 18 deletions

View File

@ -24,11 +24,6 @@
extern "C" {
#endif
typedef struct SCorEpSet {
int32_t version;
SEpSet epSet;
} SCorEpSet;
typedef struct SBlockOrderInfo {
bool nullFirst;
int32_t order;
@ -36,14 +31,6 @@ typedef struct SBlockOrderInfo {
SColumnInfoData* pColData;
} SBlockOrderInfo;
int32_t taosGetFqdnPortFromEp(const char* ep, SEp* pEp);
void addEpIntoEpSet(SEpSet* pEpSet, const char* fqdn, uint16_t port);
bool isEpsetEqual(const SEpSet* s1, const SEpSet* s2);
void updateEpSet_s(SCorEpSet* pEpSet, SEpSet* pNewEpSet);
SEpSet getEpSet_s(SCorEpSet* pEpSet);
#define NBIT (3u)
#define BitPos(_n) ((_n) & ((1 << NBIT) - 1))
#define BMCharPos(bm_, r_) ((bm_)[(r_) >> NBIT])

42
include/common/tmisce.h Normal file
View File

@ -0,0 +1,42 @@
/*
* 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_TMISCE_H
#define TDENGINE_TMISCE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "tmsg.h"
typedef struct SCorEpSet {
int32_t version;
SEpSet epSet;
} SCorEpSet;
int32_t taosGetFqdnPortFromEp(const char* ep, SEp* pEp);
void addEpIntoEpSet(SEpSet* pEpSet, const char* fqdn, uint16_t port);
bool isEpsetEqual(const SEpSet* s1, const SEpSet* s2);
void updateEpSet_s(SCorEpSet* pEpSet, SEpSet* pNewEpSet);
SEpSet getEpSet_s(SCorEpSet* pEpSet);
#ifdef __cplusplus
}
#endif
#endif // TDENGINE_TMISCE_H

View File

@ -26,7 +26,7 @@ extern "C" {
#include "query.h"
#include "taos.h"
#include "tcommon.h"
#include "tdatablock.h"
#include "tmisce.h"
#include "tdef.h"
#include "thash.h"
#include "tlist.h"

View File

@ -20,13 +20,13 @@
#include "functionMgt.h"
#include "os.h"
#include "query.h"
#include "qworker.h"
#include "scheduler.h"
#include "tglobal.h"
#include "tmsg.h"
#include "tref.h"
#include "trpc.h"
#include "version.h"
#include "tdatablock.h"
#define TSC_VAR_NOT_RELEASE 1
#define TSC_VAR_RELEASED 0

View File

@ -20,6 +20,7 @@
#include "query.h"
#include "tdef.h"
#include "tname.h"
#include "tdatablock.h"
static void setErrno(SRequestObj* pRequest, int32_t code) {
pRequest->code = code;

View File

@ -16,7 +16,7 @@
#define _DEFAULT_SOURCE
#include "tglobal.h"
#include "tconfig.h"
#include "tdatablock.h"
#include "tmisce.h"
#include "tgrant.h"
#include "tlog.h"

View File

@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include "tdatablock.h"
#include "tmisce.h"
#include "tglobal.h"
#include "tlog.h"
#include "tname.h"

View File

@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "dmUtil.h"
#include "tmisce.h"
static void dmPrintEps(SDnodeData *pData);
static bool dmIsEpChanged(SDnodeData *pData, int32_t dnodeId, const char *ep);

View File

@ -24,6 +24,7 @@
#include "mndTrans.h"
#include "mndUser.h"
#include "mndVgroup.h"
#include "tmisce.h"
#define TSDB_DNODE_VER_NUMBER 1
#define TSDB_DNODE_RESERVE_SIZE 64

View File

@ -20,7 +20,7 @@
#include "mndShow.h"
#include "mndSync.h"
#include "mndTrans.h"
#include "mndUser.h"
#include "tmisce.h"
#define MNODE_VER_NUMBER 1
#define MNODE_RESERVE_SIZE 64

View File

@ -22,6 +22,7 @@
#include "mndShow.h"
#include "mndTrans.h"
#include "mndUser.h"
#include "tmisce.h"
#define VGROUP_VER_NUMBER 1
#define VGROUP_RESERVE_SIZE 64