Merge remote-tracking branch 'origin/3.0' into feature/3.0_liaohj
This commit is contained in:
commit
30602b8cfb
|
@ -17,6 +17,7 @@ include(${TD_SUPPORT_DIR}/cmake.platform)
|
||||||
include(${TD_SUPPORT_DIR}/cmake.define)
|
include(${TD_SUPPORT_DIR}/cmake.define)
|
||||||
include(${TD_SUPPORT_DIR}/cmake.options)
|
include(${TD_SUPPORT_DIR}/cmake.options)
|
||||||
include(${TD_SUPPORT_DIR}/cmake.version)
|
include(${TD_SUPPORT_DIR}/cmake.version)
|
||||||
|
include(${TD_SUPPORT_DIR}/cmake.install)
|
||||||
|
|
||||||
# contrib
|
# contrib
|
||||||
add_subdirectory(contrib)
|
add_subdirectory(contrib)
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
#set output directory
|
||||||
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build/lib)
|
||||||
|
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build/bin)
|
||||||
|
SET(TD_TESTS_OUTPUT_DIR ${PROJECT_BINARY_DIR}/test)
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Project source directory: " ${PROJECT_SOURCE_DIR})
|
||||||
|
MESSAGE(STATUS "Project binary files output path: " ${PROJECT_BINARY_DIR})
|
||||||
|
MESSAGE(STATUS "Project executable files output path: " ${EXECUTABLE_OUTPUT_PATH})
|
||||||
|
MESSAGE(STATUS "Project library files output path: " ${LIBRARY_OUTPUT_PATH})
|
||||||
|
|
||||||
if (NOT DEFINED TD_GRANT)
|
if (NOT DEFINED TD_GRANT)
|
||||||
SET(TD_GRANT FALSE)
|
SET(TD_GRANT FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
IF (TD_LINUX)
|
||||||
|
SET(TD_MAKE_INSTALL_SH "${TD_SOURCE_DIR}/packaging/make_install.sh")
|
||||||
|
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
|
||||||
|
INSTALL(CODE "execute_process(COMMAND bash ${TD_MAKE_INSTALL_SH} ${TD_SOURCE_DIR} ${PROJECT_BINARY_DIR} Linux ${TD_VER_NUMBER})")
|
||||||
|
ELSEIF (TD_WINDOWS)
|
||||||
|
SET(CMAKE_INSTALL_PREFIX C:/TDengine)
|
||||||
|
|
||||||
|
INSTALL(DIRECTORY ${TD_SOURCE_DIR}/src/connector/go DESTINATION connector)
|
||||||
|
INSTALL(DIRECTORY ${TD_SOURCE_DIR}/src/connector/nodejs DESTINATION connector)
|
||||||
|
INSTALL(DIRECTORY ${TD_SOURCE_DIR}/src/connector/python DESTINATION connector)
|
||||||
|
INSTALL(DIRECTORY ${TD_SOURCE_DIR}/src/connector/C\# DESTINATION connector)
|
||||||
|
INSTALL(DIRECTORY ${TD_SOURCE_DIR}/examples DESTINATION .)
|
||||||
|
INSTALL(FILES ${TD_SOURCE_DIR}/packaging/cfg/taos.cfg DESTINATION cfg)
|
||||||
|
INSTALL(FILES ${TD_SOURCE_DIR}/src/inc/taos.h DESTINATION include)
|
||||||
|
INSTALL(FILES ${TD_SOURCE_DIR}/src/inc/taoserror.h DESTINATION include)
|
||||||
|
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.lib DESTINATION driver)
|
||||||
|
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos_static.lib DESTINATION driver)
|
||||||
|
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.exp DESTINATION driver)
|
||||||
|
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.dll DESTINATION driver)
|
||||||
|
|
||||||
|
IF (TD_MVN_INSTALLED)
|
||||||
|
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.38-dist.jar DESTINATION connector/jdbc)
|
||||||
|
ENDIF ()
|
||||||
|
ELSEIF (TD_DARWIN)
|
||||||
|
SET(TD_MAKE_INSTALL_SH "${TD_SOURCE_DIR}/packaging/tools/make_install.sh")
|
||||||
|
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
|
||||||
|
INSTALL(CODE "execute_process(COMMAND bash ${TD_MAKE_INSTALL_SH} ${TD_SOURCE_DIR} ${PROJECT_BINARY_DIR} Darwin ${TD_VER_NUMBER})")
|
||||||
|
ENDIF ()
|
|
@ -179,15 +179,58 @@ static int print_result(char *tbname, TAOS_RES* res, int block) {
|
||||||
warnPrint("%s", "call taos_fetch_block()\n");
|
warnPrint("%s", "call taos_fetch_block()\n");
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
while ((rows = taos_fetch_block(res, &row))) {
|
while ((rows = taos_fetch_block(res, &row))) {
|
||||||
|
int *lengths = taos_fetch_lengths(res);
|
||||||
for (int f = 0; f < num_fields; f++) {
|
for (int f = 0; f < num_fields; f++) {
|
||||||
if ((fields[f].type != TSDB_DATA_TYPE_VARCHAR)
|
if ((fields[f].type != TSDB_DATA_TYPE_VARCHAR)
|
||||||
&& (fields[f].type != TSDB_DATA_TYPE_NCHAR)
|
&& (fields[f].type != TSDB_DATA_TYPE_NCHAR)
|
||||||
&& (fields[f].type != TSDB_DATA_TYPE_JSON)) {
|
&& (fields[f].type != TSDB_DATA_TYPE_JSON)) {
|
||||||
printf("col%d type is %d, no need get offset\n",
|
printf("col%d type is %d, no need get offset\n",
|
||||||
f, fields[f].type);
|
f, fields[f].type);
|
||||||
continue;
|
for (int64_t c = 0; c < rows; c++) {
|
||||||
|
switch(fields[f].type) {
|
||||||
|
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||||
|
if (taos_is_null(res, c, f)) {
|
||||||
|
printf("col%d, row: %"PRId64" "
|
||||||
|
"value: NULL\n", f, c);
|
||||||
|
} else {
|
||||||
|
printf("col%d, row: %"PRId64", "
|
||||||
|
"value: %"PRId64"\n",
|
||||||
|
f, c,
|
||||||
|
*(int64_t*)(row[f]+c*sizeof(int64_t)));
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TSDB_DATA_TYPE_INT:
|
||||||
|
if (taos_is_null(res, c, f)) {
|
||||||
|
printf("col%d, row: %"PRId64" "
|
||||||
|
"value: NULL\n", f, c);
|
||||||
|
} else {
|
||||||
|
printf("col%d, row: %"PRId64", "
|
||||||
|
"value: %d\n",
|
||||||
|
f, c,
|
||||||
|
*(int32_t*)(row[f]+c*sizeof(int32_t)));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TSDB_DATA_TYPE_FLOAT:
|
||||||
|
if (taos_is_null(res, c, f)) {
|
||||||
|
printf("col%d, row: %"PRId64" "
|
||||||
|
"value: NULL\n", f, c);
|
||||||
|
} else {
|
||||||
|
printf("col%d, row: %"PRId64", "
|
||||||
|
"value: %f\n",
|
||||||
|
f, c,
|
||||||
|
*(float*)(row[f]+c*sizeof(float)));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf("type: %d is not processed\n",
|
||||||
|
fields[f].type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
int *offsets = taos_get_column_data_offset(res, f);
|
int *offsets = taos_get_column_data_offset(res, f);
|
||||||
if (offsets) {
|
if (offsets) {
|
||||||
for (int c = 0; c < rows; c++) {
|
for (int c = 0; c < rows; c++) {
|
||||||
|
@ -204,10 +247,11 @@ static int print_result(char *tbname, TAOS_RES* res, int block) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
errorPrint("%s() LN%d: col%d's lengths is NULL\n",
|
errorPrint("%s() LN%d: col%d's offsets is NULL\n",
|
||||||
__func__, __LINE__, f);
|
__func__, __LINE__, f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
num_rows += rows;
|
num_rows += rows;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -195,45 +195,46 @@
|
||||||
#define TK_CAST 177
|
#define TK_CAST 177
|
||||||
#define TK_NOW 178
|
#define TK_NOW 178
|
||||||
#define TK_TODAY 179
|
#define TK_TODAY 179
|
||||||
#define TK_COUNT 180
|
#define TK_TIMEZONE 180
|
||||||
#define TK_FIRST 181
|
#define TK_COUNT 181
|
||||||
#define TK_LAST 182
|
#define TK_FIRST 182
|
||||||
#define TK_LAST_ROW 183
|
#define TK_LAST 183
|
||||||
#define TK_BETWEEN 184
|
#define TK_LAST_ROW 184
|
||||||
#define TK_IS 185
|
#define TK_BETWEEN 185
|
||||||
#define TK_NK_LT 186
|
#define TK_IS 186
|
||||||
#define TK_NK_GT 187
|
#define TK_NK_LT 187
|
||||||
#define TK_NK_LE 188
|
#define TK_NK_GT 188
|
||||||
#define TK_NK_GE 189
|
#define TK_NK_LE 189
|
||||||
#define TK_NK_NE 190
|
#define TK_NK_GE 190
|
||||||
#define TK_MATCH 191
|
#define TK_NK_NE 191
|
||||||
#define TK_NMATCH 192
|
#define TK_MATCH 192
|
||||||
#define TK_CONTAINS 193
|
#define TK_NMATCH 193
|
||||||
#define TK_JOIN 194
|
#define TK_CONTAINS 194
|
||||||
#define TK_INNER 195
|
#define TK_JOIN 195
|
||||||
#define TK_SELECT 196
|
#define TK_INNER 196
|
||||||
#define TK_DISTINCT 197
|
#define TK_SELECT 197
|
||||||
#define TK_WHERE 198
|
#define TK_DISTINCT 198
|
||||||
#define TK_PARTITION 199
|
#define TK_WHERE 199
|
||||||
#define TK_BY 200
|
#define TK_PARTITION 200
|
||||||
#define TK_SESSION 201
|
#define TK_BY 201
|
||||||
#define TK_STATE_WINDOW 202
|
#define TK_SESSION 202
|
||||||
#define TK_SLIDING 203
|
#define TK_STATE_WINDOW 203
|
||||||
#define TK_FILL 204
|
#define TK_SLIDING 204
|
||||||
#define TK_VALUE 205
|
#define TK_FILL 205
|
||||||
#define TK_NONE 206
|
#define TK_VALUE 206
|
||||||
#define TK_PREV 207
|
#define TK_NONE 207
|
||||||
#define TK_LINEAR 208
|
#define TK_PREV 208
|
||||||
#define TK_NEXT 209
|
#define TK_LINEAR 209
|
||||||
#define TK_GROUP 210
|
#define TK_NEXT 210
|
||||||
#define TK_HAVING 211
|
#define TK_GROUP 211
|
||||||
#define TK_ORDER 212
|
#define TK_HAVING 212
|
||||||
#define TK_SLIMIT 213
|
#define TK_ORDER 213
|
||||||
#define TK_SOFFSET 214
|
#define TK_SLIMIT 214
|
||||||
#define TK_LIMIT 215
|
#define TK_SOFFSET 215
|
||||||
#define TK_OFFSET 216
|
#define TK_LIMIT 216
|
||||||
#define TK_ASC 217
|
#define TK_OFFSET 217
|
||||||
#define TK_NULLS 218
|
#define TK_ASC 218
|
||||||
|
#define TK_NULLS 219
|
||||||
|
|
||||||
#define TK_NK_SPACE 300
|
#define TK_NK_SPACE 300
|
||||||
#define TK_NK_COMMENT 301
|
#define TK_NK_COMMENT 301
|
||||||
|
|
|
@ -53,6 +53,11 @@ typedef struct SScanLogicNode {
|
||||||
double ratio;
|
double ratio;
|
||||||
SNodeList* pDynamicScanFuncs;
|
SNodeList* pDynamicScanFuncs;
|
||||||
int32_t dataRequired;
|
int32_t dataRequired;
|
||||||
|
int64_t interval;
|
||||||
|
int64_t offset;
|
||||||
|
int64_t sliding;
|
||||||
|
int8_t intervalUnit;
|
||||||
|
int8_t slidingUnit;
|
||||||
} SScanLogicNode;
|
} SScanLogicNode;
|
||||||
|
|
||||||
typedef struct SJoinLogicNode {
|
typedef struct SJoinLogicNode {
|
||||||
|
@ -208,6 +213,11 @@ typedef struct STableScanPhysiNode {
|
||||||
double ratio;
|
double ratio;
|
||||||
int32_t dataRequired;
|
int32_t dataRequired;
|
||||||
SNodeList* pDynamicScanFuncs;
|
SNodeList* pDynamicScanFuncs;
|
||||||
|
int64_t interval;
|
||||||
|
int64_t offset;
|
||||||
|
int64_t sliding;
|
||||||
|
int8_t intervalUnit;
|
||||||
|
int8_t slidingUnit;
|
||||||
} STableScanPhysiNode;
|
} STableScanPhysiNode;
|
||||||
|
|
||||||
typedef STableScanPhysiNode STableSeqScanPhysiNode;
|
typedef STableScanPhysiNode STableSeqScanPhysiNode;
|
||||||
|
@ -264,7 +274,6 @@ typedef struct SIntervalPhysiNode {
|
||||||
int64_t sliding;
|
int64_t sliding;
|
||||||
int8_t intervalUnit;
|
int8_t intervalUnit;
|
||||||
int8_t slidingUnit;
|
int8_t slidingUnit;
|
||||||
uint8_t precision;
|
|
||||||
SFillNode* pFill;
|
SFillNode* pFill;
|
||||||
} SIntervalPhysiNode;
|
} SIntervalPhysiNode;
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ typedef enum EColumnType {
|
||||||
typedef struct SColumnNode {
|
typedef struct SColumnNode {
|
||||||
SExprNode node; // QUERY_NODE_COLUMN
|
SExprNode node; // QUERY_NODE_COLUMN
|
||||||
uint64_t tableId;
|
uint64_t tableId;
|
||||||
|
int8_t tableType;
|
||||||
col_id_t colId;
|
col_id_t colId;
|
||||||
EColumnType colType; // column or tag
|
EColumnType colType; // column or tag
|
||||||
char dbName[TSDB_DB_NAME_LEN];
|
char dbName[TSDB_DB_NAME_LEN];
|
||||||
|
@ -196,8 +197,8 @@ typedef struct SStateWindowNode {
|
||||||
|
|
||||||
typedef struct SSessionWindowNode {
|
typedef struct SSessionWindowNode {
|
||||||
ENodeType type; // QUERY_NODE_SESSION_WINDOW
|
ENodeType type; // QUERY_NODE_SESSION_WINDOW
|
||||||
SNode* pCol; // timestamp primary key
|
SColumnNode* pCol; // timestamp primary key
|
||||||
SNode* pGap; // gap between two session window(in microseconds)
|
SValueNode* pGap; // gap between two session window(in microseconds)
|
||||||
} SSessionWindowNode;
|
} SSessionWindowNode;
|
||||||
|
|
||||||
typedef struct SIntervalWindowNode {
|
typedef struct SIntervalWindowNode {
|
||||||
|
|
|
@ -80,6 +80,7 @@ int32_t timeTruncateFunction(SScalarParam *pInput, int32_t inputNum, SScalarPara
|
||||||
int32_t timeDiffFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput);
|
int32_t timeDiffFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput);
|
||||||
int32_t nowFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput);
|
int32_t nowFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput);
|
||||||
int32_t todayFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput);
|
int32_t todayFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput);
|
||||||
|
int32_t timezoneFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput);
|
||||||
|
|
||||||
bool getTimePseudoFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv);
|
bool getTimePseudoFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv);
|
||||||
|
|
||||||
|
|
|
@ -579,7 +579,7 @@ int32_t* taosGetErrno();
|
||||||
#define TSDB_CODE_PAR_INVALID_PORT TAOS_DEF_ERROR_CODE(0, 0x2612)
|
#define TSDB_CODE_PAR_INVALID_PORT TAOS_DEF_ERROR_CODE(0, 0x2612)
|
||||||
#define TSDB_CODE_PAR_INVALID_ENDPOINT TAOS_DEF_ERROR_CODE(0, 0x2613)
|
#define TSDB_CODE_PAR_INVALID_ENDPOINT TAOS_DEF_ERROR_CODE(0, 0x2613)
|
||||||
#define TSDB_CODE_PAR_EXPRIE_STATEMENT TAOS_DEF_ERROR_CODE(0, 0x2614)
|
#define TSDB_CODE_PAR_EXPRIE_STATEMENT TAOS_DEF_ERROR_CODE(0, 0x2614)
|
||||||
#define TSDB_CODE_PAR_INTERVAL_VALUE_TOO_SMALL TAOS_DEF_ERROR_CODE(0, 0x2615)
|
#define TSDB_CODE_PAR_INTER_VALUE_TOO_SMALL TAOS_DEF_ERROR_CODE(0, 0x2615)
|
||||||
#define TSDB_CODE_PAR_DB_NOT_SPECIFIED TAOS_DEF_ERROR_CODE(0, 0x2616)
|
#define TSDB_CODE_PAR_DB_NOT_SPECIFIED TAOS_DEF_ERROR_CODE(0, 0x2616)
|
||||||
#define TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME TAOS_DEF_ERROR_CODE(0, 0x2617)
|
#define TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME TAOS_DEF_ERROR_CODE(0, 0x2617)
|
||||||
#define TSDB_CODE_PAR_CORRESPONDING_STABLE_ERR TAOS_DEF_ERROR_CODE(0, 0x2618)
|
#define TSDB_CODE_PAR_CORRESPONDING_STABLE_ERR TAOS_DEF_ERROR_CODE(0, 0x2618)
|
||||||
|
@ -598,6 +598,17 @@ int32_t* taosGetErrno();
|
||||||
#define TSDB_CODE_PAR_INVALID_OPTION_UNIT TAOS_DEF_ERROR_CODE(0, 0x2625)
|
#define TSDB_CODE_PAR_INVALID_OPTION_UNIT TAOS_DEF_ERROR_CODE(0, 0x2625)
|
||||||
#define TSDB_CODE_PAR_INVALID_KEEP_UNIT TAOS_DEF_ERROR_CODE(0, 0x2626)
|
#define TSDB_CODE_PAR_INVALID_KEEP_UNIT TAOS_DEF_ERROR_CODE(0, 0x2626)
|
||||||
#define TSDB_CODE_PAR_AGG_FUNC_NESTING TAOS_DEF_ERROR_CODE(0, 0x2627)
|
#define TSDB_CODE_PAR_AGG_FUNC_NESTING TAOS_DEF_ERROR_CODE(0, 0x2627)
|
||||||
|
#define TSDB_CODE_PAR_INVALID_STATE_WIN_TYPE TAOS_DEF_ERROR_CODE(0, 0x2628)
|
||||||
|
#define TSDB_CODE_PAR_INVALID_STATE_WIN_COL TAOS_DEF_ERROR_CODE(0, 0x2629)
|
||||||
|
#define TSDB_CODE_PAR_INVALID_STATE_WIN_TABLE TAOS_DEF_ERROR_CODE(0, 0x262A)
|
||||||
|
#define TSDB_CODE_PAR_INTER_SESSION_GAP TAOS_DEF_ERROR_CODE(0, 0x262B)
|
||||||
|
#define TSDB_CODE_PAR_INTER_SESSION_COL TAOS_DEF_ERROR_CODE(0, 0x262C)
|
||||||
|
#define TSDB_CODE_PAR_INTER_OFFSET_NEGATIVE TAOS_DEF_ERROR_CODE(0, 0x262D)
|
||||||
|
#define TSDB_CODE_PAR_INTER_OFFSET_UNIT TAOS_DEF_ERROR_CODE(0, 0x262E)
|
||||||
|
#define TSDB_CODE_PAR_INTER_OFFSET_TOO_BIG TAOS_DEF_ERROR_CODE(0, 0x262F)
|
||||||
|
#define TSDB_CODE_PAR_INTER_SLIDING_UNIT TAOS_DEF_ERROR_CODE(0, 0x2630)
|
||||||
|
#define TSDB_CODE_PAR_INTER_SLIDING_TOO_BIG TAOS_DEF_ERROR_CODE(0, 0x2631)
|
||||||
|
#define TSDB_CODE_PAR_INTER_SLIDING_TOO_SMALL TAOS_DEF_ERROR_CODE(0, 0x2632)
|
||||||
|
|
||||||
//planner
|
//planner
|
||||||
#define TSDB_CODE_PLAN_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x2700)
|
#define TSDB_CODE_PLAN_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x2700)
|
||||||
|
|
|
@ -0,0 +1,538 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# This file is used to install TAOS time-series database on linux systems. The operating system
|
||||||
|
# is required to use systemd to manage services at boot
|
||||||
|
|
||||||
|
set -e
|
||||||
|
# set -x
|
||||||
|
|
||||||
|
# -----------------------Variables definition
|
||||||
|
source_dir=$1
|
||||||
|
binary_dir=$2
|
||||||
|
osType=$3
|
||||||
|
verNumber=$4
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
script_dir=$(dirname $(readlink -f "$0"))
|
||||||
|
else
|
||||||
|
script_dir=${source_dir}/packaging/tools
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Dynamic directory
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
data_dir="/var/lib/taos"
|
||||||
|
log_dir="/var/log/taos"
|
||||||
|
|
||||||
|
cfg_install_dir="/etc/taos"
|
||||||
|
|
||||||
|
bin_link_dir="/usr/bin"
|
||||||
|
lib_link_dir="/usr/lib"
|
||||||
|
lib64_link_dir="/usr/lib64"
|
||||||
|
inc_link_dir="/usr/include"
|
||||||
|
|
||||||
|
install_main_dir="/usr/local/taos"
|
||||||
|
|
||||||
|
bin_dir="/usr/local/taos/bin"
|
||||||
|
else
|
||||||
|
data_dir="/usr/local/var/lib/taos"
|
||||||
|
log_dir="/usr/local/var/log/taos"
|
||||||
|
|
||||||
|
cfg_install_dir="/usr/local/etc/taos"
|
||||||
|
|
||||||
|
bin_link_dir="/usr/local/bin"
|
||||||
|
lib_link_dir="/usr/local/lib"
|
||||||
|
inc_link_dir="/usr/local/include"
|
||||||
|
|
||||||
|
install_main_dir="/usr/local/Cellar/tdengine/${verNumber}"
|
||||||
|
|
||||||
|
bin_dir="/usr/local/Cellar/tdengine/${verNumber}/bin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
service_config_dir="/etc/systemd/system"
|
||||||
|
|
||||||
|
# Color setting
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[1;32m'
|
||||||
|
GREEN_DARK='\033[0;32m'
|
||||||
|
GREEN_UNDERLINE='\033[4;32m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
csudo=""
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
if command -v sudo > /dev/null; then
|
||||||
|
csudo="sudo"
|
||||||
|
fi
|
||||||
|
initd_mod=0
|
||||||
|
service_mod=2
|
||||||
|
if pidof systemd &> /dev/null; then
|
||||||
|
service_mod=0
|
||||||
|
elif $(which service &> /dev/null); then
|
||||||
|
service_mod=1
|
||||||
|
service_config_dir="/etc/init.d"
|
||||||
|
if $(which chkconfig &> /dev/null); then
|
||||||
|
initd_mod=1
|
||||||
|
elif $(which insserv &> /dev/null); then
|
||||||
|
initd_mod=2
|
||||||
|
elif $(which update-rc.d &> /dev/null); then
|
||||||
|
initd_mod=3
|
||||||
|
else
|
||||||
|
service_mod=2
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
service_mod=2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# get the operating system type for using the corresponding init file
|
||||||
|
# ubuntu/debian(deb), centos/fedora(rpm), others: opensuse, redhat, ..., no verification
|
||||||
|
#osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
|
||||||
|
osinfo=$(cat /etc/os-release | grep "NAME" | cut -d '"' -f2)
|
||||||
|
#echo "osinfo: ${osinfo}"
|
||||||
|
os_type=0
|
||||||
|
if echo $osinfo | grep -qwi "ubuntu" ; then
|
||||||
|
echo "this is ubuntu system"
|
||||||
|
os_type=1
|
||||||
|
elif echo $osinfo | grep -qwi "debian" ; then
|
||||||
|
echo "this is debian system"
|
||||||
|
os_type=1
|
||||||
|
elif echo $osinfo | grep -qwi "Kylin" ; then
|
||||||
|
echo "this is Kylin system"
|
||||||
|
os_type=1
|
||||||
|
elif echo $osinfo | grep -qwi "centos" ; then
|
||||||
|
echo "this is centos system"
|
||||||
|
os_type=2
|
||||||
|
elif echo $osinfo | grep -qwi "fedora" ; then
|
||||||
|
echo "this is fedora system"
|
||||||
|
os_type=2
|
||||||
|
else
|
||||||
|
echo "${osinfo}: This is an officially unverified linux system, If there are any problems with the installation and operation, "
|
||||||
|
echo "please feel free to contact taosdata.com for support."
|
||||||
|
os_type=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
function kill_taosd() {
|
||||||
|
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}')
|
||||||
|
if [ -n "$pid" ]; then
|
||||||
|
${csudo} kill -9 $pid || :
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_main_path() {
|
||||||
|
#create install main dir and all sub dir
|
||||||
|
${csudo} rm -rf ${install_main_dir} || :
|
||||||
|
${csudo} mkdir -p ${install_main_dir}
|
||||||
|
${csudo} mkdir -p ${install_main_dir}/cfg
|
||||||
|
${csudo} mkdir -p ${install_main_dir}/bin
|
||||||
|
${csudo} mkdir -p ${install_main_dir}/connector
|
||||||
|
${csudo} mkdir -p ${install_main_dir}/driver
|
||||||
|
${csudo} mkdir -p ${install_main_dir}/examples
|
||||||
|
${csudo} mkdir -p ${install_main_dir}/include
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
${csudo} mkdir -p ${install_main_dir}/init.d
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_bin() {
|
||||||
|
# Remove links
|
||||||
|
${csudo} rm -f ${bin_link_dir}/taos || :
|
||||||
|
${csudo} rm -f ${bin_link_dir}/taosd || :
|
||||||
|
${csudo} rm -f ${bin_link_dir}/taosdemo || :
|
||||||
|
${csudo} rm -f ${bin_link_dir}/taosdump || :
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
${csudo} rm -f ${bin_link_dir}/perfMonitor || :
|
||||||
|
${csudo} rm -f ${bin_link_dir}/set_core || :
|
||||||
|
${csudo} rm -f ${bin_link_dir}/rmtaos || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
${csudo} cp -r ${binary_dir}/build/bin/* ${install_main_dir}/bin || :
|
||||||
|
${csudo} cp -r ${script_dir}/taosd-dump-cfg.gdb ${install_main_dir}/bin || :
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
${csudo} cp -r ${script_dir}/remove.sh ${install_main_dir}/bin || :
|
||||||
|
${csudo} cp -r ${script_dir}/set_core.sh ${install_main_dir}/bin || :
|
||||||
|
${csudo} cp -r ${script_dir}/startPre.sh ${install_main_dir}/bin || :
|
||||||
|
else
|
||||||
|
${csudo} cp -r ${script_dir}/remove_client.sh ${install_main_dir}/bin || :
|
||||||
|
fi
|
||||||
|
${csudo} chmod 0555 ${install_main_dir}/bin/* || :
|
||||||
|
|
||||||
|
#Make link
|
||||||
|
[ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || :
|
||||||
|
[ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || :
|
||||||
|
[ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
|
||||||
|
[ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
[ -x ${install_main_dir}/bin/perfMonitor ] && ${csudo} ln -s ${install_main_dir}/bin/perfMonitor ${bin_link_dir}/perfMonitor || :
|
||||||
|
[ -x ${install_main_dir}/set_core.sh ] && ${csudo} ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/rmtaos || :
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_jemalloc() {
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
/usr/bin/install -c -d /usr/local/bin
|
||||||
|
|
||||||
|
if [ -f ${binary_dir}/build/bin/jemalloc-config ]; then
|
||||||
|
/usr/bin/install -c -m 755 ${binary_dir}/build/bin/jemalloc-config /usr/local/bin
|
||||||
|
fi
|
||||||
|
if [ -f ${binary_dir}/build/bin/jemalloc.sh ]; then
|
||||||
|
/usr/bin/install -c -m 755 ${binary_dir}/build/bin/jemalloc.sh /usr/local/bin
|
||||||
|
fi
|
||||||
|
if [ -f ${binary_dir}/build/bin/jeprof ]; then
|
||||||
|
/usr/bin/install -c -m 755 ${binary_dir}/build/bin/jeprof /usr/local/bin
|
||||||
|
fi
|
||||||
|
if [ -f ${binary_dir}/build/include/jemalloc/jemalloc.h ]; then
|
||||||
|
/usr/bin/install -c -d /usr/local/include/jemalloc
|
||||||
|
/usr/bin/install -c -m 644 ${binary_dir}/build/include/jemalloc/jemalloc.h /usr/local/include/jemalloc
|
||||||
|
fi
|
||||||
|
if [ -f ${binary_dir}/build/lib/libjemalloc.so.2 ]; then
|
||||||
|
/usr/bin/install -c -d /usr/local/lib
|
||||||
|
/usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc.so.2 /usr/local/lib
|
||||||
|
ln -sf libjemalloc.so.2 /usr/local/lib/libjemalloc.so
|
||||||
|
/usr/bin/install -c -d /usr/local/lib
|
||||||
|
if [ -f ${binary_dir}/build/lib/libjemalloc.a ]; then
|
||||||
|
/usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc.a /usr/local/lib
|
||||||
|
fi
|
||||||
|
if [ -f ${binary_dir}/build/lib/libjemalloc_pic.a ]; then
|
||||||
|
/usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc_pic.a /usr/local/lib
|
||||||
|
fi
|
||||||
|
if [ -f ${binary_dir}/build/lib/pkgconfig/jemalloc.pc ]; then
|
||||||
|
/usr/bin/install -c -d /usr/local/lib/pkgconfig
|
||||||
|
/usr/bin/install -c -m 644 ${binary_dir}/build/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -f ${binary_dir}/build/share/doc/jemalloc/jemalloc.html ]; then
|
||||||
|
/usr/bin/install -c -d /usr/local/share/doc/jemalloc
|
||||||
|
/usr/bin/install -c -m 644 ${binary_dir}/build/share/doc/jemalloc/jemalloc.html /usr/local/share/doc/jemalloc
|
||||||
|
fi
|
||||||
|
if [ -f ${binary_dir}/build/share/man/man3/jemalloc.3 ]; then
|
||||||
|
/usr/bin/install -c -d /usr/local/share/man/man3
|
||||||
|
/usr/bin/install -c -m 644 ${binary_dir}/build/share/man/man3/jemalloc.3 /usr/local/share/man/man3
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /etc/ld.so.conf.d ]; then
|
||||||
|
echo "/usr/local/lib" | ${csudo} tee /etc/ld.so.conf.d/jemalloc.conf
|
||||||
|
${csudo} ldconfig
|
||||||
|
else
|
||||||
|
echo "/etc/ld.so.conf.d not found!"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_lib() {
|
||||||
|
# Remove links
|
||||||
|
${csudo} rm -f ${lib_link_dir}/libtaos.* || :
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
${csudo} rm -f ${lib64_link_dir}/libtaos.* || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
${csudo} cp ${binary_dir}/build/lib/libtaos.so ${install_main_dir}/driver/libtaos.so.${verNumber} && ${csudo} chmod 777 ${install_main_dir}/driver/*
|
||||||
|
${csudo} ln -sf ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.so.1
|
||||||
|
${csudo} ln -sf ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so
|
||||||
|
|
||||||
|
if [ -d "${lib64_link_dir}" ]; then
|
||||||
|
${csudo} ln -sf ${install_main_dir}/driver/libtaos.* ${lib64_link_dir}/libtaos.so.1
|
||||||
|
${csudo} ln -sf ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
${csudo} cp -Rf ${binary_dir}/build/lib/libtaos.${verNumber}.dylib ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/*
|
||||||
|
|
||||||
|
${csudo} ln -sf ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.1.dylib
|
||||||
|
${csudo} ln -sf ${lib_link_dir}/libtaos.1.dylib ${lib_link_dir}/libtaos.dylib
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_jemalloc
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
${csudo} ldconfig
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_header() {
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h || :
|
||||||
|
fi
|
||||||
|
${csudo} cp -f ${source_dir}/include/client/taos.h ${source_dir}/include/util/taoserror.h ${install_main_dir}/include && ${csudo} chmod 644 ${install_main_dir}/include/*
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
${csudo} ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h
|
||||||
|
${csudo} ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_config() {
|
||||||
|
#${csudo} rm -f ${install_main_dir}/cfg/taos.cfg || :
|
||||||
|
|
||||||
|
if [ ! -f ${cfg_install_dir}/taos.cfg ]; then
|
||||||
|
${csudo} mkdir -p ${cfg_install_dir}
|
||||||
|
[ -f ${script_dir}/../cfg/taos.cfg ] &&
|
||||||
|
${csudo} cp ${script_dir}/../cfg/taos.cfg ${cfg_install_dir} || :
|
||||||
|
${csudo} chmod 644 ${cfg_install_dir}/*
|
||||||
|
fi
|
||||||
|
|
||||||
|
${csudo} cp -f ${script_dir}/../cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org || :
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then ${csudo} ln -s ${cfg_install_dir}/taos.cfg ${install_main_dir}/cfg
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_log() {
|
||||||
|
${csudo} rm -rf ${log_dir} || :
|
||||||
|
${csudo} mkdir -p ${log_dir} && ${csudo} chmod 777 ${log_dir}
|
||||||
|
${csudo} ln -s ${log_dir} ${install_main_dir}/log
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_data() {
|
||||||
|
${csudo} mkdir -p ${data_dir}
|
||||||
|
${csudo} ln -s ${data_dir} ${install_main_dir}/data
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_connector() {
|
||||||
|
if [ -d "${source_dir}/src/connector/grafanaplugin/dist" ]; then
|
||||||
|
${csudo} cp -rf ${source_dir}/src/connector/grafanaplugin/dist ${install_main_dir}/connector/grafanaplugin
|
||||||
|
else
|
||||||
|
echo "WARNING: grafanaplugin bundled dir not found, please check if want to use it!"
|
||||||
|
fi
|
||||||
|
if find ${source_dir}/src/connector/go -mindepth 1 -maxdepth 1 | read; then
|
||||||
|
${csudo} cp -r ${source_dir}/src/connector/go ${install_main_dir}/connector
|
||||||
|
else
|
||||||
|
echo "WARNING: go connector not found, please check if want to use it!"
|
||||||
|
fi
|
||||||
|
${csudo} cp -rf ${source_dir}/src/connector/python ${install_main_dir}/connector || :
|
||||||
|
${csudo} cp ${binary_dir}/build/lib/*.jar ${install_main_dir}/connector &> /dev/null && ${csudo} chmod 777 ${install_main_dir}/connector/*.jar || echo &> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_examples() {
|
||||||
|
${csudo} cp -rf ${source_dir}/tests/examples/* ${install_main_dir}/examples || :
|
||||||
|
}
|
||||||
|
|
||||||
|
function clean_service_on_sysvinit() {
|
||||||
|
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
|
||||||
|
#${csudo} sed -i "\|${restart_config_str}|d" /etc/inittab || :
|
||||||
|
|
||||||
|
if pidof taosd &> /dev/null; then
|
||||||
|
${csudo} service taosd stop || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ((${initd_mod}==1)); then
|
||||||
|
${csudo} chkconfig --del taosd || :
|
||||||
|
elif ((${initd_mod}==2)); then
|
||||||
|
${csudo} insserv -r taosd || :
|
||||||
|
elif ((${initd_mod}==3)); then
|
||||||
|
${csudo} update-rc.d -f taosd remove || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
${csudo} rm -f ${service_config_dir}/taosd || :
|
||||||
|
|
||||||
|
if $(which init &> /dev/null); then
|
||||||
|
${csudo} init q || :
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_service_on_sysvinit() {
|
||||||
|
clean_service_on_sysvinit
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# Install taosd service
|
||||||
|
if ((${os_type}==1)); then
|
||||||
|
${csudo} cp -f ${script_dir}/../deb/taosd ${install_main_dir}/init.d || :
|
||||||
|
${csudo} cp ${script_dir}/../deb/taosd ${service_config_dir} && ${csudo} chmod a+x ${service_config_dir}/taosd || :
|
||||||
|
elif ((${os_type}==2)); then
|
||||||
|
${csudo} cp -f ${script_dir}/../rpm/taosd ${install_main_dir}/init.d || :
|
||||||
|
${csudo} cp ${script_dir}/../rpm/taosd ${service_config_dir} && ${csudo} chmod a+x ${service_config_dir}/taosd || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
|
||||||
|
#${csudo} grep -q -F "$restart_config_str" /etc/inittab || ${csudo} bash -c "echo '${restart_config_str}' >> /etc/inittab"
|
||||||
|
|
||||||
|
if ((${initd_mod}==1)); then
|
||||||
|
${csudo} chkconfig --add taosd || :
|
||||||
|
${csudo} chkconfig --level 2345 taosd on || :
|
||||||
|
elif ((${initd_mod}==2)); then
|
||||||
|
${csudo} insserv taosd || :
|
||||||
|
${csudo} insserv -d taosd || :
|
||||||
|
elif ((${initd_mod}==3)); then
|
||||||
|
${csudo} update-rc.d taosd defaults || :
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function clean_service_on_systemd() {
|
||||||
|
taosd_service_config="${service_config_dir}/taosd.service"
|
||||||
|
|
||||||
|
if systemctl is-active --quiet taosd; then
|
||||||
|
echo "TDengine is running, stopping it..."
|
||||||
|
${csudo} systemctl stop taosd &> /dev/null || echo &> /dev/null
|
||||||
|
fi
|
||||||
|
${csudo} systemctl disable taosd &> /dev/null || echo &> /dev/null
|
||||||
|
|
||||||
|
${csudo} rm -f ${taosd_service_config}
|
||||||
|
}
|
||||||
|
|
||||||
|
# taos:2345:respawn:/etc/init.d/taosd start
|
||||||
|
|
||||||
|
function install_service_on_systemd() {
|
||||||
|
clean_service_on_systemd
|
||||||
|
|
||||||
|
taosd_service_config="${service_config_dir}/taosd.service"
|
||||||
|
|
||||||
|
${csudo} bash -c "echo '[Unit]' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'Description=TDengine server service' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'After=network-online.target' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'Wants=network-online.target' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo '[Service]' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'Type=simple' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'ExecStart=/usr/bin/taosd' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'ExecStartPre=/usr/local/taos/bin/startPre.sh' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'TimeoutStopSec=1000000s' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'LimitNOFILE=infinity' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'LimitNPROC=infinity' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'LimitCORE=infinity' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'TimeoutStartSec=0' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'StandardOutput=null' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'Restart=always' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'StartLimitBurst=3' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'StartLimitInterval=60s' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo '[Install]' >> ${taosd_service_config}"
|
||||||
|
${csudo} bash -c "echo 'WantedBy=multi-user.target' >> ${taosd_service_config}"
|
||||||
|
${csudo} systemctl enable taosd
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_service() {
|
||||||
|
if ((${service_mod}==0)); then
|
||||||
|
install_service_on_systemd
|
||||||
|
elif ((${service_mod}==1)); then
|
||||||
|
install_service_on_sysvinit
|
||||||
|
else
|
||||||
|
# must manual stop taosd
|
||||||
|
kill_taosd
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function update_TDengine() {
|
||||||
|
echo -e "${GREEN}Start to update TDengine...${NC}"
|
||||||
|
# Stop the service if running
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
if pidof taosd &> /dev/null; then
|
||||||
|
if ((${service_mod}==0)); then
|
||||||
|
${csudo} systemctl stop taosd || :
|
||||||
|
elif ((${service_mod}==1)); then
|
||||||
|
${csudo} service taosd stop || :
|
||||||
|
else
|
||||||
|
kill_taosd
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_main_path
|
||||||
|
|
||||||
|
install_log
|
||||||
|
install_header
|
||||||
|
install_lib
|
||||||
|
install_connector
|
||||||
|
install_examples
|
||||||
|
install_bin
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
install_service
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_config
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
echo
|
||||||
|
echo -e "\033[44;32;1mTDengine is updated successfully!${NC}"
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
|
||||||
|
if ((${service_mod}==0)); then
|
||||||
|
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}"
|
||||||
|
elif ((${service_mod}==1)); then
|
||||||
|
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} service taosd start${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN_DARK}To start TDengine ${NC}: ./taosd${NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
||||||
|
echo
|
||||||
|
echo -e "\033[44;32;1mTDengine is updated successfully!${NC}"
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo -e "\033[44;32;1mTDengine Client is updated successfully!${NC}"
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo -e "${GREEN_DARK}To access TDengine Client ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
||||||
|
echo
|
||||||
|
echo -e "\033[44;32;1mTDengine Client is updated successfully!${NC}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_TDengine() {
|
||||||
|
# Start to install
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
echo -e "${GREEN}Start to install TDEngine...${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN}Start to install TDEngine Client ...${NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_main_path
|
||||||
|
|
||||||
|
install_data
|
||||||
|
install_log
|
||||||
|
install_header
|
||||||
|
install_lib
|
||||||
|
install_connector
|
||||||
|
install_examples
|
||||||
|
install_bin
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
install_service
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_config
|
||||||
|
|
||||||
|
if [ "$osType" != "Darwin" ]; then
|
||||||
|
# Ask if to start the service
|
||||||
|
echo
|
||||||
|
echo -e "\033[44;32;1mTDengine is installed successfully!${NC}"
|
||||||
|
echo
|
||||||
|
echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
|
||||||
|
if ((${service_mod}==0)); then
|
||||||
|
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} systemctl start taosd${NC}"
|
||||||
|
elif ((${service_mod}==1)); then
|
||||||
|
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} service taosd start${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN_DARK}To start TDengine ${NC}: ./taosd${NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
||||||
|
echo
|
||||||
|
echo -e "\033[44;32;1mTDengine is installed successfully!${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
||||||
|
echo
|
||||||
|
echo -e "\033[44;32;1mTDengine Client is installed successfully!${NC}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
## ==============================Main program starts from here============================
|
||||||
|
echo source directory: $1
|
||||||
|
echo binary directory: $2
|
||||||
|
echo $bin_dir
|
||||||
|
if [ -x ${bin_dir}/taos ]; then
|
||||||
|
update_TDengine
|
||||||
|
else
|
||||||
|
install_TDengine
|
||||||
|
fi
|
|
@ -64,11 +64,11 @@ cp ${install_files} ${install_dir}
|
||||||
header_files="${top_dir}/include/client/taos.h ${top_dir}/include/util/taoserror.h"
|
header_files="${top_dir}/include/client/taos.h ${top_dir}/include/util/taoserror.h"
|
||||||
cp ${header_files} ${install_dir}/inc
|
cp ${header_files} ${install_dir}/inc
|
||||||
|
|
||||||
bin_files="${compile_dir}/source/dnode/mgmt/taosd ${compile_dir}/tools/shell/taos ${compile_dir}/tests/test/c/create_table ${compile_dir}/tests/test/c/tmq_sim ${script_dir}/remove.sh"
|
bin_files="${compile_dir}/build/bin/taosd ${compile_dir}/build/bin/taos ${compile_dir}/build/bin/create_table ${compile_dir}/build/bin/tmq_sim ${script_dir}/remove.sh"
|
||||||
cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || :
|
cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || :
|
||||||
|
|
||||||
cp ${compile_dir}/source/client/libtaos.so ${install_dir}/lib/
|
cp ${compile_dir}/build/lib/libtaos.so ${install_dir}/lib/
|
||||||
cp ${compile_dir}/source/libs/tdb/libtdb.so ${install_dir}/lib/
|
cp ${compile_dir}/build/lib/libtdb.so ${install_dir}/lib/
|
||||||
taostoolfile="${top_dir}/tools/taosTools-1.4.1-Linux-x64.tar.gz"
|
taostoolfile="${top_dir}/tools/taosTools-1.4.1-Linux-x64.tar.gz"
|
||||||
cp ${taostoolfile} ${install_dir}/taos-tools
|
cp ${taostoolfile} ${install_dir}/taos-tools
|
||||||
|
|
||||||
|
|
|
@ -83,9 +83,9 @@ int32_t vmProcessGetVnodeLoadsReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq) {
|
||||||
|
|
||||||
static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
|
static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
|
||||||
pCfg->vgId = pCreate->vgId;
|
pCfg->vgId = pCreate->vgId;
|
||||||
pCfg->wsize = pCreate->cacheBlockSize;
|
pCfg->wsize = pCreate->cacheBlockSize * 1024 * 1024;
|
||||||
pCfg->ssize = pCreate->cacheBlockSize;
|
pCfg->ssize = 1024;
|
||||||
pCfg->lsize = pCreate->cacheBlockSize;
|
pCfg->lsize = 1024 * 1024;
|
||||||
pCfg->isHeapAllocator = true;
|
pCfg->isHeapAllocator = true;
|
||||||
pCfg->ttl = 4;
|
pCfg->ttl = 4;
|
||||||
pCfg->keep = pCreate->daysToKeep0;
|
pCfg->keep = pCreate->daysToKeep0;
|
||||||
|
@ -96,13 +96,12 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
|
||||||
pCfg->tsdbCfg.keep1 = pCreate->daysToKeep0;
|
pCfg->tsdbCfg.keep1 = pCreate->daysToKeep0;
|
||||||
pCfg->tsdbCfg.lruCacheSize = pCreate->cacheBlockSize;
|
pCfg->tsdbCfg.lruCacheSize = pCreate->cacheBlockSize;
|
||||||
pCfg->tsdbCfg.retentions = pCreate->pRetensions;
|
pCfg->tsdbCfg.retentions = pCreate->pRetensions;
|
||||||
pCfg->metaCfg.lruSize = pCreate->cacheBlockSize;
|
pCfg->walCfg.level = TAOS_WAL_WRITE;
|
||||||
pCfg->walCfg.fsyncPeriod = pCreate->fsyncPeriod;
|
pCfg->walCfg.fsyncPeriod = 0;
|
||||||
pCfg->walCfg.level = pCreate->walLevel;
|
pCfg->walCfg.retentionPeriod = 0;
|
||||||
pCfg->walCfg.retentionPeriod = 10;
|
pCfg->walCfg.retentionSize = 0;
|
||||||
pCfg->walCfg.retentionSize = 128;
|
pCfg->walCfg.rollPeriod = 0;
|
||||||
pCfg->walCfg.rollPeriod = 128;
|
pCfg->walCfg.segSize = 0;
|
||||||
pCfg->walCfg.segSize = 128;
|
|
||||||
pCfg->walCfg.vgId = pCreate->vgId;
|
pCfg->walCfg.vgId = pCreate->vgId;
|
||||||
pCfg->hashBegin = pCreate->hashBegin;
|
pCfg->hashBegin = pCreate->hashBegin;
|
||||||
pCfg->hashEnd = pCreate->hashEnd;
|
pCfg->hashEnd = pCreate->hashEnd;
|
||||||
|
@ -160,13 +159,10 @@ int32_t vmProcessCreateVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pMsg) {
|
||||||
msgCb.queueFps[APPLY_QUEUE] = vmPutMsgToApplyQueue;
|
msgCb.queueFps[APPLY_QUEUE] = vmPutMsgToApplyQueue;
|
||||||
msgCb.qsizeFp = vmGetQueueSize;
|
msgCb.qsizeFp = vmGetQueueSize;
|
||||||
|
|
||||||
vnodeCfg.msgCb = msgCb;
|
SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, msgCb);
|
||||||
vnodeCfg.pTfs = pMgmt->pTfs;
|
|
||||||
vnodeCfg.dbId = wrapperCfg.dbUid;
|
|
||||||
SVnode *pImpl = vnodeOpen(wrapperCfg.path, &vnodeCfg);
|
|
||||||
if (pImpl == NULL) {
|
if (pImpl == NULL) {
|
||||||
tFreeSCreateVnodeReq(&createReq);
|
|
||||||
dError("vgId:%d, failed to create vnode since %s", createReq.vgId, terrstr());
|
dError("vgId:%d, failed to create vnode since %s", createReq.vgId, terrstr());
|
||||||
|
tFreeSCreateVnodeReq(&createReq);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +171,7 @@ int32_t vmProcessCreateVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pMsg) {
|
||||||
tFreeSCreateVnodeReq(&createReq);
|
tFreeSCreateVnodeReq(&createReq);
|
||||||
dError("vgId:%d, failed to open vnode since %s", createReq.vgId, terrstr());
|
dError("vgId:%d, failed to open vnode since %s", createReq.vgId, terrstr());
|
||||||
vnodeClose(pImpl);
|
vnodeClose(pImpl);
|
||||||
vnodeDestroy(wrapperCfg.path);
|
vnodeDestroy(path, pMgmt->pTfs);
|
||||||
terrno = code;
|
terrno = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -184,7 +180,7 @@ int32_t vmProcessCreateVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pMsg) {
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
tFreeSCreateVnodeReq(&createReq);
|
tFreeSCreateVnodeReq(&createReq);
|
||||||
vnodeClose(pImpl);
|
vnodeClose(pImpl);
|
||||||
vnodeDestroy(wrapperCfg.path);
|
vnodeDestroy(path, pMgmt->pTfs);
|
||||||
terrno = code;
|
terrno = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,8 @@ int32_t vmOpenVnode(SVnodesMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void vmCloseVnode(SVnodesMgmt *pMgmt, SVnodeObj *pVnode) {
|
void vmCloseVnode(SVnodesMgmt *pMgmt, SVnodeObj *pVnode) {
|
||||||
|
char path[TSDB_FILENAME_LEN];
|
||||||
|
|
||||||
taosWLockLatch(&pMgmt->latch);
|
taosWLockLatch(&pMgmt->latch);
|
||||||
taosHashRemove(pMgmt->hash, &pVnode->vgId, sizeof(int32_t));
|
taosHashRemove(pMgmt->hash, &pVnode->vgId, sizeof(int32_t));
|
||||||
taosWUnLockLatch(&pMgmt->latch);
|
taosWUnLockLatch(&pMgmt->latch);
|
||||||
|
@ -104,7 +106,8 @@ void vmCloseVnode(SVnodesMgmt *pMgmt, SVnodeObj *pVnode) {
|
||||||
|
|
||||||
if (pVnode->dropped) {
|
if (pVnode->dropped) {
|
||||||
dDebug("vgId:%d, vnode is destroyed for dropped:%d", pVnode->vgId, pVnode->dropped);
|
dDebug("vgId:%d, vnode is destroyed for dropped:%d", pVnode->vgId, pVnode->dropped);
|
||||||
vnodeDestroy(pVnode->path);
|
snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, pVnode->vgId);
|
||||||
|
vnodeDestroy(path, pMgmt->pTfs);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMemoryFree(pVnode->path);
|
taosMemoryFree(pVnode->path);
|
||||||
|
@ -116,6 +119,7 @@ static void *vmOpenVnodeFunc(void *param) {
|
||||||
SVnodeThread *pThread = param;
|
SVnodeThread *pThread = param;
|
||||||
SVnodesMgmt *pMgmt = pThread->pMgmt;
|
SVnodesMgmt *pMgmt = pThread->pMgmt;
|
||||||
SDnode *pDnode = pMgmt->pDnode;
|
SDnode *pDnode = pMgmt->pDnode;
|
||||||
|
char path[TSDB_FILENAME_LEN];
|
||||||
|
|
||||||
dDebug("thread:%d, start to open %d vnodes", pThread->threadIndex, pThread->vnodeNum);
|
dDebug("thread:%d, start to open %d vnodes", pThread->threadIndex, pThread->vnodeNum);
|
||||||
setThreadName("open-vnodes");
|
setThreadName("open-vnodes");
|
||||||
|
@ -134,8 +138,8 @@ static void *vmOpenVnodeFunc(void *param) {
|
||||||
msgCb.queueFps[FETCH_QUEUE] = vmPutMsgToFetchQueue;
|
msgCb.queueFps[FETCH_QUEUE] = vmPutMsgToFetchQueue;
|
||||||
msgCb.queueFps[APPLY_QUEUE] = vmPutMsgToApplyQueue;
|
msgCb.queueFps[APPLY_QUEUE] = vmPutMsgToApplyQueue;
|
||||||
msgCb.qsizeFp = vmGetQueueSize;
|
msgCb.qsizeFp = vmGetQueueSize;
|
||||||
SVnodeCfg cfg = {.msgCb = msgCb, .pTfs = pMgmt->pTfs, .vgId = pCfg->vgId, .dbId = pCfg->dbUid};
|
snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, pCfg->vgId);
|
||||||
SVnode *pImpl = vnodeOpen(pCfg->path, &cfg);
|
SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, msgCb);
|
||||||
if (pImpl == NULL) {
|
if (pImpl == NULL) {
|
||||||
dError("vgId:%d, failed to open vnode by thread:%d", pCfg->vgId, pThread->threadIndex);
|
dError("vgId:%d, failed to open vnode by thread:%d", pCfg->vgId, pThread->threadIndex);
|
||||||
pThread->failed++;
|
pThread->failed++;
|
||||||
|
|
|
@ -37,16 +37,14 @@ extern "C" {
|
||||||
|
|
||||||
// vnode
|
// vnode
|
||||||
typedef struct SVnode SVnode;
|
typedef struct SVnode SVnode;
|
||||||
typedef struct SMetaCfg SMetaCfg; // todo: remove
|
|
||||||
typedef struct STsdbCfg STsdbCfg; // todo: remove
|
typedef struct STsdbCfg STsdbCfg; // todo: remove
|
||||||
typedef struct STqCfg STqCfg; // todo: remove
|
|
||||||
typedef struct SVnodeCfg SVnodeCfg;
|
typedef struct SVnodeCfg SVnodeCfg;
|
||||||
|
|
||||||
int vnodeInit(int nthreads);
|
int vnodeInit(int nthreads);
|
||||||
void vnodeCleanup();
|
void vnodeCleanup();
|
||||||
int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs);
|
int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs);
|
||||||
void vnodeDestroy(const char *path);
|
void vnodeDestroy(const char *path, STfs *pTfs);
|
||||||
SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg);
|
SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb);
|
||||||
void vnodeClose(SVnode *pVnode);
|
void vnodeClose(SVnode *pVnode);
|
||||||
void vnodePreprocessWriteReqs(SVnode *pVnode, SArray *pMsgs);
|
void vnodePreprocessWriteReqs(SVnode *pVnode, SArray *pMsgs);
|
||||||
int vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
|
int vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
|
||||||
|
@ -133,14 +131,9 @@ struct STsdbCfg {
|
||||||
SArray *retentions;
|
SArray *retentions;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct STqCfg {
|
|
||||||
int32_t reserved;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct SVnodeCfg {
|
struct SVnodeCfg {
|
||||||
int32_t vgId;
|
int32_t vgId;
|
||||||
uint64_t dbId;
|
uint64_t dbId;
|
||||||
STfs *pTfs;
|
|
||||||
uint64_t wsize;
|
uint64_t wsize;
|
||||||
uint64_t ssize;
|
uint64_t ssize;
|
||||||
uint64_t lsize;
|
uint64_t lsize;
|
||||||
|
@ -150,10 +143,7 @@ struct SVnodeCfg {
|
||||||
int8_t streamMode;
|
int8_t streamMode;
|
||||||
bool isWeak;
|
bool isWeak;
|
||||||
STsdbCfg tsdbCfg;
|
STsdbCfg tsdbCfg;
|
||||||
SMetaCfg metaCfg;
|
|
||||||
STqCfg tqCfg;
|
|
||||||
SWalCfg walCfg;
|
SWalCfg walCfg;
|
||||||
SMsgCb msgCb;
|
|
||||||
uint32_t hashBegin;
|
uint32_t hashBegin;
|
||||||
uint32_t hashEnd;
|
uint32_t hashEnd;
|
||||||
int8_t hashMethod;
|
int8_t hashMethod;
|
||||||
|
|
|
@ -40,7 +40,7 @@ typedef struct SMSmaCursor SMSmaCursor;
|
||||||
#define META_CHILD_TABLE TD_CHILD_TABLE
|
#define META_CHILD_TABLE TD_CHILD_TABLE
|
||||||
#define META_NORMAL_TABLE TD_NORMAL_TABLE
|
#define META_NORMAL_TABLE TD_NORMAL_TABLE
|
||||||
|
|
||||||
SMeta* metaOpen(const char* path, const SMetaCfg* pMetaCfg, SMemAllocatorFactory* pMAF);
|
SMeta* metaOpen(const char* path, SMemAllocatorFactory* pMAF);
|
||||||
void metaClose(SMeta* pMeta);
|
void metaClose(SMeta* pMeta);
|
||||||
void metaRemove(const char* path);
|
void metaRemove(const char* path);
|
||||||
int metaCreateTable(SMeta* pMeta, STbCfg* pTbCfg);
|
int metaCreateTable(SMeta* pMeta, STbCfg* pTbCfg);
|
||||||
|
@ -97,7 +97,6 @@ tb_uid_t metaGenerateUid(SMeta* pMeta);
|
||||||
struct SMeta {
|
struct SMeta {
|
||||||
char* path;
|
char* path;
|
||||||
SVnode* pVnode;
|
SVnode* pVnode;
|
||||||
SMetaCfg options;
|
|
||||||
SMetaDB* pDB;
|
SMetaDB* pDB;
|
||||||
SMetaIdx* pIdx;
|
SMetaIdx* pIdx;
|
||||||
SMetaCache* pCache;
|
SMetaCache* pCache;
|
||||||
|
|
|
@ -160,7 +160,6 @@ struct STQ {
|
||||||
// the handle of meta kvstore
|
// the handle of meta kvstore
|
||||||
bool writeTrigger;
|
bool writeTrigger;
|
||||||
char* path;
|
char* path;
|
||||||
STqCfg* tqConfig;
|
|
||||||
STqMemRef tqMemRef;
|
STqMemRef tqMemRef;
|
||||||
STqMetaStore* tqMeta;
|
STqMetaStore* tqMeta;
|
||||||
// STqPushMgr* tqPushMgr;
|
// STqPushMgr* tqPushMgr;
|
||||||
|
@ -251,8 +250,7 @@ int tqInit();
|
||||||
void tqCleanUp();
|
void tqCleanUp();
|
||||||
|
|
||||||
// open in each vnode
|
// open in each vnode
|
||||||
STQ* tqOpen(const char* path, SVnode* pVnode, SWal* pWal, SMeta* pMeta, STqCfg* tqConfig,
|
STQ* tqOpen(const char* path, SVnode* pVnode, SWal* pWal, SMeta* pMeta, SMemAllocatorFactory* allocFac);
|
||||||
SMemAllocatorFactory* allocFac);
|
|
||||||
void tqClose(STQ*);
|
void tqClose(STQ*);
|
||||||
// required by vnode
|
// required by vnode
|
||||||
int tqPushMsg(STQ*, void* msg, int32_t msgLen, tmsg_t msgType, int64_t version);
|
int tqPushMsg(STQ*, void* msg, int32_t msgLen, tmsg_t msgType, int64_t version);
|
||||||
|
|
|
@ -80,10 +80,11 @@ struct SVnodeInfo {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SVnode {
|
struct SVnode {
|
||||||
int32_t vgId;
|
|
||||||
char* path;
|
char* path;
|
||||||
SVnodeCfg config;
|
SVnodeCfg config;
|
||||||
SVState state;
|
SVState state;
|
||||||
|
STfs* pTfs;
|
||||||
|
SMsgCb msgCb;
|
||||||
SVBufPool* pBufPool;
|
SVBufPool* pBufPool;
|
||||||
SMeta* pMeta;
|
SMeta* pMeta;
|
||||||
STsdb* pTsdb;
|
STsdb* pTsdb;
|
||||||
|
@ -92,10 +93,10 @@ struct SVnode {
|
||||||
SSink* pSink;
|
SSink* pSink;
|
||||||
tsem_t canCommit;
|
tsem_t canCommit;
|
||||||
SQHandle* pQuery;
|
SQHandle* pQuery;
|
||||||
SMsgCb msgCb;
|
|
||||||
STfs* pTfs;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define TD_VID(PVNODE) (PVNODE)->config.vgId
|
||||||
|
|
||||||
// sma
|
// sma
|
||||||
void smaHandleRes(void* pVnode, int64_t smaId, const SArray* data);
|
void smaHandleRes(void* pVnode, int64_t smaId, const SArray* data);
|
||||||
|
|
||||||
|
|
|
@ -17,16 +17,16 @@
|
||||||
|
|
||||||
#include "vnodeInt.h"
|
#include "vnodeInt.h"
|
||||||
|
|
||||||
static SMeta *metaNew(const char *path, const SMetaCfg *pMetaCfg, SMemAllocatorFactory *pMAF);
|
static SMeta *metaNew(const char *path, SMemAllocatorFactory *pMAF);
|
||||||
static void metaFree(SMeta *pMeta);
|
static void metaFree(SMeta *pMeta);
|
||||||
static int metaOpenImpl(SMeta *pMeta);
|
static int metaOpenImpl(SMeta *pMeta);
|
||||||
static void metaCloseImpl(SMeta *pMeta);
|
static void metaCloseImpl(SMeta *pMeta);
|
||||||
|
|
||||||
SMeta *metaOpen(const char *path, const SMetaCfg *pMetaCfg, SMemAllocatorFactory *pMAF) {
|
SMeta *metaOpen(const char *path, SMemAllocatorFactory *pMAF) {
|
||||||
SMeta *pMeta = NULL;
|
SMeta *pMeta = NULL;
|
||||||
|
|
||||||
// Allocate handle
|
// Allocate handle
|
||||||
pMeta = metaNew(path, pMetaCfg, pMAF);
|
pMeta = metaNew(path, pMAF);
|
||||||
if (pMeta == NULL) {
|
if (pMeta == NULL) {
|
||||||
// TODO: handle error
|
// TODO: handle error
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -54,7 +54,7 @@ void metaClose(SMeta *pMeta) {
|
||||||
void metaRemove(const char *path) { taosRemoveDir(path); }
|
void metaRemove(const char *path) { taosRemoveDir(path); }
|
||||||
|
|
||||||
/* ------------------------ STATIC METHODS ------------------------ */
|
/* ------------------------ STATIC METHODS ------------------------ */
|
||||||
static SMeta *metaNew(const char *path, const SMetaCfg *pMetaCfg, SMemAllocatorFactory *pMAF) {
|
static SMeta *metaNew(const char *path, SMemAllocatorFactory *pMAF) {
|
||||||
SMeta *pMeta;
|
SMeta *pMeta;
|
||||||
size_t psize = strlen(path);
|
size_t psize = strlen(path);
|
||||||
|
|
||||||
|
|
|
@ -19,15 +19,13 @@ int32_t tqInit() { return tqPushMgrInit(); }
|
||||||
|
|
||||||
void tqCleanUp() { tqPushMgrCleanUp(); }
|
void tqCleanUp() { tqPushMgrCleanUp(); }
|
||||||
|
|
||||||
STQ* tqOpen(const char* path, SVnode* pVnode, SWal* pWal, SMeta* pVnodeMeta, STqCfg* tqConfig,
|
STQ* tqOpen(const char* path, SVnode* pVnode, SWal* pWal, SMeta* pVnodeMeta, SMemAllocatorFactory* allocFac) {
|
||||||
SMemAllocatorFactory* allocFac) {
|
|
||||||
STQ* pTq = taosMemoryMalloc(sizeof(STQ));
|
STQ* pTq = taosMemoryMalloc(sizeof(STQ));
|
||||||
if (pTq == NULL) {
|
if (pTq == NULL) {
|
||||||
terrno = TSDB_CODE_TQ_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_TQ_OUT_OF_MEMORY;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
pTq->path = strdup(path);
|
pTq->path = strdup(path);
|
||||||
pTq->tqConfig = tqConfig;
|
|
||||||
pTq->pVnode = pVnode;
|
pTq->pVnode = pVnode;
|
||||||
pTq->pWal = pWal;
|
pTq->pWal = pWal;
|
||||||
pTq->pVnodeMeta = pVnodeMeta;
|
pTq->pVnodeMeta = pVnodeMeta;
|
||||||
|
@ -267,7 +265,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) recv poll req in vg %d, req %ld %ld", consumerId, pReq->epoch,
|
vDebug("tmq poll: consumer %ld (epoch %d) recv poll req in vg %d, req %ld %ld", consumerId, pReq->epoch,
|
||||||
pTq->pVnode->vgId, pReq->currentOffset, fetchOffset);
|
TD_VID(pTq->pVnode), pReq->currentOffset, fetchOffset);
|
||||||
|
|
||||||
SMqPollRsp rsp = {
|
SMqPollRsp rsp = {
|
||||||
/*.consumerId = consumerId,*/
|
/*.consumerId = consumerId,*/
|
||||||
|
@ -277,7 +275,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
|
|
||||||
STqConsumer* pConsumer = tqHandleGet(pTq->tqMeta, consumerId);
|
STqConsumer* pConsumer = tqHandleGet(pTq->tqMeta, consumerId);
|
||||||
if (pConsumer == NULL) {
|
if (pConsumer == NULL) {
|
||||||
vWarn("tmq poll: consumer %ld (epoch %d) not found in vg %d", consumerId, pReq->epoch, pTq->pVnode->vgId);
|
vWarn("tmq poll: consumer %ld (epoch %d) not found in vg %d", consumerId, pReq->epoch, TD_VID(pTq->pVnode));
|
||||||
pMsg->pCont = NULL;
|
pMsg->pCont = NULL;
|
||||||
pMsg->contLen = 0;
|
pMsg->contLen = 0;
|
||||||
pMsg->code = -1;
|
pMsg->code = -1;
|
||||||
|
@ -303,7 +301,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
}
|
}
|
||||||
if (pTopic == NULL) {
|
if (pTopic == NULL) {
|
||||||
vWarn("tmq poll: consumer %ld (epoch %d) topic %s not found in vg %d", consumerId, pReq->epoch, pReq->topic,
|
vWarn("tmq poll: consumer %ld (epoch %d) topic %s not found in vg %d", consumerId, pReq->epoch, pReq->topic,
|
||||||
pTq->pVnode->vgId);
|
TD_VID(pTq->pVnode));
|
||||||
pMsg->pCont = NULL;
|
pMsg->pCont = NULL;
|
||||||
pMsg->contLen = 0;
|
pMsg->contLen = 0;
|
||||||
pMsg->code = -1;
|
pMsg->code = -1;
|
||||||
|
@ -312,7 +310,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
vDebug("poll topic %s from consumer %ld (epoch %d) vg %d", pTopic->topicName, consumerId, pReq->epoch,
|
vDebug("poll topic %s from consumer %ld (epoch %d) vg %d", pTopic->topicName, consumerId, pReq->epoch,
|
||||||
pTq->pVnode->vgId);
|
TD_VID(pTq->pVnode));
|
||||||
|
|
||||||
rsp.reqOffset = pReq->currentOffset;
|
rsp.reqOffset = pReq->currentOffset;
|
||||||
rsp.skipLogNum = 0;
|
rsp.skipLogNum = 0;
|
||||||
|
@ -323,7 +321,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
consumerEpoch = atomic_load_32(&pConsumer->epoch);
|
consumerEpoch = atomic_load_32(&pConsumer->epoch);
|
||||||
if (consumerEpoch > reqEpoch) {
|
if (consumerEpoch > reqEpoch) {
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) vg %d offset %ld, found new consumer epoch %d discard req epoch %d",
|
vDebug("tmq poll: consumer %ld (epoch %d) vg %d offset %ld, found new consumer epoch %d discard req epoch %d",
|
||||||
consumerId, pReq->epoch, pTq->pVnode->vgId, fetchOffset, consumerEpoch, reqEpoch);
|
consumerId, pReq->epoch, TD_VID(pTq->pVnode), fetchOffset, consumerEpoch, reqEpoch);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SWalReadHead* pHead;
|
SWalReadHead* pHead;
|
||||||
|
@ -332,11 +330,11 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
// if data inserted during waiting, launch query and
|
// if data inserted during waiting, launch query and
|
||||||
// response to user
|
// response to user
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) vg %d offset %ld, no more log to return", consumerId, pReq->epoch,
|
vDebug("tmq poll: consumer %ld (epoch %d) vg %d offset %ld, no more log to return", consumerId, pReq->epoch,
|
||||||
pTq->pVnode->vgId, fetchOffset);
|
TD_VID(pTq->pVnode), fetchOffset);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) iter log, vg %d offset %ld msgType %d", consumerId, pReq->epoch,
|
vDebug("tmq poll: consumer %ld (epoch %d) iter log, vg %d offset %ld msgType %d", consumerId, pReq->epoch,
|
||||||
pTq->pVnode->vgId, fetchOffset, pHead->msgType);
|
TD_VID(pTq->pVnode), fetchOffset, pHead->msgType);
|
||||||
/*int8_t pos = fetchOffset % TQ_BUFFER_SIZE;*/
|
/*int8_t pos = fetchOffset % TQ_BUFFER_SIZE;*/
|
||||||
/*pHead = pTopic->pReadhandle->pHead;*/
|
/*pHead = pTopic->pReadhandle->pHead;*/
|
||||||
if (pHead->msgType == TDMT_VND_SUBMIT) {
|
if (pHead->msgType == TDMT_VND_SUBMIT) {
|
||||||
|
@ -361,7 +359,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
|
|
||||||
if (taosArrayGetSize(pRes) == 0) {
|
if (taosArrayGetSize(pRes) == 0) {
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) iter log, vg %d skip log %ld since not wanted", consumerId,
|
vDebug("tmq poll: consumer %ld (epoch %d) iter log, vg %d skip log %ld since not wanted", consumerId,
|
||||||
pReq->epoch, pTq->pVnode->vgId, fetchOffset);
|
pReq->epoch, TD_VID(pTq->pVnode), fetchOffset);
|
||||||
fetchOffset++;
|
fetchOffset++;
|
||||||
rsp.skipLogNum++;
|
rsp.skipLogNum++;
|
||||||
taosArrayDestroy(pRes);
|
taosArrayDestroy(pRes);
|
||||||
|
@ -390,7 +388,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
pMsg->pCont = buf;
|
pMsg->pCont = buf;
|
||||||
pMsg->contLen = tlen;
|
pMsg->contLen = tlen;
|
||||||
pMsg->code = 0;
|
pMsg->code = 0;
|
||||||
vDebug("vg %d offset %ld msgType %d from consumer %ld (epoch %d) actual rsp", pTq->pVnode->vgId, fetchOffset,
|
vDebug("vg %d offset %ld msgType %d from consumer %ld (epoch %d) actual rsp", TD_VID(pTq->pVnode), fetchOffset,
|
||||||
pHead->msgType, consumerId, pReq->epoch);
|
pHead->msgType, consumerId, pReq->epoch);
|
||||||
tmsgSendRsp(pMsg);
|
tmsgSendRsp(pMsg);
|
||||||
taosMemoryFree(pHead);
|
taosMemoryFree(pHead);
|
||||||
|
@ -422,7 +420,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
pMsg->contLen = tlen;
|
pMsg->contLen = tlen;
|
||||||
pMsg->code = 0;
|
pMsg->code = 0;
|
||||||
tmsgSendRsp(pMsg);
|
tmsgSendRsp(pMsg);
|
||||||
vDebug("vg %d offset %ld from consumer %ld (epoch %d) not rsp", pTq->pVnode->vgId, fetchOffset, consumerId,
|
vDebug("vg %d offset %ld from consumer %ld (epoch %d) not rsp", TD_VID(pTq->pVnode), fetchOffset, consumerId,
|
||||||
pReq->epoch);
|
pReq->epoch);
|
||||||
/*}*/
|
/*}*/
|
||||||
|
|
||||||
|
@ -446,14 +444,14 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) recv poll req in vg %d, req %ld %ld", consumerId, pReq->epoch,
|
vDebug("tmq poll: consumer %ld (epoch %d) recv poll req in vg %d, req %ld %ld", consumerId, pReq->epoch,
|
||||||
pTq->pVnode->vgId, pReq->currentOffset, fetchOffset);
|
TD_VID(pTq->pVnode), pReq->currentOffset, fetchOffset);
|
||||||
|
|
||||||
SMqPollRspV2 rspV2 = {0};
|
SMqPollRspV2 rspV2 = {0};
|
||||||
rspV2.dataLen = 0;
|
rspV2.dataLen = 0;
|
||||||
|
|
||||||
STqConsumer* pConsumer = tqHandleGet(pTq->tqMeta, consumerId);
|
STqConsumer* pConsumer = tqHandleGet(pTq->tqMeta, consumerId);
|
||||||
if (pConsumer == NULL) {
|
if (pConsumer == NULL) {
|
||||||
vWarn("tmq poll: consumer %ld (epoch %d) not found in vg %d", consumerId, pReq->epoch, pTq->pVnode->vgId);
|
vWarn("tmq poll: consumer %ld (epoch %d) not found in vg %d", consumerId, pReq->epoch, TD_VID(pTq->pVnode));
|
||||||
pMsg->pCont = NULL;
|
pMsg->pCont = NULL;
|
||||||
pMsg->contLen = 0;
|
pMsg->contLen = 0;
|
||||||
pMsg->code = -1;
|
pMsg->code = -1;
|
||||||
|
@ -479,7 +477,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
}
|
}
|
||||||
if (pTopic == NULL) {
|
if (pTopic == NULL) {
|
||||||
vWarn("tmq poll: consumer %ld (epoch %d) topic %s not found in vg %d", consumerId, pReq->epoch, pReq->topic,
|
vWarn("tmq poll: consumer %ld (epoch %d) topic %s not found in vg %d", consumerId, pReq->epoch, pReq->topic,
|
||||||
pTq->pVnode->vgId);
|
TD_VID(pTq->pVnode));
|
||||||
pMsg->pCont = NULL;
|
pMsg->pCont = NULL;
|
||||||
pMsg->contLen = 0;
|
pMsg->contLen = 0;
|
||||||
pMsg->code = -1;
|
pMsg->code = -1;
|
||||||
|
@ -488,7 +486,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
vDebug("poll topic %s from consumer %ld (epoch %d) vg %d", pTopic->topicName, consumerId, pReq->epoch,
|
vDebug("poll topic %s from consumer %ld (epoch %d) vg %d", pTopic->topicName, consumerId, pReq->epoch,
|
||||||
pTq->pVnode->vgId);
|
TD_VID(pTq->pVnode));
|
||||||
|
|
||||||
rspV2.reqOffset = pReq->currentOffset;
|
rspV2.reqOffset = pReq->currentOffset;
|
||||||
rspV2.skipLogNum = 0;
|
rspV2.skipLogNum = 0;
|
||||||
|
@ -499,7 +497,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
consumerEpoch = atomic_load_32(&pConsumer->epoch);
|
consumerEpoch = atomic_load_32(&pConsumer->epoch);
|
||||||
if (consumerEpoch > reqEpoch) {
|
if (consumerEpoch > reqEpoch) {
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) vg %d offset %ld, found new consumer epoch %d discard req epoch %d",
|
vDebug("tmq poll: consumer %ld (epoch %d) vg %d offset %ld, found new consumer epoch %d discard req epoch %d",
|
||||||
consumerId, pReq->epoch, pTq->pVnode->vgId, fetchOffset, consumerEpoch, reqEpoch);
|
consumerId, pReq->epoch, TD_VID(pTq->pVnode), fetchOffset, consumerEpoch, reqEpoch);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SWalReadHead* pHead;
|
SWalReadHead* pHead;
|
||||||
|
@ -508,11 +506,11 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
// if data inserted during waiting, launch query and
|
// if data inserted during waiting, launch query and
|
||||||
// response to user
|
// response to user
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) vg %d offset %ld, no more log to return", consumerId, pReq->epoch,
|
vDebug("tmq poll: consumer %ld (epoch %d) vg %d offset %ld, no more log to return", consumerId, pReq->epoch,
|
||||||
pTq->pVnode->vgId, fetchOffset);
|
TD_VID(pTq->pVnode), fetchOffset);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) iter log, vg %d offset %ld msgType %d", consumerId, pReq->epoch,
|
vDebug("tmq poll: consumer %ld (epoch %d) iter log, vg %d offset %ld msgType %d", consumerId, pReq->epoch,
|
||||||
pTq->pVnode->vgId, fetchOffset, pHead->msgType);
|
TD_VID(pTq->pVnode), fetchOffset, pHead->msgType);
|
||||||
/*int8_t pos = fetchOffset % TQ_BUFFER_SIZE;*/
|
/*int8_t pos = fetchOffset % TQ_BUFFER_SIZE;*/
|
||||||
/*pHead = pTopic->pReadhandle->pHead;*/
|
/*pHead = pTopic->pReadhandle->pHead;*/
|
||||||
if (pHead->msgType == TDMT_VND_SUBMIT) {
|
if (pHead->msgType == TDMT_VND_SUBMIT) {
|
||||||
|
@ -537,7 +535,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
|
|
||||||
if (taosArrayGetSize(pRes) == 0) {
|
if (taosArrayGetSize(pRes) == 0) {
|
||||||
vDebug("tmq poll: consumer %ld (epoch %d) iter log, vg %d skip log %ld since not wanted", consumerId,
|
vDebug("tmq poll: consumer %ld (epoch %d) iter log, vg %d skip log %ld since not wanted", consumerId,
|
||||||
pReq->epoch, pTq->pVnode->vgId, fetchOffset);
|
pReq->epoch, TD_VID(pTq->pVnode), fetchOffset);
|
||||||
fetchOffset++;
|
fetchOffset++;
|
||||||
rspV2.skipLogNum++;
|
rspV2.skipLogNum++;
|
||||||
taosArrayDestroy(pRes);
|
taosArrayDestroy(pRes);
|
||||||
|
@ -597,7 +595,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
pMsg->pCont = buf;
|
pMsg->pCont = buf;
|
||||||
pMsg->contLen = msgLen;
|
pMsg->contLen = msgLen;
|
||||||
pMsg->code = 0;
|
pMsg->code = 0;
|
||||||
vDebug("vg %d offset %ld msgType %d from consumer %ld (epoch %d) actual rsp", pTq->pVnode->vgId, fetchOffset,
|
vDebug("vg %d offset %ld msgType %d from consumer %ld (epoch %d) actual rsp", TD_VID(pTq->pVnode), fetchOffset,
|
||||||
pHead->msgType, consumerId, pReq->epoch);
|
pHead->msgType, consumerId, pReq->epoch);
|
||||||
tmsgSendRsp(pMsg);
|
tmsgSendRsp(pMsg);
|
||||||
taosMemoryFree(pHead);
|
taosMemoryFree(pHead);
|
||||||
|
@ -631,7 +629,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
pMsg->contLen = tlen;
|
pMsg->contLen = tlen;
|
||||||
pMsg->code = 0;
|
pMsg->code = 0;
|
||||||
tmsgSendRsp(pMsg);
|
tmsgSendRsp(pMsg);
|
||||||
vDebug("vg %d offset %ld from consumer %ld (epoch %d) not rsp", pTq->pVnode->vgId, fetchOffset, consumerId,
|
vDebug("vg %d offset %ld from consumer %ld (epoch %d) not rsp", TD_VID(pTq->pVnode), fetchOffset, consumerId,
|
||||||
pReq->epoch);
|
pReq->epoch);
|
||||||
/*}*/
|
/*}*/
|
||||||
|
|
||||||
|
@ -742,7 +740,7 @@ int32_t tqProcessSetConnReq(STQ* pTq, char* msg) {
|
||||||
pTopic->buffer.output[i].task = qCreateStreamExecTaskInfo(req.qmsg, &handle);
|
pTopic->buffer.output[i].task = qCreateStreamExecTaskInfo(req.qmsg, &handle);
|
||||||
ASSERT(pTopic->buffer.output[i].task);
|
ASSERT(pTopic->buffer.output[i].task);
|
||||||
}
|
}
|
||||||
vDebug("set topic %s to consumer %ld on vg %d", pTopic->topicName, req.consumerId, pTq->pVnode->vgId);
|
vDebug("set topic %s to consumer %ld on vg %d", pTopic->topicName, req.consumerId, TD_VID(pTq->pVnode));
|
||||||
taosArrayPush(pConsumer->topics, pTopic);
|
taosArrayPush(pConsumer->topics, pTopic);
|
||||||
if (create) {
|
if (create) {
|
||||||
tqHandleMovePut(pTq->tqMeta, req.consumerId, pConsumer);
|
tqHandleMovePut(pTq->tqMeta, req.consumerId, pConsumer);
|
||||||
|
|
|
@ -108,7 +108,7 @@ int vnodeLoadInfo(const char *dir, SVnodeInfo *pInfo) {
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
pData = taosMemoryMalloc(size);
|
pData = taosMemoryMalloc(size + 1);
|
||||||
if (pData == NULL) {
|
if (pData == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
goto _err;
|
goto _err;
|
||||||
|
@ -119,6 +119,8 @@ int vnodeLoadInfo(const char *dir, SVnodeInfo *pInfo) {
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pData[size] = '\0';
|
||||||
|
|
||||||
taosCloseFile(&pFile);
|
taosCloseFile(&pFile);
|
||||||
|
|
||||||
// decode info
|
// decode info
|
||||||
|
@ -202,6 +204,16 @@ static int vnodeEncodeConfig(const void *pObj, SJson *pJson) {
|
||||||
if (tjsonAddIntegerToObject(pJson, "keep1", pCfg->tsdbCfg.keep1) < 0) return -1;
|
if (tjsonAddIntegerToObject(pJson, "keep1", pCfg->tsdbCfg.keep1) < 0) return -1;
|
||||||
if (tjsonAddIntegerToObject(pJson, "keep2", pCfg->tsdbCfg.keep2) < 0) return -1;
|
if (tjsonAddIntegerToObject(pJson, "keep2", pCfg->tsdbCfg.keep2) < 0) return -1;
|
||||||
if (tjsonAddIntegerToObject(pJson, "lruCacheSize", pCfg->tsdbCfg.lruCacheSize) < 0) return -1;
|
if (tjsonAddIntegerToObject(pJson, "lruCacheSize", pCfg->tsdbCfg.lruCacheSize) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "wal.vgId", pCfg->walCfg.vgId) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "wal.fsyncPeriod", pCfg->walCfg.fsyncPeriod) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "wal.retentionPeriod", pCfg->walCfg.retentionPeriod) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "wal.rollPeriod", pCfg->walCfg.rollPeriod) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "wal.retentionSize", pCfg->walCfg.retentionSize) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "wal.segSize", pCfg->walCfg.segSize) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "wal.level", pCfg->walCfg.level) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "hashBegin", pCfg->hashBegin) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "hashEnd", pCfg->hashEnd) < 0) return -1;
|
||||||
|
if (tjsonAddIntegerToObject(pJson, "hashMethod", pCfg->hashMethod) < 0) return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -229,6 +241,16 @@ static int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
|
||||||
if (tjsonGetNumberValue(pJson, "keep1", pCfg->tsdbCfg.keep1) < 0) return -1;
|
if (tjsonGetNumberValue(pJson, "keep1", pCfg->tsdbCfg.keep1) < 0) return -1;
|
||||||
if (tjsonGetNumberValue(pJson, "keep2", pCfg->tsdbCfg.keep2) < 0) return -1;
|
if (tjsonGetNumberValue(pJson, "keep2", pCfg->tsdbCfg.keep2) < 0) return -1;
|
||||||
if (tjsonGetNumberValue(pJson, "lruCacheSize", pCfg->tsdbCfg.lruCacheSize) < 0) return -1;
|
if (tjsonGetNumberValue(pJson, "lruCacheSize", pCfg->tsdbCfg.lruCacheSize) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "wal.vgId", pCfg->walCfg.vgId) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "wal.fsyncPeriod", pCfg->walCfg.fsyncPeriod) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "wal.retentionPeriod", pCfg->walCfg.retentionPeriod) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "wal.rollPeriod", pCfg->walCfg.rollPeriod) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "wal.retentionSize", pCfg->walCfg.retentionSize) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "wal.segSize", pCfg->walCfg.segSize) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "wal.level", pCfg->walCfg.level) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "hashBegin", pCfg->hashBegin) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "hashEnd", pCfg->hashEnd) < 0) return -1;
|
||||||
|
if (tjsonGetNumberValue(pJson, "hashMethod", pCfg->hashMethod) < 0) return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -286,7 +308,7 @@ _err:
|
||||||
static int vnodeDecodeInfo(uint8_t *pData, SVnodeInfo *pInfo) {
|
static int vnodeDecodeInfo(uint8_t *pData, SVnodeInfo *pInfo) {
|
||||||
SJson *pJson = NULL;
|
SJson *pJson = NULL;
|
||||||
|
|
||||||
pJson = tjsonCreateObject();
|
pJson = tjsonParse(pData);
|
||||||
if (pJson == NULL) {
|
if (pJson == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
|
|
||||||
#include "vnodeInt.h"
|
#include "vnodeInt.h"
|
||||||
|
|
||||||
static SVnode *vnodeNew(const char *path, const SVnodeCfg *pVnodeCfg);
|
|
||||||
static void vnodeFree(SVnode *pVnode);
|
|
||||||
static int vnodeOpenImpl(SVnode *pVnode);
|
static int vnodeOpenImpl(SVnode *pVnode);
|
||||||
static void vnodeCloseImpl(SVnode *pVnode);
|
static void vnodeCloseImpl(SVnode *pVnode);
|
||||||
|
|
||||||
|
@ -51,37 +49,41 @@ int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg) {
|
void vnodeDestroy(const char *path, STfs *pTfs) { tfsRmdir(pTfs, path); }
|
||||||
|
|
||||||
|
SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
|
||||||
SVnode *pVnode = NULL;
|
SVnode *pVnode = NULL;
|
||||||
|
SVnodeInfo info = {0};
|
||||||
|
char dir[TSDB_FILENAME_LEN];
|
||||||
|
int ret;
|
||||||
|
|
||||||
// Set default options
|
snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pTfs), TD_DIRSEP, path);
|
||||||
SVnodeCfg cfg = vnodeCfgDefault;
|
|
||||||
if (pVnodeCfg != NULL) {
|
|
||||||
cfg.vgId = pVnodeCfg->vgId;
|
|
||||||
cfg.msgCb = pVnodeCfg->msgCb;
|
|
||||||
cfg.pTfs = pVnodeCfg->pTfs;
|
|
||||||
cfg.dbId = pVnodeCfg->dbId;
|
|
||||||
cfg.hashBegin = pVnodeCfg->hashBegin;
|
|
||||||
cfg.hashEnd = pVnodeCfg->hashEnd;
|
|
||||||
cfg.hashMethod = pVnodeCfg->hashMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate options
|
// load vnode info
|
||||||
if (vnodeCheckCfg(&cfg) < 0) {
|
ret = vnodeLoadInfo(dir, &info);
|
||||||
// TODO
|
if (ret < 0) {
|
||||||
|
vError("failed to open vnode from %s since %s", path, tstrerror(terrno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the handle
|
// create handle
|
||||||
pVnode = vnodeNew(path, &cfg);
|
pVnode = (SVnode *)taosMemoryCalloc(1, sizeof(*pVnode));
|
||||||
if (pVnode == NULL) {
|
if (pVnode == NULL) {
|
||||||
// TODO: handle error
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
vError("vgId: %d failed to open vnode since %s", info.config.vgId, tstrerror(terrno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMkDir(path);
|
pVnode->path = strdup(dir);
|
||||||
|
pVnode->config = info.config;
|
||||||
|
pVnode->state.committed = info.state.committed;
|
||||||
|
pVnode->state.processed = pVnode->state.applied = pVnode->state.committed;
|
||||||
|
pVnode->pTfs = pTfs;
|
||||||
|
pVnode->msgCb = msgCb;
|
||||||
|
|
||||||
// Open the vnode
|
tsem_init(&(pVnode->canCommit), 0, 1);
|
||||||
|
|
||||||
|
// open the vnode
|
||||||
if (vnodeOpenImpl(pVnode) < 0) {
|
if (vnodeOpenImpl(pVnode) < 0) {
|
||||||
// TODO: handle error
|
// TODO: handle error
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -93,41 +95,13 @@ SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg) {
|
||||||
void vnodeClose(SVnode *pVnode) {
|
void vnodeClose(SVnode *pVnode) {
|
||||||
if (pVnode) {
|
if (pVnode) {
|
||||||
vnodeCloseImpl(pVnode);
|
vnodeCloseImpl(pVnode);
|
||||||
vnodeFree(pVnode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void vnodeDestroy(const char *path) { taosRemoveDir(path); }
|
|
||||||
|
|
||||||
/* ------------------------ STATIC METHODS ------------------------ */
|
|
||||||
static SVnode *vnodeNew(const char *path, const SVnodeCfg *pVnodeCfg) {
|
|
||||||
SVnode *pVnode = NULL;
|
|
||||||
|
|
||||||
pVnode = (SVnode *)taosMemoryCalloc(1, sizeof(*pVnode));
|
|
||||||
if (pVnode == NULL) {
|
|
||||||
// TODO
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
pVnode->vgId = pVnodeCfg->vgId;
|
|
||||||
pVnode->msgCb = pVnodeCfg->msgCb;
|
|
||||||
pVnode->pTfs = pVnodeCfg->pTfs;
|
|
||||||
pVnode->path = strdup(path);
|
|
||||||
vnodeOptionsCopy(&(pVnode->config), pVnodeCfg);
|
|
||||||
|
|
||||||
tsem_init(&(pVnode->canCommit), 0, 1);
|
|
||||||
|
|
||||||
return pVnode;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void vnodeFree(SVnode *pVnode) {
|
|
||||||
if (pVnode) {
|
|
||||||
tsem_destroy(&(pVnode->canCommit));
|
tsem_destroy(&(pVnode->canCommit));
|
||||||
taosMemoryFreeClear(pVnode->path);
|
taosMemoryFreeClear(pVnode->path);
|
||||||
taosMemoryFree(pVnode);
|
taosMemoryFree(pVnode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ------------------------ STATIC METHODS ------------------------ */
|
||||||
static int vnodeOpenImpl(SVnode *pVnode) {
|
static int vnodeOpenImpl(SVnode *pVnode) {
|
||||||
char dir[TSDB_FILENAME_LEN];
|
char dir[TSDB_FILENAME_LEN];
|
||||||
|
|
||||||
|
@ -138,7 +112,7 @@ static int vnodeOpenImpl(SVnode *pVnode) {
|
||||||
|
|
||||||
// Open meta
|
// Open meta
|
||||||
sprintf(dir, "%s/meta", pVnode->path);
|
sprintf(dir, "%s/meta", pVnode->path);
|
||||||
pVnode->pMeta = metaOpen(dir, &(pVnode->config.metaCfg), vBufPoolGetMAF(pVnode));
|
pVnode->pMeta = metaOpen(dir, vBufPoolGetMAF(pVnode));
|
||||||
if (pVnode->pMeta == NULL) {
|
if (pVnode->pMeta == NULL) {
|
||||||
// TODO: handle error
|
// TODO: handle error
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -147,7 +121,7 @@ static int vnodeOpenImpl(SVnode *pVnode) {
|
||||||
// Open tsdb
|
// Open tsdb
|
||||||
sprintf(dir, "%s/tsdb", pVnode->path);
|
sprintf(dir, "%s/tsdb", pVnode->path);
|
||||||
pVnode->pTsdb =
|
pVnode->pTsdb =
|
||||||
tsdbOpen(dir, pVnode->vgId, &(pVnode->config.tsdbCfg), vBufPoolGetMAF(pVnode), pVnode->pMeta, pVnode->pTfs);
|
tsdbOpen(dir, TD_VID(pVnode), &(pVnode->config.tsdbCfg), vBufPoolGetMAF(pVnode), pVnode->pMeta, pVnode->pTfs);
|
||||||
if (pVnode->pTsdb == NULL) {
|
if (pVnode->pTsdb == NULL) {
|
||||||
// TODO: handle error
|
// TODO: handle error
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -163,7 +137,7 @@ static int vnodeOpenImpl(SVnode *pVnode) {
|
||||||
|
|
||||||
// Open TQ
|
// Open TQ
|
||||||
sprintf(dir, "%s/tq", pVnode->path);
|
sprintf(dir, "%s/tq", pVnode->path);
|
||||||
pVnode->pTq = tqOpen(dir, pVnode, pVnode->pWal, pVnode->pMeta, &(pVnode->config.tqCfg), vBufPoolGetMAF(pVnode));
|
pVnode->pTq = tqOpen(dir, pVnode, pVnode->pWal, pVnode->pMeta, vBufPoolGetMAF(pVnode));
|
||||||
if (pVnode->pTq == NULL) {
|
if (pVnode->pTq == NULL) {
|
||||||
// TODO: handle error
|
// TODO: handle error
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "vnodeInt.h"
|
#include "vnodeInt.h"
|
||||||
|
|
||||||
int vnodeQueryOpen(SVnode *pVnode) {
|
int vnodeQueryOpen(SVnode *pVnode) {
|
||||||
return qWorkerInit(NODE_TYPE_VNODE, pVnode->vgId, NULL, (void **)&pVnode->pQuery, &pVnode->msgCb);
|
return qWorkerInit(NODE_TYPE_VNODE, TD_VID(pVnode), NULL, (void **)&pVnode->pQuery, &pVnode->msgCb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void vnodeQueryClose(SVnode *pVnode) { qWorkerDestroy((void **)&pVnode->pQuery); }
|
void vnodeQueryClose(SVnode *pVnode) { qWorkerDestroy((void **)&pVnode->pQuery); }
|
||||||
|
@ -101,7 +101,7 @@ int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg) {
|
||||||
metaRsp.numOfColumns = nCols;
|
metaRsp.numOfColumns = nCols;
|
||||||
metaRsp.tableType = pTbCfg->type;
|
metaRsp.tableType = pTbCfg->type;
|
||||||
metaRsp.tuid = uid;
|
metaRsp.tuid = uid;
|
||||||
metaRsp.vgId = pVnode->vgId;
|
metaRsp.vgId = TD_VID(pVnode);
|
||||||
|
|
||||||
memcpy(metaRsp.pSchemas, pSW->pSchema, sizeof(SSchema) * pSW->nCols);
|
memcpy(metaRsp.pSchemas, pSW->pSchema, sizeof(SSchema) * pSW->nCols);
|
||||||
if (nTagCols) {
|
if (nTagCols) {
|
||||||
|
@ -151,7 +151,7 @@ _exit:
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) {
|
int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) {
|
||||||
pLoad->vgId = pVnode->vgId;
|
pLoad->vgId = TD_VID(pVnode);
|
||||||
pLoad->role = TAOS_SYNC_STATE_LEADER;
|
pLoad->role = TAOS_SYNC_STATE_LEADER;
|
||||||
pLoad->numOfTables = metaGetTbNum(pVnode->pMeta);
|
pLoad->numOfTables = metaGetTbNum(pVnode->pMeta);
|
||||||
pLoad->numOfTimeSeries = 400;
|
pLoad->numOfTimeSeries = 400;
|
||||||
|
|
|
@ -36,7 +36,7 @@ void vnodePreprocessWriteReqs(SVnode *pVnode, SArray *pMsgs) {
|
||||||
if (walWrite(pVnode->pWal, ver, pRpc->msgType, pRpc->pCont, pRpc->contLen) < 0) {
|
if (walWrite(pVnode->pWal, ver, pRpc->msgType, pRpc->pCont, pRpc->contLen) < 0) {
|
||||||
// TODO: handle error
|
// TODO: handle error
|
||||||
/*ASSERT(false);*/
|
/*ASSERT(false);*/
|
||||||
vError("vnode:%d write wal error since %s", pVnode->vgId, terrstr());
|
vError("vnode:%d write wal error since %s", TD_VID(pVnode), terrstr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,12 +73,12 @@ int vnodeProcessWriteReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
||||||
case TDMT_VND_ALTER_STB:
|
case TDMT_VND_ALTER_STB:
|
||||||
return vnodeProcessAlterStbReq(pVnode, POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead)));
|
return vnodeProcessAlterStbReq(pVnode, POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead)));
|
||||||
case TDMT_VND_DROP_STB:
|
case TDMT_VND_DROP_STB:
|
||||||
vTrace("vgId:%d, process drop stb req", pVnode->vgId);
|
vTrace("vgId:%d, process drop stb req", TD_VID(pVnode));
|
||||||
break;
|
break;
|
||||||
case TDMT_VND_DROP_TABLE:
|
case TDMT_VND_DROP_TABLE:
|
||||||
break;
|
break;
|
||||||
case TDMT_VND_SUBMIT:
|
case TDMT_VND_SUBMIT:
|
||||||
/*printf("vnode %d write data %ld\n", pVnode->vgId, ver);*/
|
/*printf("vnode %d write data %ld\n", TD_VID(pVnode), ver);*/
|
||||||
if (pVnode->config.streamMode == 0) {
|
if (pVnode->config.streamMode == 0) {
|
||||||
*pRsp = taosMemoryCalloc(1, sizeof(SRpcMsg));
|
*pRsp = taosMemoryCalloc(1, sizeof(SRpcMsg));
|
||||||
(*pRsp)->handle = pMsg->handle;
|
(*pRsp)->handle = pMsg->handle;
|
||||||
|
@ -245,7 +245,7 @@ static int vnodeProcessCreateTbReq(SVnode *pVnode, SRpcMsg *pMsg, void *pReq, SR
|
||||||
|
|
||||||
if (metaCreateTable(pVnode->pMeta, pCreateTbReq) < 0) {
|
if (metaCreateTable(pVnode->pMeta, pCreateTbReq) < 0) {
|
||||||
// TODO: handle error
|
// TODO: handle error
|
||||||
vError("vgId:%d, failed to create table: %s", pVnode->vgId, pCreateTbReq->name);
|
vError("vgId:%d, failed to create table: %s", TD_VID(pVnode), pCreateTbReq->name);
|
||||||
}
|
}
|
||||||
// TODO: to encapsule a free API
|
// TODO: to encapsule a free API
|
||||||
taosMemoryFree(pCreateTbReq->name);
|
taosMemoryFree(pCreateTbReq->name);
|
||||||
|
@ -268,7 +268,7 @@ static int vnodeProcessCreateTbReq(SVnode *pVnode, SRpcMsg *pMsg, void *pReq, SR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vTrace("vgId:%d process create %" PRIzu " tables", pVnode->vgId, taosArrayGetSize(vCreateTbBatchReq.pArray));
|
vTrace("vgId:%d process create %" PRIzu " tables", TD_VID(pVnode), taosArrayGetSize(vCreateTbBatchReq.pArray));
|
||||||
taosArrayDestroy(vCreateTbBatchReq.pArray);
|
taosArrayDestroy(vCreateTbBatchReq.pArray);
|
||||||
if (vCreateTbBatchRsp.rspList) {
|
if (vCreateTbBatchRsp.rspList) {
|
||||||
int32_t contLen = tSerializeSVCreateTbBatchRsp(NULL, 0, &vCreateTbBatchRsp);
|
int32_t contLen = tSerializeSVCreateTbBatchRsp(NULL, 0, &vCreateTbBatchRsp);
|
||||||
|
@ -289,7 +289,7 @@ static int vnodeProcessCreateTbReq(SVnode *pVnode, SRpcMsg *pMsg, void *pReq, SR
|
||||||
|
|
||||||
static int vnodeProcessAlterStbReq(SVnode *pVnode, void *pReq) {
|
static int vnodeProcessAlterStbReq(SVnode *pVnode, void *pReq) {
|
||||||
SVCreateTbReq vAlterTbReq = {0};
|
SVCreateTbReq vAlterTbReq = {0};
|
||||||
vTrace("vgId:%d, process alter stb req", pVnode->vgId);
|
vTrace("vgId:%d, process alter stb req", TD_VID(pVnode));
|
||||||
tDeserializeSVCreateTbReq(pReq, &vAlterTbReq);
|
tDeserializeSVCreateTbReq(pReq, &vAlterTbReq);
|
||||||
// TODO: to encapsule a free API
|
// TODO: to encapsule a free API
|
||||||
taosMemoryFree(vAlterTbReq.stbCfg.pSchema);
|
taosMemoryFree(vAlterTbReq.stbCfg.pSchema);
|
||||||
|
|
|
@ -316,6 +316,9 @@ int32_t qExplainResAppendRow(SExplainCtx *ctx, char *tbuf, int32_t len, int32_t
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint8_t getIntervalPrecision(SIntervalPhysiNode* pIntNode) {
|
||||||
|
return ((SColumnNode*)pIntNode->window.pTspk)->node.resType.precision;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, int32_t level) {
|
int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, int32_t level) {
|
||||||
int32_t tlen = 0;
|
int32_t tlen = 0;
|
||||||
|
@ -658,10 +661,10 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
|
||||||
EXPLAIN_ROW_APPEND(EXPLAIN_WIDTH_FORMAT, pIntNode->window.node.pOutputDataBlockDesc->outputRowSize);
|
EXPLAIN_ROW_APPEND(EXPLAIN_WIDTH_FORMAT, pIntNode->window.node.pOutputDataBlockDesc->outputRowSize);
|
||||||
EXPLAIN_ROW_END();
|
EXPLAIN_ROW_END();
|
||||||
QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1));
|
QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1));
|
||||||
|
uint8_t precision = getIntervalPrecision(pIntNode);
|
||||||
EXPLAIN_ROW_NEW(level + 1, EXPLAIN_TIME_WINDOWS_FORMAT, INVERAL_TIME_FROM_PRECISION_TO_UNIT(pIntNode->interval, pIntNode->intervalUnit, pIntNode->precision),
|
EXPLAIN_ROW_NEW(level + 1, EXPLAIN_TIME_WINDOWS_FORMAT, INVERAL_TIME_FROM_PRECISION_TO_UNIT(pIntNode->interval, pIntNode->intervalUnit, precision),
|
||||||
pIntNode->intervalUnit, pIntNode->offset, getPrecisionUnit(pIntNode->precision),
|
pIntNode->intervalUnit, pIntNode->offset, getPrecisionUnit(precision),
|
||||||
INVERAL_TIME_FROM_PRECISION_TO_UNIT(pIntNode->sliding, pIntNode->slidingUnit, pIntNode->precision), pIntNode->slidingUnit);
|
INVERAL_TIME_FROM_PRECISION_TO_UNIT(pIntNode->sliding, pIntNode->slidingUnit, precision), pIntNode->slidingUnit);
|
||||||
EXPLAIN_ROW_END();
|
EXPLAIN_ROW_END();
|
||||||
QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1));
|
QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1));
|
||||||
|
|
||||||
|
|
|
@ -6785,7 +6785,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
|
||||||
.intervalUnit = pIntervalPhyNode->intervalUnit,
|
.intervalUnit = pIntervalPhyNode->intervalUnit,
|
||||||
.slidingUnit = pIntervalPhyNode->slidingUnit,
|
.slidingUnit = pIntervalPhyNode->slidingUnit,
|
||||||
.offset = pIntervalPhyNode->offset,
|
.offset = pIntervalPhyNode->offset,
|
||||||
.precision = pIntervalPhyNode->precision
|
.precision = ((SColumnNode*)pIntervalPhyNode->window.pTspk)->node.resType.precision
|
||||||
};
|
};
|
||||||
|
|
||||||
int32_t primaryTsSlotId = ((SColumnNode*) pIntervalPhyNode->window.pTspk)->slotId;
|
int32_t primaryTsSlotId = ((SColumnNode*) pIntervalPhyNode->window.pTspk)->slotId;
|
||||||
|
|
|
@ -138,6 +138,12 @@ static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, in
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int32_t translateTimezone(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
||||||
|
// pseudo column do not need to check parameters
|
||||||
|
pFunc->node.resType = (SDataType){.bytes = TD_TIMEZONE_LEN, .type = TSDB_DATA_TYPE_BINARY};
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
static int32_t translatePercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
static int32_t translatePercentile(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
|
||||||
if (2 != LIST_LENGTH(pFunc->pParameterList)) {
|
if (2 != LIST_LENGTH(pFunc->pParameterList)) {
|
||||||
return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName);
|
return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName);
|
||||||
|
@ -819,6 +825,16 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
.sprocessFunc = todayFunction,
|
.sprocessFunc = todayFunction,
|
||||||
.finalizeFunc = NULL
|
.finalizeFunc = NULL
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.name = "timezone",
|
||||||
|
.type = FUNCTION_TYPE_TIMEZONE,
|
||||||
|
.classification = FUNC_MGT_SCALAR_FUNC,
|
||||||
|
.translateFunc = translateTimezone,
|
||||||
|
.getEnvFunc = NULL,
|
||||||
|
.initFunc = NULL,
|
||||||
|
.sprocessFunc = timezoneFunction,
|
||||||
|
.finalizeFunc = NULL
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.name = "_rowts",
|
.name = "_rowts",
|
||||||
.type = FUNCTION_TYPE_ROWTS,
|
.type = FUNCTION_TYPE_ROWTS,
|
||||||
|
|
|
@ -748,6 +748,11 @@ static const char* jkTableScanPhysiPlanEndKey = "EndKey";
|
||||||
static const char* jkTableScanPhysiPlanRatio = "Ratio";
|
static const char* jkTableScanPhysiPlanRatio = "Ratio";
|
||||||
static const char* jkTableScanPhysiPlanDataRequired = "DataRequired";
|
static const char* jkTableScanPhysiPlanDataRequired = "DataRequired";
|
||||||
static const char* jkTableScanPhysiPlanDynamicScanFuncs = "DynamicScanFuncs";
|
static const char* jkTableScanPhysiPlanDynamicScanFuncs = "DynamicScanFuncs";
|
||||||
|
static const char* jkTableScanPhysiPlanInterval = "Interval";
|
||||||
|
static const char* jkTableScanPhysiPlanOffset = "Offset";
|
||||||
|
static const char* jkTableScanPhysiPlanSliding = "Sliding";
|
||||||
|
static const char* jkTableScanPhysiPlanIntervalUnit = "intervalUnit";
|
||||||
|
static const char* jkTableScanPhysiPlanSlidingUnit = "slidingUnit";
|
||||||
|
|
||||||
static int32_t physiTableScanNodeToJson(const void* pObj, SJson* pJson) {
|
static int32_t physiTableScanNodeToJson(const void* pObj, SJson* pJson) {
|
||||||
const STableScanPhysiNode* pNode = (const STableScanPhysiNode*)pObj;
|
const STableScanPhysiNode* pNode = (const STableScanPhysiNode*)pObj;
|
||||||
|
@ -771,6 +776,21 @@ static int32_t physiTableScanNodeToJson(const void* pObj, SJson* pJson) {
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = nodeListToJson(pJson, jkTableScanPhysiPlanDynamicScanFuncs, pNode->pDynamicScanFuncs);
|
code = nodeListToJson(pJson, jkTableScanPhysiPlanDynamicScanFuncs, pNode->pDynamicScanFuncs);
|
||||||
}
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonAddIntegerToObject(pJson, jkTableScanPhysiPlanInterval, pNode->interval);
|
||||||
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonAddIntegerToObject(pJson, jkTableScanPhysiPlanOffset, pNode->offset);
|
||||||
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonAddIntegerToObject(pJson, jkTableScanPhysiPlanSliding, pNode->sliding);
|
||||||
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonAddIntegerToObject(pJson, jkTableScanPhysiPlanIntervalUnit, pNode->intervalUnit);
|
||||||
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonAddIntegerToObject(pJson, jkTableScanPhysiPlanSlidingUnit, pNode->slidingUnit);
|
||||||
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -797,6 +817,21 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) {
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = jsonToNodeList(pJson, jkTableScanPhysiPlanDynamicScanFuncs, &pNode->pDynamicScanFuncs);
|
code = jsonToNodeList(pJson, jkTableScanPhysiPlanDynamicScanFuncs, &pNode->pDynamicScanFuncs);
|
||||||
}
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonGetNumberValue(pJson, jkTableScanPhysiPlanInterval, pNode->interval);
|
||||||
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonGetNumberValue(pJson, jkTableScanPhysiPlanOffset, pNode->offset);
|
||||||
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonGetNumberValue(pJson, jkTableScanPhysiPlanSliding, pNode->sliding);
|
||||||
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonGetNumberValue(pJson, jkTableScanPhysiPlanIntervalUnit, pNode->intervalUnit);
|
||||||
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonGetNumberValue(pJson, jkTableScanPhysiPlanSlidingUnit, pNode->slidingUnit);
|
||||||
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -1159,7 +1194,6 @@ static const char* jkIntervalPhysiPlanSliding = "Sliding";
|
||||||
static const char* jkIntervalPhysiPlanIntervalUnit = "intervalUnit";
|
static const char* jkIntervalPhysiPlanIntervalUnit = "intervalUnit";
|
||||||
static const char* jkIntervalPhysiPlanSlidingUnit = "slidingUnit";
|
static const char* jkIntervalPhysiPlanSlidingUnit = "slidingUnit";
|
||||||
static const char* jkIntervalPhysiPlanFill = "Fill";
|
static const char* jkIntervalPhysiPlanFill = "Fill";
|
||||||
static const char* jkIntervalPhysiPlanPrecision = "Precision";
|
|
||||||
|
|
||||||
static int32_t physiIntervalNodeToJson(const void* pObj, SJson* pJson) {
|
static int32_t physiIntervalNodeToJson(const void* pObj, SJson* pJson) {
|
||||||
const SIntervalPhysiNode* pNode = (const SIntervalPhysiNode*)pObj;
|
const SIntervalPhysiNode* pNode = (const SIntervalPhysiNode*)pObj;
|
||||||
|
@ -1183,9 +1217,6 @@ static int32_t physiIntervalNodeToJson(const void* pObj, SJson* pJson) {
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = tjsonAddObject(pJson, jkIntervalPhysiPlanFill, nodeToJson, pNode->pFill);
|
code = tjsonAddObject(pJson, jkIntervalPhysiPlanFill, nodeToJson, pNode->pFill);
|
||||||
}
|
}
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
|
||||||
code = tjsonAddIntegerToObject(pJson, jkIntervalPhysiPlanPrecision, pNode->precision);
|
|
||||||
}
|
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -1212,9 +1243,6 @@ static int32_t jsonToPhysiIntervalNode(const SJson* pJson, void* pObj) {
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = jsonToNodeObject(pJson, jkIntervalPhysiPlanFill, (SNode**)&pNode->pFill);
|
code = jsonToNodeObject(pJson, jkIntervalPhysiPlanFill, (SNode**)&pNode->pFill);
|
||||||
}
|
}
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
|
||||||
code = tjsonGetUTinyIntValue(pJson, jkIntervalPhysiPlanPrecision, &pNode->precision);
|
|
||||||
}
|
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,9 +87,9 @@ static EDealRes walkNode(SNode* pNode, ETraversalOrder order, FNodeWalker walker
|
||||||
}
|
}
|
||||||
case QUERY_NODE_SESSION_WINDOW: {
|
case QUERY_NODE_SESSION_WINDOW: {
|
||||||
SSessionWindowNode* pSession = (SSessionWindowNode*)pNode;
|
SSessionWindowNode* pSession = (SSessionWindowNode*)pNode;
|
||||||
res = walkNode(pSession->pCol, order, walker, pContext);
|
res = walkNode((SNode*)pSession->pCol, order, walker, pContext);
|
||||||
if (DEAL_RES_ERROR != res && DEAL_RES_END != res) {
|
if (DEAL_RES_ERROR != res && DEAL_RES_END != res) {
|
||||||
res = walkNode(pSession->pGap, order, walker, pContext);
|
res = walkNode((SNode*)pSession->pGap, order, walker, pContext);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -227,9 +227,9 @@ static EDealRes rewriteNode(SNode** pRawNode, ETraversalOrder order, FNodeRewrit
|
||||||
}
|
}
|
||||||
case QUERY_NODE_SESSION_WINDOW: {
|
case QUERY_NODE_SESSION_WINDOW: {
|
||||||
SSessionWindowNode* pSession = (SSessionWindowNode*)pNode;
|
SSessionWindowNode* pSession = (SSessionWindowNode*)pNode;
|
||||||
res = rewriteNode(&pSession->pCol, order, rewriter, pContext);
|
res = rewriteNode((SNode**)&pSession->pCol, order, rewriter, pContext);
|
||||||
if (DEAL_RES_ERROR != res && DEAL_RES_END != res) {
|
if (DEAL_RES_ERROR != res && DEAL_RES_END != res) {
|
||||||
res = rewriteNode(&pSession->pGap, order, rewriter, pContext);
|
res = rewriteNode((SNode**)&pSession->pGap, order, rewriter, pContext);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ SNode* createOperatorNode(SAstCreateContext* pCxt, EOperatorType type, SNode* pL
|
||||||
SNode* createBetweenAnd(SAstCreateContext* pCxt, SNode* pExpr, SNode* pLeft, SNode* pRight);
|
SNode* createBetweenAnd(SAstCreateContext* pCxt, SNode* pExpr, SNode* pLeft, SNode* pRight);
|
||||||
SNode* createNotBetweenAnd(SAstCreateContext* pCxt, SNode* pExpr, SNode* pLeft, SNode* pRight);
|
SNode* createNotBetweenAnd(SAstCreateContext* pCxt, SNode* pExpr, SNode* pLeft, SNode* pRight);
|
||||||
SNode* createFunctionNode(SAstCreateContext* pCxt, const SToken* pFuncName, SNodeList* pParameterList);
|
SNode* createFunctionNode(SAstCreateContext* pCxt, const SToken* pFuncName, SNodeList* pParameterList);
|
||||||
SNode* createFunctionNodeNoParam(SAstCreateContext* pCxt, const SToken* pFuncName);
|
SNode* createFunctionNodeNoArg(SAstCreateContext* pCxt, const SToken* pFuncName);
|
||||||
SNode* createCastFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SDataType dt);
|
SNode* createCastFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SDataType dt);
|
||||||
SNode* createNodeListNode(SAstCreateContext* pCxt, SNodeList* pList);
|
SNode* createNodeListNode(SAstCreateContext* pCxt, SNodeList* pList);
|
||||||
SNode* createNodeListNodeEx(SAstCreateContext* pCxt, SNode* p1, SNode* p2);
|
SNode* createNodeListNodeEx(SAstCreateContext* pCxt, SNode* p1, SNode* p2);
|
||||||
|
|
|
@ -603,12 +603,13 @@ pseudo_column(A) ::= WDURATION(B).
|
||||||
function_expression(A) ::= function_name(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); }
|
function_expression(A) ::= function_name(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); }
|
||||||
function_expression(A) ::= star_func(B) NK_LP star_func_para_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); }
|
function_expression(A) ::= star_func(B) NK_LP star_func_para_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); }
|
||||||
function_expression(A) ::= CAST(B) NK_LP expression(C) AS type_name(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, C), D)); }
|
function_expression(A) ::= CAST(B) NK_LP expression(C) AS type_name(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, C), D)); }
|
||||||
function_expression(A) ::= noarg_func(B) NK_LP NK_RP(C). { A = createRawExprNodeExt(pCxt, &B, &C, createFunctionNode(pCxt, &B, NULL)); }
|
function_expression(A) ::= noarg_func(B) NK_LP NK_RP(C). { A = createRawExprNodeExt(pCxt, &B, &C, createFunctionNodeNoArg(pCxt, &B)); }
|
||||||
|
|
||||||
%type noarg_func { SToken }
|
%type noarg_func { SToken }
|
||||||
%destructor noarg_func { }
|
%destructor noarg_func { }
|
||||||
noarg_func(A) ::= NOW(B). { A = B; }
|
noarg_func(A) ::= NOW(B). { A = B; }
|
||||||
noarg_func(A) ::= TODAY(B). { A = B; }
|
noarg_func(A) ::= TODAY(B). { A = B; }
|
||||||
|
noarg_func(A) ::= TIMEZONE(B). { A = B; }
|
||||||
|
|
||||||
%type star_func { SToken }
|
%type star_func { SToken }
|
||||||
%destructor star_func { }
|
%destructor star_func { }
|
||||||
|
|
|
@ -260,7 +260,8 @@ SNode* createValueNode(SAstCreateContext* pCxt, int32_t dataType, const SToken*
|
||||||
CHECK_OUT_OF_MEM(val);
|
CHECK_OUT_OF_MEM(val);
|
||||||
if (NULL != pLiteral) {
|
if (NULL != pLiteral) {
|
||||||
val->literal = strndup(pLiteral->z, pLiteral->n);
|
val->literal = strndup(pLiteral->z, pLiteral->n);
|
||||||
if (TK_NK_ID != pLiteral->type && (IS_VAR_DATA_TYPE(dataType) || TSDB_DATA_TYPE_TIMESTAMP == dataType)) {
|
if (TK_NK_ID != pLiteral->type && TK_TIMEZONE != pLiteral->type &&
|
||||||
|
(IS_VAR_DATA_TYPE(dataType) || TSDB_DATA_TYPE_TIMESTAMP == dataType)) {
|
||||||
trimString(pLiteral->z, pLiteral->n, val->literal, pLiteral->n);
|
trimString(pLiteral->z, pLiteral->n, val->literal, pLiteral->n);
|
||||||
}
|
}
|
||||||
CHECK_OUT_OF_MEM(val->literal);
|
CHECK_OUT_OF_MEM(val->literal);
|
||||||
|
@ -367,7 +368,7 @@ SNode* createFunctionNode(SAstCreateContext* pCxt, const SToken* pFuncName, SNod
|
||||||
return (SNode*)func;
|
return (SNode*)func;
|
||||||
}
|
}
|
||||||
|
|
||||||
SNode* createFunctionNodeNoParam(SAstCreateContext* pCxt, const SToken* pFuncName) {
|
SNode* createFunctionNodeNoArg(SAstCreateContext* pCxt, const SToken* pFuncName) {
|
||||||
SFunctionNode* func = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION);
|
SFunctionNode* func = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION);
|
||||||
CHECK_OUT_OF_MEM(func);
|
CHECK_OUT_OF_MEM(func);
|
||||||
char buf[64] = {0};
|
char buf[64] = {0};
|
||||||
|
@ -386,11 +387,11 @@ SNode* createFunctionNodeNoParam(SAstCreateContext* pCxt, const SToken* pFuncNam
|
||||||
dataType = TSDB_DATA_TYPE_BIGINT;
|
dataType = TSDB_DATA_TYPE_BIGINT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//case TK_TIMEZONE: {
|
case TK_TIMEZONE: {
|
||||||
// strncpy(buf, tsTimezoneStr, strlen(tsTimezoneStr));
|
strncpy(buf, tsTimezoneStr, strlen(tsTimezoneStr));
|
||||||
// dataType = TSDB_DATA_TYPE_BINARY;
|
dataType = TSDB_DATA_TYPE_BINARY;
|
||||||
// break;
|
break;
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
SToken token = {.type = pFuncName->type, .n = strlen(buf), .z = buf};
|
SToken token = {.type = pFuncName->type, .n = strlen(buf), .z = buf};
|
||||||
|
|
||||||
|
@ -499,8 +500,8 @@ SNode* createOrderByExprNode(SAstCreateContext* pCxt, SNode* pExpr, EOrder order
|
||||||
SNode* createSessionWindowNode(SAstCreateContext* pCxt, SNode* pCol, SNode* pGap) {
|
SNode* createSessionWindowNode(SAstCreateContext* pCxt, SNode* pCol, SNode* pGap) {
|
||||||
SSessionWindowNode* session = (SSessionWindowNode*)nodesMakeNode(QUERY_NODE_SESSION_WINDOW);
|
SSessionWindowNode* session = (SSessionWindowNode*)nodesMakeNode(QUERY_NODE_SESSION_WINDOW);
|
||||||
CHECK_OUT_OF_MEM(session);
|
CHECK_OUT_OF_MEM(session);
|
||||||
session->pCol = pCol;
|
session->pCol = (SColumnNode*)pCol;
|
||||||
session->pGap = pGap;
|
session->pGap = (SValueNode*)pGap;
|
||||||
return (SNode*)session;
|
return (SNode*)session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,6 +175,7 @@ static SKeyword keywordTable[] = {
|
||||||
{"TAGS", TK_TAGS},
|
{"TAGS", TK_TAGS},
|
||||||
{"TBNAME", TK_TBNAME},
|
{"TBNAME", TK_TBNAME},
|
||||||
{"TIMESTAMP", TK_TIMESTAMP},
|
{"TIMESTAMP", TK_TIMESTAMP},
|
||||||
|
{"TIMEZONE", TK_TIMEZONE},
|
||||||
{"TINYINT", TK_TINYINT},
|
{"TINYINT", TK_TINYINT},
|
||||||
{"TODAY", TK_TODAY},
|
{"TODAY", TK_TODAY},
|
||||||
{"TOPIC", TK_TOPIC},
|
{"TOPIC", TK_TOPIC},
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "cmdnodes.h"
|
#include "cmdnodes.h"
|
||||||
#include "functionMgt.h"
|
#include "functionMgt.h"
|
||||||
#include "parUtil.h"
|
#include "parUtil.h"
|
||||||
|
#include "tglobal.h"
|
||||||
#include "ttime.h"
|
#include "ttime.h"
|
||||||
|
|
||||||
#define GET_OPTION_VAL(pVal, defaultVal) (NULL == (pVal) ? (defaultVal) : getBigintFromValueNode((SValueNode*)(pVal)))
|
#define GET_OPTION_VAL(pVal, defaultVal) (NULL == (pVal) ? (defaultVal) : getBigintFromValueNode((SValueNode*)(pVal)))
|
||||||
|
@ -227,6 +228,7 @@ static void setColumnInfoBySchema(const SRealTableNode* pTable, const SSchema* p
|
||||||
strcpy(pCol->node.aliasName, pColSchema->name);
|
strcpy(pCol->node.aliasName, pColSchema->name);
|
||||||
}
|
}
|
||||||
pCol->tableId = pTable->pMeta->uid;
|
pCol->tableId = pTable->pMeta->uid;
|
||||||
|
pCol->tableType = pTable->pMeta->tableType;
|
||||||
pCol->colId = pColSchema->colId;
|
pCol->colId = pColSchema->colId;
|
||||||
pCol->colType = isTag ? COLUMN_TYPE_TAG : COLUMN_TYPE_COLUMN;
|
pCol->colType = isTag ? COLUMN_TYPE_TAG : COLUMN_TYPE_COLUMN;
|
||||||
pCol->node.resType.type = pColSchema->type;
|
pCol->node.resType.type = pColSchema->type;
|
||||||
|
@ -364,18 +366,38 @@ static bool translateColumnUseAlias(STranslateContext* pCxt, SColumnNode* pCol)
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDealRes translateColumn(STranslateContext* pCxt, SColumnNode* pCol) {
|
static EDealRes translateColumn(STranslateContext* pCxt, SColumnNode* pCol) {
|
||||||
// count(*)/first(*)/last(*)
|
// count(*)/first(*)/last(*) and so on
|
||||||
if (0 == strcmp(pCol->colName, "*")) {
|
if (0 == strcmp(pCol->colName, "*")) {
|
||||||
return DEAL_RES_CONTINUE;
|
return DEAL_RES_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EDealRes res = DEAL_RES_CONTINUE;
|
||||||
if ('\0' != pCol->tableAlias[0]) {
|
if ('\0' != pCol->tableAlias[0]) {
|
||||||
return translateColumnWithPrefix(pCxt, pCol);
|
res = translateColumnWithPrefix(pCxt, pCol);
|
||||||
}
|
} else {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
if (SQL_CLAUSE_ORDER_BY == pCxt->currClause) {
|
if (SQL_CLAUSE_ORDER_BY == pCxt->currClause) {
|
||||||
found = translateColumnUseAlias(pCxt, pCol);
|
found = translateColumnUseAlias(pCxt, pCol);
|
||||||
}
|
}
|
||||||
return found ? DEAL_RES_CONTINUE : translateColumnWithoutPrefix(pCxt, pCol);
|
res = (found ? DEAL_RES_CONTINUE : translateColumnWithoutPrefix(pCxt, pCol));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEAL_RES_ERROR == res) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SQL_CLAUSE_WINDOW == pCxt->currClause && QUERY_NODE_STATE_WINDOW == nodeType(pCxt->pCurrStmt->pWindow)) {
|
||||||
|
if (!IS_INTEGER_TYPE(pCol->node.resType.type)) {
|
||||||
|
return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_INVALID_STATE_WIN_TYPE);
|
||||||
|
}
|
||||||
|
if (COLUMN_TYPE_TAG == pCol->colType) {
|
||||||
|
return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_INVALID_STATE_WIN_COL);
|
||||||
|
}
|
||||||
|
if (TSDB_SUPER_TABLE == pCol->tableType) {
|
||||||
|
return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_INVALID_STATE_WIN_TABLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return DEAL_RES_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EDealRes translateValue(STranslateContext* pCxt, SValueNode* pVal) {
|
static EDealRes translateValue(STranslateContext* pCxt, SValueNode* pVal) {
|
||||||
|
@ -466,8 +488,18 @@ static EDealRes translateOperator(STranslateContext* pCxt, SOperatorNode* pOp) {
|
||||||
TSDB_DATA_TYPE_BLOB == rdt.type) {
|
TSDB_DATA_TYPE_BLOB == rdt.type) {
|
||||||
return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)(pOp->pRight))->aliasName);
|
return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)(pOp->pRight))->aliasName);
|
||||||
}
|
}
|
||||||
|
if (TSDB_DATA_TYPE_TIMESTAMP == ldt.type && TSDB_DATA_TYPE_TIMESTAMP == rdt.type) {
|
||||||
|
return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)(pOp->pRight))->aliasName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((TSDB_DATA_TYPE_TIMESTAMP == ldt.type && TSDB_DATA_TYPE_BIGINT == rdt.type) ||
|
||||||
|
(TSDB_DATA_TYPE_TIMESTAMP == rdt.type && TSDB_DATA_TYPE_BIGINT == ldt.type)) {
|
||||||
|
pOp->node.resType.type = TSDB_DATA_TYPE_TIMESTAMP;
|
||||||
|
pOp->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes;
|
||||||
|
} else {
|
||||||
pOp->node.resType.type = TSDB_DATA_TYPE_DOUBLE;
|
pOp->node.resType.type = TSDB_DATA_TYPE_DOUBLE;
|
||||||
pOp->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes;
|
pOp->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes;
|
||||||
|
}
|
||||||
} else if (nodesIsComparisonOp(pOp)) {
|
} else if (nodesIsComparisonOp(pOp)) {
|
||||||
if (TSDB_DATA_TYPE_JSON == ldt.type || TSDB_DATA_TYPE_BLOB == ldt.type || TSDB_DATA_TYPE_JSON == rdt.type ||
|
if (TSDB_DATA_TYPE_JSON == ldt.type || TSDB_DATA_TYPE_BLOB == ldt.type || TSDB_DATA_TYPE_JSON == rdt.type ||
|
||||||
TSDB_DATA_TYPE_BLOB == rdt.type) {
|
TSDB_DATA_TYPE_BLOB == rdt.type) {
|
||||||
|
@ -639,7 +671,7 @@ static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect)
|
||||||
if (!pSelect->isDistinct) {
|
if (!pSelect->isDistinct) {
|
||||||
nodesWalkExprs(pSelect->pOrderByList, doCheckAggColCoexist, &cxt);
|
nodesWalkExprs(pSelect->pOrderByList, doCheckAggColCoexist, &cxt);
|
||||||
}
|
}
|
||||||
if (cxt.existAggFunc && cxt.existCol) {
|
if ((cxt.existAggFunc || NULL != pSelect->pWindow) && cxt.existCol) {
|
||||||
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_SINGLE_GROUP);
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_SINGLE_GROUP);
|
||||||
}
|
}
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -1091,20 +1123,100 @@ static int32_t translateGroupBy(STranslateContext* pCxt, SSelectStmt* pSelect) {
|
||||||
return translateExprList(pCxt, pSelect->pGroupByList);
|
return translateExprList(pCxt, pSelect->pGroupByList);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t translateIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode* pInterval) {
|
static bool isValTimeUnit(char unit) {
|
||||||
SValueNode* pIntervalVal = (SValueNode*)pInterval->pInterval;
|
return ('n' == unit || 'y' == unit);
|
||||||
SValueNode* pIntervalOffset = (SValueNode*)pInterval->pOffset;
|
|
||||||
SValueNode* pSliding = (SValueNode*)pInterval->pSliding;
|
|
||||||
if (pIntervalVal->datum.i <= 0) {
|
|
||||||
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTERVAL_VALUE_TOO_SMALL, pIntervalVal->literal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int64_t getMonthsFromTimeVal(int64_t val, int32_t fromPrecision, char unit) {
|
||||||
|
int64_t days = convertTimeFromPrecisionToUnit(val, fromPrecision, 'd');
|
||||||
|
switch (unit) {
|
||||||
|
case 'b':
|
||||||
|
case 'u':
|
||||||
|
case 'a':
|
||||||
|
case 's':
|
||||||
|
case 'm':
|
||||||
|
case 'h':
|
||||||
|
case 'd':
|
||||||
|
case 'w':
|
||||||
|
return days / 28;
|
||||||
|
case 'n':
|
||||||
|
return val;
|
||||||
|
case 'y':
|
||||||
|
return val * 12;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t checkIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode* pInterval) {
|
||||||
|
uint8_t precision = ((SColumnNode*)pInterval->pCol)->node.resType.precision;
|
||||||
|
|
||||||
|
SValueNode* pInter = (SValueNode*)pInterval->pInterval;
|
||||||
|
bool valInter = isValTimeUnit(pInter->unit);
|
||||||
|
if (pInter->datum.i <= 0 ||
|
||||||
|
(!valInter && convertTimePrecision(pInter->datum.i, precision, TSDB_TIME_PRECISION_MICRO) < tsMinIntervalTime)) {
|
||||||
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTER_VALUE_TOO_SMALL, tsMinIntervalTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NULL != pInterval->pOffset) {
|
||||||
|
SValueNode* pOffset = (SValueNode*)pInterval->pOffset;
|
||||||
|
if (pOffset->datum.i <= 0) {
|
||||||
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTER_OFFSET_NEGATIVE);
|
||||||
|
}
|
||||||
|
if (pInter->unit == 'n' && pOffset->unit == 'y') {
|
||||||
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTER_OFFSET_UNIT);
|
||||||
|
}
|
||||||
|
bool fixed = !isValTimeUnit(pOffset->unit) && !valInter;
|
||||||
|
if ((fixed && pOffset->datum.i >= pInter->datum.i) ||
|
||||||
|
(!fixed && getMonthsFromTimeVal(pOffset->datum.i, precision, pOffset->unit) >= getMonthsFromTimeVal(pInter->datum.i, precision, pInter->unit))) {
|
||||||
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTER_OFFSET_TOO_BIG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NULL != pInterval->pSliding) {
|
||||||
|
const static int32_t INTERVAL_SLIDING_FACTOR = 100;
|
||||||
|
|
||||||
|
SValueNode* pSliding = (SValueNode*)pInterval->pSliding;
|
||||||
|
if (pInter->unit == 'n' || pInter->unit == 'y') {
|
||||||
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTER_SLIDING_UNIT);
|
||||||
|
}
|
||||||
|
if ((pSliding->datum.i < convertTimePrecision(tsMinSlidingTime, TSDB_TIME_PRECISION_MILLI, precision)) ||
|
||||||
|
(pInter->datum.i / pSliding->datum.i > INTERVAL_SLIDING_FACTOR)) {
|
||||||
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTER_SLIDING_TOO_SMALL);
|
||||||
|
}
|
||||||
|
if (pSliding->datum.i > pInter->datum.i) {
|
||||||
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTER_SLIDING_TOO_BIG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t doTranslateWindow(STranslateContext* pCxt, SNode* pWindow) {
|
static int32_t checkStateWindow(STranslateContext* pCxt, SStateWindowNode* pState) {
|
||||||
|
// todo check for "function not support for state_window"
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t checkSessionWindow(STranslateContext* pCxt, SSessionWindowNode* pSession) {
|
||||||
|
if ('y' == pSession->pGap->unit || 'n' == pSession->pGap->unit || 0 == pSession->pGap->datum.i) {
|
||||||
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTER_SESSION_GAP);
|
||||||
|
}
|
||||||
|
if (PRIMARYKEY_TIMESTAMP_COL_ID != pSession->pCol->colId) {
|
||||||
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INTER_SESSION_COL);
|
||||||
|
}
|
||||||
|
// todo check for "function not support for session"
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t checkWindow(STranslateContext* pCxt, SNode* pWindow) {
|
||||||
switch (nodeType(pWindow)) {
|
switch (nodeType(pWindow)) {
|
||||||
|
case QUERY_NODE_STATE_WINDOW:
|
||||||
|
return checkStateWindow(pCxt, (SStateWindowNode*)pWindow);
|
||||||
|
case QUERY_NODE_SESSION_WINDOW:
|
||||||
|
return checkSessionWindow(pCxt, (SSessionWindowNode*)pWindow);
|
||||||
case QUERY_NODE_INTERVAL_WINDOW:
|
case QUERY_NODE_INTERVAL_WINDOW:
|
||||||
return translateIntervalWindow(pCxt, (SIntervalWindowNode*)pWindow);
|
return checkIntervalWindow(pCxt, (SIntervalWindowNode*)pWindow);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1118,7 +1230,7 @@ static int32_t translateWindow(STranslateContext* pCxt, SNode* pWindow) {
|
||||||
pCxt->currClause = SQL_CLAUSE_WINDOW;
|
pCxt->currClause = SQL_CLAUSE_WINDOW;
|
||||||
int32_t code = translateExpr(pCxt, pWindow);
|
int32_t code = translateExpr(pCxt, pWindow);
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = doTranslateWindow(pCxt, pWindow);
|
code = checkWindow(pCxt, pWindow);
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,8 @@ static char* getSyntaxErrFormat(int32_t errCode) {
|
||||||
return "Endpoint should be in the format of 'fqdn:port'";
|
return "Endpoint should be in the format of 'fqdn:port'";
|
||||||
case TSDB_CODE_PAR_EXPRIE_STATEMENT:
|
case TSDB_CODE_PAR_EXPRIE_STATEMENT:
|
||||||
return "This statement is no longer supported";
|
return "This statement is no longer supported";
|
||||||
case TSDB_CODE_PAR_INTERVAL_VALUE_TOO_SMALL:
|
case TSDB_CODE_PAR_INTER_VALUE_TOO_SMALL:
|
||||||
return "This interval value is too small : %s";
|
return "Interval cannot be less than %d us";
|
||||||
case TSDB_CODE_PAR_DB_NOT_SPECIFIED:
|
case TSDB_CODE_PAR_DB_NOT_SPECIFIED:
|
||||||
return "Database not specified";
|
return "Database not specified";
|
||||||
case TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME:
|
case TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME:
|
||||||
|
@ -93,6 +93,28 @@ static char* getSyntaxErrFormat(int32_t errCode) {
|
||||||
return "Invalid option keep unit: %c, %c, %c, only m, h, d allowed";
|
return "Invalid option keep unit: %c, %c, %c, only m, h, d allowed";
|
||||||
case TSDB_CODE_PAR_AGG_FUNC_NESTING:
|
case TSDB_CODE_PAR_AGG_FUNC_NESTING:
|
||||||
return "Aggregate functions do not support nesting";
|
return "Aggregate functions do not support nesting";
|
||||||
|
case TSDB_CODE_PAR_INVALID_STATE_WIN_TYPE:
|
||||||
|
return "Only support STATE_WINDOW on integer column";
|
||||||
|
case TSDB_CODE_PAR_INVALID_STATE_WIN_COL:
|
||||||
|
return "Not support STATE_WINDOW on tag column";
|
||||||
|
case TSDB_CODE_PAR_INVALID_STATE_WIN_TABLE:
|
||||||
|
return "STATE_WINDOW not support for super table query";
|
||||||
|
case TSDB_CODE_PAR_INTER_SESSION_GAP:
|
||||||
|
return "SESSION gap should be fixed time window, and greater than 0";
|
||||||
|
case TSDB_CODE_PAR_INTER_SESSION_COL:
|
||||||
|
return "Only support SESSION on primary timestamp column";
|
||||||
|
case TSDB_CODE_PAR_INTER_OFFSET_NEGATIVE:
|
||||||
|
return "Interval offset cannot be negative";
|
||||||
|
case TSDB_CODE_PAR_INTER_OFFSET_UNIT:
|
||||||
|
return "Cannot use 'year' as offset when interval is 'month'";
|
||||||
|
case TSDB_CODE_PAR_INTER_OFFSET_TOO_BIG:
|
||||||
|
return "Interval offset should be shorter than interval";
|
||||||
|
case TSDB_CODE_PAR_INTER_SLIDING_UNIT:
|
||||||
|
return "Does not support sliding when interval is natural month/year";
|
||||||
|
case TSDB_CODE_PAR_INTER_SLIDING_TOO_BIG:
|
||||||
|
return "sliding value no larger than the interval value";
|
||||||
|
case TSDB_CODE_PAR_INTER_SLIDING_TOO_SMALL:
|
||||||
|
return "sliding value can not less than 1% of interval value";
|
||||||
case TSDB_CODE_OUT_OF_MEMORY:
|
case TSDB_CODE_OUT_OF_MEMORY:
|
||||||
return "Out of memory";
|
return "Out of memory";
|
||||||
default:
|
default:
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -166,12 +166,24 @@ static int32_t osdGetDataRequired(SNodeList* pFuncs) {
|
||||||
return dataRequired;
|
return dataRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void setScanWindowInfo(SScanLogicNode* pScan) {
|
||||||
|
if (QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pScan->node.pParent) &&
|
||||||
|
WINDOW_TYPE_INTERVAL == ((SWindowLogicNode*)pScan->node.pParent)->winType) {
|
||||||
|
pScan->interval = ((SWindowLogicNode*)pScan->node.pParent)->interval;
|
||||||
|
pScan->offset = ((SWindowLogicNode*)pScan->node.pParent)->offset;
|
||||||
|
pScan->sliding = ((SWindowLogicNode*)pScan->node.pParent)->sliding;
|
||||||
|
pScan->intervalUnit = ((SWindowLogicNode*)pScan->node.pParent)->intervalUnit;
|
||||||
|
pScan->slidingUnit = ((SWindowLogicNode*)pScan->node.pParent)->slidingUnit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int32_t osdOptimize(SOptimizeContext* pCxt, SLogicNode* pLogicNode) {
|
static int32_t osdOptimize(SOptimizeContext* pCxt, SLogicNode* pLogicNode) {
|
||||||
SOsdInfo info = {0};
|
SOsdInfo info = {0};
|
||||||
int32_t code = osdMatch(pCxt, pLogicNode, &info);
|
int32_t code = osdMatch(pCxt, pLogicNode, &info);
|
||||||
if (TSDB_CODE_SUCCESS == code && (NULL != info.pDsoFuncs || NULL != info.pSdrFuncs)) {
|
if (TSDB_CODE_SUCCESS == code && (NULL != info.pDsoFuncs || NULL != info.pSdrFuncs)) {
|
||||||
info.pScan->dataRequired = osdGetDataRequired(info.pSdrFuncs);
|
info.pScan->dataRequired = osdGetDataRequired(info.pSdrFuncs);
|
||||||
info.pScan->pDynamicScanFuncs = info.pDsoFuncs;
|
info.pScan->pDynamicScanFuncs = info.pDsoFuncs;
|
||||||
|
setScanWindowInfo((SScanLogicNode*)info.pScan);
|
||||||
OPTIMIZE_FLAG_SET_MASK(info.pScan->node.optimizedFlag, OPTIMIZE_FLAG_OSD);
|
OPTIMIZE_FLAG_SET_MASK(info.pScan->node.optimizedFlag, OPTIMIZE_FLAG_OSD);
|
||||||
pCxt->optimized = true;
|
pCxt->optimized = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,6 +443,11 @@ static int32_t createTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubp
|
||||||
nodesDestroyNode(pTableScan);
|
nodesDestroyNode(pTableScan);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
pTableScan->interval = pScanLogicNode->interval;
|
||||||
|
pTableScan->offset = pScanLogicNode->offset;
|
||||||
|
pTableScan->sliding = pScanLogicNode->sliding;
|
||||||
|
pTableScan->intervalUnit = pScanLogicNode->intervalUnit;
|
||||||
|
pTableScan->slidingUnit = pScanLogicNode->slidingUnit;
|
||||||
|
|
||||||
return createScanPhysiNodeFinalize(pCxt, pScanLogicNode, (SScanPhysiNode*)pTableScan, pPhyNode);
|
return createScanPhysiNodeFinalize(pCxt, pScanLogicNode, (SScanPhysiNode*)pTableScan, pPhyNode);
|
||||||
}
|
}
|
||||||
|
@ -819,7 +824,6 @@ static int32_t createIntervalPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChil
|
||||||
pInterval->sliding = pWindowLogicNode->sliding;
|
pInterval->sliding = pWindowLogicNode->sliding;
|
||||||
pInterval->intervalUnit = pWindowLogicNode->intervalUnit;
|
pInterval->intervalUnit = pWindowLogicNode->intervalUnit;
|
||||||
pInterval->slidingUnit = pWindowLogicNode->slidingUnit;
|
pInterval->slidingUnit = pWindowLogicNode->slidingUnit;
|
||||||
pInterval->precision = ((SColumnNode*)pWindowLogicNode->pTspk)->node.resType.precision;
|
|
||||||
|
|
||||||
pInterval->pFill = nodesCloneNode(pWindowLogicNode->pFill);
|
pInterval->pFill = nodesCloneNode(pWindowLogicNode->pFill);
|
||||||
if (NULL != pWindowLogicNode->pFill && NULL == pInterval->pFill) {
|
if (NULL != pWindowLogicNode->pFill && NULL == pInterval->pFill) {
|
||||||
|
|
|
@ -666,18 +666,14 @@ int32_t substrFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOu
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) {
|
int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) {
|
||||||
if (inputNum!= 3) {
|
|
||||||
return TSDB_CODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
int16_t inputType = pInput[0].columnData->info.type;
|
int16_t inputType = pInput[0].columnData->info.type;
|
||||||
int16_t outputType = *(int16_t *)pInput[1].columnData->pData;
|
int16_t outputType = pOutput[0].columnData->info.type;
|
||||||
if (outputType != TSDB_DATA_TYPE_BIGINT && outputType != TSDB_DATA_TYPE_UBIGINT &&
|
if (outputType != TSDB_DATA_TYPE_BIGINT && outputType != TSDB_DATA_TYPE_UBIGINT &&
|
||||||
outputType != TSDB_DATA_TYPE_VARCHAR && outputType != TSDB_DATA_TYPE_NCHAR &&
|
outputType != TSDB_DATA_TYPE_VARCHAR && outputType != TSDB_DATA_TYPE_NCHAR &&
|
||||||
outputType != TSDB_DATA_TYPE_TIMESTAMP) {
|
outputType != TSDB_DATA_TYPE_TIMESTAMP) {
|
||||||
return TSDB_CODE_FAILED;
|
return TSDB_CODE_FAILED;
|
||||||
}
|
}
|
||||||
int64_t outputLen = *(int64_t *)pInput[2].columnData->pData;
|
int64_t outputLen = pOutput[0].columnData->info.bytes;
|
||||||
|
|
||||||
char *input = NULL;
|
char *input = NULL;
|
||||||
char *outputBuf = taosMemoryCalloc(outputLen * pInput[0].numOfRows, 1);
|
char *outputBuf = taosMemoryCalloc(outputLen * pInput[0].numOfRows, 1);
|
||||||
|
@ -1275,6 +1271,14 @@ int32_t todayFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOut
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t timezoneFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) {
|
||||||
|
if (inputNum != 1) {
|
||||||
|
return TSDB_CODE_FAILED;
|
||||||
|
}
|
||||||
|
colDataAppend(pOutput->columnData, pOutput->numOfRows, (char *)colDataGetData(pInput->columnData, 0), false);
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t atanFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) {
|
int32_t atanFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) {
|
||||||
return doScalarFunctionUnique(pInput, inputNum, pOutput, atan);
|
return doScalarFunctionUnique(pInput, inputNum, pOutput, atan);
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,8 @@ _getBigintValue_fn_t getVectorBigintValueFn(int32_t srcType) {
|
||||||
p = getVectorBigintValue_FLOAT;
|
p = getVectorBigintValue_FLOAT;
|
||||||
}else if(srcType==TSDB_DATA_TYPE_DOUBLE) {
|
}else if(srcType==TSDB_DATA_TYPE_DOUBLE) {
|
||||||
p = getVectorBigintValue_DOUBLE;
|
p = getVectorBigintValue_DOUBLE;
|
||||||
|
}else if(srcType==TSDB_DATA_TYPE_TIMESTAMP) {
|
||||||
|
p = getVectorBigintValue_BIGINT;
|
||||||
}else {
|
}else {
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
@ -565,6 +567,25 @@ static void vectorMathAddHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void vectorMathBigintAddHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRightCol, SColumnInfoData* pOutputCol, int32_t numOfRows, int32_t step, int32_t i) {
|
||||||
|
_getBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(pLeftCol->info.type);
|
||||||
|
_getBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(pRightCol->info.type);
|
||||||
|
|
||||||
|
int64_t *output = (int64_t *)pOutputCol->pData;
|
||||||
|
|
||||||
|
if (colDataIsNull_f(pRightCol->nullbitmap, 0)) { // Set pLeft->numOfRows NULL value
|
||||||
|
colDataAppendNNULL(pOutputCol, 0, numOfRows);
|
||||||
|
} else {
|
||||||
|
for (; i >= 0 && i < numOfRows; i += step, output += 1) {
|
||||||
|
*output = getVectorBigintValueFnLeft(pLeftCol->pData, i) + getVectorBigintValueFnRight(pRightCol->pData, 0);
|
||||||
|
}
|
||||||
|
pOutputCol->hasNull = pLeftCol->hasNull;
|
||||||
|
if (pOutputCol->hasNull) {
|
||||||
|
memcpy(pOutputCol->nullbitmap, pLeftCol->nullbitmap, BitmapLen(numOfRows));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static SColumnInfoData* doVectorConvert(SScalarParam* pInput, int32_t* doConvert) {
|
static SColumnInfoData* doVectorConvert(SScalarParam* pInput, int32_t* doConvert) {
|
||||||
SScalarParam convertParam = {0};
|
SScalarParam convertParam = {0};
|
||||||
|
|
||||||
|
@ -599,10 +620,35 @@ void vectorMathAdd(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut
|
||||||
SColumnInfoData *pLeftCol = doVectorConvert(pLeft, &leftConvert);
|
SColumnInfoData *pLeftCol = doVectorConvert(pLeft, &leftConvert);
|
||||||
SColumnInfoData *pRightCol = doVectorConvert(pRight, &rightConvert);
|
SColumnInfoData *pRightCol = doVectorConvert(pRight, &rightConvert);
|
||||||
|
|
||||||
|
if ((GET_PARAM_TYPE(pLeft) == TSDB_DATA_TYPE_TIMESTAMP && GET_PARAM_TYPE(pRight) == TSDB_DATA_TYPE_BIGINT) ||
|
||||||
|
(GET_PARAM_TYPE(pRight) == TSDB_DATA_TYPE_TIMESTAMP && GET_PARAM_TYPE(pLeft) == TSDB_DATA_TYPE_BIGINT)) { //timestamp plus duration
|
||||||
|
int64_t *output = (int64_t *)pOutputCol->pData;
|
||||||
|
_getBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(pLeftCol->info.type);
|
||||||
|
_getBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(pRightCol->info.type);
|
||||||
|
|
||||||
|
if (pLeft->numOfRows == pRight->numOfRows) {
|
||||||
|
for (; i < pRight->numOfRows && i >= 0; i += step, output += 1) {
|
||||||
|
*output = getVectorBigintValueFnLeft(pLeftCol->pData, i) + getVectorBigintValueFnRight(pRightCol->pData, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
pOutputCol->hasNull = (pLeftCol->hasNull || pRightCol->hasNull);
|
||||||
|
if (pOutputCol->hasNull) {
|
||||||
|
int32_t numOfBitLen = BitmapLen(pLeft->numOfRows);
|
||||||
|
for (int32_t j = 0; j < numOfBitLen; ++j) {
|
||||||
|
pOutputCol->nullbitmap[j] = pLeftCol->nullbitmap[j] | pRightCol->nullbitmap[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (pLeft->numOfRows == 1) {
|
||||||
|
vectorMathBigintAddHelper(pRightCol, pLeftCol, pOutputCol, pRight->numOfRows, step, i);
|
||||||
|
} else if (pRight->numOfRows == 1) {
|
||||||
|
vectorMathBigintAddHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
double *output = (double *)pOutputCol->pData;
|
||||||
_getDoubleValue_fn_t getVectorDoubleValueFnLeft = getVectorDoubleValueFn(pLeftCol->info.type);
|
_getDoubleValue_fn_t getVectorDoubleValueFnLeft = getVectorDoubleValueFn(pLeftCol->info.type);
|
||||||
_getDoubleValue_fn_t getVectorDoubleValueFnRight = getVectorDoubleValueFn(pRightCol->info.type);
|
_getDoubleValue_fn_t getVectorDoubleValueFnRight = getVectorDoubleValueFn(pRightCol->info.type);
|
||||||
|
|
||||||
double *output = (double *)pOutputCol->pData;
|
|
||||||
if (pLeft->numOfRows == pRight->numOfRows) {
|
if (pLeft->numOfRows == pRight->numOfRows) {
|
||||||
for (; i < pRight->numOfRows && i >= 0; i += step, output += 1) {
|
for (; i < pRight->numOfRows && i >= 0; i += step, output += 1) {
|
||||||
*output = getVectorDoubleValueFnLeft(pLeftCol->pData, i) + getVectorDoubleValueFnRight(pRightCol->pData, i);
|
*output = getVectorDoubleValueFnLeft(pLeftCol->pData, i) + getVectorDoubleValueFnRight(pRightCol->pData, i);
|
||||||
|
@ -621,6 +667,7 @@ void vectorMathAdd(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut
|
||||||
} else if (pRight->numOfRows == 1) {
|
} else if (pRight->numOfRows == 1) {
|
||||||
vectorMathAddHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, i);
|
vectorMathAddHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
doReleaseVec(pLeftCol, leftConvert);
|
doReleaseVec(pLeftCol, leftConvert);
|
||||||
doReleaseVec(pRightCol, rightConvert);
|
doReleaseVec(pRightCol, rightConvert);
|
||||||
|
@ -646,6 +693,25 @@ static void vectorMathSubHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void vectorMathBigintSubHelper(SColumnInfoData* pLeftCol, SColumnInfoData* pRightCol, SColumnInfoData* pOutputCol, int32_t numOfRows, int32_t step, int32_t factor, int32_t i) {
|
||||||
|
_getBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(pLeftCol->info.type);
|
||||||
|
_getBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(pRightCol->info.type);
|
||||||
|
|
||||||
|
int64_t *output = (int64_t *)pOutputCol->pData;
|
||||||
|
|
||||||
|
if (colDataIsNull_f(pRightCol->nullbitmap, 0)) { // Set pLeft->numOfRows NULL value
|
||||||
|
colDataAppendNNULL(pOutputCol, 0, numOfRows);
|
||||||
|
} else {
|
||||||
|
for (; i >= 0 && i < numOfRows; i += step, output += 1) {
|
||||||
|
*output = (getVectorBigintValueFnLeft(pLeftCol->pData, i) - getVectorBigintValueFnRight(pRightCol->pData, 0)) * factor;
|
||||||
|
}
|
||||||
|
pOutputCol->hasNull = pLeftCol->hasNull;
|
||||||
|
if (pOutputCol->hasNull) {
|
||||||
|
memcpy(pOutputCol->nullbitmap, pLeftCol->nullbitmap, BitmapLen(numOfRows));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void vectorMathSub(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut, int32_t _ord) {
|
void vectorMathSub(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut, int32_t _ord) {
|
||||||
SColumnInfoData *pOutputCol = pOut->columnData;
|
SColumnInfoData *pOutputCol = pOut->columnData;
|
||||||
|
|
||||||
|
@ -658,10 +724,35 @@ void vectorMathSub(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut
|
||||||
SColumnInfoData *pLeftCol = doVectorConvert(pLeft, &leftConvert);
|
SColumnInfoData *pLeftCol = doVectorConvert(pLeft, &leftConvert);
|
||||||
SColumnInfoData *pRightCol = doVectorConvert(pRight, &rightConvert);
|
SColumnInfoData *pRightCol = doVectorConvert(pRight, &rightConvert);
|
||||||
|
|
||||||
|
if ((GET_PARAM_TYPE(pLeft) == TSDB_DATA_TYPE_TIMESTAMP && GET_PARAM_TYPE(pRight) == TSDB_DATA_TYPE_BIGINT) ||
|
||||||
|
(GET_PARAM_TYPE(pRight) == TSDB_DATA_TYPE_TIMESTAMP && GET_PARAM_TYPE(pLeft) == TSDB_DATA_TYPE_BIGINT)) { //timestamp minus duration
|
||||||
|
int64_t *output = (int64_t *)pOutputCol->pData;
|
||||||
|
_getBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(pLeftCol->info.type);
|
||||||
|
_getBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(pRightCol->info.type);
|
||||||
|
|
||||||
|
if (pLeft->numOfRows == pRight->numOfRows) {
|
||||||
|
for (; i < pRight->numOfRows && i >= 0; i += step, output += 1) {
|
||||||
|
*output = getVectorBigintValueFnLeft(pLeftCol->pData, i) - getVectorBigintValueFnRight(pRightCol->pData, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
pOutputCol->hasNull = (pLeftCol->hasNull || pRightCol->hasNull);
|
||||||
|
if (pOutputCol->hasNull) {
|
||||||
|
int32_t numOfBitLen = BitmapLen(pLeft->numOfRows);
|
||||||
|
for (int32_t j = 0; j < numOfBitLen; ++j) {
|
||||||
|
pOutputCol->nullbitmap[j] = pLeftCol->nullbitmap[j] | pRightCol->nullbitmap[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (pLeft->numOfRows == 1) {
|
||||||
|
vectorMathBigintSubHelper(pRightCol, pLeftCol, pOutputCol, pRight->numOfRows, step, -1, i);
|
||||||
|
} else if (pRight->numOfRows == 1) {
|
||||||
|
vectorMathBigintSubHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, 1, i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
double *output = (double *)pOutputCol->pData;
|
||||||
_getDoubleValue_fn_t getVectorDoubleValueFnLeft = getVectorDoubleValueFn(pLeftCol->info.type);
|
_getDoubleValue_fn_t getVectorDoubleValueFnLeft = getVectorDoubleValueFn(pLeftCol->info.type);
|
||||||
_getDoubleValue_fn_t getVectorDoubleValueFnRight = getVectorDoubleValueFn(pRightCol->info.type);
|
_getDoubleValue_fn_t getVectorDoubleValueFnRight = getVectorDoubleValueFn(pRightCol->info.type);
|
||||||
|
|
||||||
double *output = (double *)pOutputCol->pData;
|
|
||||||
if (pLeft->numOfRows == pRight->numOfRows) {
|
if (pLeft->numOfRows == pRight->numOfRows) {
|
||||||
for (; i < pRight->numOfRows && i >= 0; i += step, output += 1) {
|
for (; i < pRight->numOfRows && i >= 0; i += step, output += 1) {
|
||||||
*output = getVectorDoubleValueFnLeft(pLeftCol->pData, i) - getVectorDoubleValueFnRight(pRightCol->pData, i);
|
*output = getVectorDoubleValueFnLeft(pLeftCol->pData, i) - getVectorDoubleValueFnRight(pRightCol->pData, i);
|
||||||
|
@ -680,6 +771,7 @@ void vectorMathSub(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut
|
||||||
} else if (pRight->numOfRows == 1) {
|
} else if (pRight->numOfRows == 1) {
|
||||||
vectorMathSubHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, 1, i);
|
vectorMathSubHelper(pLeftCol, pRightCol, pOutputCol, pLeft->numOfRows, step, 1, i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
doReleaseVec(pLeftCol, leftConvert);
|
doReleaseVec(pLeftCol, leftConvert);
|
||||||
doReleaseVec(pRightCol, rightConvert);
|
doReleaseVec(pRightCol, rightConvert);
|
||||||
|
|
|
@ -35,11 +35,11 @@ CURR_DIR=`pwd`
|
||||||
IN_TDINTERNAL="community"
|
IN_TDINTERNAL="community"
|
||||||
if [[ "$CURR_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$CURR_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
TAOS_DIR=$CURR_DIR/../../..
|
TAOS_DIR=$CURR_DIR/../../..
|
||||||
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep bin|head -n1`
|
||||||
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6,7|rev`/lib
|
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6,7|rev`/lib
|
||||||
else
|
else
|
||||||
TAOS_DIR=$CURR_DIR/../..
|
TAOS_DIR=$CURR_DIR/../..
|
||||||
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep bin|head -n1`
|
||||||
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6|rev`/lib
|
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6|rev`/lib
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,11 @@ CURR_DIR=`pwd`
|
||||||
IN_TDINTERNAL="community"
|
IN_TDINTERNAL="community"
|
||||||
if [[ "$CURR_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$CURR_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
TAOS_DIR=$CURR_DIR/../../..
|
TAOS_DIR=$CURR_DIR/../../..
|
||||||
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep bin|head -n1`
|
||||||
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6,7|rev`/lib
|
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6,7|rev`/lib
|
||||||
else
|
else
|
||||||
TAOS_DIR=$CURR_DIR/../..
|
TAOS_DIR=$CURR_DIR/../..
|
||||||
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep bin|head -n1`
|
||||||
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6|rev`/lib
|
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6|rev`/lib
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ else
|
||||||
cd ../../..
|
cd ../../..
|
||||||
fi
|
fi
|
||||||
TOP_DIR=`pwd`
|
TOP_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep -v community|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep -v community|grep bin|head -n1`
|
||||||
VALGRIND_OUT=taosd_valgrind.out
|
VALGRIND_OUT=taosd_valgrind.out
|
||||||
VALGRIND_ERR=taosd_valgrind.err
|
VALGRIND_ERR=taosd_valgrind.err
|
||||||
rm -rf /var/lib/taos/*
|
rm -rf /var/lib/taos/*
|
||||||
|
|
|
@ -35,11 +35,11 @@ CURR_DIR=`pwd`
|
||||||
IN_TDINTERNAL="community"
|
IN_TDINTERNAL="community"
|
||||||
if [[ "$CURR_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$CURR_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
TAOS_DIR=$CURR_DIR/../../..
|
TAOS_DIR=$CURR_DIR/../../..
|
||||||
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep bin|head -n1`
|
||||||
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6,7|rev`/lib
|
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6,7|rev`/lib
|
||||||
else
|
else
|
||||||
TAOS_DIR=$CURR_DIR/../..
|
TAOS_DIR=$CURR_DIR/../..
|
||||||
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep bin|head -n1`
|
||||||
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6|rev`/lib
|
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6|rev`/lib
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ if [[ "$CURR_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
else
|
else
|
||||||
TAOS_DIR=$CURR_DIR/../..
|
TAOS_DIR=$CURR_DIR/../..
|
||||||
fi
|
fi
|
||||||
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find $TAOS_DIR -name "taosd"|grep bin|head -n1`
|
||||||
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6|rev`/lib
|
LIB_DIR=`echo $TAOSD_DIR|rev|cut -d '/' -f 3,4,5,6|rev`/lib
|
||||||
export PYTHONPATH=$(pwd)/../../src/connector/python
|
export PYTHONPATH=$(pwd)/../../src/connector/python
|
||||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIB_DIR
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIB_DIR
|
||||||
|
|
|
@ -10,7 +10,9 @@ set -e
|
||||||
#set -x
|
#set -x
|
||||||
VALGRIND=0
|
VALGRIND=0
|
||||||
LOG_BK_DIR=/data/valgrind_log_backup # 192.168.0.203
|
LOG_BK_DIR=/data/valgrind_log_backup # 192.168.0.203
|
||||||
while getopts "v:r" arg
|
SIM_FILES=./jenkins/basic.txt
|
||||||
|
|
||||||
|
while getopts "v:r:f:" arg
|
||||||
do
|
do
|
||||||
case $arg in
|
case $arg in
|
||||||
v)
|
v)
|
||||||
|
@ -19,6 +21,9 @@ do
|
||||||
r)
|
r)
|
||||||
LOG_BK_DIR=$(echo $OPTARG)
|
LOG_BK_DIR=$(echo $OPTARG)
|
||||||
;;
|
;;
|
||||||
|
f)
|
||||||
|
SIM_FILES=$(echo $OPTARG)
|
||||||
|
;;
|
||||||
?) #unknow option
|
?) #unknow option
|
||||||
echo "unkonw argument"
|
echo "unkonw argument"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -27,6 +32,7 @@ do
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "VALGRIND: $VALGRIND, LOG_BK_DIR: $LOG_BK_DIR"
|
echo "VALGRIND: $VALGRIND, LOG_BK_DIR: $LOG_BK_DIR"
|
||||||
|
echo "SIM_FILES: $SIM_FILES"
|
||||||
|
|
||||||
CURRENT_DIR=`pwd`
|
CURRENT_DIR=`pwd`
|
||||||
TSIM_LOG_DIR=$CURRENT_DIR/../../sim/tsim/log
|
TSIM_LOG_DIR=$CURRENT_DIR/../../sim/tsim/log
|
||||||
|
@ -76,6 +82,7 @@ do
|
||||||
$line
|
$line
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < ./jenkins/basic.txt
|
done < ${SIM_FILES}
|
||||||
|
#done < ./jenkins/basic.txt
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -52,9 +52,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
|
@ -46,7 +46,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -55,9 +55,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
|
@ -41,7 +41,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -50,9 +50,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep source|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep source|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
||||||
|
|
|
@ -52,7 +52,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -61,9 +61,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
|
@ -52,7 +52,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -61,9 +61,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
|
@ -52,7 +52,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -61,9 +61,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
|
@ -56,7 +56,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -65,16 +65,16 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep source|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep source|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
||||||
|
|
||||||
SIM_DIR=$TAOS_DIR/sim
|
SIM_DIR=$TAOS_DIR/sim
|
||||||
NODE_DIR=$SIM_DIR/$NODE_NAME
|
NODE_DIR=$SIM_DIR/$NODE_NAME
|
||||||
EXE_DIR=$BUILD_DIR/source/dnode/mgmt
|
EXE_DIR=$BUILD_DIR/build/bin
|
||||||
CFG_DIR=$NODE_DIR/cfg
|
CFG_DIR=$NODE_DIR/cfg
|
||||||
LOG_DIR=$NODE_DIR/log
|
LOG_DIR=$NODE_DIR/log
|
||||||
DATA_DIR=$NODE_DIR/data
|
DATA_DIR=$NODE_DIR/data
|
||||||
|
@ -101,8 +101,8 @@ if [ "$EXEC_OPTON" = "start" ]; then
|
||||||
if [ "$VALGRIND_OPTION" = "true" ]; then
|
if [ "$VALGRIND_OPTION" = "true" ]; then
|
||||||
TT=`date +%s`
|
TT=`date +%s`
|
||||||
#mkdir ${LOG_DIR}/${TT}
|
#mkdir ${LOG_DIR}/${TT}
|
||||||
echo "nohup valgrind --log-file=${LOG_DIR}/valgrind-taosd-${TT}.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &"
|
echo "nohup valgrind --log-file=${LOG_DIR}/valgrind-taosd-${NODE_NAME}-${TT}.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &"
|
||||||
nohup valgrind --log-file=${LOG_DIR}/valgrind-taosd-${TT}.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
|
nohup valgrind --log-file=${LOG_DIR}/valgrind-taosd-${NODE_NAME}-${TT}.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
|
||||||
else
|
else
|
||||||
echo "nohup $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &"
|
echo "nohup $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &"
|
||||||
nohup $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
|
nohup $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
|
||||||
|
|
|
@ -49,7 +49,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -58,9 +58,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
|
@ -67,9 +67,9 @@ cd ${projectDir}
|
||||||
gitPullBranchInfo $TDengineBrVer
|
gitPullBranchInfo $TDengineBrVer
|
||||||
compileTDengineVersion
|
compileTDengineVersion
|
||||||
|
|
||||||
taos_dir=${projectDir}/debug/tools/shell
|
taos_dir=${projectDir}/debug/build/bin
|
||||||
taosd_dir=${projectDir}/debug/source/dnode/mgmt
|
taosd_dir=${projectDir}/debug/build/bin
|
||||||
exec_process_dir=${projectDir}/debug/tests/test/c
|
exec_process_dir=${projectDir}/debug/build/bin
|
||||||
|
|
||||||
rm -f /usr/bin/taos
|
rm -f /usr/bin/taos
|
||||||
rm -f /usr/bin/taosd
|
rm -f /usr/bin/taosd
|
||||||
|
|
|
@ -18,7 +18,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -27,9 +27,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
|
@ -18,7 +18,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
TAOS_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -27,9 +27,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep debug|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
BUILD_DIR=$TAOS_DIR/$BIN_DIR/build
|
||||||
|
|
|
@ -51,7 +51,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TOP_DIR=`pwd`
|
TOP_DIR=`pwd`
|
||||||
TAOSD_DIR=`find . -name "taosd"|grep debug|head -n1`
|
TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1`
|
||||||
|
|
||||||
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
if [[ "$OS_TYPE" != "Darwin" ]]; then
|
||||||
cut_opt="--field="
|
cut_opt="--field="
|
||||||
|
@ -60,16 +60,16 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||||
BIN_DIR=`find . -name "taosd"|grep source|head -n1|cut -d '/' ${cut_opt}2,3`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3`
|
||||||
else
|
else
|
||||||
BIN_DIR=`find . -name "taosd"|grep source|head -n1|cut -d '/' ${cut_opt}2`
|
BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_DIR=$TOP_DIR/$BIN_DIR
|
declare -x BUILD_DIR=$TOP_DIR/$BIN_DIR
|
||||||
|
|
||||||
SIM_DIR=$TOP_DIR/sim
|
declare -x SIM_DIR=$TOP_DIR/sim
|
||||||
|
|
||||||
PROGRAM=$BUILD_DIR/tests/tsim/tsim
|
PROGRAM=$BUILD_DIR/build/bin/tsim
|
||||||
|
|
||||||
PRG_DIR=$SIM_DIR/tsim
|
PRG_DIR=$SIM_DIR/tsim
|
||||||
CFG_DIR=$PRG_DIR/cfg
|
CFG_DIR=$PRG_DIR/cfg
|
||||||
|
@ -125,8 +125,14 @@ ulimit -c unlimited
|
||||||
if [ -n "$FILE_NAME" ]; then
|
if [ -n "$FILE_NAME" ]; then
|
||||||
echo "------------------------------------------------------------------------"
|
echo "------------------------------------------------------------------------"
|
||||||
if [ $VALGRIND -eq 1 ]; then
|
if [ $VALGRIND -eq 1 ]; then
|
||||||
echo valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${CODE_DIR}/../script/valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME -v
|
if [[ $MULTIPROCESS -eq 1 ]];then
|
||||||
valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${LOG_DIR}/valgrind-tsim.log $PROGRAM -c $CFG_DIR -f $FILE_NAME -v
|
FLAG="-m -v"
|
||||||
|
else
|
||||||
|
FLAG="-v"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${LOG_DIR}/valgrind-tsim.log $PROGRAM -c $CFG_DIR -f $FILE_NAME $FLAG
|
||||||
|
valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${LOG_DIR}/valgrind-tsim.log $PROGRAM -c $CFG_DIR -f $FILE_NAME $FLAG
|
||||||
else
|
else
|
||||||
if [[ $MULTIPROCESS -eq 1 ]];then
|
if [[ $MULTIPROCESS -eq 1 ]];then
|
||||||
echo "ExcuteCmd(multiprocess):" $PROGRAM -m -c $CFG_DIR -f $FILE_NAME
|
echo "ExcuteCmd(multiprocess):" $PROGRAM -m -c $CFG_DIR -f $FILE_NAME
|
||||||
|
|
|
@ -45,8 +45,8 @@ sql explain select * from information_schema.user_stables;
|
||||||
sql explain select count(*),sum(f1) from tb1;
|
sql explain select count(*),sum(f1) from tb1;
|
||||||
sql explain select count(*),sum(f1) from st1;
|
sql explain select count(*),sum(f1) from st1;
|
||||||
sql explain select count(*),sum(f1) from st1 group by f1;
|
sql explain select count(*),sum(f1) from st1 group by f1;
|
||||||
sql explain select count(f1) from tb1 interval(1s, 2d) sliding(3s) fill(prev);
|
sql explain select count(f1) from tb1 interval(10s, 2s) sliding(3s) fill(prev);
|
||||||
sql explain select min(f1) from st1 interval(1m, 2a) sliding(3n);
|
sql explain select min(f1) from st1 interval(1m, 2a) sliding(30s);
|
||||||
|
|
||||||
print ======== step3
|
print ======== step3
|
||||||
sql explain verbose true select * from st1 where -2;
|
sql explain verbose true select * from st1 where -2;
|
||||||
|
@ -65,8 +65,8 @@ sql explain analyze select * from information_schema.user_stables;
|
||||||
sql explain analyze select count(*),sum(f1) from tb1;
|
sql explain analyze select count(*),sum(f1) from tb1;
|
||||||
sql explain analyze select count(*),sum(f1) from st1;
|
sql explain analyze select count(*),sum(f1) from st1;
|
||||||
sql explain analyze select count(*),sum(f1) from st1 group by f1;
|
sql explain analyze select count(*),sum(f1) from st1 group by f1;
|
||||||
sql explain analyze select count(f1) from tb1 interval(1s, 2d) sliding(3s) fill(prev);
|
sql explain analyze select count(f1) from tb1 interval(10s, 2s) sliding(3s) fill(prev);
|
||||||
sql explain analyze select min(f1) from st1 interval(3n, 2a) sliding(1n);
|
sql explain analyze select min(f1) from st1 interval(3m, 2a) sliding(1m);
|
||||||
|
|
||||||
print ======== step5
|
print ======== step5
|
||||||
sql explain analyze verbose true select ts from st1 where -2;
|
sql explain analyze verbose true select ts from st1 where -2;
|
||||||
|
@ -78,20 +78,20 @@ sql explain analyze verbose true select * from information_schema.user_stables;
|
||||||
sql explain analyze verbose true select count(*),sum(f1) from tb1;
|
sql explain analyze verbose true select count(*),sum(f1) from tb1;
|
||||||
sql explain analyze verbose true select count(*),sum(f1) from st1;
|
sql explain analyze verbose true select count(*),sum(f1) from st1;
|
||||||
sql explain analyze verbose true select count(*),sum(f1) from st1 group by f1;
|
sql explain analyze verbose true select count(*),sum(f1) from st1 group by f1;
|
||||||
sql explain analyze verbose true select count(f1) from tb1 interval(1s, 2d) sliding(3s) fill(prev);
|
sql explain analyze verbose true select count(f1) from tb1 interval(10s, 2s) sliding(3s) fill(prev);
|
||||||
sql explain analyze verbose true select ts from tb1 where f1 > 0;
|
sql explain analyze verbose true select ts from tb1 where f1 > 0;
|
||||||
sql explain analyze verbose true select f1 from st1 where f1 > 0 and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00';
|
sql explain analyze verbose true select f1 from st1 where f1 > 0 and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00';
|
||||||
sql explain analyze verbose true select * from information_schema.user_stables where db_name='db2';
|
sql explain analyze verbose true select * from information_schema.user_stables where db_name='db2';
|
||||||
sql explain analyze verbose true select count(*),sum(f1) from st1 where f1 > 0 and ts > '2021-10-31 00:00:00' group by f1 having sum(f1) > 0;
|
sql explain analyze verbose true select count(*),sum(f1) from st1 where f1 > 0 and ts > '2021-10-31 00:00:00' group by f1 having sum(f1) > 0;
|
||||||
sql explain analyze verbose true select min(f1) from st1 interval(3n, 2a) sliding(1n);
|
sql explain analyze verbose true select min(f1) from st1 interval(3m, 2a) sliding(1m);
|
||||||
sql explain analyze verbose true select * from (select min(f1),count(*) a from st1 where f1 > 0) where a < 0;
|
sql explain analyze verbose true select * from (select min(f1),count(*) a from st1 where f1 > 0) where a < 0;
|
||||||
|
|
||||||
#not pass case
|
#not pass case
|
||||||
#sql explain verbose true select count(*),sum(f1) as aa from tb1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' order by aa;
|
#sql explain verbose true select count(*),sum(f1) as aa from tb1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' order by aa;
|
||||||
#sql explain verbose true select * from st1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' order by ts;
|
#sql explain verbose true select * from st1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' order by ts;
|
||||||
#sql explain verbose true select count(*),sum(f1) from st1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' order by ts;
|
#sql explain verbose true select count(*),sum(f1) from st1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' order by ts;
|
||||||
#sql explain verbose true select count(f1) from tb1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' interval(1s, 2d) sliding(3s) order by ts;
|
#sql explain verbose true select count(f1) from tb1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' interval(10s, 2s) sliding(3s) order by ts;
|
||||||
#sql explain verbose true select min(f1) from st1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' interval(1m, 2a) sliding(3n) fill(linear) order by ts;
|
#sql explain verbose true select min(f1) from st1 where (f1 > 0 or f1 < -1) and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00' interval(1m, 2a) sliding(30s) fill(linear) order by ts;
|
||||||
#sql explain select max(f1) from tb1 SESSION(ts, 1s);
|
#sql explain select max(f1) from tb1 SESSION(ts, 1s);
|
||||||
#sql explain select max(f1) from st1 SESSION(ts, 1s);
|
#sql explain select max(f1) from st1 SESSION(ts, 1s);
|
||||||
#sql explain select * from tb1, tb2 where tb1.ts=tb2.ts;
|
#sql explain select * from tb1, tb2 where tb1.ts=tb2.ts;
|
||||||
|
|
|
@ -200,43 +200,8 @@ if $data02 != 2678400000 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct3 interval(1n, 1w) sliding(2w)
|
sql_error select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct3 interval(1n, 1w) sliding(2w)
|
||||||
print ===> select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct3 interval(1n, 1w) sliding(2w)
|
sql_error select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct3 interval(1n, 1w) sliding(4w)
|
||||||
print ===> rows: $rows
|
|
||||||
print ===> rows0: $data00 $data01 $data02 $data03 $data04
|
|
||||||
print ===> rows1: $data10 $data11 $data12 $data13 $data14
|
|
||||||
print ===> rows2: $data20 $data21 $data22 $data23 $data24
|
|
||||||
print ===> rows3: $data30 $data31 $data32 $data33 $data34
|
|
||||||
if $rows != 4 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data00 != @21-11-30 08:00:00.000@ then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data01 != NULL then
|
|
||||||
print expect null, actual: $data01
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data31 != $data34 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct3 interval(1n, 1w) sliding(4w)
|
|
||||||
print ===> select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct3 interval(1n, 1w) sliding(4w)
|
|
||||||
print ===> rows: $rows
|
|
||||||
print ===> rows0: $data00 $data01 $data02 $data03 $data04
|
|
||||||
print ===> rows1: $data10 $data11 $data12 $data13 $data14
|
|
||||||
print ===> rows2: $data20 $data21 $data22 $data23 $data24
|
|
||||||
print ===> rows3: $data30 $data31 $data32 $data33 $data34
|
|
||||||
if $rows != 4 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data01 != NULL then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data04 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n)
|
sql select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n)
|
||||||
print ===> select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n)
|
print ===> select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n)
|
||||||
|
@ -254,37 +219,8 @@ if $data04 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(*) from ct4 interval(1y, 6n) sliding(6n)
|
sql_error select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(*) from ct4 interval(1y, 6n) sliding(6n)
|
||||||
print ===> select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(*) from ct4 interval(1y, 6n) sliding(6n)
|
sql_error select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n) sliding(12n)
|
||||||
print ===> rows: $rows
|
|
||||||
print ===> rows0: $data00 $data01 $data02 $data03 $data04
|
|
||||||
print ===> rows1: $data10 $data11 $data12 $data13 $data14
|
|
||||||
print ===> rows2: $data20 $data21 $data22 $data23 $data24
|
|
||||||
if $rows != 3 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data00 != 2 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data04 != 2 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n) sliding(12n)
|
|
||||||
print ===> select _wstartts, count(tbcol), _wduration, _wstartts, count(*) from ct4 interval(1y, 6n) sliding(12n)
|
|
||||||
print ===> rows: $rows
|
|
||||||
print ===> rows0: $data00 $data01 $data02 $data03 $data04
|
|
||||||
print ===> rows1: $data10 $data11 $data12 $data13 $data14
|
|
||||||
print ===> rows2: $data20 $data21 $data22 $data23 $data24
|
|
||||||
if $rows != 3 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data01 != 2 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data04 != 2 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
print =============== stop and restart taosd
|
print =============== stop and restart taosd
|
||||||
|
|
|
@ -290,32 +290,33 @@ print ================> syntax error check not active ================> reactive
|
||||||
sql_error select * from dev_001 session(ts,1w)
|
sql_error select * from dev_001 session(ts,1w)
|
||||||
sql_error select count(*) from st session(ts,1w)
|
sql_error select count(*) from st session(ts,1w)
|
||||||
sql_error select count(*) from dev_001 group by tagtype session(ts,1w)
|
sql_error select count(*) from dev_001 group by tagtype session(ts,1w)
|
||||||
sql select count(*) from dev_001 session(ts,1n)
|
sql_error sql select count(*) from dev_001 session(ts,1n)
|
||||||
sql select count(*) from dev_001 session(ts,1y)
|
sql_error sql select count(*) from dev_001 session(ts,1y)
|
||||||
sql select count(*) from dev_001 session(ts,0s)
|
sql_error sql select count(*) from dev_001 session(ts,0s)
|
||||||
sql_error select count(*) from dev_001 session(i,1y)
|
sql_error select count(*) from dev_001 session(i,1y)
|
||||||
sql_error select count(*) from dev_001 session(ts,1d) where ts <'2020-05-20 0:0:0'
|
sql_error select count(*) from dev_001 session(ts,1d) where ts <'2020-05-20 0:0:0'
|
||||||
|
|
||||||
print ====> create database d1 precision 'us'
|
# vnode does not return the precision of the table
|
||||||
sql create database d1 precision 'us'
|
#print ====> create database d1 precision 'us'
|
||||||
sql use d1
|
#sql create database d1 precision 'us'
|
||||||
sql create table dev_001 (ts timestamp ,i timestamp ,j int)
|
#sql use d1
|
||||||
sql insert into dev_001 values(1623046993681000,now,1)(1623046993681001,now+1s,2)(1623046993681002,now+2s,3)(1623046993681004,now+5s,4)
|
#sql create table dev_001 (ts timestamp ,i timestamp ,j int)
|
||||||
print ====> select count(*) from dev_001 session(ts,1u)
|
#sql insert into dev_001 values(1623046993681000,now,1)(1623046993681001,now+1s,2)(1623046993681002,now+2s,3)(1623046993681004,now+5s,4)
|
||||||
sql select _wstartts, count(*) from dev_001 session(ts,1u)
|
#print ====> select count(*) from dev_001 session(ts,1u)
|
||||||
print rows: $rows
|
#sql select _wstartts, count(*) from dev_001 session(ts,1u)
|
||||||
print $data00 $data01 $data02 $data03
|
#print rows: $rows
|
||||||
print $data10 $data11 $data12 $data13
|
#print $data00 $data01 $data02 $data03
|
||||||
print $data20 $data21 $data22 $data23
|
#print $data10 $data11 $data12 $data13
|
||||||
print $data30 $data31 $data32 $data33
|
#print $data20 $data21 $data22 $data23
|
||||||
if $rows != 4 then
|
#print $data30 $data31 $data32 $data33
|
||||||
print expect 2, actual: $rows
|
#if $rows != 4 then
|
||||||
return -1
|
# print expect 2, actual: $rows
|
||||||
endi
|
# return -1
|
||||||
|
#endi
|
||||||
if $data01 != 1 then
|
#
|
||||||
return -1
|
#if $data01 != 1 then
|
||||||
endi
|
# return -1
|
||||||
|
#endi
|
||||||
|
|
||||||
#sql_error select count(*) from dev_001 session(i,1s)
|
#sql_error select count(*) from dev_001 session(i,1s)
|
||||||
sql create table secondts(ts timestamp,t2 timestamp,i int)
|
sql create table secondts(ts timestamp,t2 timestamp,i int)
|
||||||
|
|
|
@ -41,8 +41,15 @@ endi
|
||||||
# -m startTimestamp, default is 1640966400000 [2022-01-01 00:00:00]
|
# -m startTimestamp, default is 1640966400000 [2022-01-01 00:00:00]
|
||||||
# -g showMsgFlag, default is 0
|
# -g showMsgFlag, default is 0
|
||||||
#
|
#
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_demo -sim 1 -b 100 -c ../../sim/tsim/cfg -w ../../sim/dnode1/data/vnode/vnode4/wal
|
|
||||||
system_content ../../debug/tests/test/c/tmq_demo -sim 1 -b 100 -c ../../sim/tsim/cfg -w ../../sim/dnode1/data/vnode/vnode4/wal
|
system_content echo -n \$BUILD_DIR
|
||||||
|
$tmq_demo = $system_content . /build/bin/tmq_demo
|
||||||
|
system_content echo -n \$SIM_DIR
|
||||||
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
$sim_wal = $system_content . /dnode1/data/vnode/vnode4/wal
|
||||||
|
|
||||||
|
print cmd===> system_content $tmq_demo -sim 1 -b 100 -c $tsim_cfg -w $sim_wal
|
||||||
|
system_content $tmq_demo -sim 1 -b 100 -c $tsim_cfg -w $sim_wal
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != @{consume success: 100}@ then
|
if $system_content != @{consume success: 100}@ then
|
||||||
return -1
|
return -1
|
||||||
|
|
|
@ -127,65 +127,70 @@ print inserted totalMsgCnt: $totalMsgCnt
|
||||||
# td.connect.port:6030
|
# td.connect.port:6030
|
||||||
# td.connect.db:db
|
# td.connect.db:db
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2"
|
system_content echo -n \$BUILD_DIR
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2"
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
|
system_content echo -n \$SIM_DIR
|
||||||
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2"
|
||||||
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != @{consume success: 20, 0}@ then
|
if $system_content != @{consume success: 20, 0}@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2"
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2"
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2"
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2"
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 20, 0}@ then
|
#if $system_content != @{consume success: 20, 0}@ then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != @{consume success: 20, 0}@ then
|
if $system_content != @{consume success: 20, 0}@ then
|
||||||
print expect @{consume success: 20, 0}@, actual: $system_content
|
print expect @{consume success: 20, 0}@, actual: $system_content
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != @{consume success: 10, 0}@ then
|
if $system_content != @{consume success: 10, 0}@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != @{consume success: 10, 0}@ then
|
if $system_content != @{consume success: 10, 0}@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != @{consume success: 10, 0}@ then
|
if $system_content != @{consume success: 10, 0}@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != @{consume success: 20, 0}@ then
|
if $system_content != @{consume success: 20, 0}@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != @{consume success: 20, 0}@ then
|
if $system_content != @{consume success: 20, 0}@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != @{consume success: 20, 0}@ then
|
if $system_content != @{consume success: 20, 0}@ then
|
||||||
return -1
|
return -1
|
||||||
|
|
|
@ -180,22 +180,27 @@ $expect_result = $expect_result . $rowNum
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
system_content echo -n \$BUILD_DIR
|
||||||
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
||||||
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 0
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
|
@ -206,22 +211,22 @@ endi
|
||||||
#$expect_result = $expect_result . @, @
|
#$expect_result = $expect_result . @, @
|
||||||
#$expect_result = $expect_result . 0}
|
#$expect_result = $expect_result . 0}
|
||||||
#print expect_result----> $expect_result
|
#print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
|
@ -232,23 +237,23 @@ endi
|
||||||
#$expect_result = $expect_result . @, @
|
#$expect_result = $expect_result . @, @
|
||||||
#$expect_result = $expect_result . 0}
|
#$expect_result = $expect_result . 0}
|
||||||
#print expect_result----> $expect_result
|
#print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
##print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
##print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
##system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
##system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
##print cmd result----> $system_content
|
##print cmd result----> $system_content
|
||||||
###if $system_content != @{consume success: 10000, 0}@ then
|
###if $system_content != @{consume success: 10000, 0}@ then
|
||||||
##if $system_content != success then
|
##if $system_content != success then
|
||||||
## return -1
|
## return -1
|
||||||
##endi
|
##endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
##if $system_content != @{consume success: 10000, 0}@ then
|
##if $system_content != @{consume success: 10000, 0}@ then
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
|
|
|
@ -156,22 +156,27 @@ print expectMsgCntFromStb: $expectMsgCntFromStb
|
||||||
#$expect_result = $expect_result . @, @
|
#$expect_result = $expect_result . @, @
|
||||||
#$expect_result = $expect_result . 0}
|
#$expect_result = $expect_result . 0}
|
||||||
#print expect_result----> $expect_result
|
#print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
system_content echo -n \$BUILD_DIR
|
||||||
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
|
@ -182,22 +187,22 @@ print expectMsgCntFromStb: $expectMsgCntFromStb
|
||||||
#$expect_result = $expect_result . @, @
|
#$expect_result = $expect_result . @, @
|
||||||
#$expect_result = $expect_result . 0}
|
#$expect_result = $expect_result . 0}
|
||||||
#print expect_result----> $expect_result
|
#print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
|
@ -208,23 +213,23 @@ $expect_result = $expect_result . $expectMsgCntFromStb
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
##if $system_content != @{consume success: 10000, 0}@ then
|
##if $system_content != @{consume success: 10000, 0}@ then
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 0
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 10000, 0}@ then
|
#if $system_content != @{consume success: 10000, 0}@ then
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
|
|
|
@ -150,22 +150,27 @@ $expect_result = $expect_result . $rowNum
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
system_content echo -n \$BUILD_DIR
|
||||||
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
||||||
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
|
@ -176,22 +181,22 @@ endi
|
||||||
#$expect_result = $expect_result . @, @
|
#$expect_result = $expect_result . @, @
|
||||||
#$expect_result = $expect_result . 0}
|
#$expect_result = $expect_result . 0}
|
||||||
#print expect_result----> $expect_result
|
#print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 1
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
|
@ -202,23 +207,23 @@ endi
|
||||||
#$expect_result = $expect_result . @, @
|
#$expect_result = $expect_result . @, @
|
||||||
#$expect_result = $expect_result . 0}
|
#$expect_result = $expect_result . 0}
|
||||||
#print expect_result----> $expect_result
|
#print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
##print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
##print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
##system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
##system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
##print cmd result----> $system_content
|
##print cmd result----> $system_content
|
||||||
###if $system_content != @{consume success: 10000, 0}@ then
|
###if $system_content != @{consume success: 10000, 0}@ then
|
||||||
##if $system_content != success then
|
##if $system_content != success then
|
||||||
## return -1
|
## return -1
|
||||||
##endi
|
##endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
##if $system_content != @{consume success: 10000, 0}@ then
|
##if $system_content != @{consume success: 10000, 0}@ then
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
|
|
|
@ -156,22 +156,27 @@ print expectMsgCntFromStb: $expectMsgCntFromStb
|
||||||
#$expect_result = $expect_result . @, @
|
#$expect_result = $expect_result . @, @
|
||||||
#$expect_result = $expect_result . 0}
|
#$expect_result = $expect_result . 0}
|
||||||
#print expect_result----> $expect_result
|
#print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
system_content echo -n \$BUILD_DIR
|
||||||
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_column" -k1 "group.id:tg2" -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_all" -k1 "group.id:tg2" -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ctb_function" -k1 "group.id:tg2" -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
|
@ -182,22 +187,22 @@ print expectMsgCntFromStb: $expectMsgCntFromStb
|
||||||
#$expect_result = $expect_result . @, @
|
#$expect_result = $expect_result . @, @
|
||||||
#$expect_result = $expect_result . 0}
|
#$expect_result = $expect_result . 0}
|
||||||
#print expect_result----> $expect_result
|
#print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_column" -k1 "group.id:tg2" -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_all" -k1 "group.id:tg2" -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#
|
#
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_ntb_function" -k1 "group.id:tg2" -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
|
@ -208,23 +213,23 @@ $expect_result = $expect_result . $expectMsgCntFromStb
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_all" -k1 "group.id:tg2" -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
##if $system_content != @{consume success: 10000, 0}@ then
|
##if $system_content != @{consume success: 10000, 0}@ then
|
||||||
#if $system_content != success then
|
#if $system_content != success then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column" -k1 "group.id:tg2" -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 1
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 10000, 0}@ then
|
#if $system_content != @{consume success: 10000, 0}@ then
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
|
|
|
@ -160,10 +160,15 @@ $expect_result = $expect_result . $expectMsgCntFromStb
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column, topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column, topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
system_content echo -n \$BUILD_DIR
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column, topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column, topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column, topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column, topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column, topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column, topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 20000, 0}@ then
|
#if $system_content != @{consume success: 20000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
@ -178,8 +183,8 @@ $expect_result = $expect_result . $expectMsgCntFromCtb
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 300, 0}@ then
|
#if $system_content != @{consume success: 300, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
@ -194,8 +199,8 @@ $expect_result = $expect_result . $expectMsgCntFromNtb
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_all, topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_all, topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_all, topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_all, topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 30000, 0}@ then
|
#if $system_content != @{consume success: 30000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
|
|
@ -157,23 +157,28 @@ $expect_result = $expect_result . $expectMsgCntFromStb
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
system_content echo -n \$BUILD_DIR
|
||||||
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
##if $system_content != @{consume success: 10000, 0}@ then
|
##if $system_content != @{consume success: 10000, 0}@ then
|
||||||
#if $system_content != $expect_result then
|
#if $system_content != $expect_result then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 10000, 0}@ then
|
#if $system_content != @{consume success: 10000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
@ -185,22 +190,22 @@ $expect_result = $expect_result . $expectMsgCntFromCtb
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
|
@ -211,22 +216,22 @@ $expect_result = $expect_result . $expectMsgCntFromStb
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
|
|
|
@ -173,10 +173,15 @@ $expect_result = $expect_result . $totalMsgCntOfmultiTopics
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column, topic_stb_function, topic_stb_all" -k "group.id:tg2"
|
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column, topic_stb_function, topic_stb_all" -k "group.id:tg2"
|
system_content echo -n \$BUILD_DIR
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column, topic_stb_function" -k "group.id:tg2"
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column, topic_stb_function" -k "group.id:tg2"
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column, topic_stb_function, topic_stb_all" -k "group.id:tg2"
|
||||||
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column, topic_stb_function, topic_stb_all" -k "group.id:tg2"
|
||||||
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column, topic_stb_function" -k "group.id:tg2"
|
||||||
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column, topic_stb_function" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 20000, 0}@ then
|
#if $system_content != @{consume success: 20000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
@ -190,8 +195,8 @@ $expect_result = $expect_result . $totalMsgCntOfmultiTopics
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 300, 0}@ then
|
#if $system_content != @{consume success: 300, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
@ -205,8 +210,8 @@ $expect_result = $expect_result . $totalMsgCntOfmultiTopics
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_all, topic_ntb_function" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_all, topic_ntb_function" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_all, topic_ntb_function" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_all, topic_ntb_function" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 30000, 0}@ then
|
#if $system_content != @{consume success: 30000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
|
|
@ -171,24 +171,29 @@ $expect_result = $expect_result . $totalMsgCnt
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2"
|
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2"
|
system_content echo -n \$BUILD_DIR
|
||||||
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2"
|
||||||
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_column" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 10000, 0}@ then
|
#if $system_content != @{consume success: 10000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2"
|
#print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2"
|
||||||
#system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2"
|
#system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_all" -k "group.id:tg2"
|
||||||
#print cmd result----> $system_content
|
#print cmd result----> $system_content
|
||||||
##if $system_content != @{consume success: 10000, 0}@ then
|
##if $system_content != @{consume success: 10000, 0}@ then
|
||||||
#if $system_content != $expect_result then
|
#if $system_content != $expect_result then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_stb_function" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 10000, 0}@ then
|
#if $system_content != @{consume success: 10000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
@ -200,24 +205,24 @@ $expect_result = $expect_result . $rowNum
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 100, 0}@ then
|
#if $system_content != @{consume success: 100, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_all" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 100, 0}@ then
|
#if $system_content != @{consume success: 100, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_function" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 100, 0}@ then
|
#if $system_content != @{consume success: 100, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
@ -229,24 +234,24 @@ $expect_result = $expect_result . $totalMsgCnt
|
||||||
$expect_result = $expect_result . @, @
|
$expect_result = $expect_result . @, @
|
||||||
$expect_result = $expect_result . 0}
|
$expect_result = $expect_result . 0}
|
||||||
print expect_result----> $expect_result
|
print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 10000, 0}@ then
|
#if $system_content != @{consume success: 10000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_all" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 10000, 0}@ then
|
#if $system_content != @{consume success: 10000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2"
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2"
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2"
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_function" -k "group.id:tg2"
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
#if $system_content != @{consume success: 10000, 0}@ then
|
#if $system_content != @{consume success: 10000, 0}@ then
|
||||||
if $system_content != $expect_result then
|
if $system_content != $expect_result then
|
||||||
|
|
|
@ -190,15 +190,20 @@ endi
|
||||||
|
|
||||||
$expectMsgCntFromStb0 = 2001
|
$expectMsgCntFromStb0 = 2001
|
||||||
$expectMsgCntFromStb1 = 2001
|
$expectMsgCntFromStb1 = 2001
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column, topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb0 -m1 $expectMsgCntFromStb1 -j 2
|
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column, topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb0 -m1 $expectMsgCntFromStb1 -j 2
|
system_content echo -n \$BUILD_DIR
|
||||||
|
$tmq_sim = $system_content . /build/bin/tmq_sim
|
||||||
|
$tsim_cfg = $system_content . /tsim/cfg
|
||||||
|
|
||||||
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column, topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb0 -m1 $expectMsgCntFromStb1 -j 2
|
||||||
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column, topic_stb_function" -k1 "group.id:tg2" -t "topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb0 -m1 $expectMsgCntFromStb1 -j 2
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column, topic_stb_function" -k1 "group.id:tg1" -t "topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 3
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column, topic_stb_function" -k1 "group.id:tg1" -t "topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 3
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t1 "topic_stb_column, topic_stb_function" -k1 "group.id:tg1" -t "topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 3
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t1 "topic_stb_column, topic_stb_function" -k1 "group.id:tg1" -t "topic_stb_function, topic_stb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromStb -j 3
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
|
@ -211,29 +216,29 @@ endi
|
||||||
#$expect_result = $expect_result . @, @
|
#$expect_result = $expect_result . @, @
|
||||||
#$expect_result = $expect_result . 0}
|
#$expect_result = $expect_result . 0}
|
||||||
#print expect_result----> $expect_result
|
#print expect_result----> $expect_result
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 4
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 4
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 4
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -t "topic_ctb_column, topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 4
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function" -k "group.id:tg1" -t "topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 3
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function" -k "group.id:tg1" -t "topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 3
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function" -k "group.id:tg1" -t "topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 3
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ctb_column, topic_ctb_function" -k "group.id:tg1" -t "topic_ctb_function, topic_ctb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromCtb -j 3
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -t "topic_ntb_column, topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb -j 4
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -t "topic_ntb_column, topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb -j 4
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -t "topic_ntb_column, topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb -j 4
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -t "topic_ntb_column, topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb -j 4
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print cmd===> system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_function" -k "group.id:tg1" -t "topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb -j 3
|
print cmd===> system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_function" -k "group.id:tg1" -t "topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb -j 3
|
||||||
system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_function" -k "group.id:tg1" -t "topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb -j 3
|
system_content $tmq_sim -c $tsim_cfg -d $dbNamme -t "topic_ntb_column, topic_ntb_function" -k "group.id:tg1" -t "topic_ntb_function, topic_ntb_all" -k "group.id:tg2" -y $consumeDelay -m $expectMsgCntFromNtb -j 3
|
||||||
print cmd result----> $system_content
|
print cmd result----> $system_content
|
||||||
if $system_content != success then
|
if $system_content != success then
|
||||||
return -1
|
return -1
|
||||||
|
|
Loading…
Reference in New Issue