提交 25d888f1 编写于 作者: H hjxilinx

Merge branch 'develop' into feature/liaohj

...@@ -38,21 +38,56 @@ IF (NOT DEFINED TD_CLUSTER) ...@@ -38,21 +38,56 @@ IF (NOT DEFINED TD_CLUSTER)
# Set macro definitions according to os platform # Set macro definitions according to os platform
SET(TD_LINUX_64 FALSE) SET(TD_LINUX_64 FALSE)
SET(TD_LINUX_32 FALSE) SET(TD_LINUX_32 FALSE)
SET(TD_ARM FALSE)
SET(TD_ARM_64 FALSE) SET(TD_ARM_64 FALSE)
SET(TD_ARM_32 FALSE) SET(TD_ARM_32 FALSE)
SET(TD_MIPS_64 FALSE) SET(TD_MIPS_64 FALSE)
SET(TD_DARWIN_64 FALSE) SET(TD_DARWIN_64 FALSE)
SET(TD_WINDOWS_64 FALSE) SET(TD_WINDOWS_64 FALSE)
# if generate ARM version:
# cmake -DARMVER=arm32 .. or cmake -DARMVER=arm64
IF (${ARMVER} MATCHES "arm32")
SET(TD_ARM TRUE)
SET(TD_ARM_32 TRUE)
ADD_DEFINITIONS(-D_TD_ARM_)
ADD_DEFINITIONS(-D_TD_ARM_32_)
ELSEIF (${ARMVER} MATCHES "arm64")
SET(TD_ARM TRUE)
SET(TD_ARM_64 TRUE)
ADD_DEFINITIONS(-D_TD_ARM_)
ADD_DEFINITIONS(-D_TD_ARM_64_)
ENDIF ()
IF (TD_ARM)
ADD_DEFINITIONS(-D_TD_ARM_)
IF (TD_ARM_32)
ADD_DEFINITIONS(-D_TD_ARM_32_)
ELSEIF (TD_ARM_64)
ADD_DEFINITIONS(-D_TD_ARM_64_)
ELSE ()
EXIT ()
ENDIF ()
ENDIF ()
IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
IF (${CMAKE_SIZEOF_VOID_P} MATCHES 8) IF (${CMAKE_SIZEOF_VOID_P} MATCHES 8)
SET(TD_LINUX_64 TRUE) SET(TD_LINUX_64 TRUE)
SET(TD_OS_DIR ${TD_COMMUNITY_DIR}/src/os/linux) SET(TD_OS_DIR ${TD_COMMUNITY_DIR}/src/os/linux)
ADD_DEFINITIONS(-D_M_X64) ADD_DEFINITIONS(-D_M_X64)
MESSAGE(STATUS "The current platform is Linux 64-bit") MESSAGE(STATUS "The current platform is Linux 64-bit")
ELSE () ELSEIF (${CMAKE_SIZEOF_VOID_P} MATCHES 4)
IF (TD_ARM)
SET(TD_LINUX_32 TRUE) SET(TD_LINUX_32 TRUE)
MESSAGE(FATAL_ERROR "The current platform is Linux 32-bit, not supported yet") SET(TD_OS_DIR ${TD_COMMUNITY_DIR}/src/os/linux)
#ADD_DEFINITIONS(-D_M_IX86)
MESSAGE(STATUS "The current platform is Linux 32-bit")
ELSE ()
MESSAGE(FATAL_ERROR "The current platform is Linux 32-bit, but no ARM not supported yet")
EXIT ()
ENDIF ()
ELSE ()
MESSAGE(FATAL_ERROR "The current platform is Linux neither 32-bit nor 64-bit, not supported yet")
EXIT () EXIT ()
ENDIF () ENDIF ()
ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
...@@ -102,13 +137,27 @@ IF (NOT DEFINED TD_CLUSTER) ...@@ -102,13 +137,27 @@ IF (NOT DEFINED TD_CLUSTER)
IF (TD_LINUX_64) IF (TD_LINUX_64)
SET(DEBUG_FLAGS "-O0 -DDEBUG") SET(DEBUG_FLAGS "-O0 -DDEBUG")
SET(RELEASE_FLAGS "-O0") SET(RELEASE_FLAGS "-O0")
IF (NOT TD_ARM)
IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
ELSE () ELSE ()
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
ENDIF () ENDIF ()
ELSE ()
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -Wno-char-subscripts -fsigned-char -munaligned-access -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
ENDIF ()
ADD_DEFINITIONS(-DLINUX)
ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
ELSEIF (TD_LINUX_32)
IF (NOT TD_ARM)
EXIT ()
ENDIF ()
SET(DEBUG_FLAGS "-O0 -DDEBUG")
SET(RELEASE_FLAGS "-O0")
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -Wno-char-subscripts -fsigned-char -munaligned-access -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
ADD_DEFINITIONS(-DLINUX) ADD_DEFINITIONS(-DLINUX)
ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT) ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
ADD_DEFINITIONS(-DUSE_LIBICONV)
ELSEIF (TD_WINDOWS_64) ELSEIF (TD_WINDOWS_64)
SET(CMAKE_GENERATOR "NMake Makefiles" CACHE INTERNAL "" FORCE) SET(CMAKE_GENERATOR "NMake Makefiles" CACHE INTERNAL "" FORCE)
SET(COMMON_FLAGS "/nologo /WX- /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-") SET(COMMON_FLAGS "/nologo /WX- /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-")
...@@ -169,6 +218,14 @@ IF (NOT DEFINED TD_CLUSTER) ...@@ -169,6 +218,14 @@ IF (NOT DEFINED TD_CLUSTER)
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})")
INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR})") INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR})")
ELSEIF (TD_LINUX_32)
IF (NOT TD_ARM)
EXIT ()
ENDIF ()
SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh")
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})")
INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR})")
ELSEIF (TD_WINDOWS_64) ELSEIF (TD_WINDOWS_64)
SET(CMAKE_INSTALL_PREFIX C:/TDengine) SET(CMAKE_INSTALL_PREFIX C:/TDengine)
INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/go DESTINATION connector) INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/go DESTINATION connector)
......
...@@ -247,9 +247,9 @@ vercomp () { ...@@ -247,9 +247,9 @@ vercomp () {
function is_version_compatible() { function is_version_compatible() {
curr_version=$(${bin_dir}/taosd -V | cut -d ' ' -f 1) curr_version=$(${bin_dir}/taosd -V | cut -d ' ' -f 2)
min_compatible_version=$(${script_dir}/bin/taosd -V | cut -d ' ' -f 2) min_compatible_version=$(${script_dir}/bin/taosd -V | cut -d ' ' -f 4)
vercomp $curr_version $min_compatible_version vercomp $curr_version $min_compatible_version
case $? in case $? in
......
...@@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) ...@@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
AUX_SOURCE_DIRECTORY(./src SRC) AUX_SOURCE_DIRECTORY(./src SRC)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/linux) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/linux)
# set the static lib name # set the static lib name
......
...@@ -206,10 +206,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn ...@@ -206,10 +206,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn
ret = (jlong)taos_connect((char *)host, (char *)user, (char *)pass, (char *)dbname, jport); ret = (jlong)taos_connect((char *)host, (char *)user, (char *)pass, (char *)dbname, jport);
if (ret == 0) { if (ret == 0) {
jniError("jobj:%p, taos:%p, connect to tdengine failed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret, jniError("jobj:%p, conn:%p, connect to database failed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret,
(char *)host, (char *)user, (char *)dbname, jport); (char *)host, (char *)user, (char *)dbname, jport);
} else { } else {
jniTrace("jobj:%p, taos:%p, connect to tdengine succeed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret, jniTrace("jobj:%p, conn:%p, connect to database succeed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret,
(char *)host, (char *)user, (char *)dbname, jport); (char *)host, (char *)user, (char *)dbname, jport);
} }
...@@ -230,7 +230,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J ...@@ -230,7 +230,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
} }
if (jsql == NULL) { if (jsql == NULL) {
jniError("jobj:%p, taos:%p, sql is null", jobj, tscon); jniError("jobj:%p, conn:%p, sql is null", jobj, tscon);
return JNI_SQL_NULL; return JNI_SQL_NULL;
} }
...@@ -248,7 +248,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J ...@@ -248,7 +248,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
int code = taos_query(tscon, dst); int code = taos_query(tscon, dst);
if (code != 0) { if (code != 0) {
jniError("jobj:%p, taos:%p, code:%d, msg:%s, sql:%s", jobj, tscon, code, taos_errstr(tscon), dst); jniError("jobj:%p, conn:%p, code:%d, msg:%s, sql:%s", jobj, tscon, code, taos_errstr(tscon), dst);
free(dst); free(dst);
return JNI_TDENGINE_ERROR; return JNI_TDENGINE_ERROR;
} else { } else {
...@@ -257,9 +257,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J ...@@ -257,9 +257,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
if (pSql->cmd.command == TSDB_SQL_INSERT) { if (pSql->cmd.command == TSDB_SQL_INSERT) {
affectRows = taos_affected_rows(tscon); affectRows = taos_affected_rows(tscon);
jniTrace("jobj:%p, taos:%p, code:%d, affect rows:%d, sql:%s", jobj, tscon, code, affectRows, dst); jniTrace("jobj:%p, conn:%p, code:%d, affect rows:%d, sql:%s", jobj, tscon, code, affectRows, dst);
} else { } else {
jniTrace("jobj:%p, taos:%p, code:%d, sql:%s", jobj, tscon, code, dst); jniTrace("jobj:%p, conn:%p, code:%d, sql:%s", jobj, tscon, code, dst);
} }
free(dst); free(dst);
...@@ -293,10 +293,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getResultSetImp( ...@@ -293,10 +293,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getResultSetImp(
if (tscIsUpdateQuery(tscon)) { if (tscIsUpdateQuery(tscon)) {
ret = 0; // for update query, no result pointer ret = 0; // for update query, no result pointer
jniTrace("jobj:%p, taos:%p, no result", jobj, tscon); jniTrace("jobj:%p, conn:%p, no result", jobj, tscon);
} else { } else {
ret = (jlong) taos_use_result(tscon); ret = (jlong) taos_use_result(tscon);
jniTrace("jobj:%p, taos:%p, get resultset:%p", jobj, tscon, (void *) ret); jniTrace("jobj:%p, conn:%p, get resultset:%p", jobj, tscon, (void *) ret);
} }
return ret; return ret;
...@@ -311,12 +311,12 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_freeResultSetImp( ...@@ -311,12 +311,12 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_freeResultSetImp(
} }
if ((void *)res == NULL) { if ((void *)res == NULL) {
jniError("jobj:%p, taos:%p, resultset is null", jobj, tscon); jniError("jobj:%p, conn:%p, resultset is null", jobj, tscon);
return JNI_RESULT_SET_NULL; return JNI_RESULT_SET_NULL;
} }
taos_free_result((void *)res); taos_free_result((void *)res);
jniTrace("jobj:%p, taos:%p, free resultset:%p", jobj, tscon, (void *)res); jniTrace("jobj:%p, conn:%p, free resultset:%p", jobj, tscon, (void *)res);
return JNI_SUCCESS; return JNI_SUCCESS;
} }
...@@ -330,7 +330,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getAffectedRowsIm ...@@ -330,7 +330,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getAffectedRowsIm
jint ret = taos_affected_rows(tscon); jint ret = taos_affected_rows(tscon);
jniTrace("jobj:%p, taos:%p, affect rows:%d", jobj, tscon, (void *)con, ret); jniTrace("jobj:%p, conn:%p, affect rows:%d", jobj, tscon, (void *)con, ret);
return ret; return ret;
} }
...@@ -346,7 +346,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData ...@@ -346,7 +346,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData
TAOS_RES *result = (TAOS_RES *)res; TAOS_RES *result = (TAOS_RES *)res;
if (result == NULL) { if (result == NULL) {
jniError("jobj:%p, taos:%p, resultset is null", jobj, tscon); jniError("jobj:%p, conn:%p, resultset is null", jobj, tscon);
return JNI_RESULT_SET_NULL; return JNI_RESULT_SET_NULL;
} }
...@@ -356,10 +356,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData ...@@ -356,10 +356,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData
// jobject arrayListObj = (*env)->NewObject(env, g_arrayListClass, g_arrayListConstructFp, ""); // jobject arrayListObj = (*env)->NewObject(env, g_arrayListClass, g_arrayListConstructFp, "");
if (num_fields == 0) { if (num_fields == 0) {
jniError("jobj:%p, taos:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields); jniError("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields);
return JNI_NUM_OF_FIELDS_0; return JNI_NUM_OF_FIELDS_0;
} else { } else {
jniTrace("jobj:%p, taos:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields); jniTrace("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields);
for (int i = 0; i < num_fields; ++i) { for (int i = 0; i < num_fields; ++i) {
jobject metadataObj = (*env)->NewObject(env, g_metadataClass, g_metadataConstructFp); jobject metadataObj = (*env)->NewObject(env, g_metadataClass, g_metadataConstructFp);
(*env)->SetIntField(env, metadataObj, g_metadataColtypeField, fields[i].type); (*env)->SetIntField(env, metadataObj, g_metadataColtypeField, fields[i].type);
...@@ -402,7 +402,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn ...@@ -402,7 +402,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
TAOS_RES *result = (TAOS_RES *)res; TAOS_RES *result = (TAOS_RES *)res;
if (result == NULL) { if (result == NULL) {
jniError("jobj:%p, taos:%p, resultset is null", jobj, tscon); jniError("jobj:%p, conn:%p, resultset is null", jobj, tscon);
return JNI_RESULT_SET_NULL; return JNI_RESULT_SET_NULL;
} }
...@@ -410,7 +410,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn ...@@ -410,7 +410,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
int num_fields = taos_num_fields(result); int num_fields = taos_num_fields(result);
if (num_fields == 0) { if (num_fields == 0) {
jniError("jobj:%p, taos:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields); jniError("jobj:%p, conn:%p, resultset:%p, fields size is %d", jobj, tscon, res, num_fields);
return JNI_NUM_OF_FIELDS_0; return JNI_NUM_OF_FIELDS_0;
} }
...@@ -418,10 +418,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn ...@@ -418,10 +418,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
if (row == NULL) { if (row == NULL) {
int tserrno = taos_errno(tscon); int tserrno = taos_errno(tscon);
if (tserrno == 0) { if (tserrno == 0) {
jniTrace("jobj:%p, taos:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, res, num_fields); jniTrace("jobj:%p, conn:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, res, num_fields);
return JNI_FETCH_END; return JNI_FETCH_END;
} else { } else {
jniTrace("jobj:%p, taos:%p, interruptted query", jobj, tscon); jniTrace("jobj:%p, conn:%p, interruptted query", jobj, tscon);
return JNI_RESULT_SET_NULL; return JNI_RESULT_SET_NULL;
} }
} }
...@@ -485,7 +485,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_closeConnectionIm ...@@ -485,7 +485,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_closeConnectionIm
jniError("jobj:%p, connection is closed", jobj); jniError("jobj:%p, connection is closed", jobj);
return JNI_CONNECTION_NULL; return JNI_CONNECTION_NULL;
} else { } else {
jniTrace("jobj:%p, taos:%p, close connection success", jobj, tscon); jniTrace("jobj:%p, conn:%p, close connection success", jobj, tscon);
taos_close(tscon); taos_close(tscon);
return JNI_SUCCESS; return JNI_SUCCESS;
} }
...@@ -640,7 +640,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_validateCreateTab ...@@ -640,7 +640,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_validateCreateTab
} }
if (jsql == NULL) { if (jsql == NULL) {
jniError("jobj:%p, taos:%p, sql is null", jobj, tscon); jniError("jobj:%p, conn:%p, sql is null", jobj, tscon);
return JNI_SQL_NULL; return JNI_SQL_NULL;
} }
......
...@@ -3812,10 +3812,11 @@ static void getStatics_i64(int64_t *primaryKey, int64_t *data, int32_t numOfRow, ...@@ -3812,10 +3812,11 @@ static void getStatics_i64(int64_t *primaryKey, int64_t *data, int32_t numOfRow,
static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, double *min, double *max, double *sum, static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, double *min, double *max, double *sum,
int16_t *minIndex, int16_t *maxIndex, int32_t *numOfNull) { int16_t *minIndex, int16_t *maxIndex, int32_t *numOfNull) {
*min = DBL_MAX; float fmin = DBL_MAX;
*max = -DBL_MAX; float fmax = -DBL_MAX;
*minIndex = 0; float fminIndex = 0;
*maxIndex = 0; float fmaxIndex = 0;
double dsum = 0;
assert(numOfRow <= INT16_MAX); assert(numOfRow <= INT16_MAX);
...@@ -3825,15 +3826,19 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou ...@@ -3825,15 +3826,19 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou
continue; continue;
} }
*sum += data[i]; float fv = 0;
if (*min > data[i]) { *(int32_t*)(&fv) = *(int32_t*)(&(data[i]));
*min = data[i];
*minIndex = i; //*sum += data[i];
dsum += fv;
if (fmin > fv) {
fmin = fv;
fminIndex = i;
} }
if (*max < data[i]) { if (fmax < fv) {
*max = data[i]; fmax = fv;
*maxIndex = i; fmaxIndex = i;
} }
// if (isNull(&lastVal, TSDB_DATA_TYPE_FLOAT)) { // if (isNull(&lastVal, TSDB_DATA_TYPE_FLOAT)) {
...@@ -3845,14 +3850,26 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou ...@@ -3845,14 +3850,26 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou
// lastVal = data[i]; // lastVal = data[i];
// } // }
} }
double csum = 0;
*(int64_t*)(&csum) = *(int64_t*)sum;
csum += dsum;
*(int64_t*)(sum) = *(int64_t*)(&csum);
*(int32_t*)max = *(int32_t*)(&fmax);
*(int32_t*)min = *(int32_t*)(&fmin);
*(int32_t*)minIndex = *(int32_t*)(&fminIndex);
*(int32_t*)maxIndex = *(int32_t*)(&fmaxIndex);
} }
static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, double *min, double *max, double *sum, static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, double *min, double *max, double *sum,
int16_t *minIndex, int16_t *maxIndex, int32_t *numOfNull) { int16_t *minIndex, int16_t *maxIndex, int32_t *numOfNull) {
*min = DBL_MAX; double dmin = DBL_MAX;
*max = -DBL_MAX; double dmax = -DBL_MAX;
*minIndex = 0; double dminIndex = 0;
*maxIndex = 0; double dmaxIndex = 0;
double dsum = 0;
assert(numOfRow <= INT16_MAX); assert(numOfRow <= INT16_MAX);
...@@ -3865,15 +3882,19 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do ...@@ -3865,15 +3882,19 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do
continue; continue;
} }
*sum += data[i]; double dv = 0;
if (*min > data[i]) { *(int64_t*)(&dv) = *(int64_t*)(&(data[i]));
*min = data[i];
*minIndex = i; //*sum += data[i];
dsum += dv;
if (dmin > dv) {
dmin = dv;
dminIndex = i;
} }
if (*max < data[i]) { if (dmax < dv) {
*max = data[i]; dmax = dv;
*maxIndex = i; dmaxIndex = i;
} }
// if (isNull(&lastVal, TSDB_DATA_TYPE_DOUBLE)) { // if (isNull(&lastVal, TSDB_DATA_TYPE_DOUBLE)) {
...@@ -3885,6 +3906,16 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do ...@@ -3885,6 +3906,16 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do
// lastVal = data[i]; // lastVal = data[i];
// } // }
} }
double csum = 0;
*(int64_t*)(&csum) = *(int64_t*)sum;
csum += dsum;
*(int64_t*)(sum) = *(int64_t*)(&csum);
*(int64_t*)max = *(int64_t*)(&dmax);
*(int64_t*)min = *(int64_t*)(&dmin);
*(int64_t*)minIndex = *(int64_t*)(&dminIndex);
*(int64_t*)maxIndex = *(int64_t*)(&dmaxIndex);
} }
void getStatistics(char *priData, char *data, int32_t size, int32_t numOfRow, int32_t type, int64_t *min, int64_t *max, void getStatistics(char *priData, char *data, int32_t size, int32_t numOfRow, int32_t type, int64_t *min, int64_t *max,
......
...@@ -20,6 +20,27 @@ ...@@ -20,6 +20,27 @@
#include "ttimer.h" #include "ttimer.h"
#include "tutil.h" #include "tutil.h"
void tscSaveSlowQueryFp(void *handle, void *tmrId);
void *tscSlowQueryConn = NULL;
bool tscSlowQueryConnInitialized = false;
TAOS *taos_connect_a(char *ip, char *user, char *pass, char *db, int port, void (*fp)(void *, TAOS_RES *, int),
void *param, void **taos);
void tscInitConnCb(void *param, TAOS_RES *result, int code) {
char *sql = param;
if (code < 0) {
tscError("taos:%p, slow query connect failed, code:%d", tscSlowQueryConn, code);
taos_close(tscSlowQueryConn);
tscSlowQueryConn = NULL;
tscSlowQueryConnInitialized = false;
free(sql);
} else {
tscTrace("taos:%p, slow query connect success, code:%d", tscSlowQueryConn, code);
tscSlowQueryConnInitialized = true;
tscSaveSlowQueryFp(sql, NULL);
}
}
void tscAddIntoSqlList(SSqlObj *pSql) { void tscAddIntoSqlList(SSqlObj *pSql) {
static uint32_t queryId = 1; static uint32_t queryId = 1;
...@@ -44,33 +65,35 @@ void tscAddIntoSqlList(SSqlObj *pSql) { ...@@ -44,33 +65,35 @@ void tscAddIntoSqlList(SSqlObj *pSql) {
void tscSaveSlowQueryFpCb(void *param, TAOS_RES *result, int code) { void tscSaveSlowQueryFpCb(void *param, TAOS_RES *result, int code) {
if (code < 0) { if (code < 0) {
tscError("failed to save slowquery, code:%d", code); tscError("failed to save slow query, code:%d", code);
} else {
tscTrace("success to save slow query, code:%d", code);
} }
} }
void tscSaveSlowQueryFp(void *handle, void *tmrId) { void tscSaveSlowQueryFp(void *handle, void *tmrId) {
char *sql = handle; char *sql = handle;
static void *taos = NULL; if (!tscSlowQueryConnInitialized) {
if (taos == NULL) { if (tscSlowQueryConn == NULL) {
taos = taos_connect(NULL, "monitor", tsInternalPass, NULL, 0); tscTrace("start to init slow query connect");
if (taos == NULL) { taos_connect_a(NULL, "monitor", tsInternalPass, "", 0, tscInitConnCb, sql, &tscSlowQueryConn);
tscError("failed to save slow query, can't connect to server"); } else {
tscError("taos:%p, slow query connect is already initialized", tscSlowQueryConn);
free(sql); free(sql);
return;
}
} }
} else {
tscTrace("save slow query:sql", sql); tscTrace("taos:%p, save slow query:%s", tscSlowQueryConn, sql);
taos_query_a(taos, sql, tscSaveSlowQueryFpCb, NULL); taos_query_a(tscSlowQueryConn, sql, tscSaveSlowQueryFpCb, NULL);
free(sql); free(sql);
}
} }
void tscSaveSlowQuery(SSqlObj *pSql) { void tscSaveSlowQuery(SSqlObj *pSql) {
const static int64_t SLOW_QUERY_INTERVAL = 3000000L; const static int64_t SLOW_QUERY_INTERVAL = 3000000L;
if (pSql->res.useconds < SLOW_QUERY_INTERVAL) return; if (pSql->res.useconds < SLOW_QUERY_INTERVAL) return;
tscTrace("%p query time:%ld sql:%s", pSql, pSql->res.useconds, pSql->sqlstr); tscTrace("%p query time:%lld sql:%s", pSql, pSql->res.useconds, pSql->sqlstr);
char *sql = malloc(200); char *sql = malloc(200);
int len = snprintf(sql, 200, "insert into %s.slowquery values(now, '%s', %lld, %lld, '", tsMonitorDbName, int len = snprintf(sql, 200, "insert into %s.slowquery values(now, '%s', %lld, %lld, '", tsMonitorDbName,
......
...@@ -562,7 +562,7 @@ void *tscProcessMsgFromServer(char *msg, void *ahandle, void *thandle) { ...@@ -562,7 +562,7 @@ void *tscProcessMsgFromServer(char *msg, void *ahandle, void *thandle) {
void *taosres = tscKeepConn[command] ? pSql : NULL; void *taosres = tscKeepConn[command] ? pSql : NULL;
code = pRes->code ? -pRes->code : pRes->numOfRows; code = pRes->code ? -pRes->code : pRes->numOfRows;
tscTrace("%p Async SQL result:%d taosres:%p", pSql, code, taosres); tscTrace("%p Async SQL result:%d res:%p", pSql, code, taosres);
/* /*
* Whether to free sqlObj or not should be decided before call the user defined function, since this SqlObj * Whether to free sqlObj or not should be decided before call the user defined function, since this SqlObj
......
...@@ -176,7 +176,7 @@ void taos_init_imp() { ...@@ -176,7 +176,7 @@ void taos_init_imp() {
tscConnCache = taosOpenConnCache(tsMaxMeterConnections * 2, taosCloseRpcConn, tscTmr, tsShellActivityTimer * 1000); tscConnCache = taosOpenConnCache(tsMaxMeterConnections * 2, taosCloseRpcConn, tscTmr, tsShellActivityTimer * 1000);
initialized = 1; initialized = 1;
tscTrace("taos client is initialized successfully"); tscTrace("client is initialized successfully");
tsInsertHeadSize = tsRpcHeadSize + sizeof(SShellSubmitMsg); tsInsertHeadSize = tsRpcHeadSize + sizeof(SShellSubmitMsg);
} }
......
...@@ -29,7 +29,7 @@ import ( ...@@ -29,7 +29,7 @@ import (
"unsafe" "unsafe"
) )
func (mc *taosConn) taosConnect(ip, user, pass, db string, port int) (taos unsafe.Pointer, err error){ func (mc *taosConn) taosConnect(ip, user, pass, db string, port int) (taos unsafe.Pointer, err error) {
cuser := C.CString(user) cuser := C.CString(user)
cpass := C.CString(pass) cpass := C.CString(pass)
cip := C.CString(ip) cip := C.CString(ip)
...@@ -48,7 +48,7 @@ func (mc *taosConn) taosConnect(ip, user, pass, db string, port int) (taos unsaf ...@@ -48,7 +48,7 @@ func (mc *taosConn) taosConnect(ip, user, pass, db string, port int) (taos unsaf
} }
func (mc *taosConn) taosQuery(sqlstr string) (int, error) { func (mc *taosConn) taosQuery(sqlstr string) (int, error) {
taosLog.Printf("taosQuery() input sql:%s\n", sqlstr) //taosLog.Printf("taosQuery() input sql:%s\n", sqlstr)
csqlstr := C.CString(sqlstr) csqlstr := C.CString(sqlstr)
defer C.free(unsafe.Pointer(csqlstr)) defer C.free(unsafe.Pointer(csqlstr))
...@@ -58,6 +58,7 @@ func (mc *taosConn) taosQuery(sqlstr string) (int, error) { ...@@ -58,6 +58,7 @@ func (mc *taosConn) taosQuery(sqlstr string) (int, error) {
mc.taos_error() mc.taos_error()
errStr := C.GoString(C.taos_errstr(mc.taos)) errStr := C.GoString(C.taos_errstr(mc.taos))
taosLog.Println("taos_query() failed:", errStr) taosLog.Println("taos_query() failed:", errStr)
taosLog.Printf("taosQuery() input sql:%s\n", sqlstr)
return 0, errors.New(errStr) return 0, errors.New(errStr)
} }
......
...@@ -169,6 +169,8 @@ extern uint32_t debugFlag; ...@@ -169,6 +169,8 @@ extern uint32_t debugFlag;
extern uint32_t odbcdebugFlag; extern uint32_t odbcdebugFlag;
extern uint32_t qdebugFlag; extern uint32_t qdebugFlag;
extern uint32_t taosMaxTmrCtrl;
extern int tsRpcTimer; extern int tsRpcTimer;
extern int tsRpcMaxTime; extern int tsRpcMaxTime;
extern int tsUdpDelay; extern int tsUdpDelay;
......
...@@ -25,6 +25,7 @@ typedef void (*TAOS_TMR_CALLBACK)(void *, void *); ...@@ -25,6 +25,7 @@ typedef void (*TAOS_TMR_CALLBACK)(void *, void *);
extern uint32_t tmrDebugFlag; extern uint32_t tmrDebugFlag;
extern int taosTmrThreads; extern int taosTmrThreads;
extern uint32_t taosMaxTmrCtrl;
#define tmrError(...) \ #define tmrError(...) \
do { if (tmrDebugFlag & DEBUG_ERROR) { \ do { if (tmrDebugFlag & DEBUG_ERROR) { \
...@@ -41,7 +42,6 @@ extern int taosTmrThreads; ...@@ -41,7 +42,6 @@ extern int taosTmrThreads;
tprintf("TMR ", tmrDebugFlag, __VA_ARGS__); \ tprintf("TMR ", tmrDebugFlag, __VA_ARGS__); \
} } while(0) } } while(0)
#define MAX_NUM_OF_TMRCTL 512
#define MSECONDS_PER_TICK 5 #define MSECONDS_PER_TICK 5
void *taosTmrInit(int maxTmr, int resoultion, int longest, const char *label); void *taosTmrInit(int maxTmr, int resoultion, int longest, const char *label);
......
...@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) ...@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc) INCLUDE_DIRECTORIES(inc)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
AUX_SOURCE_DIRECTORY(./src SRC) AUX_SOURCE_DIRECTORY(./src SRC)
LIST(REMOVE_ITEM SRC ./src/shellWindows.c) LIST(REMOVE_ITEM SRC ./src/shellWindows.c)
ADD_EXECUTABLE(shell ${SRC}) ADD_EXECUTABLE(shell ${SRC})
......
...@@ -445,7 +445,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -445,7 +445,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
printf("%*lld|", l[i], *((int64_t *)row[i])); printf("%*lld|", l[i], *((int64_t *)row[i]));
break; break;
case TSDB_DATA_TYPE_FLOAT: case TSDB_DATA_TYPE_FLOAT: {
#ifdef _TD_ARM_32_ #ifdef _TD_ARM_32_
float fv = 0; float fv = 0;
//memcpy(&fv, row[i], sizeof(float)); //memcpy(&fv, row[i], sizeof(float));
...@@ -454,8 +454,9 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -454,8 +454,9 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
#else #else
printf("%*.5f|", l[i], *((float *)row[i])); printf("%*.5f|", l[i], *((float *)row[i]));
#endif #endif
}
break; break;
case TSDB_DATA_TYPE_DOUBLE: case TSDB_DATA_TYPE_DOUBLE: {
#ifdef _TD_ARM_32_ #ifdef _TD_ARM_32_
double dv = 0; double dv = 0;
//memcpy(&dv, row[i], sizeof(double)); //memcpy(&dv, row[i], sizeof(double));
...@@ -464,6 +465,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -464,6 +465,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
#else #else
printf("%*.9f|", l[i], *((double *)row[i])); printf("%*.9f|", l[i], *((double *)row[i]));
#endif #endif
}
break; break;
case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_NCHAR:
...@@ -528,7 +530,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -528,7 +530,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
printf("%lld\n", *((int64_t *)row[i])); printf("%lld\n", *((int64_t *)row[i]));
break; break;
case TSDB_DATA_TYPE_FLOAT: case TSDB_DATA_TYPE_FLOAT: {
#ifdef _TD_ARM_32_ #ifdef _TD_ARM_32_
float fv = 0; float fv = 0;
//memcpy(&fv, row[i], sizeof(float)); //memcpy(&fv, row[i], sizeof(float));
...@@ -537,8 +539,9 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -537,8 +539,9 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
#else #else
printf("%.5f\n", *((float *)row[i])); printf("%.5f\n", *((float *)row[i]));
#endif #endif
}
break; break;
case TSDB_DATA_TYPE_DOUBLE: case TSDB_DATA_TYPE_DOUBLE: {
#ifdef _TD_ARM_32_ #ifdef _TD_ARM_32_
double dv = 0; double dv = 0;
//memcpy(&dv, row[i], sizeof(double)); //memcpy(&dv, row[i], sizeof(double));
...@@ -547,6 +550,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -547,6 +550,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
#else #else
printf("%.9f\n", *((double *)row[i])); printf("%.9f\n", *((double *)row[i]));
#endif #endif
}
break; break;
case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_NCHAR:
...@@ -614,7 +618,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -614,7 +618,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
fprintf(fp, "%lld", *((int64_t *)row[i])); fprintf(fp, "%lld", *((int64_t *)row[i]));
break; break;
case TSDB_DATA_TYPE_FLOAT: case TSDB_DATA_TYPE_FLOAT: {
#ifdef _TD_ARM_32_ #ifdef _TD_ARM_32_
float fv = 0; float fv = 0;
//memcpy(&fv, row[i], sizeof(float)); //memcpy(&fv, row[i], sizeof(float));
...@@ -623,8 +627,9 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -623,8 +627,9 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
#else #else
fprintf(fp, "%.5f", *((float *)row[i])); fprintf(fp, "%.5f", *((float *)row[i]));
#endif #endif
}
break; break;
case TSDB_DATA_TYPE_DOUBLE: case TSDB_DATA_TYPE_DOUBLE: {
#ifdef _TD_ARM_32_ #ifdef _TD_ARM_32_
double dv = 0; double dv = 0;
//memcpy(&dv, row[i], sizeof(double)); //memcpy(&dv, row[i], sizeof(double));
...@@ -633,6 +638,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -633,6 +638,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
#else #else
fprintf(fp, "%.9f", *((double *)row[i])); fprintf(fp, "%.9f", *((double *)row[i]));
#endif #endif
}
break; break;
case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_NCHAR:
......
...@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) ...@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc) INCLUDE_DIRECTORIES(inc)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
AUX_SOURCE_DIRECTORY(. SRC) AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(taosdemo ${SRC}) ADD_EXECUTABLE(taosdemo ${SRC})
TARGET_LINK_LIBRARIES(taosdemo taos_static) TARGET_LINK_LIBRARIES(taosdemo taos_static)
......
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
#include <wordexp.h> #include <wordexp.h>
#include "taos.h" #include "taos.h"
extern char configDir[];
#pragma GCC diagnostic ignored "-Wmissing-braces" #pragma GCC diagnostic ignored "-Wmissing-braces"
#define BUFFER_SIZE 65536 #define BUFFER_SIZE 65536
......
...@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) ...@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc) INCLUDE_DIRECTORIES(inc)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
AUX_SOURCE_DIRECTORY(. SRC) AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(taosdump ${SRC}) ADD_EXECUTABLE(taosdump ${SRC})
TARGET_LINK_LIBRARIES(taosdump taos_static) TARGET_LINK_LIBRARIES(taosdump taos_static)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/zlib-1.2.11/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/zlib-1.2.11/inc)
......
...@@ -50,7 +50,7 @@ int httpInitSystem() { ...@@ -50,7 +50,7 @@ int httpInitSystem() {
httpServer = (HttpServer *)malloc(sizeof(HttpServer)); httpServer = (HttpServer *)malloc(sizeof(HttpServer));
memset(httpServer, 0, sizeof(HttpServer)); memset(httpServer, 0, sizeof(HttpServer));
strcpy(httpServer->label, "taosh"); strcpy(httpServer->label, "rest");
strcpy(httpServer->serverIp, tsHttpIp); strcpy(httpServer->serverIp, tsHttpIp);
httpServer->serverPort = tsHttpPort; httpServer->serverPort = tsHttpPort;
httpServer->cacheContext = tsHttpCacheSessions; httpServer->cacheContext = tsHttpCacheSessions;
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
......
...@@ -131,7 +131,7 @@ void monitorInitConn(void *para, void *unused) { ...@@ -131,7 +131,7 @@ void monitorInitConn(void *para, void *unused) {
void monitorInitConnCb(void *param, TAOS_RES *result, int code) { void monitorInitConnCb(void *param, TAOS_RES *result, int code) {
if (code < 0) { if (code < 0) {
monitorError("monitor:%p, connect to taosd failed, code:%d", monitor->conn, code); monitorError("monitor:%p, connect to database failed, code:%d", monitor->conn, code);
taos_close(monitor->conn); taos_close(monitor->conn);
monitor->conn = NULL; monitor->conn = NULL;
monitor->state = MONITOR_STATE_UN_INIT; monitor->state = MONITOR_STATE_UN_INIT;
...@@ -139,7 +139,7 @@ void monitorInitConnCb(void *param, TAOS_RES *result, int code) { ...@@ -139,7 +139,7 @@ void monitorInitConnCb(void *param, TAOS_RES *result, int code) {
return; return;
} }
monitorTrace("monitor:%p, connect to taosd success, code:%d", monitor->conn, code); monitorTrace("monitor:%p, connect to database success, code:%d", monitor->conn, code);
monitorInitDatabase(); monitorInitDatabase();
} }
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(inc) INCLUDE_DIRECTORIES(inc)
AUX_SOURCE_DIRECTORY(src SRC) AUX_SOURCE_DIRECTORY(src SRC)
......
...@@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) ...@@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc) INCLUDE_DIRECTORIES(inc)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
AUX_SOURCE_DIRECTORY(./src SRC) AUX_SOURCE_DIRECTORY(./src SRC)
ELSEIF (TD_DARWIN_64) ELSEIF (TD_DARWIN_64)
LIST(APPEND SRC ./src/thaship.c) LIST(APPEND SRC ./src/thaship.c)
......
...@@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) ...@@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc) INCLUDE_DIRECTORIES(inc)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
AUX_SOURCE_DIRECTORY(src SRC) AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(sdb ${SRC}) ADD_LIBRARY(sdb ${SRC})
TARGET_LINK_LIBRARIES(sdb trpc) TARGET_LINK_LIBRARIES(sdb trpc)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/http/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/http/inc)
......
...@@ -866,7 +866,8 @@ int vnodeSaveQueryResult(void *handle, char *data, int32_t *size) { ...@@ -866,7 +866,8 @@ int vnodeSaveQueryResult(void *handle, char *data, int32_t *size) {
pQInfo->pointsRead); pQInfo->pointsRead);
if (pQInfo->over == 0) { if (pQInfo->over == 0) {
dTrace("QInfo:%p set query flag, oldSig:%p, func:%s", pQInfo, pQInfo->signature, __FUNCTION__); //dTrace("QInfo:%p set query flag, oldSig:%p, func:%s", pQInfo, pQInfo->signature, __FUNCTION__);
dTrace("QInfo:%p set query flag, oldSig:%p", pQInfo, pQInfo->signature);
uint64_t oldSignature = TSDB_QINFO_SET_QUERY_FLAG(pQInfo); uint64_t oldSignature = TSDB_QINFO_SET_QUERY_FLAG(pQInfo);
/* /*
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/http/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/http/inc)
......
...@@ -4,7 +4,7 @@ PROJECT(TDengine) ...@@ -4,7 +4,7 @@ PROJECT(TDengine)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
IF (TD_LINUX_64) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
AUX_SOURCE_DIRECTORY(src SRC) AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(tutil ${SRC}) ADD_LIBRARY(tutil ${SRC})
TARGET_LINK_LIBRARIES(tutil pthread os m rt) TARGET_LINK_LIBRARIES(tutil pthread os m rt)
......
...@@ -1353,7 +1353,7 @@ uint32_t crc32c_hw(uint32_t crc, crc_stream buf, size_t len) { ...@@ -1353,7 +1353,7 @@ uint32_t crc32c_hw(uint32_t crc, crc_stream buf, size_t len) {
#endif // #ifndef _TD_ARM_ #endif // #ifndef _TD_ARM_
void taosResolveCRC() { void taosResolveCRC() {
#ifndef _TD_ARM_32 #ifndef _TD_ARM_
int sse42; int sse42;
SSE42(sse42); SSE42(sse42);
crc32c = sse42 ? crc32c_hw : crc32c_sf; crc32c = sse42 ? crc32c_hw : crc32c_sf;
......
...@@ -536,6 +536,11 @@ void tsInitGlobalConfig() { ...@@ -536,6 +536,11 @@ void tsInitGlobalConfig() {
0, 2, 0, TSDB_CFG_UTYPE_NONE); 0, 2, 0, TSDB_CFG_UTYPE_NONE);
// 0-any, 1-mgmt, 2-dnode // 0-any, 1-mgmt, 2-dnode
// timer
tsInitConfigOption(cfg++, "maxTmrCtrl", &taosMaxTmrCtrl, TSDB_CFG_VTYPE_INT,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLUSTER,
8, 2048, 0, TSDB_CFG_UTYPE_NONE);
// time // time
tsInitConfigOption(cfg++, "monitorInterval", &tsMonitorInterval, TSDB_CFG_VTYPE_INT, tsInitConfigOption(cfg++, "monitorInterval", &tsMonitorInterval, TSDB_CFG_VTYPE_INT,
TSDB_CFG_CTYPE_B_CONFIG, TSDB_CFG_CTYPE_B_CONFIG,
......
...@@ -82,12 +82,15 @@ typedef struct time_wheel_t { ...@@ -82,12 +82,15 @@ typedef struct time_wheel_t {
} time_wheel_t; } time_wheel_t;
uint32_t tmrDebugFlag = DEBUG_ERROR | DEBUG_WARN | DEBUG_FILE; uint32_t tmrDebugFlag = DEBUG_ERROR | DEBUG_WARN | DEBUG_FILE;
uint32_t taosMaxTmrCtrl = 512;
static pthread_once_t tmrModuleInit = PTHREAD_ONCE_INIT; static pthread_once_t tmrModuleInit = PTHREAD_ONCE_INIT;
static pthread_mutex_t tmrCtrlMutex; static pthread_mutex_t tmrCtrlMutex;
static tmr_ctrl_t tmrCtrls[MAX_NUM_OF_TMRCTL]; static tmr_ctrl_t* tmrCtrls;
static tmr_ctrl_t* unusedTmrCtrl = NULL; static tmr_ctrl_t* unusedTmrCtrl = NULL;
void* tmrQhandle; static void* tmrQhandle;
static int numOfTmrCtrl = 0;
int taosTmrThreads = 1; int taosTmrThreads = 1;
static uintptr_t nextTimerId = 0; static uintptr_t nextTimerId = 0;
...@@ -129,7 +132,7 @@ static void unlockTimerList(timer_list_t* list) { ...@@ -129,7 +132,7 @@ static void unlockTimerList(timer_list_t* list) {
int64_t tid = taosGetPthreadId(); int64_t tid = taosGetPthreadId();
if (__sync_val_compare_and_swap_64(&(list->lockedBy), tid, 0) != tid) { if (__sync_val_compare_and_swap_64(&(list->lockedBy), tid, 0) != tid) {
assert(false); assert(false);
tmrError("trying to unlock a timer list not locked by current thread."); tmrError("%d trying to unlock a timer list not locked by current thread.", tid);
} }
} }
...@@ -256,13 +259,13 @@ static void processExpiredTimer(void* handle, void* arg) { ...@@ -256,13 +259,13 @@ static void processExpiredTimer(void* handle, void* arg) {
timer->executedBy = taosGetPthreadId(); timer->executedBy = taosGetPthreadId();
uint8_t state = __sync_val_compare_and_swap_8(&timer->state, TIMER_STATE_WAITING, TIMER_STATE_EXPIRED); uint8_t state = __sync_val_compare_and_swap_8(&timer->state, TIMER_STATE_WAITING, TIMER_STATE_EXPIRED);
if (state == TIMER_STATE_WAITING) { if (state == TIMER_STATE_WAITING) {
const char* fmt = "timer[label=%s, id=%lld, fp=%p, param=%p] execution start."; const char* fmt = "%s timer[id=%lld, fp=%p, param=%p] execution start.";
tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param); tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param);
(*timer->fp)(timer->param, (tmr_h)timer->id); (*timer->fp)(timer->param, (tmr_h)timer->id);
atomic_store_8(&timer->state, TIMER_STATE_STOPPED); atomic_store_8(&timer->state, TIMER_STATE_STOPPED);
fmt = "timer[label=%s, id=%lld, fp=%p, param=%p] execution end."; fmt = "%s timer[id=%lld, fp=%p, param=%p] execution end.";
tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param); tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param);
} }
removeTimer(timer->id); removeTimer(timer->id);
...@@ -270,18 +273,21 @@ static void processExpiredTimer(void* handle, void* arg) { ...@@ -270,18 +273,21 @@ static void processExpiredTimer(void* handle, void* arg) {
} }
static void addToExpired(tmr_obj_t* head) { static void addToExpired(tmr_obj_t* head) {
const char* fmt = "timer[label=%s, id=%lld, fp=%p, param=%p] expired"; const char* fmt = "%s adding expired timer[id=%lld, fp=%p, param=%p] to queue.";
while (head != NULL) { while (head != NULL) {
tmrTrace(fmt, head->ctrl->label, head->id, head->fp, head->param); uintptr_t id = head->id;
tmr_obj_t* next = head->next; tmr_obj_t* next = head->next;
tmrTrace(fmt, head->ctrl->label, id, head->fp, head->param);
SSchedMsg schedMsg; SSchedMsg schedMsg;
schedMsg.fp = NULL; schedMsg.fp = NULL;
schedMsg.tfp = processExpiredTimer; schedMsg.tfp = processExpiredTimer;
schedMsg.ahandle = head; schedMsg.ahandle = head;
schedMsg.thandle = NULL; schedMsg.thandle = NULL;
taosScheduleTask(tmrQhandle, &schedMsg); taosScheduleTask(tmrQhandle, &schedMsg);
tmrTrace("timer[id=%lld] has been added to queue.", id);
head = next; head = next;
} }
} }
...@@ -295,7 +301,7 @@ static uintptr_t doStartTimer(tmr_obj_t* timer, TAOS_TMR_CALLBACK fp, int msecon ...@@ -295,7 +301,7 @@ static uintptr_t doStartTimer(tmr_obj_t* timer, TAOS_TMR_CALLBACK fp, int msecon
timer->ctrl = ctrl; timer->ctrl = ctrl;
addTimer(timer); addTimer(timer);
const char* fmt = "timer[label=%s, id=%lld, fp=%p, param=%p] started"; const char* fmt = "%s timer[id=%lld, fp=%p, param=%p] started";
tmrTrace(fmt, ctrl->label, timer->id, timer->fp, timer->param); tmrTrace(fmt, ctrl->label, timer->id, timer->fp, timer->param);
if (mseconds == 0) { if (mseconds == 0) {
...@@ -318,7 +324,7 @@ tmr_h taosTmrStart(TAOS_TMR_CALLBACK fp, int mseconds, void* param, void* handle ...@@ -318,7 +324,7 @@ tmr_h taosTmrStart(TAOS_TMR_CALLBACK fp, int mseconds, void* param, void* handle
tmr_obj_t* timer = (tmr_obj_t*)calloc(1, sizeof(tmr_obj_t)); tmr_obj_t* timer = (tmr_obj_t*)calloc(1, sizeof(tmr_obj_t));
if (timer == NULL) { if (timer == NULL) {
tmrError("failed to allocated memory for new timer object."); tmrError("%s failed to allocated memory for new timer object.", ctrl->label);
return NULL; return NULL;
} }
...@@ -389,7 +395,7 @@ static bool doStopTimer(tmr_obj_t* timer, uint8_t state) { ...@@ -389,7 +395,7 @@ static bool doStopTimer(tmr_obj_t* timer, uint8_t state) {
// we cannot guarantee the thread safety of the timr in all other cases. // we cannot guarantee the thread safety of the timr in all other cases.
reusable = true; reusable = true;
} }
const char* fmt = "timer[label=%s, id=%lld, fp=%p, param=%p] is cancelled."; const char* fmt = "%s timer[id=%lld, fp=%p, param=%p] is cancelled.";
tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param); tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param);
} else if (state != TIMER_STATE_EXPIRED) { } else if (state != TIMER_STATE_EXPIRED) {
// timer already stopped or cancelled, has nothing to do in this case // timer already stopped or cancelled, has nothing to do in this case
...@@ -400,7 +406,7 @@ static bool doStopTimer(tmr_obj_t* timer, uint8_t state) { ...@@ -400,7 +406,7 @@ static bool doStopTimer(tmr_obj_t* timer, uint8_t state) {
} else { } else {
assert(timer->executedBy != taosGetPthreadId()); assert(timer->executedBy != taosGetPthreadId());
const char* fmt = "timer[label=%s, id=%lld, fp=%p, param=%p] fired, waiting..."; const char* fmt = "%s timer[id=%lld, fp=%p, param=%p] fired, waiting...";
tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param); tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param);
for (int i = 1; atomic_load_8(&timer->state) != TIMER_STATE_STOPPED; i++) { for (int i = 1; atomic_load_8(&timer->state) != TIMER_STATE_STOPPED; i++) {
...@@ -409,7 +415,7 @@ static bool doStopTimer(tmr_obj_t* timer, uint8_t state) { ...@@ -409,7 +415,7 @@ static bool doStopTimer(tmr_obj_t* timer, uint8_t state) {
} }
} }
fmt = "timer[label=%s, id=%lld, fp=%p, param=%p] stopped."; fmt = "%s timer[id=%lld, fp=%p, param=%p] stopped.";
tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param); tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param);
} }
...@@ -448,7 +454,7 @@ bool taosTmrReset(TAOS_TMR_CALLBACK fp, int mseconds, void* param, void* handle, ...@@ -448,7 +454,7 @@ bool taosTmrReset(TAOS_TMR_CALLBACK fp, int mseconds, void* param, void* handle,
bool stopped = false; bool stopped = false;
tmr_obj_t* timer = findTimer(id); tmr_obj_t* timer = findTimer(id);
if (timer == NULL) { if (timer == NULL) {
tmrTrace("timer[id=%lld] does not exist", id); tmrTrace("%s timer[id=%lld] does not exist", ctrl->label, id);
} else { } else {
uint8_t state = __sync_val_compare_and_swap_8(&timer->state, TIMER_STATE_WAITING, TIMER_STATE_CANCELED); uint8_t state = __sync_val_compare_and_swap_8(&timer->state, TIMER_STATE_WAITING, TIMER_STATE_CANCELED);
if (!doStopTimer(timer, state)) { if (!doStopTimer(timer, state)) {
...@@ -463,7 +469,7 @@ bool taosTmrReset(TAOS_TMR_CALLBACK fp, int mseconds, void* param, void* handle, ...@@ -463,7 +469,7 @@ bool taosTmrReset(TAOS_TMR_CALLBACK fp, int mseconds, void* param, void* handle,
return stopped; return stopped;
} }
tmrTrace("timer[id=%lld] is reused", timer->id); tmrTrace("%s timer[id=%lld] is reused", ctrl->label, timer->id);
// wait until there's no other reference to this timer, // wait until there's no other reference to this timer,
// so that we can reuse this timer safely. // so that we can reuse this timer safely.
...@@ -481,7 +487,13 @@ bool taosTmrReset(TAOS_TMR_CALLBACK fp, int mseconds, void* param, void* handle, ...@@ -481,7 +487,13 @@ bool taosTmrReset(TAOS_TMR_CALLBACK fp, int mseconds, void* param, void* handle,
} }
static void taosTmrModuleInit(void) { static void taosTmrModuleInit(void) {
for (int i = 0; i < tListLen(tmrCtrls) - 1; ++i) { tmrCtrls = malloc(sizeof(tmr_ctrl_t) * taosMaxTmrCtrl);
if (tmrCtrls == NULL) {
tmrError("failed to allocate memory for timer controllers.");
return;
}
for (int i = 0; i < taosMaxTmrCtrl - 1; ++i) {
tmr_ctrl_t* ctrl = tmrCtrls + i; tmr_ctrl_t* ctrl = tmrCtrls + i;
ctrl->next = ctrl + 1; ctrl->next = ctrl + 1;
} }
...@@ -526,17 +538,18 @@ void* taosTmrInit(int maxNumOfTmrs, int resolution, int longest, const char* lab ...@@ -526,17 +538,18 @@ void* taosTmrInit(int maxNumOfTmrs, int resolution, int longest, const char* lab
tmr_ctrl_t* ctrl = unusedTmrCtrl; tmr_ctrl_t* ctrl = unusedTmrCtrl;
if (ctrl != NULL) { if (ctrl != NULL) {
unusedTmrCtrl = ctrl->next; unusedTmrCtrl = ctrl->next;
numOfTmrCtrl++;
} }
pthread_mutex_unlock(&tmrCtrlMutex); pthread_mutex_unlock(&tmrCtrlMutex);
if (ctrl == NULL) { if (ctrl == NULL) {
tmrError("too many timer controllers, failed to create timer controller[label=%s].", label); tmrError("%s too many timer controllers, failed to create timer controller.", label);
return NULL; return NULL;
} }
strncpy(ctrl->label, label, sizeof(ctrl->label)); strncpy(ctrl->label, label, sizeof(ctrl->label));
ctrl->label[sizeof(ctrl->label) - 1] = 0; ctrl->label[sizeof(ctrl->label) - 1] = 0;
tmrTrace("timer controller[label=%s] is initialized.", label); tmrTrace("%s timer controller is initialized, number of timer controllers: %d.", label, numOfTmrCtrl);
return ctrl; return ctrl;
} }
...@@ -544,11 +557,12 @@ void taosTmrCleanUp(void* handle) { ...@@ -544,11 +557,12 @@ void taosTmrCleanUp(void* handle) {
tmr_ctrl_t* ctrl = (tmr_ctrl_t*)handle; tmr_ctrl_t* ctrl = (tmr_ctrl_t*)handle;
assert(ctrl != NULL && ctrl->label[0] != 0); assert(ctrl != NULL && ctrl->label[0] != 0);
tmrTrace("timer controller[label=%s] is cleaned up.", ctrl->label); tmrTrace("%s timer controller is cleaned up.", ctrl->label);
ctrl->label[0] = 0; ctrl->label[0] = 0;
pthread_mutex_lock(&tmrCtrlMutex); pthread_mutex_lock(&tmrCtrlMutex);
ctrl->next = unusedTmrCtrl; ctrl->next = unusedTmrCtrl;
numOfTmrCtrl--;
unusedTmrCtrl = ctrl; unusedTmrCtrl = ctrl;
pthread_mutex_unlock(&tmrCtrlMutex); pthread_mutex_unlock(&tmrCtrlMutex);
} }
char version[64] = "1.6.4.0"; char version[64] = "1.6.4.0";
char compatible_version[64] = "1.6.1.0"; char compatible_version[64] = "1.6.1.0";
char gitinfo[128] = "869171d2331eb25ba0901e88d33ae627bf5a9d91"; char gitinfo[128] = "d04354a8ac2f7dd9ba521d755e5d484a203783d9";
char buildinfo[512] = "Built by ubuntu at 2019-11-07 22:31"; char buildinfo[512] = "Built by root at 2019-11-11 10:23";
...@@ -9,5 +9,5 @@ TDengine's JDBC driver jar is not yet published to maven center repo, so we need ...@@ -9,5 +9,5 @@ TDengine's JDBC driver jar is not yet published to maven center repo, so we need
## Compile the Demo Code and Run It ## Compile the Demo Code and Run It
To compile the demo project, go to the source directory ``TDengine/tests/examples/JDBC/JDBCDemo`` and execute To compile the demo project, go to the source directory ``TDengine/tests/examples/JDBC/JDBCDemo`` and execute
<pre>mvn clean assembly:single package</pre> <pre>mvn clean assembly:single package</pre>
The ``pom.xml`` is configured to package all the dependencies into one executable jar file. To run it, go to ``TDengine/tests/examples/JDBC/JDBCDemo/target`` and execute The ``pom.xml`` is configured to package all the dependencies into one executable jar file. To run it, go to ``examples/JDBC/JDBCDemo/target`` and execute
<pre>java -jar jdbcdemo-1.0-SNAPSHOT-jar-with-dependencies.jar</pre> <pre>java -jar jdbcdemo-1.0-SNAPSHOT-jar-with-dependencies.jar</pre>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册