mockCatalogService.cpp 17.2 KB
Newer Older
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/>.
 */

X
Xiaoyu Wang 已提交
16 17
#include "mockCatalogService.h"

18 19 20 21
#include <iomanip>
#include <iostream>
#include <map>

X
Xiaoyu Wang 已提交
22
#include "tdatablock.h"
23
#include "tname.h"
24 25
#include "ttypes.h"

26
std::unique_ptr<MockCatalogService> g_mockCatalogService;
27 28

class TableBuilder : public ITableBuilder {
X
Xiaoyu Wang 已提交
29
 public:
30
  virtual TableBuilder& addColumn(const std::string& name, int8_t type, int32_t bytes) {
X
Xiaoyu Wang 已提交
31
    assert(colId_ <= schema()->tableInfo.numOfTags + schema()->tableInfo.numOfColumns);
X
Xiaoyu Wang 已提交
32
    SSchema* col = schema()->schema + (colId_ - 1);
33
    col->type = type;
34
    col->colId = colId_++;
35 36
    col->bytes = bytes;
    strcpy(col->name, name.c_str());
37
    rowsize_ += bytes;
38 39 40 41
    return *this;
  }

  virtual TableBuilder& setVgid(int16_t vgid) {
42
    schema()->vgId = vgid;
H
Haojun Liao 已提交
43

X
Xiaoyu Wang 已提交
44
    SVgroupInfo vgroup = {vgid, 0, 0, {0}, 0};
wafwerar's avatar
wafwerar 已提交
45 46 47
    addEpIntoEpSet(&vgroup.epSet, "dnode_1", 6030);
    addEpIntoEpSet(&vgroup.epSet, "dnode_2", 6030);
    addEpIntoEpSet(&vgroup.epSet, "dnode_3", 6030);
L
Liu Jicong 已提交
48
    vgroup.epSet.inUse = 0;
H
Haojun Liao 已提交
49 50

    meta_->vgs.emplace_back(vgroup);
51 52 53 54
    return *this;
  }

  virtual TableBuilder& setPrecision(uint8_t precision) {
55
    schema()->tableInfo.precision = precision;
56 57 58
    return *this;
  }

X
Xiaoyu Wang 已提交
59
  virtual void done() { schema()->tableInfo.rowSize = rowsize_; }
60

X
Xiaoyu Wang 已提交
61
 private:
62 63 64
  friend class MockCatalogServiceImpl;

  static std::unique_ptr<TableBuilder> createTableBuilder(int8_t tableType, int32_t numOfColumns, int32_t numOfTags) {
X
Xiaoyu Wang 已提交
65 66
    STableMeta* meta =
        (STableMeta*)taosMemoryCalloc(1, sizeof(STableMeta) + sizeof(SSchema) * (numOfColumns + numOfTags));
67 68 69 70 71 72 73 74 75
    if (nullptr == meta) {
      throw std::bad_alloc();
    }
    meta->tableType = tableType;
    meta->tableInfo.numOfTags = numOfTags;
    meta->tableInfo.numOfColumns = numOfColumns;
    return std::unique_ptr<TableBuilder>(new TableBuilder(meta));
  }

X
Xiaoyu Wang 已提交
76
  TableBuilder(STableMeta* schemaMeta) : colId_(1), rowsize_(0), meta_(new MockTableMeta()) {
X
Xiaoyu Wang 已提交
77
    meta_->schema = schemaMeta;
78 79
  }

X
Xiaoyu Wang 已提交
80
  STableMeta* schema() { return meta_->schema; }
81

X
Xiaoyu Wang 已提交
82
  std::shared_ptr<MockTableMeta> table() { return meta_; }
83

84
  col_id_t                       colId_;
X
Xiaoyu Wang 已提交
85
  int32_t                        rowsize_;
86
  std::shared_ptr<MockTableMeta> meta_;
87 88 89
};

class MockCatalogServiceImpl {
X
Xiaoyu Wang 已提交
90
 public:
91 92
  static const int32_t numOfDataTypes = sizeof(tDataTypes) / sizeof(tDataTypes[0]);

X
Xiaoyu Wang 已提交
93
  MockCatalogServiceImpl() : id_(1) {}
94

X
Xiaoyu Wang 已提交
95
  int32_t catalogGetHandle() const { return 0; }
96

H
Haojun Liao 已提交
97
  int32_t catalogGetTableMeta(const SName* pTableName, STableMeta** pTableMeta) const {
98
    std::unique_ptr<STableMeta> table;
H
Haojun Liao 已提交
99

X
Xiaoyu Wang 已提交
100 101
    char db[TSDB_DB_NAME_LEN] = {0};
    tNameGetDbName(pTableName, db);
H
Haojun Liao 已提交
102 103

    const char* tname = tNameGetTableName(pTableName);
X
Xiaoyu Wang 已提交
104
    int32_t     code = copyTableSchemaMeta(db, tname, &table);
105 106 107
    if (TSDB_CODE_SUCCESS != code) {
      return code;
    }
108
    *pTableMeta = table.release();
109
    return TSDB_CODE_SUCCESS;
110 111
  }

H
Haojun Liao 已提交
112
  int32_t catalogGetTableHashVgroup(const SName* pTableName, SVgroupInfo* vgInfo) const {
113 114
    vgInfo->vgId = 1;
    return TSDB_CODE_SUCCESS;
X
Xiaoyu Wang 已提交
115 116
  }

X
bugfix  
Xiaoyu Wang 已提交
117 118 119 120
  int32_t catalogGetTableDistVgInfo(const SName* pTableName, SArray** vgList) const {
    char db[TSDB_DB_NAME_LEN] = {0};
    tNameGetDbName(pTableName, db);
    return copyTableVgroup(db, tNameGetTableName(pTableName), vgList);
H
Haojun Liao 已提交
121 122
  }

123 124 125 126 127 128 129 130 131
  int32_t catalogGetUdfInfo(const std::string& funcName, SFuncInfo* pInfo) const {
    auto it = udf_.find(funcName);
    if (udf_.end() == it) {
      return TSDB_CODE_FAILED;
    }
    memcpy(pInfo, it->second.get(), sizeof(SFuncInfo));
    return TSDB_CODE_SUCCESS;
  }

132 133 134 135 136
  int32_t catalogGetAllMeta(const SCatalogReq* pCatalogReq, SMetaData* pMetaData) const {
    int32_t code = getAllTableMeta(pCatalogReq->pTableMeta, &pMetaData->pTableMeta);
    if (TSDB_CODE_SUCCESS == code) {
      code = getAllTableVgroup(pCatalogReq->pTableHash, &pMetaData->pTableHash);
    }
137 138 139 140 141 142
    if (TSDB_CODE_SUCCESS == code) {
      code = getAllDbVgroup(pCatalogReq->pDbVgroup, &pMetaData->pDbVgroup);
    }
    if (TSDB_CODE_SUCCESS == code) {
      code = getAllDbCfg(pCatalogReq->pDbCfg, &pMetaData->pDbCfg);
    }
143 144 145 146 147 148
    if (TSDB_CODE_SUCCESS == code) {
      code = getAllDbInfo(pCatalogReq->pDbInfo, &pMetaData->pDbInfo);
    }
    if (TSDB_CODE_SUCCESS == code) {
      code = getAllUserAuth(pCatalogReq->pUser, &pMetaData->pUser);
    }
149 150 151
    if (TSDB_CODE_SUCCESS == code) {
      code = getAllUdf(pCatalogReq->pUdf, &pMetaData->pUdfList);
    }
152 153 154
    return code;
  }

X
Xiaoyu Wang 已提交
155 156
  TableBuilder& createTableBuilder(const std::string& db, const std::string& tbname, int8_t tableType,
                                   int32_t numOfColumns, int32_t numOfTags) {
157
    builder_ = TableBuilder::createTableBuilder(tableType, numOfColumns, numOfTags);
158 159
    meta_[db][tbname] = builder_->table();
    meta_[db][tbname]->schema->uid = id_++;
160 161 162
    return *(builder_.get());
  }

163 164
  void createSubTable(const std::string& db, const std::string& stbname, const std::string& tbname, int16_t vgid) {
    std::unique_ptr<STableMeta> table;
165 166
    if (TSDB_CODE_SUCCESS != copyTableSchemaMeta(db, stbname, &table)) {
      throw std::runtime_error("copyTableSchemaMeta failed");
167
    }
168
    meta_[db][tbname].reset(new MockTableMeta());
X
Xiaoyu Wang 已提交
169
    meta_[db][tbname]->schema = table.release();
170
    meta_[db][tbname]->schema->uid = id_++;
171
    meta_[db][tbname]->schema->tableType = TSDB_CHILD_TABLE;
H
Haojun Liao 已提交
172

X
Xiaoyu Wang 已提交
173
    SVgroupInfo vgroup = {vgid, 0, 0, {0}, 0};
L
Liu Jicong 已提交
174 175 176 177
    addEpIntoEpSet(&vgroup.epSet, "dnode_1", 6030);
    addEpIntoEpSet(&vgroup.epSet, "dnode_2", 6030);
    addEpIntoEpSet(&vgroup.epSet, "dnode_3", 6030);
    vgroup.epSet.inUse = 0;
H
Haojun Liao 已提交
178 179

    meta_[db][tbname]->vgs.emplace_back(vgroup);
180
    // super table
H
Haojun Liao 已提交
181
    meta_[db][stbname]->vgs.emplace_back(vgroup);
182 183
  }

184
  void showTables() const {
X
Xiaoyu Wang 已提交
185 186 187 188 189
// number of forward fills
#define NOF(n) ((n) / 2)
// number of backward fills
#define NOB(n) ((n) % 2 ? (n) / 2 + 1 : (n) / 2)
// center aligned
wafwerar's avatar
wafwerar 已提交
190 191
#define CA(n, s) std::setw(NOF((n) - int((s).length()))) << "" << (s) \
              << std::setw(NOB((n) - int((s).length()))) << "" << "|"
X
Xiaoyu Wang 已提交
192 193 194 195 196 197 198 199 200 201 202 203 204 205
// string field length
#define SFL 20
// string field header
#define SH(h) CA(SFL, std::string(h))
// string field
#define SF(n) CA(SFL, n)
// integer field length
#define IFL 10
// integer field header
#define IH(i) CA(IFL, std::string(i))
// integer field
#define IF(i) CA(IFL, std::to_string(i))
// split line
#define SL(sn, in) std::setfill('=') << std::setw((sn) * (SFL + 1) + (in) * (IFL + 1)) << "" << std::setfill(' ')
206 207

    for (const auto& db : meta_) {
208
      std::cout << "Databse:" << db.first << std::endl;
209
      std::cout << SH("Table") << SH("Type") << SH("Precision") << IH("Vgid") << IH("RowSize") << std::endl;
210
      std::cout << SL(3, 1) << std::endl;
211
      for (const auto& table : db.second) {
212
        const auto& schema = table.second->schema;
X
Xiaoyu Wang 已提交
213 214
        std::cout << SF(table.first) << SF(ttToString(schema->tableType)) << SF(pToString(schema->tableInfo.precision))
                  << IF(schema->vgId) << IF(schema->tableInfo.rowSize) << std::endl;
215 216 217 218 219 220
      }
      std::cout << std::endl;
    }

    for (const auto& db : meta_) {
      for (const auto& table : db.second) {
221
        const auto& schema = table.second->schema;
222 223 224
        std::cout << "Table:" << table.first << std::endl;
        std::cout << SH("Field") << SH("Type") << SH("DataType") << IH("Bytes") << std::endl;
        std::cout << SL(3, 1) << std::endl;
225 226
        int16_t numOfColumns = schema->tableInfo.numOfColumns;
        int16_t numOfFields = numOfColumns + schema->tableInfo.numOfTags;
227
        for (int16_t i = 0; i < numOfFields; ++i) {
228
          const SSchema* col = schema->schema + i;
X
Xiaoyu Wang 已提交
229 230
          std::cout << SF(std::string(col->name)) << SH(ftToString(i, numOfColumns)) << SH(dtToString(col->type))
                    << IF(col->bytes) << std::endl;
231 232
        }
        std::cout << std::endl;
233 234 235 236
      }
    }
  }

237 238 239 240 241 242 243 244
  void createFunction(const std::string& func, int8_t funcType, int8_t outputType, int32_t outputLen, int32_t bufSize) {
    std::shared_ptr<SFuncInfo> info(new SFuncInfo);
    strcpy(info->name, func.c_str());
    info->funcType = funcType;
    info->scriptType = TSDB_FUNC_SCRIPT_BIN_LIB;
    info->outputType = outputType;
    info->outputLen = outputLen;
    info->bufSize = bufSize;
wafwerar's avatar
wafwerar 已提交
245 246
    info->pCode = nullptr;
    info->pComment = nullptr;
247
    udf_.insert(std::make_pair(func, info));
248 249
  }

X
Xiaoyu Wang 已提交
250
 private:
251
  typedef std::map<std::string, std::shared_ptr<MockTableMeta>> TableMetaCache;
X
Xiaoyu Wang 已提交
252
  typedef std::map<std::string, TableMetaCache>                 DbMetaCache;
253
  typedef std::map<std::string, std::shared_ptr<SFuncInfo>>     UdfMetaCache;
254

255 256 257 258 259 260 261 262
  std::string toDbname(const std::string& dbFullName) const {
    std::string::size_type n = dbFullName.find(".");
    if (n == std::string::npos) {
      return dbFullName;
    }
    return dbFullName.substr(n + 1);
  }

263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
  std::string ttToString(int8_t tableType) const {
    switch (tableType) {
      case TSDB_SUPER_TABLE:
        return "super table";
      case TSDB_CHILD_TABLE:
        return "child table";
      case TSDB_NORMAL_TABLE:
        return "normal table";
      default:
        return "unknown";
    }
  }

  std::string pToString(uint8_t precision) const {
    switch (precision) {
      case TSDB_TIME_PRECISION_MILLI:
        return "millisecond";
      case TSDB_TIME_PRECISION_MICRO:
        return "microsecond";
      case TSDB_TIME_PRECISION_NANO:
        return "nanosecond";
      default:
        return "unknown";
    }
  }

X
Xiaoyu Wang 已提交
289
  std::string dtToString(int8_t type) const { return tDataTypes[type].name; }
290

291
  std::string ftToString(int16_t colid, int16_t numOfColumns) const {
292
    return (0 == colid ? "column" : (colid < numOfColumns ? "column" : "tag"));
293 294
  }

X
Xiaoyu Wang 已提交
295
  STableMeta* getTableSchemaMeta(const std::string& db, const std::string& tbname) const {
296
    std::shared_ptr<MockTableMeta> table = getTableMeta(db, tbname);
X
Xiaoyu Wang 已提交
297
    return table ? table->schema : nullptr;
298 299
  }

X
Xiaoyu Wang 已提交
300 301
  int32_t copyTableSchemaMeta(const std::string& db, const std::string& tbname,
                              std::unique_ptr<STableMeta>* dst) const {
X
Xiaoyu Wang 已提交
302 303
    STableMeta* src = getTableSchemaMeta(db, tbname);
    if (nullptr == src) {
304 305 306
      return TSDB_CODE_TSC_INVALID_TABLE_NAME;
    }
    int32_t len = sizeof(STableMeta) + sizeof(SSchema) * (src->tableInfo.numOfTags + src->tableInfo.numOfColumns);
wafwerar's avatar
wafwerar 已提交
307
    dst->reset((STableMeta*)taosMemoryCalloc(1, len));
308 309 310
    if (!dst) {
      return TSDB_CODE_TSC_OUT_OF_MEMORY;
    }
X
Xiaoyu Wang 已提交
311
    memcpy(dst->get(), src, len);
312 313 314
    return TSDB_CODE_SUCCESS;
  }

X
bugfix  
Xiaoyu Wang 已提交
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335
  int32_t copyTableVgroup(const std::string& db, const std::string& tbname, SVgroupInfo* vg) const {
    std::shared_ptr<MockTableMeta> table = getTableMeta(db, tbname);
    if (table->vgs.empty()) {
      return TSDB_CODE_SUCCESS;
    }
    memcpy(vg, &(table->vgs[0]), sizeof(SVgroupInfo));
    return TSDB_CODE_SUCCESS;
  }

  int32_t copyTableVgroup(const std::string& db, const std::string& tbname, SArray** vgList) const {
    std::shared_ptr<MockTableMeta> table = getTableMeta(db, tbname);
    if (table->vgs.empty()) {
      return TSDB_CODE_SUCCESS;
    }
    *vgList = taosArrayInit(table->vgs.size(), sizeof(SVgroupInfo));
    for (const SVgroupInfo& vg : table->vgs) {
      taosArrayPush(*vgList, &vg);
    }
    return TSDB_CODE_SUCCESS;
  }

336 337 338 339 340 341 342 343 344 345 346 347
  std::shared_ptr<MockTableMeta> getTableMeta(const std::string& db, const std::string& tbname) const {
    DbMetaCache::const_iterator it = meta_.find(db);
    if (meta_.end() == it) {
      return std::shared_ptr<MockTableMeta>();
    }
    TableMetaCache::const_iterator tit = it->second.find(tbname);
    if (it->second.end() == tit) {
      return std::shared_ptr<MockTableMeta>();
    }
    return tit->second;
  }

348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
  int32_t getAllTableMeta(SArray* pTableMetaReq, SArray** pTableMetaData) const {
    int32_t code = TSDB_CODE_SUCCESS;
    if (NULL != pTableMetaReq) {
      int32_t ntables = taosArrayGetSize(pTableMetaReq);
      *pTableMetaData = taosArrayInit(ntables, POINTER_BYTES);
      for (int32_t i = 0; i < ntables; ++i) {
        STableMeta* pMeta = NULL;
        code = catalogGetTableMeta((const SName*)taosArrayGet(pTableMetaReq, i), &pMeta);
        if (TSDB_CODE_SUCCESS == code) {
          taosArrayPush(*pTableMetaData, &pMeta);
        } else {
          break;
        }
      }
    }
    return code;
  }

  int32_t getAllTableVgroup(SArray* pTableVgroupReq, SArray** pTableVgroupData) const {
    int32_t code = TSDB_CODE_SUCCESS;
    if (NULL != pTableVgroupReq) {
      int32_t ntables = taosArrayGetSize(pTableVgroupReq);
370
      *pTableVgroupData = taosArrayInit(ntables, sizeof(SVgroupInfo));
371
      for (int32_t i = 0; i < ntables; ++i) {
372 373
        SVgroupInfo vgInfo = {0};
        code = catalogGetTableHashVgroup((const SName*)taosArrayGet(pTableVgroupReq, i), &vgInfo);
374
        if (TSDB_CODE_SUCCESS == code) {
375
          taosArrayPush(*pTableVgroupData, &vgInfo);
376 377 378 379 380 381 382 383
        } else {
          break;
        }
      }
    }
    return code;
  }

384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
  int32_t getAllDbVgroup(SArray* pDbVgroupReq, SArray** pDbVgroupData) const {
    int32_t code = TSDB_CODE_SUCCESS;
    if (NULL != pDbVgroupReq) {
      int32_t ndbs = taosArrayGetSize(pDbVgroupReq);
      *pDbVgroupData = taosArrayInit(ndbs, POINTER_BYTES);
      for (int32_t i = 0; i < ndbs; ++i) {
        int64_t zeroVg = 0;
        taosArrayPush(*pDbVgroupData, &zeroVg);
      }
    }
    return code;
  }

  int32_t getAllDbCfg(SArray* pDbCfgReq, SArray** pDbCfgData) const {
    int32_t code = TSDB_CODE_SUCCESS;
    if (NULL != pDbCfgReq) {
      int32_t ndbs = taosArrayGetSize(pDbCfgReq);
      *pDbCfgData = taosArrayInit(ndbs, sizeof(SDbCfgInfo));
      for (int32_t i = 0; i < ndbs; ++i) {
        SDbCfgInfo dbCfg = {0};
        taosArrayPush(*pDbCfgData, &dbCfg);
      }
    }
    return code;
  }

410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
  int32_t getAllDbInfo(SArray* pDbInfoReq, SArray** pDbInfoData) const {
    int32_t code = TSDB_CODE_SUCCESS;
    if (NULL != pDbInfoReq) {
      int32_t ndbs = taosArrayGetSize(pDbInfoReq);
      *pDbInfoData = taosArrayInit(ndbs, sizeof(SDbCfgInfo));
      for (int32_t i = 0; i < ndbs; ++i) {
        SDbInfo dbInfo = {0};
        taosArrayPush(*pDbInfoData, &dbInfo);
      }
    }
    return code;
  }

  int32_t getAllUserAuth(SArray* pUserAuthReq, SArray** pUserAuthData) const {
    int32_t code = TSDB_CODE_SUCCESS;
    if (NULL != pUserAuthReq) {
      int32_t num = taosArrayGetSize(pUserAuthReq);
      *pUserAuthData = taosArrayInit(num, sizeof(bool));
      for (int32_t i = 0; i < num; ++i) {
        bool pass = true;
        taosArrayPush(*pUserAuthData, &pass);
      }
    }
    return code;
  }

436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
  int32_t getAllUdf(SArray* pUdfReq, SArray** pUdfData) const {
    int32_t code = TSDB_CODE_SUCCESS;
    if (NULL != pUdfReq) {
      int32_t num = taosArrayGetSize(pUdfReq);
      *pUdfData = taosArrayInit(num, sizeof(SFuncInfo));
      for (int32_t i = 0; i < num; ++i) {
        SFuncInfo info = {0};
        code = catalogGetUdfInfo((char*)taosArrayGet(pUdfReq, i), &info);
        if (TSDB_CODE_SUCCESS == code) {
          taosArrayPush(*pUdfData, &info);
        } else {
          break;
        }
      }
    }
    return code;
  }

X
Xiaoyu Wang 已提交
454
  uint64_t                      id_;
455
  std::unique_ptr<TableBuilder> builder_;
X
Xiaoyu Wang 已提交
456
  DbMetaCache                   meta_;
457
  UdfMetaCache                  udf_;
458 459
};

X
Xiaoyu Wang 已提交
460
MockCatalogService::MockCatalogService() : impl_(new MockCatalogServiceImpl()) {}
461

X
Xiaoyu Wang 已提交
462
MockCatalogService::~MockCatalogService() {}
463

X
Xiaoyu Wang 已提交
464 465
ITableBuilder& MockCatalogService::createTableBuilder(const std::string& db, const std::string& tbname,
                                                      int8_t tableType, int32_t numOfColumns, int32_t numOfTags) {
466 467 468
  return impl_->createTableBuilder(db, tbname, tableType, numOfColumns, numOfTags);
}

X
Xiaoyu Wang 已提交
469 470
void MockCatalogService::createSubTable(const std::string& db, const std::string& stbname, const std::string& tbname,
                                        int16_t vgid) {
471 472 473
  impl_->createSubTable(db, stbname, tbname, vgid);
}

X
Xiaoyu Wang 已提交
474
void MockCatalogService::showTables() const { impl_->showTables(); }
475

476 477 478
void MockCatalogService::createFunction(const std::string& func, int8_t funcType, int8_t outputType, int32_t outputLen,
                                        int32_t bufSize) {
  impl_->createFunction(func, funcType, outputType, outputLen, bufSize);
479 480
}

H
Haojun Liao 已提交
481 482
int32_t MockCatalogService::catalogGetTableMeta(const SName* pTableName, STableMeta** pTableMeta) const {
  return impl_->catalogGetTableMeta(pTableName, pTableMeta);
483 484
}

H
Haojun Liao 已提交
485 486
int32_t MockCatalogService::catalogGetTableHashVgroup(const SName* pTableName, SVgroupInfo* vgInfo) const {
  return impl_->catalogGetTableHashVgroup(pTableName, vgInfo);
H
Haojun Liao 已提交
487 488 489 490
}

int32_t MockCatalogService::catalogGetTableDistVgInfo(const SName* pTableName, SArray** pVgList) const {
  return impl_->catalogGetTableDistVgInfo(pTableName, pVgList);
X
Xiaoyu Wang 已提交
491
}
492

493 494 495 496
int32_t MockCatalogService::catalogGetUdfInfo(const std::string& funcName, SFuncInfo* pInfo) const {
  return impl_->catalogGetUdfInfo(funcName, pInfo);
}

497 498 499
int32_t MockCatalogService::catalogGetAllMeta(const SCatalogReq* pCatalogReq, SMetaData* pMetaData) const {
  return impl_->catalogGetAllMeta(pCatalogReq, pMetaData);
}