catalogInt.h 26.1 KB
Newer Older
H
Hongze Cheng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
 * 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 _TD_CATALOG_INT_H_
#define _TD_CATALOG_INT_H_

#ifdef __cplusplus
extern "C" {
#endif

H
Haojun Liao 已提交
23
#include "catalog.h"
S
common  
Shengliang Guan 已提交
24
#include "tcommon.h"
D
dapan1121 已提交
25
#include "query.h"
H
Haojun Liao 已提交
26

D
dapan1121 已提交
27 28 29
#define CTG_DEFAULT_CACHE_CLUSTER_NUMBER 6
#define CTG_DEFAULT_CACHE_VGROUP_NUMBER 100
#define CTG_DEFAULT_CACHE_DB_NUMBER 20
D
dapan1121 已提交
30
#define CTG_DEFAULT_CACHE_TBLMETA_NUMBER 1000
D
dapan1121 已提交
31 32
#define CTG_DEFAULT_RENT_SECOND 10
#define CTG_DEFAULT_RENT_SLOT_SIZE 10
D
dapan1121 已提交
33
#define CTG_DEFAULT_MAX_RETRY_TIMES 3
D
dapan1121 已提交
34
#define CTG_DEFAULT_BATCH_NUM 64
35
#define CTG_DEFAULT_FETCH_NUM 8
D
dapan1121 已提交
36

D
dapan1121 已提交
37
#define CTG_RENT_SLOT_SECOND 1.5
D
dapan1121 已提交
38 39

#define CTG_DEFAULT_INVALID_VERSION (-1)
D
dapan 已提交
40

D
dapan1121 已提交
41
#define CTG_ERR_CODE_TABLE_NOT_EXIST TSDB_CODE_PAR_TABLE_NOT_EXIST
D
dapan1121 已提交
42

D
dapan1121 已提交
43 44
#define CTG_BATCH_FETCH 1

D
dapan1121 已提交
45 46 47 48 49
enum {
  CTG_READ = 1,
  CTG_WRITE,
};

D
dapan1121 已提交
50 51 52 53 54
enum {
  CTG_RENT_DB = 1,
  CTG_RENT_STABLE,
};

D
dapan1121 已提交
55
enum {
D
dapan1121 已提交
56 57 58
  CTG_OP_UPDATE_VGROUP = 0,
  CTG_OP_UPDATE_TB_META,
  CTG_OP_DROP_DB_CACHE,
D
dapan1121 已提交
59
  CTG_OP_DROP_DB_VGROUP,
D
dapan1121 已提交
60 61 62 63
  CTG_OP_DROP_STB_META,
  CTG_OP_DROP_TB_META,
  CTG_OP_UPDATE_USER,
  CTG_OP_UPDATE_VG_EPSET,
D
dapan1121 已提交
64 65
  CTG_OP_UPDATE_TB_INDEX,
  CTG_OP_DROP_TB_INDEX,
D
dapan1121 已提交
66
  CTG_OP_CLEAR_CACHE,
D
dapan1121 已提交
67
  CTG_OP_MAX
D
dapan1121 已提交
68 69
};

D
dapan1121 已提交
70 71
typedef enum {
  CTG_TASK_GET_QNODE = 0,
D
dapan1121 已提交
72
  CTG_TASK_GET_DNODE,
D
dapan1121 已提交
73 74
  CTG_TASK_GET_DB_VGROUP,
  CTG_TASK_GET_DB_CFG,
D
dapan1121 已提交
75
  CTG_TASK_GET_DB_INFO,
D
dapan1121 已提交
76 77
  CTG_TASK_GET_TB_META,
  CTG_TASK_GET_TB_HASH,
D
dapan1121 已提交
78
  CTG_TASK_GET_TB_INDEX,
D
dapan1121 已提交
79
  CTG_TASK_GET_TB_CFG,
D
dapan1121 已提交
80 81 82
  CTG_TASK_GET_INDEX,
  CTG_TASK_GET_UDF,
  CTG_TASK_GET_USER,
D
dapan1121 已提交
83
  CTG_TASK_GET_SVR_VER,
D
dapan1121 已提交
84
  CTG_TASK_GET_TB_META_BATCH,
85
  CTG_TASK_GET_TB_HASH_BATCH,
D
dapan1121 已提交
86 87
} CTG_TASK_TYPE;

D
dapan1121 已提交
88 89 90 91 92 93
typedef enum {
  CTG_TASK_LAUNCHED = 1,
  CTG_TASK_DONE,
} CTG_TASK_STATUS;


D
dapan1121 已提交
94
typedef struct SCtgDebug {
D
dapan1121 已提交
95 96 97 98
  bool     lockEnable;
  bool     cacheEnable;
  bool     apiEnable;
  bool     metaEnable;
D
dapan1121 已提交
99
  uint32_t showCachePeriodSec;
D
dapan1121 已提交
100
} SCtgDebug;
101

D
dapan1121 已提交
102 103 104 105 106 107 108 109 110
typedef struct SCtgTbCacheInfo {
  bool     inCache;
  uint64_t dbId;
  uint64_t suid;
  int32_t  tbType;
} SCtgTbCacheInfo;

typedef struct SCtgTbMetaCtx {
  SCtgTbCacheInfo tbInfo;
D
dapan1121 已提交
111
  int32_t vgId;
D
dapan1121 已提交
112 113 114 115
  SName* pName;
  int32_t flag;
} SCtgTbMetaCtx;

D
dapan1121 已提交
116
typedef struct SCtgFetch {
117 118
  int32_t dbIdx;
  int32_t tbIdx;
D
dapan1121 已提交
119
  int32_t fetchIdx;
120
  int32_t resIdx;
D
dapan1121 已提交
121 122 123 124 125
  int32_t flag;
  SCtgTbCacheInfo tbInfo;
  int32_t vgId;
} SCtgFetch;

126
typedef struct SCtgTbMetasCtx {
D
dapan1121 已提交
127 128
  int32_t fetchNum;
  SArray* pNames;
129
  SArray* pResList;
D
dapan1121 已提交
130
  SArray* pFetchs;
131
} SCtgTbMetasCtx;
D
dapan1121 已提交
132

D
dapan1121 已提交
133 134 135 136
typedef struct SCtgTbIndexCtx {
  SName* pName;
} SCtgTbIndexCtx;

D
dapan1121 已提交
137 138 139 140 141 142
typedef struct SCtgTbCfgCtx {
  SName*       pName;
  int32_t      tbType;
  SVgroupInfo* pVgInfo;
} SCtgTbCfgCtx;

D
dapan1121 已提交
143 144 145 146 147 148 149 150
typedef struct SCtgDbVgCtx {
  char dbFName[TSDB_DB_FNAME_LEN];
} SCtgDbVgCtx;

typedef struct SCtgDbCfgCtx {
  char dbFName[TSDB_DB_FNAME_LEN];
} SCtgDbCfgCtx;

D
dapan1121 已提交
151 152 153 154
typedef struct SCtgDbInfoCtx {
  char dbFName[TSDB_DB_FNAME_LEN];
} SCtgDbInfoCtx;

D
dapan1121 已提交
155 156 157 158 159
typedef struct SCtgTbHashCtx {
  char dbFName[TSDB_DB_FNAME_LEN];
  SName* pName;
} SCtgTbHashCtx;

160
typedef struct SCtgTbHashsCtx {
161 162 163 164
  int32_t fetchNum;
  SArray* pNames;
  SArray* pResList;
  SArray* pFetchs;
165
} SCtgTbHashsCtx;
166 167


D
dapan1121 已提交
168 169 170 171 172 173 174 175 176 177 178
typedef struct SCtgIndexCtx {
  char indexFName[TSDB_INDEX_FNAME_LEN];
} SCtgIndexCtx;

typedef struct SCtgUdfCtx {
  char udfName[TSDB_FUNC_NAME_LEN];
} SCtgUdfCtx;

typedef struct SCtgUserCtx {
  SUserAuthInfo user;
} SCtgUserCtx;
179

D
dapan1121 已提交
180
typedef STableIndexRsp STableIndex;
D
dapan1121 已提交
181

D
dapan1121 已提交
182 183 184 185 186 187 188 189
typedef struct SCtgTbCache {
  SRWLatch     metaLock;
  STableMeta  *pMeta;
  SRWLatch     indexLock;
  STableIndex *pIndex;
} SCtgTbCache;

typedef struct SCtgVgCache {
D
dapan1121 已提交
190
  SRWLatch         vgLock;
191
  SDBVgInfo       *vgInfo;
D
dapan1121 已提交
192 193 194 195
} SCtgVgCache;

typedef struct SCtgDBCache {
  SRWLatch         dbLock;          // RC between destroy tbCache/stbCache and all reads
D
dapan1121 已提交
196
  uint64_t         dbId;
D
dapan1121 已提交
197
  int8_t           deleted;
D
dapan1121 已提交
198 199
  SCtgVgCache      vgCache;
  SHashObj        *tbCache;         // key:tbname, value:SCtgTbCache
D
dapan1121 已提交
200
  SHashObj        *stbCache;        // key:suid, value:char*
D
dapan1121 已提交
201
} SCtgDBCache;
D
dapan1121 已提交
202

D
dapan1121 已提交
203
typedef struct SCtgRentSlot {
D
dapan1121 已提交
204 205
  SRWLatch lock;
  bool     needSort;
D
dapan1121 已提交
206
  SArray  *meta;  // element is SDbVgVersion or SSTableVersion
D
dapan1121 已提交
207
} SCtgRentSlot;
D
dapan1121 已提交
208

D
dapan1121 已提交
209
typedef struct SCtgRentMgmt {
D
dapan1121 已提交
210 211 212 213
  int8_t         type;
  uint16_t       slotNum;
  uint16_t       slotRIdx;
  int64_t        lastReadMsec;
D
dapan1121 已提交
214 215
  SCtgRentSlot  *slots;
} SCtgRentMgmt;
D
dapan1121 已提交
216

D
dapan 已提交
217 218 219 220 221 222 223 224 225
typedef struct SCtgUserAuth {
  int32_t   version;
  SRWLatch  lock;
  bool      superUser;
  SHashObj *createdDbs;
  SHashObj *readDbs;
  SHashObj *writeDbs;
} SCtgUserAuth;

D
dapan1121 已提交
226
typedef struct SCatalog {
227
  uint64_t         clusterId;
D
dapan 已提交
228
  SHashObj        *userCache;    //key:user, value:SCtgUserAuth
D
dapan1121 已提交
229 230 231
  SHashObj        *dbCache;      //key:dbname, value:SCtgDBCache
  SCtgRentMgmt     dbRent;
  SCtgRentMgmt     stbRent;
H
Haojun Liao 已提交
232 233
} SCatalog;

D
dapan1121 已提交
234 235 236 237 238
typedef struct SCtgBatch {
  int32_t batchId;
  int32_t msgType;
  int32_t msgSize;
  SArray* pMsgs;
239
  SRequestConnInfo conn;
D
dapan1121 已提交
240 241
  char    dbFName[TSDB_DB_FNAME_LEN];
  SArray* pTaskIds;
D
dapan1121 已提交
242
  SArray* pMsgIdxs;
D
dapan1121 已提交
243 244
} SCtgBatch;

D
dapan1121 已提交
245
typedef struct SCtgJob {
D
dapan1121 已提交
246
  int64_t           refId;
D
dapan1121 已提交
247 248
  int32_t           batchId;
  SHashObj*         pBatchs;
D
dapan1121 已提交
249
  SArray*           pTasks;
D
dapan1121 已提交
250
  int32_t           subTaskNum;
D
dapan1121 已提交
251 252
  int32_t           taskDone;
  SMetaData         jobRes;
D
dapan1121 已提交
253
  int32_t           jobResCode;
D
dapan1121 已提交
254 255
  int32_t           taskIdx;
  SRWLatch          taskLock;
256

D
dapan1121 已提交
257
  uint64_t          queryId;
258
  SCatalog*         pCtg;
D
dapan1121 已提交
259 260 261 262 263 264 265 266
  SRequestConnInfo  conn;
  void*             userParam;
  catalogCallback   userFp;
  int32_t           tbMetaNum;
  int32_t           tbHashNum;
  int32_t           dbVgNum;
  int32_t           udfNum;
  int32_t           qnodeNum;
D
dapan1121 已提交
267
  int32_t           dnodeNum;
D
dapan1121 已提交
268 269 270 271 272
  int32_t           dbCfgNum;
  int32_t           indexNum;
  int32_t           userNum;
  int32_t           dbInfoNum;
  int32_t           tbIndexNum;
D
dapan1121 已提交
273
  int32_t           tbCfgNum;
D
dapan1121 已提交
274
  int32_t           svrVerNum;
D
dapan1121 已提交
275 276 277 278 279 280 281
} SCtgJob;

typedef struct SCtgMsgCtx {
  int32_t reqType;
  void* lastOut;
  void* out;
  char* target;
282
  SHashObj* pBatchs;
D
dapan1121 已提交
283 284
} SCtgMsgCtx;

285 286 287 288 289 290 291

typedef struct SCtgTaskCallbackParam {
  uint64_t                queryId;
  int64_t                 refId;
  SArray*                 taskId;
  int32_t                 reqType;
  int32_t                 batchId;
D
dapan1121 已提交
292
  SArray*                 msgIdx;
293 294 295
} SCtgTaskCallbackParam;


D
dapan1121 已提交
296 297 298 299 300 301 302 303 304 305
typedef struct SCtgTask SCtgTask;
typedef int32_t (*ctgSubTaskCbFp)(SCtgTask*);

typedef struct SCtgSubRes {
  CTG_TASK_TYPE  type;
  int32_t        code;
  void*          res;
  ctgSubTaskCbFp fp;
} SCtgSubRes;

D
dapan1121 已提交
306
typedef struct SCtgTask {
D
dapan1121 已提交
307 308 309 310
  CTG_TASK_TYPE   type;
  int32_t         taskId;
  SCtgJob*        pJob;
  void*           taskCtx;
D
dapan1121 已提交
311
  SArray*         msgCtxs;
D
dapan1121 已提交
312 313 314 315 316 317 318
  SCtgMsgCtx      msgCtx;
  int32_t         code;
  void*           res;
  CTG_TASK_STATUS status;
  SRWLatch        lock;
  SArray*         pParents;
  SCtgSubRes      subRes;
D
dapan1121 已提交
319 320
} SCtgTask;

D
dapan1121 已提交
321 322 323 324 325
typedef struct SCtgTaskReq {
  SCtgTask* pTask;
  int32_t   msgIdx;
} SCtgTaskReq;

D
dapan1121 已提交
326
typedef int32_t (*ctgInitTaskFp)(SCtgJob*, int32_t, void*);
D
dapan1121 已提交
327
typedef int32_t (*ctgLanchTaskFp)(SCtgTask*);
D
dapan1121 已提交
328
typedef int32_t (*ctgHandleTaskMsgRspFp)(SCtgTaskReq*, int32_t, const SDataBuf *, int32_t);
D
dapan1121 已提交
329
typedef int32_t (*ctgDumpTaskResFp)(SCtgTask*);
D
dapan1121 已提交
330 331
typedef int32_t (*ctgCloneTaskResFp)(SCtgTask*, void**);
typedef int32_t (*ctgCompTaskFp)(SCtgTask*, void*, bool*);
D
dapan1121 已提交
332 333

typedef struct SCtgAsyncFps {
D
dapan1121 已提交
334 335
  ctgInitTaskFp         initFp;
  ctgLanchTaskFp        launchFp;
D
dapan1121 已提交
336
  ctgHandleTaskMsgRspFp handleRspFp;
D
dapan1121 已提交
337 338 339
  ctgDumpTaskResFp      dumpResFp;
  ctgCompTaskFp         compFp;
  ctgCloneTaskResFp     cloneFp;
D
dapan1121 已提交
340 341
} SCtgAsyncFps;

D
dapan1121 已提交
342 343
typedef struct SCtgApiStat {

wafwerar's avatar
wafwerar 已提交
344
#if defined(WINDOWS) || defined(_TD_DARWIN_64)
wafwerar's avatar
wafwerar 已提交
345 346 347
  size_t avoidCompilationErrors;
#endif

D
dapan1121 已提交
348 349
} SCtgApiStat;

D
dapan1121 已提交
350
typedef struct SCtgRuntimeStat {
D
dapan1121 已提交
351 352 353
  uint64_t numOfOpAbort;
  uint64_t numOfOpEnqueue;
  uint64_t numOfOpDequeue;
D
dapan1121 已提交
354
} SCtgRuntimeStat;
D
dapan1121 已提交
355 356

typedef struct SCtgCacheStat {
D
dapan1121 已提交
357 358 359 360 361 362 363 364 365 366
  uint64_t numOfCluster;
  uint64_t numOfDb;
  uint64_t numOfTbl;
  uint64_t numOfStb;
  uint64_t numOfUser;
  uint64_t numOfVgHit;
  uint64_t numOfVgMiss;
  uint64_t numOfMetaHit;
  uint64_t numOfMetaMiss;
  uint64_t numOfIndexHit;
367
  uint64_t numOfIndexMiss;
D
dapan1121 已提交
368 369 370
  uint64_t numOfUserHit;
  uint64_t numOfUserMiss;
  uint64_t numOfClear;
D
dapan1121 已提交
371 372 373 374
} SCtgCacheStat;

typedef struct SCatalogStat {
  SCtgApiStat      api;
D
dapan1121 已提交
375
  SCtgRuntimeStat  runtime;
D
dapan1121 已提交
376 377 378
  SCtgCacheStat    cache;
} SCatalogStat;

D
dapan1121 已提交
379 380 381 382
typedef struct SCtgUpdateMsgHeader {
  SCatalog* pCtg;
} SCtgUpdateMsgHeader;

D
dapan1121 已提交
383 384 385 386 387 388 389
typedef struct SCtgUpdateVgMsg {
  SCatalog* pCtg;
  char  dbFName[TSDB_DB_FNAME_LEN];
  uint64_t dbId;
  SDBVgInfo* dbInfo;
} SCtgUpdateVgMsg;

D
dapan1121 已提交
390 391 392 393
typedef struct SCtgUpdateTbMetaMsg {
  SCatalog*         pCtg;
  STableMetaOutput* pMeta;
} SCtgUpdateTbMetaMsg;
D
dapan1121 已提交
394

D
dapan1121 已提交
395
typedef struct SCtgDropDBMsg {
D
dapan1121 已提交
396 397 398
  SCatalog* pCtg;
  char  dbFName[TSDB_DB_FNAME_LEN];
  uint64_t dbId;
D
dapan1121 已提交
399
} SCtgDropDBMsg;
D
dapan1121 已提交
400

D
dapan1121 已提交
401 402 403 404 405 406 407
typedef struct SCtgDropDbVgroupMsg {
  SCatalog* pCtg;
  char  dbFName[TSDB_DB_FNAME_LEN];
} SCtgDropDbVgroupMsg;


typedef struct SCtgDropStbMetaMsg {
D
dapan1121 已提交
408 409 410 411 412
  SCatalog* pCtg;
  char  dbFName[TSDB_DB_FNAME_LEN];
  char  stbName[TSDB_TABLE_NAME_LEN];
  uint64_t dbId;
  uint64_t suid;
D
dapan1121 已提交
413
} SCtgDropStbMetaMsg;
D
dapan1121 已提交
414

D
dapan1121 已提交
415
typedef struct SCtgDropTblMetaMsg {
D
dapan1121 已提交
416 417 418 419
  SCatalog* pCtg;
  char  dbFName[TSDB_DB_FNAME_LEN];
  char  tbName[TSDB_TABLE_NAME_LEN];
  uint64_t dbId;
D
dapan1121 已提交
420
} SCtgDropTblMetaMsg;
D
dapan1121 已提交
421

D
dapan 已提交
422 423 424
typedef struct SCtgUpdateUserMsg {
  SCatalog* pCtg;
  SGetUserAuthRsp userAuth;
D
dapan 已提交
425
} SCtgUpdateUserMsg;
D
dapan 已提交
426

D
dapan1121 已提交
427 428 429 430 431 432 433 434 435 436 437
typedef struct SCtgUpdateTbIndexMsg {
  SCatalog*    pCtg;
  STableIndex* pIndex;
} SCtgUpdateTbIndexMsg;

typedef struct SCtgDropTbIndexMsg {
  SCatalog*    pCtg;
  char         dbFName[TSDB_DB_FNAME_LEN];
  char         tbName[TSDB_TABLE_NAME_LEN];
} SCtgDropTbIndexMsg;

D
dapan1121 已提交
438 439
typedef struct SCtgClearCacheMsg {
  SCatalog*    pCtg;
D
dapan1121 已提交
440
  bool         freeCtg;
D
dapan1121 已提交
441 442
} SCtgClearCacheMsg;

D
dapan1121 已提交
443 444 445 446 447 448
typedef struct SCtgUpdateEpsetMsg {
  SCatalog* pCtg;
  char  dbFName[TSDB_DB_FNAME_LEN];
  int32_t vgId;
  SEpSet  epSet;
} SCtgUpdateEpsetMsg;
D
dapan1121 已提交
449

D
dapan1121 已提交
450 451
typedef struct SCtgCacheOperation {
  int32_t  opId;
D
dapan1121 已提交
452
  void    *data;
D
dapan1121 已提交
453
  bool     syncOp;
454
  tsem_t   rspSem;
D
dapan1121 已提交
455
  bool     stopQueue;
456
  bool     unLocked;
D
dapan1121 已提交
457
} SCtgCacheOperation;
D
dapan1121 已提交
458 459

typedef struct SCtgQNode {
D
dapan1121 已提交
460
  SCtgCacheOperation    *op;
D
dapan1121 已提交
461 462 463
  struct SCtgQNode      *next;
} SCtgQNode;

D
dapan1121 已提交
464
typedef struct SCtgQueue {
D
dapan1121 已提交
465
  SRWLatch              qlock;
D
dapan1121 已提交
466
  bool                  stopQueue;
D
dapan1121 已提交
467 468
  SCtgQNode            *head;
  SCtgQNode            *tail;
469
  tsem_t                reqSem;
D
dapan 已提交
470
  uint64_t              qRemainNum;
D
dapan1121 已提交
471 472 473 474
} SCtgQueue;

typedef struct SCatalogMgmt {
  bool                  exit;
D
dapan1121 已提交
475
  int32_t               jobPool;
D
dapan1121 已提交
476 477
  SRWLatch              lock;
  SCtgQueue             queue;
478
  TdThread              updateThread;
D
dapan1121 已提交
479 480 481
  SHashObj             *pCluster;     //key: clusterId, value: SCatalog*
  SCatalogStat          stat;
  SCatalogCfg           cfg;
D
dapan1121 已提交
482 483
} SCatalogMgmt;

D
dapan1121 已提交
484
typedef uint32_t (*tableNameHashFp)(const char *, uint32_t);
D
dapan1121 已提交
485
typedef int32_t (*ctgOpFunc)(SCtgCacheOperation *);
D
dapan 已提交
486

D
dapan1121 已提交
487 488
typedef struct SCtgOperation {
  int32_t    opId;
D
dapan 已提交
489
  char       name[32];
D
dapan1121 已提交
490 491
  ctgOpFunc func;
} SCtgOperation;
D
dapan 已提交
492

D
dapan1121 已提交
493 494
#define CTG_QUEUE_INC() atomic_add_fetch_64(&gCtgMgmt.queue.qRemainNum, 1)
#define CTG_QUEUE_DEC() atomic_sub_fetch_64(&gCtgMgmt.queue.qRemainNum, 1)
D
dapan 已提交
495

D
dapan1121 已提交
496 497
#define CTG_STAT_INC(_item, _n) atomic_add_fetch_64(&(_item), _n)
#define CTG_STAT_DEC(_item, _n) atomic_sub_fetch_64(&(_item), _n)
D
dapan1121 已提交
498
#define CTG_STAT_GET(_item) atomic_load_64(&(_item))
D
dapan1121 已提交
499

D
dapan1121 已提交
500 501 502
#define CTG_RT_STAT_INC(item, n) (CTG_STAT_INC(gCtgMgmt.stat.runtime.item, n))
#define CTG_CACHE_STAT_INC(item, n) (CTG_STAT_INC(gCtgMgmt.stat.cache.item, n))
#define CTG_CACHE_STAT_DEC(item, n) (CTG_STAT_DEC(gCtgMgmt.stat.cache.item, n))
D
dapan 已提交
503

D
dapan1121 已提交
504
#define CTG_IS_META_NULL(type) ((type) == META_TYPE_NULL_TABLE)
D
dapan1121 已提交
505 506 507 508
#define CTG_IS_META_CTABLE(type) ((type) == META_TYPE_CTABLE)
#define CTG_IS_META_TABLE(type) ((type) == META_TYPE_TABLE)
#define CTG_IS_META_BOTH(type) ((type) == META_TYPE_BOTH_TABLE)

D
dapan1121 已提交
509 510 511
#define CTG_FLAG_STB          0x1
#define CTG_FLAG_NOT_STB      0x2
#define CTG_FLAG_UNKNOWN_STB  0x4
D
dapan1121 已提交
512
#define CTG_FLAG_SYS_DB       0x8
D
dapan1121 已提交
513 514
#define CTG_FLAG_FORCE_UPDATE 0x10

D
dapan 已提交
515 516
#define CTG_FLAG_SET(_flag, _v) ((_flag) |= (_v))

D
dapan1121 已提交
517 518 519
#define CTG_FLAG_IS_STB(_flag) ((_flag) & CTG_FLAG_STB)
#define CTG_FLAG_IS_NOT_STB(_flag) ((_flag) & CTG_FLAG_NOT_STB)
#define CTG_FLAG_IS_UNKNOWN_STB(_flag) ((_flag) & CTG_FLAG_UNKNOWN_STB)
D
dapan1121 已提交
520
#define CTG_FLAG_IS_SYS_DB(_flag) ((_flag) & CTG_FLAG_SYS_DB)
D
dapan1121 已提交
521
#define CTG_FLAG_IS_FORCE_UPDATE(_flag) ((_flag) & CTG_FLAG_FORCE_UPDATE)
D
dapan1121 已提交
522
#define CTG_FLAG_SET_SYS_DB(_flag) ((_flag) |= CTG_FLAG_SYS_DB)
D
dapan1121 已提交
523 524 525
#define CTG_FLAG_SET_STB(_flag, tbType) do { (_flag) |= ((tbType) == TSDB_SUPER_TABLE) ? CTG_FLAG_STB : ((tbType) > TSDB_SUPER_TABLE ? CTG_FLAG_NOT_STB : CTG_FLAG_UNKNOWN_STB); } while (0)
#define CTG_FLAG_MAKE_STB(_isStb) (((_isStb) == 1) ? CTG_FLAG_STB : ((_isStb) == 0 ? CTG_FLAG_NOT_STB : CTG_FLAG_UNKNOWN_STB))
#define CTG_FLAG_MATCH_STB(_flag, tbType) (CTG_FLAG_IS_UNKNOWN_STB(_flag) || (CTG_FLAG_IS_STB(_flag) && (tbType) == TSDB_SUPER_TABLE) || (CTG_FLAG_IS_NOT_STB(_flag) && (tbType) != TSDB_SUPER_TABLE))
D
dapan1121 已提交
526

D
dapan1121 已提交
527
#define CTG_GET_TASK_MSGCTX(_task, _id) (((CTG_TASK_GET_TB_META_BATCH == (_task)->type) || (CTG_TASK_GET_TB_HASH_BATCH == (_task)->type)) ? taosArrayGet((_task)->msgCtxs, (_id)) : &(_task)->msgCtx)
D
dapan1121 已提交
528

D
dapan1121 已提交
529 530
#define CTG_META_SIZE(pMeta) (sizeof(STableMeta) + ((pMeta)->tableInfo.numOfTags + (pMeta)->tableInfo.numOfColumns) * sizeof(SSchema))

531 532
#define CTG_TABLE_NOT_EXIST(code) (code == CTG_ERR_CODE_TABLE_NOT_EXIST)
#define CTG_DB_NOT_EXIST(code) (code == TSDB_CODE_MND_DB_NOT_EXIST)
D
dapan1121 已提交
533

D
dapan1121 已提交
534 535 536 537 538 539
#define ctgFatal(param, ...)  qFatal("CTG:%p " param, pCtg, __VA_ARGS__)
#define ctgError(param, ...)  qError("CTG:%p " param, pCtg, __VA_ARGS__)
#define ctgWarn(param, ...)   qWarn("CTG:%p " param, pCtg, __VA_ARGS__)
#define ctgInfo(param, ...)   qInfo("CTG:%p " param, pCtg, __VA_ARGS__)
#define ctgDebug(param, ...)  qDebug("CTG:%p " param, pCtg, __VA_ARGS__)
#define ctgTrace(param, ...)  qTrace("CTG:%p " param, pCtg, __VA_ARGS__)
D
dapan 已提交
540

D
dapan1121 已提交
541 542 543
#define CTG_LOCK_DEBUG(...) do { if (gCTGDebug.lockEnable) { qDebug(__VA_ARGS__); } } while (0)
#define CTG_CACHE_DEBUG(...) do { if (gCTGDebug.cacheEnable) { qDebug(__VA_ARGS__); } } while (0)
#define CTG_API_DEBUG(...) do { if (gCTGDebug.apiEnable) { qDebug(__VA_ARGS__); } } while (0)
544

D
dapan1121 已提交
545 546
#define TD_RWLATCH_WRITE_FLAG_COPY 0x40000000

D
dapan1121 已提交
547 548
#define CTG_LOCK(type, _lock) do {   \
  if (CTG_READ == (type)) {          \
549 550
    assert(atomic_load_32((_lock)) >= 0);  \
    CTG_LOCK_DEBUG("CTG RLOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
D
dapan1121 已提交
551
    taosRLockLatch(_lock);           \
552 553
    CTG_LOCK_DEBUG("CTG RLOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
    assert(atomic_load_32((_lock)) > 0);  \
D
dapan1121 已提交
554
  } else {                                                \
555 556
    assert(atomic_load_32((_lock)) >= 0);  \
    CTG_LOCK_DEBUG("CTG WLOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__);  \
D
dapan1121 已提交
557
    taosWLockLatch(_lock);                                \
558 559
    CTG_LOCK_DEBUG("CTG WLOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__);  \
    assert(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY);  \
D
dapan1121 已提交
560 561 562 563 564
  }                                                       \
} while (0)

#define CTG_UNLOCK(type, _lock) do {                       \
  if (CTG_READ == (type)) {                                \
565 566
    assert(atomic_load_32((_lock)) > 0);  \
    CTG_LOCK_DEBUG("CTG RULOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
D
dapan1121 已提交
567
    taosRUnLockLatch(_lock);                              \
568 569
    CTG_LOCK_DEBUG("CTG RULOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
    assert(atomic_load_32((_lock)) >= 0);  \
D
dapan1121 已提交
570
  } else {                                                \
571 572
    assert(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY);  \
    CTG_LOCK_DEBUG("CTG WULOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
D
dapan1121 已提交
573
    taosWUnLockLatch(_lock);                              \
574 575
    CTG_LOCK_DEBUG("CTG WULOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
    assert(atomic_load_32((_lock)) >= 0);  \
D
dapan1121 已提交
576 577 578
  }                                                       \
} while (0)

579

D
dapan1121 已提交
580 581 582 583
#define CTG_ERR_RET(c) do { int32_t _code = c; if (_code != TSDB_CODE_SUCCESS) { terrno = _code; return _code; } } while (0)
#define CTG_RET(c) do { int32_t _code = c; if (_code != TSDB_CODE_SUCCESS) { terrno = _code; } return _code; } while (0)
#define CTG_ERR_JRET(c) do { code = c; if (code != TSDB_CODE_SUCCESS) { terrno = code; goto _return; } } while (0)

584 585 586 587 588 589 590 591 592 593 594 595 596 597
#define CTG_API_LEAVE(c) do {                             \
  int32_t __code = c;                                     \
  CTG_UNLOCK(CTG_READ, &gCtgMgmt.lock);                   \
  CTG_API_DEBUG("CTG API leave %s", __FUNCTION__);        \
  CTG_RET(__code);                                        \
} while (0)

#define CTG_API_ENTER() do {                              \
  CTG_API_DEBUG("CTG API enter %s", __FUNCTION__);        \
  CTG_LOCK(CTG_READ, &gCtgMgmt.lock);                     \
  if (atomic_load_8((int8_t*)&gCtgMgmt.exit)) {           \
    CTG_API_LEAVE(TSDB_CODE_CTG_OUT_OF_SERVICE);          \
  }                                                       \
} while (0)
D
dapan1121 已提交
598

D
dapan1121 已提交
599 600 601 602 603 604 605 606
#define CTG_API_JENTER() do {                             \
  CTG_API_DEBUG("CTG API enter %s", __FUNCTION__);        \
  CTG_LOCK(CTG_READ, &gCtgMgmt.lock);                     \
  if (atomic_load_8((int8_t*)&gCtgMgmt.exit)) {           \
    CTG_ERR_JRET(TSDB_CODE_CTG_OUT_OF_SERVICE);           \
  }                                                       \
} while (0)

D
dapan1121 已提交
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621

#define CTG_API_LEAVE_NOLOCK(c) do {                        \
    int32_t __code = c;                                     \
    CTG_API_DEBUG("CTG API leave %s", __FUNCTION__);        \
    CTG_RET(__code);                                        \
  } while (0)

#define CTG_API_ENTER_NOLOCK() do {                       \
  CTG_API_DEBUG("CTG API enter %s", __FUNCTION__);        \
  if (atomic_load_8((int8_t*)&gCtgMgmt.exit)) {           \
    CTG_API_LEAVE_NOLOCK(TSDB_CODE_CTG_OUT_OF_SERVICE);   \
  }                                                       \
} while (0)


D
dapan1121 已提交
622 623
void    ctgdShowTableMeta(SCatalog* pCtg, const char *tbName, STableMeta* p);
void    ctgdShowClusterCache(SCatalog* pCtg);
D
dapan1121 已提交
624 625 626
int32_t ctgdShowCacheInfo(void);

int32_t ctgRemoveTbMetaFromCache(SCatalog* pCtg, SName* pTableName, bool syncReq);
D
dapan1121 已提交
627
int32_t ctgGetTbMetaFromCache(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgTbMetaCtx* ctx, STableMeta** pTableMeta);
628
int32_t ctgGetTbMetasFromCache(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgTbMetasCtx* ctx, int32_t dbIdx, int32_t *fetchIdx, int32_t baseResIdx, SArray* pList);
D
dapan1121 已提交
629

D
dapan1121 已提交
630 631 632
int32_t ctgOpUpdateVgroup(SCtgCacheOperation *action);
int32_t ctgOpUpdateTbMeta(SCtgCacheOperation *action);
int32_t ctgOpDropDbCache(SCtgCacheOperation *action);
D
dapan1121 已提交
633
int32_t ctgOpDropDbVgroup(SCtgCacheOperation *action);
D
dapan1121 已提交
634 635 636 637
int32_t ctgOpDropStbMeta(SCtgCacheOperation *action);
int32_t ctgOpDropTbMeta(SCtgCacheOperation *action);
int32_t ctgOpUpdateUser(SCtgCacheOperation *action);
int32_t ctgOpUpdateEpset(SCtgCacheOperation *operation);
D
dapan1121 已提交
638
int32_t ctgAcquireVgInfoFromCache(SCatalog* pCtg, const char *dbFName, SCtgDBCache **pCache);
D
dapan1121 已提交
639 640
void    ctgReleaseDBCache(SCatalog *pCtg, SCtgDBCache *dbCache);
void    ctgRUnlockVgInfo(SCtgDBCache *dbCache);
D
dapan1121 已提交
641 642
int32_t ctgTbMetaExistInCache(SCatalog* pCtg, char *dbFName, char* tbName, int32_t *exist);
int32_t ctgReadTbMetaFromCache(SCatalog* pCtg, SCtgTbMetaCtx* ctx, STableMeta** pTableMeta);
D
dapan1121 已提交
643 644
int32_t ctgReadTbVerFromCache(SCatalog *pCtg, SName *pTableName, int32_t *sver, int32_t *tver, int32_t *tbType, uint64_t *suid, char *stbName);
int32_t ctgChkAuthFromCache(SCatalog* pCtg, char* user, char* dbFName, AUTH_TYPE type, bool *inCache, bool *pass);
D
dapan1121 已提交
645
int32_t ctgDropDbCacheEnqueue(SCatalog* pCtg, const char *dbFName, int64_t dbId);
D
dapan1121 已提交
646
int32_t ctgDropDbVgroupEnqueue(SCatalog* pCtg, const char *dbFName, bool syncReq);
D
dapan1121 已提交
647 648 649 650 651 652
int32_t ctgDropStbMetaEnqueue(SCatalog* pCtg, const char *dbFName, int64_t dbId, const char *stbName, uint64_t suid, bool syncReq);
int32_t ctgDropTbMetaEnqueue(SCatalog* pCtg, const char *dbFName, int64_t dbId, const char *tbName, bool syncReq);
int32_t ctgUpdateVgroupEnqueue(SCatalog* pCtg, const char *dbFName, int64_t dbId, SDBVgInfo* dbInfo, bool syncReq);
int32_t ctgUpdateTbMetaEnqueue(SCatalog* pCtg, STableMetaOutput *output, bool syncReq);
int32_t ctgUpdateUserEnqueue(SCatalog* pCtg, SGetUserAuthRsp *pAuth, bool syncReq);
int32_t ctgUpdateVgEpsetEnqueue(SCatalog* pCtg, char *dbFName, int32_t vgId, SEpSet* pEpSet);
D
dapan1121 已提交
653
int32_t ctgUpdateTbIndexEnqueue(SCatalog* pCtg, STableIndex **pIndex, bool syncOp);
D
dapan1121 已提交
654
int32_t ctgClearCacheEnqueue(SCatalog* pCtg, bool freeCtg, bool stopQueue, bool syncOp);
D
dapan1121 已提交
655 656 657 658 659 660
int32_t ctgMetaRentInit(SCtgRentMgmt *mgmt, uint32_t rentSec, int8_t type);
int32_t ctgMetaRentAdd(SCtgRentMgmt *mgmt, void *meta, int64_t id, int32_t size);
int32_t ctgMetaRentGet(SCtgRentMgmt *mgmt, void **res, uint32_t *num, int32_t size);
int32_t ctgUpdateTbMetaToCache(SCatalog* pCtg, STableMetaOutput* pOut, bool syncReq);
int32_t ctgStartUpdateThread();
int32_t ctgRelaunchGetTbMetaTask(SCtgTask *pTask);
D
dapan1121 已提交
661
void    ctgReleaseVgInfoToCache(SCatalog* pCtg, SCtgDBCache *dbCache);
D
dapan1121 已提交
662 663 664 665
int32_t ctgReadTbIndexFromCache(SCatalog* pCtg, SName* pTableName, SArray** pRes);
int32_t ctgDropTbIndexEnqueue(SCatalog* pCtg, SName* pName, bool syncOp);
int32_t ctgOpDropTbIndex(SCtgCacheOperation *operation);
int32_t ctgOpUpdateTbIndex(SCtgCacheOperation *operation);
D
dapan1121 已提交
666
int32_t ctgOpClearCache(SCtgCacheOperation *operation);
D
dapan1121 已提交
667
int32_t ctgReadTbTypeFromCache(SCatalog* pCtg, char* dbFName, char *tableName, int32_t *tbType);
D
dapan1121 已提交
668
int32_t ctgGetTbHashVgroupFromCache(SCatalog *pCtg, const SName *pTableName, SVgroupInfo **pVgroup);
D
dapan1121 已提交
669

D
dapan1121 已提交
670 671 672 673



int32_t ctgProcessRspMsg(void* out, int32_t reqType, char* msg, int32_t msgSize, int32_t rspCode, char* target);
D
dapan1121 已提交
674
int32_t ctgGetDBVgInfoFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, SBuildUseDBInput *input, SUseDbOutput *out, SCtgTaskReq* tReq);
D
dapan1121 已提交
675
int32_t ctgGetQnodeListFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, SArray *out, SCtgTask* pTask);
D
dapan1121 已提交
676
int32_t ctgGetDnodeListFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, SArray **out, SCtgTask* pTask);
D
dapan1121 已提交
677 678
int32_t ctgGetDBCfgFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, const char *dbFName, SDbCfgInfo *out, SCtgTask* pTask);
int32_t ctgGetIndexInfoFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, const char *indexName, SIndexInfo *out, SCtgTask* pTask);
D
dapan1121 已提交
679
int32_t ctgGetTbIndexFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, SName *name, STableIndex* out, SCtgTask* pTask);
D
dapan1121 已提交
680 681
int32_t ctgGetUdfInfoFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, const char *funcName, SFuncInfo *out, SCtgTask* pTask);
int32_t ctgGetUserDbAuthFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, const char *user, SGetUserAuthRsp *out, SCtgTask* pTask);
D
dapan1121 已提交
682 683 684
int32_t ctgGetTbMetaFromMnodeImpl(SCatalog* pCtg, SRequestConnInfo *pConn, char *dbFName, char* tbName, STableMetaOutput* out, SCtgTaskReq* tReq);
int32_t ctgGetTbMetaFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, const SName* pTableName, STableMetaOutput* out, SCtgTaskReq* tReq);
int32_t ctgGetTbMetaFromVnode(SCatalog* pCtg, SRequestConnInfo *pConn, const SName* pTableName, SVgroupInfo *vgroupInfo, STableMetaOutput* out, SCtgTaskReq* tReq);
D
dapan1121 已提交
685 686
int32_t ctgGetTableCfgFromVnode(SCatalog* pCtg, SRequestConnInfo *pConn, const SName* pTableName, SVgroupInfo *vgroupInfo, STableCfg **out, SCtgTask* pTask);
int32_t ctgGetTableCfgFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, const SName* pTableName, STableCfg **out, SCtgTask* pTask);
D
dapan1121 已提交
687
int32_t ctgGetSvrVerFromMnode(SCatalog* pCtg, SRequestConnInfo *pConn, char **out, SCtgTask* pTask);
688
int32_t ctgLaunchBatchs(SCatalog* pCtg, SCtgJob *pJob, SHashObj* pBatchs);
D
dapan1121 已提交
689

D
dapan1121 已提交
690
int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgJob** job, const SCatalogReq* pReq, catalogCallback fp, void* param);
D
dapan1121 已提交
691 692
int32_t ctgLaunchJob(SCtgJob *pJob);
int32_t ctgMakeAsyncRes(SCtgJob *pJob);
D
dapan1121 已提交
693 694
int32_t ctgLaunchSubTask(SCtgTask *pTask, CTG_TASK_TYPE type, ctgSubTaskCbFp fp, void* param);
int32_t ctgGetTbCfgCb(SCtgTask *pTask);
D
dapan1121 已提交
695
void    ctgFreeHandle(SCatalog* pCatalog);
D
dapan1121 已提交
696

697
void    ctgFreeMsgSendParam(void* param);
D
dapan1121 已提交
698 699
void    ctgFreeBatch(SCtgBatch *pBatch);
void    ctgFreeBatchs(SHashObj *pBatchs);
D
dapan1121 已提交
700 701 702
int32_t ctgCloneVgInfo(SDBVgInfo *src, SDBVgInfo **dst);
int32_t ctgCloneMetaOutput(STableMetaOutput *output, STableMetaOutput **pOutput);
int32_t ctgGenerateVgList(SCatalog *pCtg, SHashObj *vgHash, SArray** pList);
D
dapan1121 已提交
703
void    ctgFreeJob(void* job);
D
dapan1121 已提交
704
void    ctgFreeHandleImpl(SCatalog* pCtg);
D
dapan1121 已提交
705
void    ctgFreeVgInfo(SDBVgInfo *vgInfo);
D
dapan1121 已提交
706
int32_t ctgGetVgInfoFromHashValue(SCatalog *pCtg, SDBVgInfo *dbInfo, const SName *pTableName, SVgroupInfo *pVgroup);
D
dapan1121 已提交
707
int32_t ctgGetVgInfosFromHashValue(SCatalog *pCtg, SCtgTaskReq* tReq, SDBVgInfo *dbInfo, SCtgTbHashsCtx *pCtx, char* dbFName, SArray* pNames, bool update);
D
dapan1121 已提交
708 709
void    ctgResetTbMetaTask(SCtgTask* pTask);
void    ctgFreeDbCache(SCtgDBCache *dbCache);
D
dapan1121 已提交
710 711 712 713
int32_t ctgStbVersionSortCompare(const void* key1, const void* key2);
int32_t ctgDbVgVersionSortCompare(const void* key1, const void* key2);
int32_t ctgStbVersionSearchCompare(const void* key1, const void* key2);
int32_t ctgDbVgVersionSearchCompare(const void* key1, const void* key2);
D
dapan1121 已提交
714
void    ctgFreeSTableMetaOutput(STableMetaOutput* pOutput);
D
dapan1121 已提交
715
int32_t ctgUpdateMsgCtx(SCtgMsgCtx* pCtx, int32_t reqType, void* out, char* target);
D
dapan1121 已提交
716
int32_t ctgAddMsgCtx(SArray* pCtxs, int32_t reqType, void* out, char* target);
D
dapan1121 已提交
717
char *  ctgTaskTypeStr(CTG_TASK_TYPE type);
718
int32_t ctgUpdateSendTargetInfo(SMsgSendInfo *pMsgSendInfo, int32_t msgType, char* dbFName, int32_t vgId);
719 720
int32_t ctgGetTablesReqNum(SArray *pList);
int32_t ctgAddFetch(SArray** pFetchs, int32_t dbIdx, int32_t tbIdx, int32_t *fetchIdx, int32_t resIdx, int32_t flag);
D
dapan1121 已提交
721
int32_t ctgCloneTableIndex(SArray* pIndex, SArray** pRes);
D
dapan1121 已提交
722
void    ctgFreeSTableIndex(void *info);
D
dapan1121 已提交
723
void    ctgClearSubTaskRes(SCtgSubRes *pRes);
D
dapan1121 已提交
724 725
void    ctgFreeQNode(SCtgQNode *node);
void    ctgClearHandle(SCatalog* pCtg);
D
dapan1121 已提交
726
void    ctgFreeTbCacheImpl(SCtgTbCache *pCache);
D
dapan1121 已提交
727 728
int32_t ctgRemoveTbMeta(SCatalog* pCtg, SName* pTableName);
int32_t ctgGetTbHashVgroup(SCatalog *pCtg, SRequestConnInfo *pConn, const SName *pTableName, SVgroupInfo *pVgroup);
D
dapan1121 已提交
729
SName*  ctgGetFetchName(SArray* pNames, SCtgFetch* pFetch);
730

D
dapan1121 已提交
731 732 733 734

extern SCatalogMgmt gCtgMgmt;
extern SCtgDebug gCTGDebug;
extern SCtgAsyncFps gCtgAsyncFps[];
D
dapan1121 已提交
735

H
Hongze Cheng 已提交
736 737 738 739
#ifdef __cplusplus
}
#endif

D
dapan 已提交
740
#endif /*_TD_CATALOG_INT_H_*/