Skip to content

Commit

Permalink
feat: add bind vgroup new function
Browse files Browse the repository at this point in the history
  • Loading branch information
DuanKuanJun committed May 27, 2024
1 parent 9bb1cf5 commit 28ad4c5
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
58 changes: 58 additions & 0 deletions case/insertBindVGroup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"filetype": "insert",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"num_of_records_per_req": 200,
"thread_count": 20,
"thread_bind_vgroup": "yes",
"create_table_thread_count": 1,
"confirm_parameter_prompt": "no",
"databases": [
{
"dbinfo": {
"name": "binddb",
"drop": "yes",
"vgroups": 2
},
"super_tables": [
{
"name": "meters",
"child_table_exists": "no",
"childtable_count": 4,
"insert_rows": 100,
"interlace_rows": 10,
"childtable_prefix": "d",
"insert_mode": "taosc",
"timestamp_step": 1000,
"start_timestamp":1500000000000,
"columns": [
{ "type": "bool", "name": "bc"},
{ "type": "float", "name": "fc", "max": 1, "min": 0 },
{ "type": "double", "name": "dc", "max": 1, "min": 0 },
{ "type": "tinyint", "name": "ti", "max": 100, "min": 0 },
{ "type": "smallint", "name": "si", "max": 100, "min": 0 },
{ "type": "int", "name": "ic", "max": 100, "min": 0 },
{ "type": "bigint", "name": "bi", "max": 100, "min": 0 },
{ "type": "utinyint", "name": "uti", "max": 100, "min": 0 },
{ "type": "usmallint", "name": "usi", "max": 100, "min": 0 },
{ "type": "uint", "name": "ui", "max": 100, "min": 0 },
{ "type": "ubigint", "name": "ubi", "max": 100, "min": 0 },
{ "type": "binary", "name": "bin", "len": 32},
{ "type": "nchar", "name": "nch", "len": 64}
],
"tags": [
{"type": "tinyint", "name": "groupid","max": 10,"min": 1},
{"type": "binary", "name": "location", "len": 16,
"values": ["San Francisco", "Los Angles", "San Diego",
"San Jose", "Palo Alto", "Campbell", "Mountain View",
"Sunnyvale", "Santa Clara", "Cupertino"]
}
]
}
]
}
]
}
3 changes: 2 additions & 1 deletion src/benchInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -3729,7 +3729,8 @@ static int startMultiThreadInsertData(SDataBase* database, SSuperTable* stbInfo)
int32_t ret = initInsertThread(database, stbInfo, nthreads, infos, div, mod);
if( ret != 0) {
errorPrint("init insert thread failed. %s.%s\n", database->dbName, stbInfo->stbName);
FREE_RESOURCE();
tmfree(pids);
tmfree(infos);
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion src/benchUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ int convertStringToDatatype(char *type, int length) {
return TSDB_DATA_TYPE_JSON;
} else if (0 == strncasecmp(type, "varchar", length)) {
return TSDB_DATA_TYPE_BINARY;
} else if (0 == strcnasecmp(type, "varbinary", length) {
} else if (0 == strncasecmp(type, "varbinary", length)) {
return TSDB_DATA_TYPE_VARBINARY;
} else {
errorPrint("unknown data type: %s\n", type);
Expand Down

0 comments on commit 28ad4c5

Please sign in to comment.