chore: code optimization for array size
This commit is contained in:
parent
85226d05a3
commit
b9767707cb
|
@ -98,9 +98,6 @@ typedef struct SQueryNode SQueryNode;
|
||||||
#define VND_INFO_FNAME "vnode.json"
|
#define VND_INFO_FNAME "vnode.json"
|
||||||
#define VND_INFO_FNAME_TMP "vnode_tmp.json"
|
#define VND_INFO_FNAME_TMP "vnode_tmp.json"
|
||||||
|
|
||||||
#define TK_LOG_STB_NUM 19
|
|
||||||
#define TK_AUDIT_STB_NUM 1
|
|
||||||
|
|
||||||
// vnd.h
|
// vnd.h
|
||||||
typedef int32_t (*_query_reseek_func_t)(void* pQHandle);
|
typedef int32_t (*_query_reseek_func_t)(void* pQHandle);
|
||||||
struct SQueryNode {
|
struct SQueryNode {
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
#ifdef TD_ENTERPRISE
|
#ifdef TD_ENTERPRISE
|
||||||
extern const char* tkLogStb[];
|
extern const char* tkLogStb[];
|
||||||
extern const char* tkAuditStb[];
|
extern const char* tkAuditStb[];
|
||||||
|
extern const int tkLogStbNum;
|
||||||
|
extern const int tkAuditStbNum;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TAG_FILTER_RES_KEY_LEN 32
|
#define TAG_FILTER_RES_KEY_LEN 32
|
||||||
|
@ -946,10 +948,10 @@ int32_t metaInitTbFilterCache(SMeta* pMeta) {
|
||||||
|
|
||||||
if (!(dbName = strchr(pMeta->pVnode->config.dbname, '.'))) return 0;
|
if (!(dbName = strchr(pMeta->pVnode->config.dbname, '.'))) return 0;
|
||||||
if (0 == strncmp(++dbName, "log", TSDB_DB_NAME_LEN)) {
|
if (0 == strncmp(++dbName, "log", TSDB_DB_NAME_LEN)) {
|
||||||
tbNum = TK_LOG_STB_NUM;
|
tbNum = tkLogStbNum;
|
||||||
pTbArr = (const char**)&tkLogStb;
|
pTbArr = (const char**)&tkLogStb;
|
||||||
} else if (0 == strncmp(dbName, "audit", TSDB_DB_NAME_LEN)) {
|
} else if (0 == strncmp(dbName, "audit", TSDB_DB_NAME_LEN)) {
|
||||||
tbNum = TK_AUDIT_STB_NUM;
|
tbNum = tkAuditStbNum;
|
||||||
pTbArr = (const char**)&tkAuditStb;
|
pTbArr = (const char**)&tkAuditStb;
|
||||||
}
|
}
|
||||||
if (tbNum && pTbArr) {
|
if (tbNum && pTbArr) {
|
||||||
|
|
|
@ -566,26 +566,28 @@ int32_t vnodeGetStbColumnNum(SVnode *pVnode, tb_uid_t suid, int *num) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TD_ENTERPRISE
|
#ifdef TD_ENTERPRISE
|
||||||
const char *tkLogStb[TK_LOG_STB_NUM] = {"cluster_info",
|
const char *tkLogStb[] = {"cluster_info",
|
||||||
"data_dir",
|
"data_dir",
|
||||||
"dnodes_info",
|
"dnodes_info",
|
||||||
"d_info",
|
"d_info",
|
||||||
"grants_info",
|
"grants_info",
|
||||||
"keeper_monitor",
|
"keeper_monitor",
|
||||||
"logs",
|
"logs",
|
||||||
"log_dir",
|
"log_dir",
|
||||||
"log_summary",
|
"log_summary",
|
||||||
"m_info",
|
"m_info",
|
||||||
"taosadapter_restful_http_request_fail",
|
"taosadapter_restful_http_request_fail",
|
||||||
"taosadapter_restful_http_request_in_flight",
|
"taosadapter_restful_http_request_in_flight",
|
||||||
"taosadapter_restful_http_request_summary_milliseconds",
|
"taosadapter_restful_http_request_summary_milliseconds",
|
||||||
"taosadapter_restful_http_request_total",
|
"taosadapter_restful_http_request_total",
|
||||||
"taosadapter_system_cpu_percent",
|
"taosadapter_system_cpu_percent",
|
||||||
"taosadapter_system_mem_percent",
|
"taosadapter_system_mem_percent",
|
||||||
"temp_dir",
|
"temp_dir",
|
||||||
"vgroups_info",
|
"vgroups_info",
|
||||||
"vnodes_role"};
|
"vnodes_role"};
|
||||||
const char *tkAuditStb[TK_AUDIT_STB_NUM] = {"operations"};
|
const char *tkAuditStb[] = {"operations"};
|
||||||
|
const int tkLogStbNum = ARRAY_SIZE(tkLogStb);
|
||||||
|
const int tkAuditStbNum = ARRAY_SIZE(tkAuditStb);
|
||||||
|
|
||||||
// exclude stbs of taoskeeper log
|
// exclude stbs of taoskeeper log
|
||||||
static int32_t vnodeGetTimeSeriesBlackList(SVnode *pVnode) {
|
static int32_t vnodeGetTimeSeriesBlackList(SVnode *pVnode) {
|
||||||
|
@ -596,10 +598,10 @@ static int32_t vnodeGetTimeSeriesBlackList(SVnode *pVnode) {
|
||||||
|
|
||||||
if (!(dbName = strchr(pVnode->config.dbname, '.'))) return 0;
|
if (!(dbName = strchr(pVnode->config.dbname, '.'))) return 0;
|
||||||
if (0 == strncmp(++dbName, "log", TSDB_DB_NAME_LEN)) {
|
if (0 == strncmp(++dbName, "log", TSDB_DB_NAME_LEN)) {
|
||||||
tbNum = TK_LOG_STB_NUM;
|
tbNum = tkLogStbNum;
|
||||||
pTbArr = (const char **)&tkLogStb;
|
pTbArr = (const char **)&tkLogStb;
|
||||||
} else if (0 == strncmp(dbName, "audit", TSDB_DB_NAME_LEN)) {
|
} else if (0 == strncmp(dbName, "audit", TSDB_DB_NAME_LEN)) {
|
||||||
tbNum = TK_AUDIT_STB_NUM;
|
tbNum = tkAuditStbNum;
|
||||||
pTbArr = (const char **)&tkAuditStb;
|
pTbArr = (const char **)&tkAuditStb;
|
||||||
}
|
}
|
||||||
if (tbNum && pTbArr) {
|
if (tbNum && pTbArr) {
|
||||||
|
|
Loading…
Reference in New Issue