Skip to content

Commit

Permalink
feat: add pre_load_tb_meta options
Browse files Browse the repository at this point in the history
  • Loading branch information
DuanKuanJun committed May 17, 2024
1 parent 655f4c4 commit 28e814c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions inc/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@ typedef struct SArguments_S {
enum CONTINUE_IF_FAIL_MODE continueIfFail;
bool mistMode;
bool escape_character;
bool pre_load_tb_meta;
} SArguments;

typedef struct SBenchConn {
Expand Down
4 changes: 4 additions & 0 deletions src/benchInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,9 +1504,13 @@ static int64_t getDisorderTs(SSuperTable *stbInfo, int *disorderRange) {

void loadChildTableInfo(threadInfo* pThreadInfo) {
SSuperTable *stbInfo = pThreadInfo->stbInfo;
if(!g_arguments->pre_load_tb_meta) {
return ;
}
if(pThreadInfo->conn == NULL) {
return ;
}

char *db = pThreadInfo->dbInfo->dbName;
int64_t cnt = pThreadInfo->end_table_to - pThreadInfo->start_table_from;

Expand Down
8 changes: 8 additions & 0 deletions src/benchJsonOpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,14 @@ static int getMetaFromInsertJsonFile(tools_cJSON *json) {
}
}

g_arguments->pre_load_tb_meta = false;
tools_cJSON *preLoad = tools_cJSON_GetObjectItem(json, "pre_load_tb_meta");
if (tools_cJSON_IsString(preLoad)) {
if (0 == strcasecmp(preLoad->valuestring, "yes")) {
g_arguments->pre_load_tb_meta = true;
}
}

tools_cJSON *resultfile = tools_cJSON_GetObjectItem(json, "result_file");
if (resultfile && resultfile->type == tools_cJSON_String
&& resultfile->valuestring != NULL) {
Expand Down

0 comments on commit 28e814c

Please sign in to comment.