mndDef.h 24.0 KB
Newer Older
H
refact  
Hongze Cheng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * 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/>.
 */

S
Shengliang Guan 已提交
16 17
#ifndef _TD_MND_DEF_H_
#define _TD_MND_DEF_H_
S
Shengliang Guan 已提交
18

19
#include "os.h"
S
Shengliang Guan 已提交
20 21

#include "cJSON.h"
L
Liu Jicong 已提交
22
#include "scheduler.h"
S
Shengliang Guan 已提交
23 24
#include "sync.h"
#include "thash.h"
L
Liu Jicong 已提交
25
#include "tlist.h"
S
Shengliang Guan 已提交
26
#include "tlog.h"
L
Liu Jicong 已提交
27
#include "tmsg.h"
S
Shengliang Guan 已提交
28
#include "trpc.h"
L
Liu Jicong 已提交
29
#include "tstream.h"
S
Shengliang Guan 已提交
30
#include "ttimer.h"
S
Shengliang Guan 已提交
31

S
Shengliang Guan 已提交
32
#include "mnode.h"
S
Shengliang Guan 已提交
33

S
Shengliang Guan 已提交
34 35 36
#ifdef __cplusplus
extern "C" {
#endif
S
Shengliang Guan 已提交
37

S
Shengliang Guan 已提交
38
typedef enum {
39 40 41 42 43 44 45 46
  MND_AUTH_ACCT_START = 0,
  MND_AUTH_ACCT_USER,
  MND_AUTH_ACCT_DNODE,
  MND_AUTH_ACCT_MNODE,
  MND_AUTH_ACCT_DB,
  MND_AUTH_ACCT_TABLE,
  MND_AUTH_ACCT_MAX
} EAuthAcct;
S
Shengliang Guan 已提交
47 48

typedef enum {
49 50 51 52 53 54
  MND_AUTH_OP_START = 0,
  MND_AUTH_OP_CREATE_USER,
  MND_AUTH_OP_ALTER_USER,
  MND_AUTH_OP_DROP_USER,
  MND_AUTH_MAX
} EAuthOp;
S
Shengliang Guan 已提交
55

S
Shengliang Guan 已提交
56
typedef enum {
57
  TRN_STAGE_PREPARE = 0,
S
Shengliang Guan 已提交
58 59
  TRN_STAGE_REDO_LOG = 1,
  TRN_STAGE_REDO_ACTION = 2,
60 61
  TRN_STAGE_COMMIT = 3,
  TRN_STAGE_COMMIT_LOG = 4,
62 63
  TRN_STAGE_UNDO_ACTION = 5,
  TRN_STAGE_UNDO_LOG = 6,
S
Shengliang Guan 已提交
64 65
  TRN_STAGE_ROLLBACK = 7,
  TRN_STAGE_FINISHED = 8
S
Shengliang Guan 已提交
66 67
} ETrnStage;

S
Shengliang Guan 已提交
68
typedef enum {
S
Shengliang Guan 已提交
69 70 71 72
  TRN_TYPE_BASIC_SCOPE = 1000,
  TRN_TYPE_CREATE_USER = 1001,
  TRN_TYPE_ALTER_USER = 1002,
  TRN_TYPE_DROP_USER = 1003,
S
Shengliang Guan 已提交
73 74
  TRN_TYPE_CREATE_FUNC = 1004,
  TRN_TYPE_DROP_FUNC = 1005,
S
Shengliang Guan 已提交
75 76 77 78 79 80 81 82 83 84 85 86
  TRN_TYPE_CREATE_SNODE = 1006,
  TRN_TYPE_DROP_SNODE = 1007,
  TRN_TYPE_CREATE_QNODE = 1008,
  TRN_TYPE_DROP_QNODE = 1009,
  TRN_TYPE_CREATE_BNODE = 1010,
  TRN_TYPE_DROP_BNODE = 1011,
  TRN_TYPE_CREATE_MNODE = 1012,
  TRN_TYPE_DROP_MNODE = 1013,
  TRN_TYPE_CREATE_TOPIC = 1014,
  TRN_TYPE_DROP_TOPIC = 1015,
  TRN_TYPE_SUBSCRIBE = 1016,
  TRN_TYPE_REBALANCE = 1017,
L
Liu Jicong 已提交
87
  TRN_TYPE_COMMIT_OFFSET = 1018,
L
Liu Jicong 已提交
88
  TRN_TYPE_CREATE_STREAM = 1019,
L
Liu Jicong 已提交
89 90
  TRN_TYPE_DROP_STREAM = 1020,
  TRN_TYPE_ALTER_STREAM = 1021,
91
  TRN_TYPE_CONSUMER_LOST = 1022,
S
Shengliang Guan 已提交
92 93 94 95 96 97 98 99 100
  TRN_TYPE_BASIC_SCOPE_END,
  TRN_TYPE_GLOBAL_SCOPE = 2000,
  TRN_TYPE_CREATE_DNODE = 2001,
  TRN_TYPE_DROP_DNODE = 2002,
  TRN_TYPE_GLOBAL_SCOPE_END,
  TRN_TYPE_DB_SCOPE = 3000,
  TRN_TYPE_CREATE_DB = 3001,
  TRN_TYPE_ALTER_DB = 3002,
  TRN_TYPE_DROP_DB = 3003,
S
Shengliang Guan 已提交
101 102
  TRN_TYPE_SPLIT_VGROUP = 3004,
  TRN_TYPE_MERGE_VGROUP = 3015,
S
Shengliang Guan 已提交
103
  TRN_TYPE_DB_SCOPE_END,
S
Shengliang Guan 已提交
104 105 106 107
  TRN_TYPE_STB_SCOPE = 4000,
  TRN_TYPE_CREATE_STB = 4001,
  TRN_TYPE_ALTER_STB = 4002,
  TRN_TYPE_DROP_STB = 4003,
S
Shengliang Guan 已提交
108 109
  TRN_TYPE_CREATE_SMA = 4004,
  TRN_TYPE_DROP_SMA = 4005,
S
Shengliang Guan 已提交
110
  TRN_TYPE_STB_SCOPE_END,
S
Shengliang Guan 已提交
111 112
} ETrnType;

113
typedef enum { TRN_POLICY_ROLLBACK = 0, TRN_POLICY_RETRY = 1 } ETrnPolicy;
S
Shengliang Guan 已提交
114

S
Shengliang Guan 已提交
115 116 117 118 119 120 121 122 123 124 125 126 127 128
typedef enum {
  DND_REASON_ONLINE = 0,
  DND_REASON_STATUS_MSG_TIMEOUT,
  DND_REASON_STATUS_NOT_RECEIVED,
  DND_REASON_VERSION_NOT_MATCH,
  DND_REASON_DNODE_ID_NOT_MATCH,
  DND_REASON_CLUSTER_ID_NOT_MATCH,
  DND_REASON_STATUS_INTERVAL_NOT_MATCH,
  DND_REASON_TIME_ZONE_NOT_MATCH,
  DND_REASON_LOCALE_NOT_MATCH,
  DND_REASON_CHARSET_NOT_MATCH,
  DND_REASON_OTHERS
} EDndReason;

S
Shengliang Guan 已提交
129
typedef struct {
S
Shengliang Guan 已提交
130 131 132
  int32_t    id;
  ETrnStage  stage;
  ETrnPolicy policy;
S
Shengliang Guan 已提交
133
  ETrnType   transType;
S
Shengliang Guan 已提交
134 135
  int32_t    code;
  int32_t    failedTimes;
L
Liu Jicong 已提交
136 137
  void*      rpcHandle;
  void*      rpcAHandle;
S
Shengliang Guan 已提交
138 139
  void*      rpcRsp;
  int32_t    rpcRspLen;
L
Liu Jicong 已提交
140 141 142 143 144
  SArray*    redoLogs;
  SArray*    undoLogs;
  SArray*    commitLogs;
  SArray*    redoActions;
  SArray*    undoActions;
S
Shengliang Guan 已提交
145 146
  int64_t    createdTime;
  int64_t    lastExecTime;
L
Liu Jicong 已提交
147
  int64_t    dbUid;
S
Shengliang Guan 已提交
148
  char       dbname[TSDB_DB_FNAME_LEN];
S
Shengliang Guan 已提交
149
  char       lastError[TSDB_TRANS_ERROR_LEN];
S
Shengliang Guan 已提交
150
} STrans;
S
Shengliang Guan 已提交
151

S
Shengliang Guan 已提交
152
typedef struct {
153
  int64_t id;
S
Shengliang Guan 已提交
154
  char    name[TSDB_CLUSTER_ID_LEN];
S
Shengliang Guan 已提交
155 156 157 158
  int64_t createdTime;
  int64_t updateTime;
} SClusterObj;

S
Shengliang Guan 已提交
159
typedef struct {
S
Shengliang Guan 已提交
160 161 162 163
  int32_t    id;
  int64_t    createdTime;
  int64_t    updateTime;
  int64_t    rebootTime;
164
  int64_t    lastAccessTime;
S
Shengliang Guan 已提交
165
  int32_t    accessTimes;
S
Shengliang Guan 已提交
166
  int32_t    numOfVnodes;
S
Shengliang Guan 已提交
167 168
  int32_t    numOfSupportVnodes;
  int32_t    numOfCores;
S
Shengliang Guan 已提交
169 170 171 172
  EDndReason offlineReason;
  uint16_t   port;
  char       fqdn[TSDB_FQDN_LEN];
  char       ep[TSDB_EP_LEN];
S
Shengliang Guan 已提交
173 174
} SDnodeObj;

S
Shengliang Guan 已提交
175
typedef struct {
S
Shengliang Guan 已提交
176
  int32_t    id;
S
Shengliang Guan 已提交
177 178
  int64_t    createdTime;
  int64_t    updateTime;
S
Shengliang Guan 已提交
179
  ESyncState role;
S
Shengliang Guan 已提交
180 181
  int32_t    roleTerm;
  int64_t    roleTime;
L
Liu Jicong 已提交
182
  SDnodeObj* pDnode;
S
Shengliang Guan 已提交
183 184
} SMnodeObj;

S
Shengliang Guan 已提交
185 186 187 188
typedef struct {
  int32_t    id;
  int64_t    createdTime;
  int64_t    updateTime;
L
Liu Jicong 已提交
189
  SDnodeObj* pDnode;
S
Shengliang Guan 已提交
190 191 192 193 194 195
} SQnodeObj;

typedef struct {
  int32_t    id;
  int64_t    createdTime;
  int64_t    updateTime;
L
Liu Jicong 已提交
196
  SDnodeObj* pDnode;
S
Shengliang Guan 已提交
197 198 199 200 201 202
} SSnodeObj;

typedef struct {
  int32_t    id;
  int64_t    createdTime;
  int64_t    updateTime;
L
Liu Jicong 已提交
203
  SDnodeObj* pDnode;
S
Shengliang Guan 已提交
204 205
} SBnodeObj;

S
Shengliang Guan 已提交
206 207 208
typedef struct {
  int32_t maxUsers;
  int32_t maxDbs;
S
Shengliang Guan 已提交
209 210
  int32_t maxStbs;
  int32_t maxTbs;
S
Shengliang Guan 已提交
211 212
  int32_t maxTimeSeries;
  int32_t maxStreams;
S
Shengliang Guan 已提交
213 214 215 216
  int32_t maxFuncs;
  int32_t maxConsumers;
  int32_t maxConns;
  int32_t maxTopics;
217
  int64_t maxStorage;
S
Shengliang Guan 已提交
218
  int32_t accessState;  // Configured only by command
S
Shengliang Guan 已提交
219 220 221 222 223 224 225
} SAcctCfg;

typedef struct {
  int32_t numOfUsers;
  int32_t numOfDbs;
  int32_t numOfTimeSeries;
  int32_t numOfStreams;
S
Shengliang Guan 已提交
226 227
  int64_t totalStorage;  // Total storage wrtten from this account
  int64_t compStorage;   // Compressed storage on disk
S
Shengliang Guan 已提交
228 229
} SAcctInfo;

S
Shengliang Guan 已提交
230
typedef struct {
S
Shengliang Guan 已提交
231 232 233 234
  char      acct[TSDB_USER_LEN];
  int64_t   createdTime;
  int64_t   updateTime;
  int32_t   acctId;
S
Shengliang Guan 已提交
235
  int32_t   status;
S
Shengliang Guan 已提交
236 237 238 239
  SAcctCfg  cfg;
  SAcctInfo info;
} SAcctObj;

S
Shengliang Guan 已提交
240
typedef struct {
S
Shengliang Guan 已提交
241
  char      user[TSDB_USER_LEN];
242
  char      pass[TSDB_PASSWORD_LEN];
S
Shengliang Guan 已提交
243 244 245
  char      acct[TSDB_USER_LEN];
  int64_t   createdTime;
  int64_t   updateTime;
246
  int8_t    superUser;
S
Shengliang Guan 已提交
247
  int32_t   acctId;
248 249
  SHashObj* readDbs;
  SHashObj* writeDbs;
S
Shengliang Guan 已提交
250 251 252
} SUserObj;

typedef struct {
253
  int32_t numOfVgroups;
S
Shengliang Guan 已提交
254 255 256 257 258 259
  int32_t cacheBlockSize;
  int32_t totalBlocks;
  int32_t daysPerFile;
  int32_t daysToKeep0;
  int32_t daysToKeep1;
  int32_t daysToKeep2;
S
Shengliang Guan 已提交
260 261
  int32_t minRows;
  int32_t maxRows;
S
Shengliang Guan 已提交
262 263
  int32_t commitTime;
  int32_t fsyncPeriod;
D
dapan1121 已提交
264
  int32_t ttl;
S
Shengliang Guan 已提交
265
  int8_t  walLevel;
S
Shengliang Guan 已提交
266 267 268
  int8_t  precision;
  int8_t  compression;
  int8_t  replications;
S
Shengliang Guan 已提交
269
  int8_t  strict;
S
Shengliang Guan 已提交
270 271
  int8_t  update;
  int8_t  cacheLastRow;
L
Liu Jicong 已提交
272
  int8_t  streamMode;
D
dapan1121 已提交
273
  int8_t  singleSTable;
S
Shengliang Guan 已提交
274
  int8_t  hashMethod;  // default is 1
S
sma  
Shengliang Guan 已提交
275 276
  int32_t numOfRetensions;
  SArray* pRetensions;
S
Shengliang Guan 已提交
277 278
} SDbCfg;

S
Shengliang Guan 已提交
279
typedef struct {
280 281 282 283 284 285 286 287 288 289
  char     name[TSDB_DB_FNAME_LEN];
  char     acct[TSDB_USER_LEN];
  char     createUser[TSDB_USER_LEN];
  int64_t  createdTime;
  int64_t  updateTime;
  int64_t  uid;
  int32_t  cfgVersion;
  int32_t  vgVersion;
  SDbCfg   cfg;
  SRWLatch lock;
S
Shengliang Guan 已提交
290 291 292 293
} SDbObj;

typedef struct {
  int32_t    dnodeId;
S
Shengliang Guan 已提交
294
  ESyncState role;
S
Shengliang Guan 已提交
295 296
} SVnodeGid;

S
Shengliang Guan 已提交
297
typedef struct {
S
Shengliang Guan 已提交
298
  int32_t   vgId;
S
Shengliang Guan 已提交
299 300
  int64_t   createdTime;
  int64_t   updateTime;
S
Shengliang Guan 已提交
301
  int32_t   version;
S
Shengliang Guan 已提交
302 303
  uint32_t  hashBegin;
  uint32_t  hashEnd;
304
  char      dbName[TSDB_DB_FNAME_LEN];
S
Shengliang Guan 已提交
305
  int64_t   dbUid;
S
Shengliang Guan 已提交
306 307
  int64_t   numOfTables;
  int64_t   numOfTimeSeries;
S
Shengliang Guan 已提交
308 309 310
  int64_t   totalStorage;
  int64_t   compStorage;
  int64_t   pointsWritten;
S
Shengliang Guan 已提交
311 312
  int8_t    compact;
  int8_t    replica;
L
Liu Jicong 已提交
313
  int8_t    streamMode;
S
Shengliang Guan 已提交
314
  SVnodeGid vnodeGid[TSDB_MAX_REPLICA];
S
Shengliang Guan 已提交
315 316
} SVgObj;

S
Shengliang Guan 已提交
317
typedef struct {
S
Shengliang Guan 已提交
318
  char    name[TSDB_TABLE_FNAME_LEN];
S
sma  
Shengliang Guan 已提交
319 320
  char    stb[TSDB_TABLE_FNAME_LEN];
  char    db[TSDB_DB_FNAME_LEN];
S
Shengliang Guan 已提交
321 322 323
  int64_t createdTime;
  int64_t uid;
  int64_t stbUid;
S
sma  
Shengliang Guan 已提交
324
  int64_t dbUid;
S
Shengliang Guan 已提交
325 326 327
  int8_t  intervalUnit;
  int8_t  slidingUnit;
  int8_t  timezone;
S
sma  
Shengliang Guan 已提交
328
  int32_t dstVgId;  // for stream
S
Shengliang Guan 已提交
329 330 331
  int64_t interval;
  int64_t offset;
  int64_t sliding;
S
sma  
Shengliang Guan 已提交
332
  int32_t exprLen;  // strlen + 1
S
Shengliang Guan 已提交
333
  int32_t tagsFilterLen;
S
sma  
Shengliang Guan 已提交
334 335
  int32_t sqlLen;
  int32_t astLen;
S
Shengliang Guan 已提交
336 337
  char*   expr;
  char*   tagsFilter;
S
sma  
Shengliang Guan 已提交
338 339
  char*   sql;
  char*   ast;
S
Shengliang Guan 已提交
340 341
} SSmaObj;

S
Shengliang Guan 已提交
342
typedef struct {
S
Shengliang Guan 已提交
343
  char     name[TSDB_TABLE_FNAME_LEN];
344
  char     db[TSDB_DB_FNAME_LEN];
345 346
  int64_t  createdTime;
  int64_t  updateTime;
L
Liu Jicong 已提交
347 348
  int64_t  uid;
  int64_t  dbUid;
S
Shengliang Guan 已提交
349
  int32_t  version;
S
Shengliang Guan 已提交
350
  int32_t  nextColId;
S
sma  
Shengliang Guan 已提交
351 352 353
  float    xFilesFactor;
  int32_t  aggregationMethod;
  int32_t  delay;
S
sma  
Shengliang Guan 已提交
354
  int32_t  ttl;
S
Shengliang Guan 已提交
355 356
  int32_t  numOfColumns;
  int32_t  numOfTags;
S
sma  
Shengliang Guan 已提交
357
  int32_t  numOfSmas;
S
sma  
Shengliang Guan 已提交
358
  int32_t  commentLen;
359 360
  int32_t  ast1Len;
  int32_t  ast2Len;
S
Shengliang Guan 已提交
361
  SSchema* pColumns;
S
Shengliang Guan 已提交
362
  SSchema* pTags;
S
sma  
Shengliang Guan 已提交
363
  SSchema* pSmas;
S
sma  
Shengliang Guan 已提交
364
  char*    comment;
365 366
  char*    pAst1;
  char*    pAst2;
S
Shengliang Guan 已提交
367
  SRWLatch lock;
S
Shengliang Guan 已提交
368
} SStbObj;
S
Shengliang Guan 已提交
369

S
Shengliang Guan 已提交
370
typedef struct {
S
Shengliang Guan 已提交
371 372
  char    name[TSDB_FUNC_NAME_LEN];
  int64_t createdTime;
S
Shengliang Guan 已提交
373 374 375 376 377 378
  int8_t  funcType;
  int8_t  scriptType;
  int8_t  align;
  int8_t  outputType;
  int32_t outputLen;
  int32_t bufSize;
S
Shengliang 已提交
379
  int64_t signature;
S
Shengliang Guan 已提交
380 381
  int32_t commentSize;
  int32_t codeSize;
L
Liu Jicong 已提交
382 383
  char*   pComment;
  char*   pCode;
S
Shengliang Guan 已提交
384
  char    pData[];
S
Shengliang Guan 已提交
385 386
} SFuncObj;

S
Shengliang Guan 已提交
387
typedef struct {
L
Liu Jicong 已提交
388 389 390 391 392 393 394 395 396
  int64_t        id;
  int8_t         type;
  int8_t         replica;
  int16_t        numOfColumns;
  int32_t        rowSize;
  int32_t        numOfRows;
  int32_t        payloadLen;
  void*          pIter;
  SMnode*        pMnode;
397
  STableMetaRsp* pMeta;
L
Liu Jicong 已提交
398 399 400 401
  bool           sysDbRsp;
  char           db[TSDB_DB_FNAME_LEN];
  int16_t        offset[TSDB_MAX_COLUMNS];
  int32_t        bytes[TSDB_MAX_COLUMNS];
S
Shengliang Guan 已提交
402 403
} SShowObj;

404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
typedef struct {
  int64_t id;
  int8_t  type;
  int8_t  replica;
  int16_t numOfColumns;
  int32_t rowSize;
  int32_t numOfRows;
  int32_t numOfReads;
  int32_t payloadLen;
  void*   pIter;
  SMnode* pMnode;
  char    db[TSDB_DB_FNAME_LEN];
  int16_t offset[TSDB_MAX_COLUMNS];
  int32_t bytes[TSDB_MAX_COLUMNS];
  char    payload[];
} SSysTableRetrieveObj;

L
Liu Jicong 已提交
421 422 423
typedef struct {
  int32_t vgId;  // -1 for unassigned
  int32_t status;
L
Liu Jicong 已提交
424
  int32_t epoch;
L
Liu Jicong 已提交
425 426 427 428
  SEpSet  epSet;
  int64_t oldConsumerId;
  int64_t consumerId;  // -1 for unassigned
  char*   qmsg;
L
Liu Jicong 已提交
429 430
} SMqConsumerEp;

L
Liu Jicong 已提交
431
static FORCE_INLINE int32_t tEncodeSMqConsumerEp(void** buf, const SMqConsumerEp* pConsumerEp) {
L
Liu Jicong 已提交
432 433
  int32_t tlen = 0;
  tlen += taosEncodeFixedI32(buf, pConsumerEp->vgId);
L
Liu Jicong 已提交
434
  tlen += taosEncodeFixedI32(buf, pConsumerEp->status);
L
Liu Jicong 已提交
435
  tlen += taosEncodeFixedI32(buf, pConsumerEp->epoch);
436
  tlen += taosEncodeSEpSet(buf, &pConsumerEp->epSet);
L
Liu Jicong 已提交
437
  tlen += taosEncodeFixedI64(buf, pConsumerEp->oldConsumerId);
L
Liu Jicong 已提交
438
  tlen += taosEncodeFixedI64(buf, pConsumerEp->consumerId);
L
Liu Jicong 已提交
439
  tlen += taosEncodeString(buf, pConsumerEp->qmsg);
L
Liu Jicong 已提交
440 441 442 443 444
  return tlen;
}

static FORCE_INLINE void* tDecodeSMqConsumerEp(void** buf, SMqConsumerEp* pConsumerEp) {
  buf = taosDecodeFixedI32(buf, &pConsumerEp->vgId);
L
Liu Jicong 已提交
445
  buf = taosDecodeFixedI32(buf, &pConsumerEp->status);
L
Liu Jicong 已提交
446
  buf = taosDecodeFixedI32(buf, &pConsumerEp->epoch);
447
  buf = taosDecodeSEpSet(buf, &pConsumerEp->epSet);
L
Liu Jicong 已提交
448
  buf = taosDecodeFixedI64(buf, &pConsumerEp->oldConsumerId);
L
Liu Jicong 已提交
449
  buf = taosDecodeFixedI64(buf, &pConsumerEp->consumerId);
L
Liu Jicong 已提交
450
  buf = taosDecodeString(buf, &pConsumerEp->qmsg);
L
Liu Jicong 已提交
451 452 453
  return buf;
}

L
Liu Jicong 已提交
454 455
static FORCE_INLINE void tDeleteSMqConsumerEp(SMqConsumerEp* pConsumerEp) {
  if (pConsumerEp) {
wafwerar's avatar
wafwerar 已提交
456
    taosMemoryFreeClear(pConsumerEp->qmsg);
L
Liu Jicong 已提交
457 458 459
  }
}

L
Liu Jicong 已提交
460 461 462 463
typedef struct {
  int64_t consumerId;
  SArray* vgInfo;  // SArray<SMqConsumerEp>
} SMqSubConsumer;
L
Liu Jicong 已提交
464

L
Liu Jicong 已提交
465 466 467 468
static FORCE_INLINE int32_t tEncodeSMqSubConsumer(void** buf, const SMqSubConsumer* pConsumer) {
  int32_t tlen = 0;
  tlen += taosEncodeFixedI64(buf, pConsumer->consumerId);
  int32_t sz = taosArrayGetSize(pConsumer->vgInfo);
L
Liu Jicong 已提交
469
  tlen += taosEncodeFixedI32(buf, sz);
L
Liu Jicong 已提交
470 471 472
  for (int32_t i = 0; i < sz; i++) {
    SMqConsumerEp* pCEp = taosArrayGet(pConsumer->vgInfo, i);
    tlen += tEncodeSMqConsumerEp(buf, pCEp);
L
Liu Jicong 已提交
473
  }
L
Liu Jicong 已提交
474 475
  return tlen;
}
L
Liu Jicong 已提交
476

L
Liu Jicong 已提交
477 478 479 480 481 482 483 484 485
static FORCE_INLINE void* tDecodeSMqSubConsumer(void** buf, SMqSubConsumer* pConsumer) {
  int32_t sz;
  buf = taosDecodeFixedI64(buf, &pConsumer->consumerId);
  buf = taosDecodeFixedI32(buf, &sz);
  pConsumer->vgInfo = taosArrayInit(sz, sizeof(SMqConsumerEp));
  for (int32_t i = 0; i < sz; i++) {
    SMqConsumerEp consumerEp;
    buf = tDecodeSMqConsumerEp(buf, &consumerEp);
    taosArrayPush(pConsumer->vgInfo, &consumerEp);
L
Liu Jicong 已提交
486
  }
L
Liu Jicong 已提交
487 488 489 490 491 492 493
  return buf;
}

static FORCE_INLINE void tDeleteSMqSubConsumer(SMqSubConsumer* pSubConsumer) {
  if (pSubConsumer->vgInfo) {
    taosArrayDestroyEx(pSubConsumer->vgInfo, (void (*)(void*))tDeleteSMqConsumerEp);
    pSubConsumer->vgInfo = NULL;
L
Liu Jicong 已提交
494
  }
L
Liu Jicong 已提交
495 496
}

L
Liu Jicong 已提交
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514
typedef struct {
  char    key[TSDB_PARTITION_KEY_LEN];
  int64_t offset;
} SMqOffsetObj;

static FORCE_INLINE int32_t tEncodeSMqOffsetObj(void** buf, const SMqOffsetObj* pOffset) {
  int32_t tlen = 0;
  tlen += taosEncodeString(buf, pOffset->key);
  tlen += taosEncodeFixedI64(buf, pOffset->offset);
  return tlen;
}

static FORCE_INLINE void* tDecodeSMqOffsetObj(void* buf, SMqOffsetObj* pOffset) {
  buf = taosDecodeStringTo(buf, pOffset->key);
  buf = taosDecodeFixedI64(buf, &pOffset->offset);
  return buf;
}

515
#if 0
L
Liu Jicong 已提交
516 517 518 519
typedef struct {
  char    key[TSDB_SUBSCRIBE_KEY_LEN];
  int32_t status;
  int32_t vgNum;
L
Liu Jicong 已提交
520 521 522
  SArray* consumers;      // SArray<SMqSubConsumer>
  SArray* lostConsumers;  // SArray<SMqSubConsumer>
  SArray* unassignedVg;   // SArray<SMqConsumerEp>
L
Liu Jicong 已提交
523 524 525
} SMqSubscribeObj;

static FORCE_INLINE SMqSubscribeObj* tNewSubscribeObj() {
wafwerar's avatar
wafwerar 已提交
526
  SMqSubscribeObj* pSub = taosMemoryCalloc(1, sizeof(SMqSubscribeObj));
L
Liu Jicong 已提交
527
  if (pSub == NULL) {
L
Liu Jicong 已提交
528 529
    return NULL;
  }
L
Liu Jicong 已提交
530

L
Liu Jicong 已提交
531 532 533
  pSub->consumers = taosArrayInit(0, sizeof(SMqSubConsumer));
  if (pSub->consumers == NULL) {
    goto _err;
L
Liu Jicong 已提交
534
  }
L
Liu Jicong 已提交
535 536 537 538 539 540

  pSub->lostConsumers = taosArrayInit(0, sizeof(SMqSubConsumer));
  if (pSub->lostConsumers == NULL) {
    goto _err;
  }

L
Liu Jicong 已提交
541
  pSub->unassignedVg = taosArrayInit(0, sizeof(SMqConsumerEp));
L
Liu Jicong 已提交
542
  if (pSub->unassignedVg == NULL) {
L
Liu Jicong 已提交
543
    goto _err;
L
Liu Jicong 已提交
544
  }
L
Liu Jicong 已提交
545 546 547 548 549

  pSub->key[0] = 0;
  pSub->vgNum = 0;
  pSub->status = 0;

L
Liu Jicong 已提交
550
  return pSub;
L
Liu Jicong 已提交
551 552

_err:
wafwerar's avatar
wafwerar 已提交
553 554 555 556
  taosMemoryFreeClear(pSub->consumers);
  taosMemoryFreeClear(pSub->lostConsumers);
  taosMemoryFreeClear(pSub->unassignedVg);
  taosMemoryFreeClear(pSub);
L
Liu Jicong 已提交
557
  return NULL;
L
Liu Jicong 已提交
558 559 560 561 562
}

static FORCE_INLINE int32_t tEncodeSubscribeObj(void** buf, const SMqSubscribeObj* pSub) {
  int32_t tlen = 0;
  tlen += taosEncodeString(buf, pSub->key);
L
Liu Jicong 已提交
563 564
  tlen += taosEncodeFixedI32(buf, pSub->vgNum);
  tlen += taosEncodeFixedI32(buf, pSub->status);
L
Liu Jicong 已提交
565 566
  int32_t sz;

L
Liu Jicong 已提交
567
  sz = taosArrayGetSize(pSub->consumers);
L
Liu Jicong 已提交
568 569
  tlen += taosEncodeFixedI32(buf, sz);
  for (int32_t i = 0; i < sz; i++) {
L
Liu Jicong 已提交
570 571
    SMqSubConsumer* pSubConsumer = taosArrayGet(pSub->consumers, i);
    tlen += tEncodeSMqSubConsumer(buf, pSubConsumer);
L
Liu Jicong 已提交
572 573
  }

L
Liu Jicong 已提交
574 575 576 577 578 579 580
  sz = taosArrayGetSize(pSub->lostConsumers);
  tlen += taosEncodeFixedI32(buf, sz);
  for (int32_t i = 0; i < sz; i++) {
    SMqSubConsumer* pSubConsumer = taosArrayGet(pSub->lostConsumers, i);
    tlen += tEncodeSMqSubConsumer(buf, pSubConsumer);
  }

L
Liu Jicong 已提交
581 582 583 584 585 586 587 588 589 590 591 592
  sz = taosArrayGetSize(pSub->unassignedVg);
  tlen += taosEncodeFixedI32(buf, sz);
  for (int32_t i = 0; i < sz; i++) {
    SMqConsumerEp* pCEp = taosArrayGet(pSub->unassignedVg, i);
    tlen += tEncodeSMqConsumerEp(buf, pCEp);
  }

  return tlen;
}

static FORCE_INLINE void* tDecodeSubscribeObj(void* buf, SMqSubscribeObj* pSub) {
  buf = taosDecodeStringTo(buf, pSub->key);
L
Liu Jicong 已提交
593 594
  buf = taosDecodeFixedI32(buf, &pSub->vgNum);
  buf = taosDecodeFixedI32(buf, &pSub->status);
L
Liu Jicong 已提交
595 596 597 598

  int32_t sz;

  buf = taosDecodeFixedI32(buf, &sz);
L
Liu Jicong 已提交
599 600
  pSub->consumers = taosArrayInit(sz, sizeof(SMqSubConsumer));
  if (pSub->consumers == NULL) {
L
Liu Jicong 已提交
601 602 603
    return NULL;
  }
  for (int32_t i = 0; i < sz; i++) {
L
Liu Jicong 已提交
604 605 606
    SMqSubConsumer subConsumer = {0};
    buf = tDecodeSMqSubConsumer(buf, &subConsumer);
    taosArrayPush(pSub->consumers, &subConsumer);
L
Liu Jicong 已提交
607 608
  }

L
Liu Jicong 已提交
609 610 611 612 613 614 615 616 617 618 619
  buf = taosDecodeFixedI32(buf, &sz);
  pSub->lostConsumers = taosArrayInit(sz, sizeof(SMqSubConsumer));
  if (pSub->lostConsumers == NULL) {
    return NULL;
  }
  for (int32_t i = 0; i < sz; i++) {
    SMqSubConsumer subConsumer = {0};
    buf = tDecodeSMqSubConsumer(buf, &subConsumer);
    taosArrayPush(pSub->lostConsumers, &subConsumer);
  }

L
Liu Jicong 已提交
620 621 622 623 624 625
  buf = taosDecodeFixedI32(buf, &sz);
  pSub->unassignedVg = taosArrayInit(sz, sizeof(SMqConsumerEp));
  if (pSub->unassignedVg == NULL) {
    return NULL;
  }
  for (int32_t i = 0; i < sz; i++) {
L
Liu Jicong 已提交
626 627 628
    SMqConsumerEp consumerEp = {0};
    buf = tDecodeSMqConsumerEp(buf, &consumerEp);
    taosArrayPush(pSub->unassignedVg, &consumerEp);
L
Liu Jicong 已提交
629 630 631
  }
  return buf;
}
L
Liu Jicong 已提交
632

L
Liu Jicong 已提交
633
static FORCE_INLINE void tDeleteSMqSubscribeObj(SMqSubscribeObj* pSub) {
L
Liu Jicong 已提交
634
  if (pSub->consumers) {
L
Liu Jicong 已提交
635 636
    // taosArrayDestroyEx(pSub->consumers, (void (*)(void*))tDeleteSMqSubConsumer);
    //  taosArrayDestroy(pSub->consumers);
L
Liu Jicong 已提交
637
    pSub->consumers = NULL;
L
Liu Jicong 已提交
638
  }
L
Liu Jicong 已提交
639

L
Liu Jicong 已提交
640
  if (pSub->unassignedVg) {
L
Liu Jicong 已提交
641 642
    // taosArrayDestroyEx(pSub->unassignedVg, (void (*)(void*))tDeleteSMqConsumerEp);
    //  taosArrayDestroy(pSub->unassignedVg);
L
Liu Jicong 已提交
643 644
    pSub->unassignedVg = NULL;
  }
L
Liu Jicong 已提交
645
}
646
#endif
L
Liu Jicong 已提交
647

L
Liu Jicong 已提交
648
typedef struct {
L
Liu Jicong 已提交
649 650 651 652 653 654 655 656 657
  char           name[TSDB_TOPIC_FNAME_LEN];
  char           db[TSDB_DB_FNAME_LEN];
  int64_t        createTime;
  int64_t        updateTime;
  int64_t        uid;
  int64_t        dbUid;
  int32_t        version;
  SRWLatch       lock;
  int32_t        sqlLen;
L
Liu Jicong 已提交
658
  int32_t        astLen;
L
Liu Jicong 已提交
659
  char*          sql;
L
Liu Jicong 已提交
660
  char*          ast;
L
Liu Jicong 已提交
661 662
  char*          physicalPlan;
  SSchemaWrapper schema;
L
Liu Jicong 已提交
663 664
} SMqTopicObj;

665
#if 0
L
Liu Jicong 已提交
666
typedef struct {
L
Liu Jicong 已提交
667
  int64_t  consumerId;
L
Liu Jicong 已提交
668
  int64_t  connId;
L
Liu Jicong 已提交
669
  SRWLatch lock;
L
Liu Jicong 已提交
670
  char     cgroup[TSDB_CGROUP_LEN];
L
Liu Jicong 已提交
671 672
  SArray*  currentTopics;        // SArray<char*>
  SArray*  recentRemovedTopics;  // SArray<char*>
L
Liu Jicong 已提交
673
  int32_t  epoch;
L
Liu Jicong 已提交
674
  // stat
L
Liu Jicong 已提交
675 676 677 678 679 680 681
  int64_t pollCnt;
  // status
  int32_t status;
  // heartbeat from the consumer reset hbStatus to 0
  // each checkConsumerAlive msg add hbStatus by 1
  // if checkConsumerAlive > CONSUMER_REBALANCE_CNT, mask to lost
  int32_t hbStatus;
L
Liu Jicong 已提交
682 683
} SMqConsumerObj;

L
Liu Jicong 已提交
684
static FORCE_INLINE int32_t tEncodeSMqConsumerObj(void** buf, const SMqConsumerObj* pConsumer) {
L
Liu Jicong 已提交
685
  int32_t sz;
L
Liu Jicong 已提交
686 687
  int32_t tlen = 0;
  tlen += taosEncodeFixedI64(buf, pConsumer->consumerId);
L
Liu Jicong 已提交
688
  tlen += taosEncodeFixedI64(buf, pConsumer->connId);
L
Liu Jicong 已提交
689
  tlen += taosEncodeFixedI32(buf, pConsumer->epoch);
L
Liu Jicong 已提交
690
  tlen += taosEncodeFixedI64(buf, pConsumer->pollCnt);
L
Liu Jicong 已提交
691
  tlen += taosEncodeFixedI32(buf, pConsumer->status);
L
Liu Jicong 已提交
692
  tlen += taosEncodeString(buf, pConsumer->cgroup);
L
Liu Jicong 已提交
693 694 695 696 697 698 699 700 701

  sz = taosArrayGetSize(pConsumer->currentTopics);
  tlen += taosEncodeFixedI32(buf, sz);
  for (int32_t i = 0; i < sz; i++) {
    char* topic = taosArrayGetP(pConsumer->currentTopics, i);
    tlen += taosEncodeString(buf, topic);
  }

  sz = taosArrayGetSize(pConsumer->recentRemovedTopics);
L
Liu Jicong 已提交
702 703
  tlen += taosEncodeFixedI32(buf, sz);
  for (int32_t i = 0; i < sz; i++) {
L
Liu Jicong 已提交
704
    char* topic = taosArrayGetP(pConsumer->recentRemovedTopics, i);
L
Liu Jicong 已提交
705
    tlen += taosEncodeString(buf, topic);
L
Liu Jicong 已提交
706 707 708 709 710
  }
  return tlen;
}

static FORCE_INLINE void* tDecodeSMqConsumerObj(void* buf, SMqConsumerObj* pConsumer) {
L
Liu Jicong 已提交
711
  int32_t sz;
L
Liu Jicong 已提交
712
  buf = taosDecodeFixedI64(buf, &pConsumer->consumerId);
L
Liu Jicong 已提交
713
  buf = taosDecodeFixedI64(buf, &pConsumer->connId);
L
Liu Jicong 已提交
714
  buf = taosDecodeFixedI32(buf, &pConsumer->epoch);
L
Liu Jicong 已提交
715
  buf = taosDecodeFixedI64(buf, &pConsumer->pollCnt);
L
Liu Jicong 已提交
716
  buf = taosDecodeFixedI32(buf, &pConsumer->status);
L
Liu Jicong 已提交
717
  buf = taosDecodeStringTo(buf, pConsumer->cgroup);
L
Liu Jicong 已提交
718 719

  buf = taosDecodeFixedI32(buf, &sz);
720
  pConsumer->currentTopics = taosArrayInit(sz, sizeof(void*));
L
Liu Jicong 已提交
721 722 723 724 725 726
  for (int32_t i = 0; i < sz; i++) {
    char* topic;
    buf = taosDecodeString(buf, &topic);
    taosArrayPush(pConsumer->currentTopics, &topic);
  }

L
Liu Jicong 已提交
727
  buf = taosDecodeFixedI32(buf, &sz);
728
  pConsumer->recentRemovedTopics = taosArrayInit(sz, sizeof(void*));
L
Liu Jicong 已提交
729
  for (int32_t i = 0; i < sz; i++) {
L
Liu Jicong 已提交
730 731
    char* topic;
    buf = taosDecodeString(buf, &topic);
L
Liu Jicong 已提交
732
    taosArrayPush(pConsumer->recentRemovedTopics, &topic);
L
Liu Jicong 已提交
733 734 735
  }
  return buf;
}
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861
#endif

enum {
  CONSUMER_UPDATE__TOUCH = 1,
  CONSUMER_UPDATE__ADD,
  CONSUMER_UPDATE__REMOVE,
  CONSUMER_UPDATE__LOST,
  CONSUMER_UPDATE__MODIFY,
};

typedef struct {
  int64_t consumerId;
  char    cgroup[TSDB_CGROUP_LEN];
  int8_t  updateType;  // used only for update
  int32_t epoch;
  int32_t status;
  // hbStatus is not applicable to serialization
  int32_t hbStatus;
  // lock is used for topics update
  SRWLatch lock;
  SArray*  currentTopics;  // SArray<char*>
#if 0
  SArray*  waitingRebTopics;  // SArray<char*>
#endif
  SArray* rebNewTopics;      // SArray<char*>
  SArray* rebRemovedTopics;  // SArray<char*>
} SMqConsumerObj;

SMqConsumerObj* tNewSMqConsumerObj(int64_t consumerId, char cgroup[TSDB_CGROUP_LEN]);
void            tDeleteSMqConsumerObj(SMqConsumerObj* pConsumer);
int32_t         tEncodeSMqConsumerObj(void** buf, const SMqConsumerObj* pConsumer);
void*           tDecodeSMqConsumerObj(const void* buf, SMqConsumerObj* pConsumer);

typedef struct {
  int32_t vgId;
  char*   qmsg;
  // char    topic[TSDB_TOPIC_FNAME_LEN];
  SEpSet epSet;
} SMqVgEp;

SMqVgEp* tCloneSMqVgEp(const SMqVgEp* pVgEp);
void     tDeleteSMqVgEp(SMqVgEp* pVgEp);
int32_t  tEncodeSMqVgEp(void** buf, const SMqVgEp* pVgEp);
void*    tDecodeSMqVgEp(const void* buf, SMqVgEp* pVgEp);

typedef struct {
  int64_t consumerId;  // -1 for unassigned
  SArray* vgs;         // SArray<SMqVgEp*>
} SMqConsumerEpInSub;

SMqConsumerEpInSub* tCloneSMqConsumerEpInSub(const SMqConsumerEpInSub* pEpInSub);
void                tDeleteSMqConsumerEpInSub(SMqConsumerEpInSub* pEpInSub);
int32_t             tEncodeSMqConsumerEpInSub(void** buf, const SMqConsumerEpInSub* pEpInSub);
void*               tDecodeSMqConsumerEpInSub(const void* buf, SMqConsumerEpInSub* pEpInSub);

typedef struct {
  char      key[TSDB_SUBSCRIBE_KEY_LEN];
  SRWLatch  lock;
  int32_t   vgNum;
  SHashObj* consumerHash;  // consumerId -> SMqConsumerEpInSub
} SMqSubscribeObj;

SMqSubscribeObj* tNewSubscribeObj(const char key[TSDB_SUBSCRIBE_KEY_LEN]);
SMqSubscribeObj* tCloneSubscribeObj(const SMqSubscribeObj* pSub);
void             tDeleteSubscribeObj(SMqSubscribeObj* pSub);
int32_t          tEncodeSubscribeObj(void** buf, const SMqSubscribeObj* pSub);
void*            tDecodeSubscribeObj(const void* buf, SMqSubscribeObj* pSub);

typedef struct {
  int32_t epoch;
  SArray* consumers;  // SArray<SMqConsumerEpInSub*>
} SMqSubActionLogEntry;

SMqSubActionLogEntry* tCloneSMqSubActionLogEntry(SMqSubActionLogEntry* pEntry);
void                  tDeleteSMqSubActionLogEntry(SMqSubActionLogEntry* pEntry);
int32_t               tEncodeSMqSubActionLogEntry(void** buf, const SMqSubActionLogEntry* pEntry);
void*                 tDecodeSMqSubActionLogEntry(const void* buf, SMqSubActionLogEntry* pEntry);

typedef struct {
  char    key[TSDB_SUBSCRIBE_KEY_LEN];
  SArray* logs;  // SArray<SMqSubActionLogEntry*>
} SMqSubActionLogObj;

SMqSubActionLogObj* tCloneSMqSubActionLogObj(SMqSubActionLogObj* pLog);
void                tDeleteSMqSubActionLogObj(SMqSubActionLogObj* pLog);
int32_t             tEncodeSMqSubActionLogObj(void** buf, const SMqSubActionLogObj* pLog);
void*               tDecodeSMqSubActionLogObj(const void* buf, SMqSubActionLogObj* pLog);

typedef struct {
  int64_t  consumerId;
  char     cgroup[TSDB_CGROUP_LEN];
  SRWLatch lock;
  SArray*  vgs;  // SArray<SMqVgEp*>
} SMqConsumerEpObj;

SMqConsumerEpObj* tCloneSMqConsumerEpObj(const SMqConsumerEpObj* pConsumerEp);
void              tDeleteSMqConsumerEpObj(SMqConsumerEpObj* pConsumerEp);
int32_t           tEncodeSMqConsumerEpObj(void** buf, const SMqConsumerEpObj* pConsumerEp);
void*             tDecodeSMqConsumerEpObj(const void* buf, SMqConsumerEpObj* pConsumerEp);

typedef struct {
  const SMqSubscribeObj* pOldSub;
  const SMqTopicObj*     pTopic;
  const SMqRebSubscribe* pRebInfo;
} SMqRebInputObj;

typedef struct {
  int64_t  oldConsumerId;
  int64_t  newConsumerId;
  SMqVgEp* pVgEp;
} SMqRebOutputVg;

#if 0
typedef struct {
  int64_t consumerId;
} SMqRebOutputConsumer;
#endif

typedef struct {
  SArray*               rebVgs;            // SArray<SMqRebOutputVg>
  SArray*               newConsumers;      // SArray<int64_t>
  SArray*               removedConsumers;  // SArray<int64_t>
  SArray*               touchedConsumers;  // SArray<int64_t>
  SMqSubscribeObj*      pSub;
  SMqSubActionLogEntry* pLogEntry;
} SMqRebOutputObj;
L
Liu Jicong 已提交
862

L
Liu Jicong 已提交
863
typedef struct {
L
Liu Jicong 已提交
864 865
  char     name[TSDB_TOPIC_FNAME_LEN];
  char     db[TSDB_DB_FNAME_LEN];
L
Liu Jicong 已提交
866
  char     outputSTbName[TSDB_TABLE_FNAME_LEN];
L
Liu Jicong 已提交
867 868 869 870 871
  int64_t  createTime;
  int64_t  updateTime;
  int64_t  uid;
  int64_t  dbUid;
  int32_t  version;
L
Liu Jicong 已提交
872
  int32_t  vgNum;
L
Liu Jicong 已提交
873 874 875
  SRWLatch lock;
  int8_t   status;
  // int32_t  sqlLen;
L
Liu Jicong 已提交
876 877 878
  int8_t         createdBy;      // STREAM_CREATED_BY__USER or SMA
  int32_t        fixedSinkVgId;  // 0 for shuffle
  int64_t        smaId;          // 0 for unused
L
fix  
Liu Jicong 已提交
879 880 881
  int8_t         trigger;
  int32_t        triggerParam;
  int64_t        waterMark;
L
Liu Jicong 已提交
882 883 884 885 886
  char*          sql;
  char*          logicalPlan;
  char*          physicalPlan;
  SArray*        tasks;  // SArray<SArray<SStreamTask>>
  SSchemaWrapper outputSchema;
L
Liu Jicong 已提交
887 888 889 890
} SStreamObj;

int32_t tEncodeSStreamObj(SCoder* pEncoder, const SStreamObj* pObj);
int32_t tDecodeSStreamObj(SCoder* pDecoder, SStreamObj* pObj);
L
Liu Jicong 已提交
891

S
Shengliang Guan 已提交
892 893 894
#ifdef __cplusplus
}
#endif
S
Shengliang Guan 已提交
895

S
Shengliang Guan 已提交
896
#endif /*_TD_MND_DEF_H_*/