Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
84d3a5e7
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
84d3a5e7
编写于
6月 25, 2021
作者:
haoranc
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:taosdata/TDengine into test/chr
上级
39604d77
71b953e1
变更
46
显示空白变更内容
内联
并排
Showing
46 changed file
with
710 addition
and
368 deletion
+710
-368
.gitmodules
.gitmodules
+3
-0
cmake/define.inc
cmake/define.inc
+12
-7
cmake/env.inc
cmake/env.inc
+6
-5
cmake/version.inc
cmake/version.inc
+1
-1
deps/CMakeLists.txt
deps/CMakeLists.txt
+13
-0
deps/jemalloc
deps/jemalloc
+1
-0
packaging/deb/makedeb.sh
packaging/deb/makedeb.sh
+42
-8
packaging/release.sh
packaging/release.sh
+28
-16
packaging/rpm/makerpm.sh
packaging/rpm/makerpm.sh
+3
-3
packaging/rpm/tdengine.spec
packaging/rpm/tdengine.spec
+63
-18
packaging/tools/install.sh
packaging/tools/install.sh
+178
-131
packaging/tools/make_install.sh
packaging/tools/make_install.sh
+79
-34
packaging/tools/makepkg.sh
packaging/tools/makepkg.sh
+42
-9
snap/snapcraft.yaml
snap/snapcraft.yaml
+1
-1
src/balance/src/bnMain.c
src/balance/src/bnMain.c
+14
-7
src/client/src/tscSub.c
src/client/src/tscSub.c
+1
-0
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+2
-1
src/client/tests/timeParseTest.cpp
src/client/tests/timeParseTest.cpp
+2
-2
src/connector/go
src/connector/go
+1
-1
src/connector/hivemq-tdengine-extension
src/connector/hivemq-tdengine-extension
+1
-1
src/dnode/CMakeLists.txt
src/dnode/CMakeLists.txt
+8
-1
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+2
-0
src/inc/tbn.h
src/inc/tbn.h
+1
-0
src/kit/shell/CMakeLists.txt
src/kit/shell/CMakeLists.txt
+9
-2
src/kit/taosdemo/CMakeLists.txt
src/kit/taosdemo/CMakeLists.txt
+10
-3
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+69
-81
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+6
-3
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+4
-2
src/os/inc/osDef.h
src/os/inc/osDef.h
+2
-3
src/os/inc/osMemory.h
src/os/inc/osMemory.h
+4
-0
src/os/inc/osSysinfo.h
src/os/inc/osSysinfo.h
+1
-0
src/os/src/darwin/darwinSysInfo.c
src/os/src/darwin/darwinSysInfo.c
+8
-3
src/os/src/detail/osSysinfo.c
src/os/src/detail/osSysinfo.c
+8
-3
src/os/src/windows/wSysinfo.c
src/os/src/windows/wSysinfo.c
+6
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+5
-1
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+27
-6
src/query/tests/astTest.cpp
src/query/tests/astTest.cpp
+1
-0
src/query/tests/histogramTest.cpp
src/query/tests/histogramTest.cpp
+4
-0
src/query/tests/patternMatchTest.cpp
src/query/tests/patternMatchTest.cpp
+3
-0
src/query/tests/percentileTest.cpp
src/query/tests/percentileTest.cpp
+3
-0
src/query/tests/resultBufferTest.cpp
src/query/tests/resultBufferTest.cpp
+3
-0
src/query/tests/tsBufTest.cpp
src/query/tests/tsBufTest.cpp
+4
-0
src/query/tests/unitTest.cpp
src/query/tests/unitTest.cpp
+6
-3
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+1
-1
tests/pytest/dockerCluster/OneMnodeMultipleVnodesTest.py
tests/pytest/dockerCluster/OneMnodeMultipleVnodesTest.py
+2
-3
tests/pytest/dockerCluster/basic.py
tests/pytest/dockerCluster/basic.py
+20
-7
未找到文件。
.gitmodules
浏览文件 @
84d3a5e7
...
@@ -10,3 +10,6 @@
...
@@ -10,3 +10,6 @@
[submodule "tests/examples/rust"]
[submodule "tests/examples/rust"]
path = tests/examples/rust
path = tests/examples/rust
url = https://github.com/songtianyi/tdengine-rust-bindings.git
url = https://github.com/songtianyi/tdengine-rust-bindings.git
[submodule "deps/jemalloc"]
path = deps/jemalloc
url = https://github.com/jemalloc/jemalloc
cmake/define.inc
浏览文件 @
84d3a5e7
...
@@ -57,15 +57,20 @@ IF (TD_LINUX_64)
...
@@ -57,15 +57,20 @@ IF (TD_LINUX_64)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_TD_LINUX_64
)
ADD_DEFINITIONS
(
-
D_TD_LINUX_64
)
MESSAGE
(
STATUS
"linux64 is defined"
)
MESSAGE
(
STATUS
"linux64 is defined"
)
SET
(
COMMON_FLAGS
"-
std=gnu99 -
Wall -Werror -fPIC -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-Wall -Werror -fPIC -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
IF
(
JEMALLOC_ENABLED
)
ADD_DEFINITIONS
(
-
DTD_JEMALLOC_ENABLED
-
I
$
{
CMAKE_BINARY_DIR
}
/
build
/
include
-
L
$
{
CMAKE_BINARY_DIR
}
/
build
/
lib
-
Wl
,
-
rpath
,
$
{
CMAKE_BINARY_DIR
}
/
build
/
lib
-
ljemalloc
)
ENDIF
()
ENDIF
()
ENDIF
()
IF
(
TD_LINUX_32
)
IF
(
TD_LINUX_32
)
ADD_DEFINITIONS
(
-
D_TD_LINUX_32
)
ADD_DEFINITIONS
(
-
D_TD_LINUX_32
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"linux32 is defined"
)
MESSAGE
(
STATUS
"linux32 is defined"
)
SET
(
COMMON_FLAGS
"-
std=gnu99 -
Wall -Werror -fPIC -fsigned-char -munaligned-access -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-Wall -Werror -fPIC -fsigned-char -munaligned-access -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
ENDIF
()
IF
(
TD_ARM_64
)
IF
(
TD_ARM_64
)
...
@@ -73,7 +78,7 @@ IF (TD_ARM_64)
...
@@ -73,7 +78,7 @@ IF (TD_ARM_64)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"arm64 is defined"
)
MESSAGE
(
STATUS
"arm64 is defined"
)
SET
(
COMMON_FLAGS
"-
std=gnu99 -
Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
ENDIF
()
IF
(
TD_ARM_32
)
IF
(
TD_ARM_32
)
...
@@ -81,7 +86,7 @@ IF (TD_ARM_32)
...
@@ -81,7 +86,7 @@ IF (TD_ARM_32)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"arm32 is defined"
)
MESSAGE
(
STATUS
"arm32 is defined"
)
SET
(
COMMON_FLAGS
"-
std=gnu99 -
Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types "
)
SET
(
COMMON_FLAGS
"-Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types "
)
ENDIF
()
ENDIF
()
IF
(
TD_MIPS_64
)
IF
(
TD_MIPS_64
)
...
@@ -89,7 +94,7 @@ IF (TD_MIPS_64)
...
@@ -89,7 +94,7 @@ IF (TD_MIPS_64)
ADD_DEFINITIONS
(
-
D_TD_MIPS_64
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_64
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"mips64 is defined"
)
MESSAGE
(
STATUS
"mips64 is defined"
)
SET
(
COMMON_FLAGS
"-
std=gnu99 -
Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
ENDIF
()
IF
(
TD_MIPS_32
)
IF
(
TD_MIPS_32
)
...
@@ -97,7 +102,7 @@ IF (TD_MIPS_32)
...
@@ -97,7 +102,7 @@ IF (TD_MIPS_32)
ADD_DEFINITIONS
(
-
D_TD_MIPS_32
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_32
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"mips32 is defined"
)
MESSAGE
(
STATUS
"mips32 is defined"
)
SET
(
COMMON_FLAGS
"-
std=gnu99 -
Wall -Werror -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-Wall -Werror -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
ENDIF
()
IF
(
TD_APLHINE
)
IF
(
TD_APLHINE
)
...
@@ -142,7 +147,7 @@ IF (TD_DARWIN_64)
...
@@ -142,7 +147,7 @@ IF (TD_DARWIN_64)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"darwin64 is defined"
)
MESSAGE
(
STATUS
"darwin64 is defined"
)
SET
(
COMMON_FLAGS
"-
std=gnu99 -
Wall -Werror -Wno-missing-braces -fPIC -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-Wall -Werror -Wno-missing-braces -fPIC -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
IF
(
TD_MEMORY_SANITIZER
)
IF
(
TD_MEMORY_SANITIZER
)
SET
(
DEBUG_FLAGS
"-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -O0 -g3 -DDEBUG"
)
SET
(
DEBUG_FLAGS
"-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -O0 -g3 -DDEBUG"
)
ELSE
()
ELSE
()
...
...
cmake/env.inc
浏览文件 @
84d3a5e7
...
@@ -34,13 +34,14 @@ ENDIF ()
...
@@ -34,13 +34,14 @@ ENDIF ()
#
#
# Set compiler options
# Set compiler options
SET
(
CMAKE_C_FLAGS_DEBUG
"${CMAKE_C_FLAGS_DEBUG} ${COMMON_FLAGS} ${DEBUG_FLAGS}"
)
SET
(
COMMON_C_FLAGS
"${COMMON_FLAGS} -std=gnu99"
)
SET
(
CMAKE_C_FLAGS_RELEASE
"${CMAKE_C_FLAGS_RELEASE} ${COMMON_FLAGS} ${RELEASE_FLAGS}"
)
SET
(
CMAKE_C_FLAGS_DEBUG
"${CMAKE_C_FLAGS_DEBUG} ${COMMON_C_FLAGS} ${DEBUG_FLAGS}"
)
SET
(
CMAKE_C_FLAGS_RELEASE
"${CMAKE_C_FLAGS_RELEASE} ${COMMON_C_FLAGS} ${RELEASE_FLAGS}"
)
# Set c++ compiler options
# Set c++ compiler options
# SET(COMMON_CXX_FLAGS "${COMMON_FLAGS} -std=c++11
")
SET
(
COMMON_CXX_FLAGS
"${COMMON_FLAGS} -std=c++11 -Wno-unused-function
"
)
#
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS} ${DEBUG_FLAGS}")
SET
(
CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS} ${DEBUG_FLAGS}"
)
#
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${COMMON_CXX_FLAGS} ${RELEASE_FLAGS}")
SET
(
CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} ${COMMON_CXX_FLAGS} ${RELEASE_FLAGS}"
)
IF
(
$
{
CMAKE_BUILD_TYPE
}
MATCHES
"Debug"
)
IF
(
$
{
CMAKE_BUILD_TYPE
}
MATCHES
"Debug"
)
SET
(
CMAKE_BUILD_TYPE
"Debug"
)
SET
(
CMAKE_BUILD_TYPE
"Debug"
)
...
...
cmake/version.inc
浏览文件 @
84d3a5e7
...
@@ -4,7 +4,7 @@ PROJECT(TDengine)
...
@@ -4,7 +4,7 @@ PROJECT(TDengine)
IF
(
DEFINED
VERNUMBER
)
IF
(
DEFINED
VERNUMBER
)
SET
(
TD_VER_NUMBER
$
{
VERNUMBER
})
SET
(
TD_VER_NUMBER
$
{
VERNUMBER
})
ELSE
()
ELSE
()
SET
(
TD_VER_NUMBER
"2.0.20.
5
"
)
SET
(
TD_VER_NUMBER
"2.0.20.
8
"
)
ENDIF
()
ENDIF
()
IF
(
DEFINED
VERCOMPATIBLE
)
IF
(
DEFINED
VERCOMPATIBLE
)
...
...
deps/CMakeLists.txt
浏览文件 @
84d3a5e7
...
@@ -18,3 +18,16 @@ ENDIF ()
...
@@ -18,3 +18,16 @@ ENDIF ()
IF
(
TD_DARWIN AND TD_MQTT
)
IF
(
TD_DARWIN AND TD_MQTT
)
ADD_SUBDIRECTORY
(
MQTT-C
)
ADD_SUBDIRECTORY
(
MQTT-C
)
ENDIF
()
ENDIF
()
IF
(
TD_LINUX_64 AND JEMALLOC_ENABLED
)
MESSAGE
(
"setup dpes/jemalloc, current source dir:"
${
CMAKE_CURRENT_SOURCE_DIR
}
)
MESSAGE
(
"binary dir:"
${
CMAKE_BINARY_DIR
}
)
include
(
ExternalProject
)
ExternalProject_Add
(
jemalloc
PREFIX
"jemalloc"
SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/jemalloc
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./autogen.sh COMMAND ./configure --prefix=
${
CMAKE_BINARY_DIR
}
/build/
BUILD_COMMAND
${
MAKE
}
)
ENDIF
()
jemalloc
@
ea6b3e97
Subproject commit ea6b3e973b477b8061e0076bb257dbd7f3faa756
packaging/deb/makedeb.sh
浏览文件 @
84d3a5e7
...
@@ -67,7 +67,41 @@ fi
...
@@ -67,7 +67,41 @@ fi
cp
-r
${
top_dir
}
/src/connector/python
${
pkg_dir
}${
install_home_path
}
/connector
cp
-r
${
top_dir
}
/src/connector/python
${
pkg_dir
}${
install_home_path
}
/connector
cp
-r
${
top_dir
}
/src/connector/go
${
pkg_dir
}${
install_home_path
}
/connector
cp
-r
${
top_dir
}
/src/connector/go
${
pkg_dir
}${
install_home_path
}
/connector
cp
-r
${
top_dir
}
/src/connector/nodejs
${
pkg_dir
}${
install_home_path
}
/connector
cp
-r
${
top_dir
}
/src/connector/nodejs
${
pkg_dir
}${
install_home_path
}
/connector
cp
${
compile_dir
}
/build/lib/taos-jdbcdriver
*
dist.
*
${
pkg_dir
}${
install_home_path
}
/connector
||
:
cp
${
compile_dir
}
/build/lib/taos-jdbcdriver
*
.
*
${
pkg_dir
}${
install_home_path
}
/connector
||
:
if
[
-f
${
compile_dir
}
/build/bin/jemalloc-config
]
;
then
install_user_local_path
=
"/usr/local"
mkdir
-p
${
pkg_dir
}${
install_user_local_path
}
/
{
bin,lib,lib/pkgconfig,include/jemalloc,share/doc/jemalloc,share/man/man3
}
cp
${
compile_dir
}
/build/bin/jemalloc-config
${
pkg_dir
}${
install_user_local_path
}
/bin/
if
[
-f
${
compile_dir
}
/build/bin/jemalloc.sh
]
;
then
cp
${
compile_dir
}
/build/bin/jemalloc.sh
${
pkg_dir
}${
install_user_local_path
}
/bin/
fi
if
[
-f
${
compile_dir
}
/build/bin/jeprof
]
;
then
cp
${
compile_dir
}
/build/bin/jeprof
${
pkg_dir
}${
install_user_local_path
}
/bin/
fi
if
[
-f
${
compile_dir
}
/build/include/jemalloc/jemalloc.h
]
;
then
cp
${
compile_dir
}
/build/include/jemalloc/jemalloc.h
${
pkg_dir
}${
install_user_local_path
}
/include/jemalloc/
fi
if
[
-f
${
compile_dir
}
/build/lib/libjemalloc.so.2
]
;
then
cp
${
compile_dir
}
/build/lib/libjemalloc.so.2
${
pkg_dir
}${
install_user_local_path
}
/lib/
ln
-sf
libjemalloc.so.2
${
pkg_dir
}${
install_user_local_path
}
/lib/libjemalloc.so
fi
if
[
-f
${
compile_dir
}
/build/lib/libjemalloc.a
]
;
then
cp
${
compile_dir
}
/build/lib/libjemalloc.a
${
pkg_dir
}${
install_user_local_path
}
/lib/
fi
if
[
-f
${
compile_dir
}
/build/lib/libjemalloc_pic.a
]
;
then
cp
${
compile_dir
}
/build/lib/libjemalloc_pic.a
${
pkg_dir
}${
install_user_local_path
}
/lib/
fi
if
[
-f
${
compile_dir
}
/build/lib/pkgconfig/jemalloc.pc
]
;
then
cp
${
compile_dir
}
/build/lib/pkgconfig/jemalloc.pc
${
pkg_dir
}${
install_user_local_path
}
/lib/pkgconfig/
fi
if
[
-f
${
compile_dir
}
/build/share/doc/jemalloc/jemalloc.html
]
;
then
cp
${
compile_dir
}
/build/share/doc/jemalloc/jemalloc.html
${
pkg_dir
}${
install_user_local_path
}
/share/doc/jemalloc/
fi
if
[
-f
${
compile_dir
}
/build/share/man/man3/jemalloc.3
]
;
then
cp
${
compile_dir
}
/build/share/man/man3/jemalloc.3
${
pkg_dir
}${
install_user_local_path
}
/share/man/man3/
fi
fi
cp
-r
${
compile_dir
}
/../packaging/deb/DEBIAN
${
pkg_dir
}
/
cp
-r
${
compile_dir
}
/../packaging/deb/DEBIAN
${
pkg_dir
}
/
chmod
755
${
pkg_dir
}
/DEBIAN/
*
chmod
755
${
pkg_dir
}
/DEBIAN/
*
...
...
packaging/release.sh
浏览文件 @
84d3a5e7
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
set
-e
set
-e
#set -x
#set -x
# releas
h.sh -v [cluster | edge]
# releas
e.sh -v [cluster | edge]
# -c [aarch32 | aarch64 | x64 | x86 | mips64 ...]
# -c [aarch32 | aarch64 | x64 | x86 | mips64 ...]
# -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...]
# -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...]
# -V [stable | beta]
# -V [stable | beta]
...
@@ -22,11 +22,12 @@ cpuType=x64 # [aarch32 | aarch64 | x64 | x86 | mips64 ...]
...
@@ -22,11 +22,12 @@ cpuType=x64 # [aarch32 | aarch64 | x64 | x86 | mips64 ...]
osType
=
Linux
# [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...]
osType
=
Linux
# [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...]
pagMode
=
full
# [full | lite]
pagMode
=
full
# [full | lite]
soMode
=
dynamic
# [static | dynamic]
soMode
=
dynamic
# [static | dynamic]
allocator
=
glibc
# [glibc | jemalloc]
dbName
=
taos
# [taos | power]
dbName
=
taos
# [taos | power]
verNumber
=
""
verNumber
=
""
verNumberComp
=
"2.0.0.0"
verNumberComp
=
"2.0.0.0"
while
getopts
"hv:V:c:o:l:s:d:n:m:"
arg
while
getopts
"hv:V:c:o:l:s:d:
a:
n:m:"
arg
do
do
case
$arg
in
case
$arg
in
v
)
v
)
...
@@ -53,6 +54,10 @@ do
...
@@ -53,6 +54,10 @@ do
#echo "dbName=$OPTARG"
#echo "dbName=$OPTARG"
dbName
=
$(
echo
$OPTARG
)
dbName
=
$(
echo
$OPTARG
)
;;
;;
a
)
#echo "allocator=$OPTARG"
allocator
=
$(
echo
$OPTARG
)
;;
n
)
n
)
#echo "verNumber=$OPTARG"
#echo "verNumber=$OPTARG"
verNumber
=
$(
echo
$OPTARG
)
verNumber
=
$(
echo
$OPTARG
)
...
@@ -71,6 +76,7 @@ do
...
@@ -71,6 +76,7 @@ do
echo
" -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...] "
echo
" -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...] "
echo
" -V [stable | beta] "
echo
" -V [stable | beta] "
echo
" -l [full | lite] "
echo
" -l [full | lite] "
echo
" -a [glibc | jemalloc] "
echo
" -s [static | dynamic] "
echo
" -s [static | dynamic] "
echo
" -d [taos | power] "
echo
" -d [taos | power] "
echo
" -n [version number] "
echo
" -n [version number] "
...
@@ -84,7 +90,7 @@ do
...
@@ -84,7 +90,7 @@ do
esac
esac
done
done
echo
"verMode=
${
verMode
}
verType=
${
verType
}
cpuType=
${
cpuType
}
osType=
${
osType
}
pagMode=
${
pagMode
}
soMode=
${
soMode
}
dbName=
${
dbName
}
verNumber=
${
verNumber
}
verNumberComp=
${
verNumberComp
}
"
echo
"verMode=
${
verMode
}
verType=
${
verType
}
cpuType=
${
cpuType
}
osType=
${
osType
}
pagMode=
${
pagMode
}
soMode=
${
soMode
}
dbName=
${
dbName
}
allocator=
${
allocator
}
verNumber=
${
verNumber
}
verNumberComp=
${
verNumberComp
}
"
curr_dir
=
$(
pwd
)
curr_dir
=
$(
pwd
)
...
@@ -180,12 +186,18 @@ else
...
@@ -180,12 +186,18 @@ else
fi
fi
cd
${
compile_dir
}
cd
${
compile_dir
}
if
[[
"
$allocator
"
==
"jemalloc"
]]
;
then
allocator_macro
=
"-DJEMALLOC_ENABLED=true"
else
allocator_macro
=
""
fi
# check support cpu type
# check support cpu type
if
[[
"
$cpuType
"
==
"x64"
]]
||
[[
"
$cpuType
"
==
"aarch64"
]]
||
[[
"
$cpuType
"
==
"aarch32"
]]
||
[[
"
$cpuType
"
==
"mips64"
]]
;
then
if
[[
"
$cpuType
"
==
"x64"
]]
||
[[
"
$cpuType
"
==
"aarch64"
]]
||
[[
"
$cpuType
"
==
"aarch32"
]]
||
[[
"
$cpuType
"
==
"mips64"
]]
;
then
if
[
"
$verMode
"
!=
"cluster"
]
;
then
if
[
"
$verMode
"
!=
"cluster"
]
;
then
cmake ../
-DCPUTYPE
=
${
cpuType
}
-DOSTYPE
=
${
osType
}
-DSOMODE
=
${
soMode
}
-DDBNAME
=
${
dbName
}
-DVERTYPE
=
${
verType
}
-DVERDATE
=
"
${
build_time
}
"
-DGITINFO
=
${
gitinfo
}
-DGITINFOI
=
${
gitinfoOfInternal
}
-DVERNUMBER
=
${
verNumber
}
-DVERCOMPATIBLE
=
${
verNumberComp
}
-DPAGMODE
=
${
pagMode
}
cmake ../
-DCPUTYPE
=
${
cpuType
}
-DOSTYPE
=
${
osType
}
-DSOMODE
=
${
soMode
}
-DDBNAME
=
${
dbName
}
-DVERTYPE
=
${
verType
}
-DVERDATE
=
"
${
build_time
}
"
-DGITINFO
=
${
gitinfo
}
-DGITINFOI
=
${
gitinfoOfInternal
}
-DVERNUMBER
=
${
verNumber
}
-DVERCOMPATIBLE
=
${
verNumberComp
}
-DPAGMODE
=
${
pagMode
}
${
allocator_macro
}
else
else
cmake ../../
-DCPUTYPE
=
${
cpuType
}
-DOSTYPE
=
${
osType
}
-DSOMODE
=
${
soMode
}
-DDBNAME
=
${
dbName
}
-DVERTYPE
=
${
verType
}
-DVERDATE
=
"
${
build_time
}
"
-DGITINFO
=
${
gitinfo
}
-DGITINFOI
=
${
gitinfoOfInternal
}
-DVERNUMBER
=
${
verNumber
}
-DVERCOMPATIBLE
=
${
verNumberComp
}
cmake ../../
-DCPUTYPE
=
${
cpuType
}
-DOSTYPE
=
${
osType
}
-DSOMODE
=
${
soMode
}
-DDBNAME
=
${
dbName
}
-DVERTYPE
=
${
verType
}
-DVERDATE
=
"
${
build_time
}
"
-DGITINFO
=
${
gitinfo
}
-DGITINFOI
=
${
gitinfoOfInternal
}
-DVERNUMBER
=
${
verNumber
}
-DVERCOMPATIBLE
=
${
verNumberComp
}
${
allocator_macro
}
fi
fi
else
else
echo
"input cpuType=
${
cpuType
}
error!!!"
echo
"input cpuType=
${
cpuType
}
error!!!"
...
...
packaging/rpm/makerpm.sh
浏览文件 @
84d3a5e7
packaging/rpm/tdengine.spec
浏览文件 @
84d3a5e7
%define homepath /usr/local/taos
%define homepath /usr/local/taos
%define userlocalpath /usr/local
%define cfg_install_dir /etc/taos
%define cfg_install_dir /etc/taos
%define __strip /bin/true
%define __strip /bin/true
...
@@ -75,9 +76,53 @@ fi
...
@@ -75,9 +76,53 @@ fi
cp -r %{_compiledir}/../src/connector/python %{buildroot}%{homepath}/connector
cp -r %{_compiledir}/../src/connector/python %{buildroot}%{homepath}/connector
cp -r %{_compiledir}/../src/connector/go %{buildroot}%{homepath}/connector
cp -r %{_compiledir}/../src/connector/go %{buildroot}%{homepath}/connector
cp -r %{_compiledir}/../src/connector/nodejs %{buildroot}%{homepath}/connector
cp -r %{_compiledir}/../src/connector/nodejs %{buildroot}%{homepath}/connector
cp %{_compiledir}/build/lib/taos-jdbcdriver*
dist.*
%{buildroot}%{homepath}/connector ||:
cp %{_compiledir}/build/lib/taos-jdbcdriver*
.*
%{buildroot}%{homepath}/connector ||:
cp -r %{_compiledir}/../tests/examples/* %{buildroot}%{homepath}/examples
cp -r %{_compiledir}/../tests/examples/* %{buildroot}%{homepath}/examples
if [ -f %{_compiledir}/build/bin/jemalloc-config ]; then
mkdir -p %{buildroot}%{userlocalpath}/bin
mkdir -p %{buildroot}%{userlocalpath}/lib
mkdir -p %{buildroot}%{userlocalpath}/lib/pkgconfig
mkdir -p %{buildroot}%{userlocalpath}/include
mkdir -p %{buildroot}%{userlocalpath}/include/jemalloc
mkdir -p %{buildroot}%{userlocalpath}/share
mkdir -p %{buildroot}%{userlocalpath}/share/doc
mkdir -p %{buildroot}%{userlocalpath}/share/doc/jemalloc
mkdir -p %{buildroot}%{userlocalpath}/share/man
mkdir -p %{buildroot}%{userlocalpath}/share/man/man3
cp %{_compiledir}/build/bin/jemalloc-config %{buildroot}%{userlocalpath}/bin/
if [ -f %{_compiledir}/build/bin/jemalloc.sh ]; then
cp %{_compiledir}/build/bin/jemalloc.sh %{buildroot}%{userlocalpath}/bin/
fi
if [ -f %{_compiledir}/build/bin/jeprof ]; then
cp %{_compiledir}/build/bin/jeprof %{buildroot}%{userlocalpath}/bin/
fi
if [ -f %{_compiledir}/build/include/jemalloc/jemalloc.h ]; then
cp %{_compiledir}/build/include/jemalloc/jemalloc.h %{buildroot}%{userlocalpath}/include/jemalloc/
fi
if [ -f %{_compiledir}/build/lib/libjemalloc.so.2 ]; then
cp %{_compiledir}/build/lib/libjemalloc.so.2 %{buildroot}%{userlocalpath}/lib/
ln -sf libjemalloc.so.2 %{buildroot}%{userlocalpath}/lib/libjemalloc.so
fi
if [ -f %{_compiledir}/build/lib/libjemalloc.a ]; then
cp %{_compiledir}/build/lib/libjemalloc.a %{buildroot}%{userlocalpath}/lib/
fi
if [ -f %{_compiledir}/build/lib/libjemalloc_pic.a ]; then
cp %{_compiledir}/build/lib/libjemalloc_pic.a %{buildroot}%{userlocalpath}/lib/
fi
if [ -f %{_compiledir}/build/lib/pkgconfig/jemalloc.pc ]; then
cp %{_compiledir}/build/lib/pkgconfig/jemalloc.pc %{buildroot}%{userlocalpath}/lib/pkgconfig/
fi
if [ -f %{_compiledir}/build/share/doc/jemalloc/jemalloc.html ]; then
cp %{_compiledir}/build/share/doc/jemalloc/jemalloc.html %{buildroot}%{userlocalpath}/share/doc/jemalloc/
fi
if [ -f %{_compiledir}/build/share/man/man3/jemalloc.3 ]; then
cp %{_compiledir}/build/share/man/man3/jemalloc.3 %{buildroot}%{userlocalpath}/share/man/man3/
fi
fi
#Scripts executed before installation
#Scripts executed before installation
%pre
%pre
csudo=""
csudo=""
...
...
packaging/tools/install.sh
浏览文件 @
84d3a5e7
...
@@ -227,6 +227,52 @@ function install_lib() {
...
@@ -227,6 +227,52 @@ function install_lib() {
${
csudo
}
ldconfig
${
csudo
}
ldconfig
}
}
function
install_jemalloc
()
{
jemalloc_dir
=
${
script_dir
}
/jemalloc
if
[
-d
${
jemalloc_dir
}
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/bin
if
[
-f
${
jemalloc_dir
}
/bin/jemalloc-config
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/bin/jemalloc-config /usr/local/bin
fi
if
[
-f
${
jemalloc_dir
}
/bin/jemalloc.sh
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/bin/jemalloc.sh /usr/local/bin
fi
if
[
-f
${
jemalloc_dir
}
/bin/jeprof
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/bin/jeprof /usr/local/bin
fi
if
[
-f
${
jemalloc_dir
}
/include/jemalloc/jemalloc.h
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/include/jemalloc
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/include/jemalloc/jemalloc.h /usr/local/include/jemalloc
fi
if
[
-f
${
jemalloc_dir
}
/lib/libjemalloc.so.2
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/lib
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/lib/libjemalloc.so.2 /usr/local/lib
${
csudo
}
ln
-sf
libjemalloc.so.2 /usr/local/lib/libjemalloc.so
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/lib
if
[
-f
${
jemalloc_dir
}
/lib/libjemalloc.a
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/lib/libjemalloc.a /usr/local/lib
fi
if
[
-f
${
jemalloc_dir
}
/lib/libjemalloc_pic.a
]
;
then
${
csudo
}
/usr/bin/install
-c
-m
755
${
jemalloc_dir
}
/lib/libjemalloc_pic.a /usr/local/lib
fi
if
[
-f
${
jemalloc_dir
}
/lib/libjemalloc_pic.a
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/lib/pkgconfig
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig
fi
fi
if
[
-f
${
jemalloc_dir
}
/share/doc/jemalloc/jemalloc.html
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/doc/jemalloc
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/doc/jemalloc/jemalloc.html /usr/local/share/doc/jemalloc
fi
if
[
-f
${
jemalloc_dir
}
/share/man/man3/jemalloc.3
]
;
then
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
fi
}
function
install_header
()
{
function
install_header
()
{
${
csudo
}
rm
-f
${
inc_link_dir
}
/taos.h
${
inc_link_dir
}
/taoserror.h
||
:
${
csudo
}
rm
-f
${
inc_link_dir
}
/taos.h
${
inc_link_dir
}
/taoserror.h
||
:
${
csudo
}
cp
-f
${
script_dir
}
/inc/
*
${
install_main_dir
}
/include
&&
${
csudo
}
chmod
644
${
install_main_dir
}
/include/
*
${
csudo
}
cp
-f
${
script_dir
}
/inc/
*
${
install_main_dir
}
/include
&&
${
csudo
}
chmod
644
${
install_main_dir
}
/include/
*
...
@@ -776,6 +822,7 @@ function update_TDengine() {
...
@@ -776,6 +822,7 @@ function update_TDengine() {
install_log
install_log
install_header
install_header
install_lib
install_lib
install_jemalloc
if
[
"
$pagMode
"
!=
"lite"
]
;
then
if
[
"
$pagMode
"
!=
"lite"
]
;
then
install_connector
install_connector
fi
fi
...
...
packaging/tools/make_install.sh
浏览文件 @
84d3a5e7
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
set
-e
set
-e
# set -x
# set -x
# -----------------------Variables definition
---------------------
# -----------------------Variables definition
source_dir
=
$1
source_dir
=
$1
binary_dir
=
$2
binary_dir
=
$2
osType
=
$3
osType
=
$3
...
@@ -176,6 +176,49 @@ function install_bin() {
...
@@ -176,6 +176,49 @@ function install_bin() {
[
-x
${
install_main_dir
}
/bin/remove_client.sh
]
&&
${
csudo
}
ln
-s
${
install_main_dir
}
/bin/remove_client.sh
${
bin_link_dir
}
/rmtaos
||
:
[
-x
${
install_main_dir
}
/bin/remove_client.sh
]
&&
${
csudo
}
ln
-s
${
install_main_dir
}
/bin/remove_client.sh
${
bin_link_dir
}
/rmtaos
||
:
fi
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
fi
}
function
install_lib
()
{
function
install_lib
()
{
# Remove links
# Remove links
...
@@ -199,6 +242,8 @@ function install_lib() {
...
@@ -199,6 +242,8 @@ function install_lib() {
${
csudo
}
ln
-sf
${
lib_link_dir
}
/libtaos.1.dylib
${
lib_link_dir
}
/libtaos.dylib
${
csudo
}
ln
-sf
${
lib_link_dir
}
/libtaos.1.dylib
${
lib_link_dir
}
/libtaos.dylib
fi
fi
install_jemalloc
if
[
"
$osType
"
!=
"Darwin"
]
;
then
if
[
"
$osType
"
!=
"Darwin"
]
;
then
${
csudo
}
ldconfig
${
csudo
}
ldconfig
fi
fi
...
...
packaging/tools/makepkg.sh
浏览文件 @
84d3a5e7
...
@@ -30,7 +30,7 @@ else
...
@@ -30,7 +30,7 @@ else
install_dir
=
"
${
release_dir
}
/TDengine-server-
${
version
}
"
install_dir
=
"
${
release_dir
}
/TDengine-server-
${
version
}
"
fi
fi
# Directories and files
.
# Directories and files
if
[
"
$pagMode
"
==
"lite"
]
;
then
if
[
"
$pagMode
"
==
"lite"
]
;
then
strip
${
build_dir
}
/bin/taosd
strip
${
build_dir
}
/bin/taosd
strip
${
build_dir
}
/bin/taos
strip
${
build_dir
}
/bin/taos
...
@@ -73,6 +73,39 @@ mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/taos
...
@@ -73,6 +73,39 @@ mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/taos
mkdir
-p
${
install_dir
}
/init.d
&&
cp
${
init_file_tarbitrator_deb
}
${
install_dir
}
/init.d/tarbitratord.deb
||
:
mkdir
-p
${
install_dir
}
/init.d
&&
cp
${
init_file_tarbitrator_deb
}
${
install_dir
}
/init.d/tarbitratord.deb
||
:
mkdir
-p
${
install_dir
}
/init.d
&&
cp
${
init_file_tarbitrator_rpm
}
${
install_dir
}
/init.d/tarbitratord.rpm
||
:
mkdir
-p
${
install_dir
}
/init.d
&&
cp
${
init_file_tarbitrator_rpm
}
${
install_dir
}
/init.d/tarbitratord.rpm
||
:
if
[
-f
${
build_dir
}
/bin/jemalloc-config
]
;
then
mkdir
-p
${
install_dir
}
/jemalloc/
{
bin,lib,lib/pkgconfig,include/jemalloc,share/doc/jemalloc,share/man/man3
}
cp
${
build_dir
}
/bin/jemalloc-config
${
install_dir
}
/jemalloc/bin
if
[
-f
${
build_dir
}
/bin/jemalloc.sh
]
;
then
cp
${
build_dir
}
/bin/jemalloc.sh
${
install_dir
}
/jemalloc/bin
fi
if
[
-f
${
build_dir
}
/bin/jeprof
]
;
then
cp
${
build_dir
}
/bin/jeprof
${
install_dir
}
/jemalloc/bin
fi
if
[
-f
${
build_dir
}
/include/jemalloc/jemalloc.h
]
;
then
cp
${
build_dir
}
/include/jemalloc/jemalloc.h
${
install_dir
}
/jemalloc/include/jemalloc
fi
if
[
-f
${
build_dir
}
/lib/libjemalloc.so.2
]
;
then
cp
${
build_dir
}
/lib/libjemalloc.so.2
${
install_dir
}
/jemalloc/lib
ln
-sf
libjemalloc.so.2
${
install_dir
}
/jemalloc/lib/libjemalloc.so
fi
if
[
-f
${
build_dir
}
/lib/libjemalloc.a
]
;
then
cp
${
build_dir
}
/lib/libjemalloc.a
${
install_dir
}
/jemalloc/lib
fi
if
[
-f
${
build_dir
}
/lib/libjemalloc_pic.a
]
;
then
cp
${
build_dir
}
/lib/libjemalloc_pic.a
${
install_dir
}
/jemalloc/lib
fi
if
[
-f
${
build_dir
}
/lib/pkgconfig/jemalloc.pc
]
;
then
cp
${
build_dir
}
/lib/pkgconfig/jemalloc.pc
${
install_dir
}
/jemalloc/lib/pkgconfig
fi
if
[
-f
${
build_dir
}
/share/doc/jemalloc/jemalloc.html
]
;
then
cp
${
build_dir
}
/share/doc/jemalloc/jemalloc.html
${
install_dir
}
/jemalloc/share/doc/jemalloc
fi
if
[
-f
${
build_dir
}
/share/man/man3/jemalloc.3
]
;
then
cp
${
build_dir
}
/share/man/man3/jemalloc.3
${
install_dir
}
/jemalloc/share/man/man3
fi
fi
if
[
"
$verMode
"
==
"cluster"
]
;
then
if
[
"
$verMode
"
==
"cluster"
]
;
then
sed
's/verMode=edge/verMode=cluster/g'
${
install_dir
}
/bin/remove.sh
>>
remove_temp.sh
sed
's/verMode=edge/verMode=cluster/g'
${
install_dir
}
/bin/remove.sh
>>
remove_temp.sh
mv
remove_temp.sh
${
install_dir
}
/bin/remove.sh
mv
remove_temp.sh
${
install_dir
}
/bin/remove.sh
...
...
snap/snapcraft.yaml
浏览文件 @
84d3a5e7
name
:
tdengine
name
:
tdengine
base
:
core18
base
:
core18
version
:
'
2.0.20.
5
'
version
:
'
2.0.20.
8
'
icon
:
snap/gui/t-dengine.svg
icon
:
snap/gui/t-dengine.svg
summary
:
an open-source big data platform designed and optimized for IoT.
summary
:
an open-source big data platform designed and optimized for IoT.
description
:
|
description
:
|
...
...
src/balance/src/bnMain.c
浏览文件 @
84d3a5e7
...
@@ -637,6 +637,19 @@ int32_t bnDropDnode(SDnodeObj *pDnode) {
...
@@ -637,6 +637,19 @@ int32_t bnDropDnode(SDnodeObj *pDnode) {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
bnDnodeCanCreateMnode
(
struct
SDnodeObj
*
pDnode
)
{
if
(
pDnode
==
NULL
)
return
0
;
if
(
pDnode
->
isMgmt
||
pDnode
->
alternativeRole
==
TAOS_DN_ALTERNATIVE_ROLE_VNODE
||
pDnode
->
status
==
TAOS_DN_STATUS_DROPPING
||
pDnode
->
status
==
TAOS_DN_STATUS_OFFLINE
)
{
return
0
;
}
else
{
return
1
;
}
}
static
void
bnMonitorDnodeModule
()
{
static
void
bnMonitorDnodeModule
()
{
int32_t
numOfMnodes
=
mnodeGetMnodesNum
();
int32_t
numOfMnodes
=
mnodeGetMnodesNum
();
if
(
numOfMnodes
>=
tsNumOfMnodes
)
return
;
if
(
numOfMnodes
>=
tsNumOfMnodes
)
return
;
...
@@ -645,13 +658,7 @@ static void bnMonitorDnodeModule() {
...
@@ -645,13 +658,7 @@ static void bnMonitorDnodeModule() {
SDnodeObj
*
pDnode
=
tsBnDnodes
.
list
[
i
];
SDnodeObj
*
pDnode
=
tsBnDnodes
.
list
[
i
];
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
->
isMgmt
||
pDnode
->
status
==
TAOS_DN_STATUS_DROPPING
||
pDnode
->
status
==
TAOS_DN_STATUS_OFFLINE
)
{
if
(
!
bnDnodeCanCreateMnode
(
pDnode
))
continue
;
continue
;
}
if
(
pDnode
->
alternativeRole
==
TAOS_DN_ALTERNATIVE_ROLE_VNODE
)
{
continue
;
}
mLInfo
(
"dnode:%d, numOfMnodes:%d expect:%d, create mnode in this dnode"
,
pDnode
->
dnodeId
,
numOfMnodes
,
tsNumOfMnodes
);
mLInfo
(
"dnode:%d, numOfMnodes:%d expect:%d, create mnode in this dnode"
,
pDnode
->
dnodeId
,
numOfMnodes
,
tsNumOfMnodes
);
mnodeCreateMnode
(
pDnode
->
dnodeId
,
pDnode
->
dnodeEp
,
true
);
mnodeCreateMnode
(
pDnode
->
dnodeId
,
pDnode
->
dnodeEp
,
true
);
...
...
src/client/src/tscSub.c
浏览文件 @
84d3a5e7
...
@@ -509,6 +509,7 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) {
...
@@ -509,6 +509,7 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) {
}
}
pSub
->
pSql
=
pSql
;
pSub
->
pSql
=
pSql
;
pSql
->
pSubscription
=
pSub
;
pSql
->
pSubscription
=
pSub
;
pSub
->
lastSyncTime
=
0
;
// no table list now, force to update it
// no table list now, force to update it
tscDebug
(
"begin table synchronization"
);
tscDebug
(
"begin table synchronization"
);
...
...
src/client/src/tscSystem.c
浏览文件 @
84d3a5e7
...
@@ -45,6 +45,7 @@ int32_t tscNumOfObj = 0; // number of sqlObj in current process.
...
@@ -45,6 +45,7 @@ int32_t tscNumOfObj = 0; // number of sqlObj in current process.
static
void
*
tscCheckDiskUsageTmr
;
static
void
*
tscCheckDiskUsageTmr
;
void
*
tscRpcCache
;
// cache to keep rpc obj
void
*
tscRpcCache
;
// cache to keep rpc obj
int32_t
tscNumOfThreads
=
1
;
// num of rpc threads
int32_t
tscNumOfThreads
=
1
;
// num of rpc threads
char
tscLogFileName
[
12
]
=
"taoslog"
;
static
pthread_mutex_t
rpcObjMutex
;
// mutex to protect open the rpc obj concurrently
static
pthread_mutex_t
rpcObjMutex
;
// mutex to protect open the rpc obj concurrently
static
pthread_once_t
tscinit
=
PTHREAD_ONCE_INIT
;
static
pthread_once_t
tscinit
=
PTHREAD_ONCE_INIT
;
static
volatile
int
tscInitRes
=
0
;
static
volatile
int
tscInitRes
=
0
;
...
@@ -132,7 +133,7 @@ void taos_init_imp(void) {
...
@@ -132,7 +133,7 @@ void taos_init_imp(void) {
printf
(
"failed to create log dir:%s
\n
"
,
tsLogDir
);
printf
(
"failed to create log dir:%s
\n
"
,
tsLogDir
);
}
}
sprintf
(
temp
,
"%s/
taoslog"
,
tsLogDir
);
sprintf
(
temp
,
"%s/
%s"
,
tsLogDir
,
tscLogFileName
);
if
(
taosInitLog
(
temp
,
tsNumOfLogLines
,
10
)
<
0
)
{
if
(
taosInitLog
(
temp
,
tsNumOfLogLines
,
10
)
<
0
)
{
printf
(
"failed to open log file in directory:%s
\n
"
,
tsLogDir
);
printf
(
"failed to open log file in directory:%s
\n
"
,
tsLogDir
);
}
}
...
...
src/client/tests/timeParseTest.cpp
浏览文件 @
84d3a5e7
...
@@ -98,7 +98,7 @@ TEST(testCase, parse_time) {
...
@@ -98,7 +98,7 @@ TEST(testCase, parse_time) {
taosParseTime
(
t41
,
&
time
,
strlen
(
t41
),
TSDB_TIME_PRECISION_MILLI
,
0
);
taosParseTime
(
t41
,
&
time
,
strlen
(
t41
),
TSDB_TIME_PRECISION_MILLI
,
0
);
EXPECT_EQ
(
time
,
852048000999
);
EXPECT_EQ
(
time
,
852048000999
);
int64_t
k
=
timezone
;
//
int64_t k = timezone;
char
t42
[]
=
"1997-1-1T0:0:0.999999999Z"
;
char
t42
[]
=
"1997-1-1T0:0:0.999999999Z"
;
taosParseTime
(
t42
,
&
time
,
strlen
(
t42
),
TSDB_TIME_PRECISION_MILLI
,
0
);
taosParseTime
(
t42
,
&
time
,
strlen
(
t42
),
TSDB_TIME_PRECISION_MILLI
,
0
);
EXPECT_EQ
(
time
,
852048000999
-
timezone
*
MILLISECOND_PER_SECOND
);
EXPECT_EQ
(
time
,
852048000999
-
timezone
*
MILLISECOND_PER_SECOND
);
...
@@ -163,7 +163,7 @@ TEST(testCase, parse_time) {
...
@@ -163,7 +163,7 @@ TEST(testCase, parse_time) {
taosParseTime
(
t13
,
&
time
,
strlen
(
t13
),
TSDB_TIME_PRECISION_MILLI
,
0
);
taosParseTime
(
t13
,
&
time
,
strlen
(
t13
),
TSDB_TIME_PRECISION_MILLI
,
0
);
EXPECT_EQ
(
time
,
-
28800
*
MILLISECOND_PER_SECOND
);
EXPECT_EQ
(
time
,
-
28800
*
MILLISECOND_PER_SECOND
);
char
*
t
=
"2021-01-08T02:11:40.000+00:00"
;
char
t
[]
=
"2021-01-08T02:11:40.000+00:00"
;
taosParseTime
(
t
,
&
time
,
strlen
(
t
),
TSDB_TIME_PRECISION_MILLI
,
0
);
taosParseTime
(
t
,
&
time
,
strlen
(
t
),
TSDB_TIME_PRECISION_MILLI
,
0
);
printf
(
"%ld
\n
"
,
time
);
printf
(
"%ld
\n
"
,
time
);
}
}
...
...
go
@
b8f76da4
比较
7a26c432
...
b8f76da4
Subproject commit
7a26c432f8b4203e42344ff3290b9b9b01b983d5
Subproject commit
b8f76da4a708d158ec3cc4b844571dc4414e36b4
hivemq-tdengine-extension
@
ce520101
比较
b62a26ec
...
ce520101
Subproject commit
b62a26ecc164a310104df57691691b237e091c89
Subproject commit
ce5201014136503d34fecbd56494b67b4961056c
src/dnode/CMakeLists.txt
浏览文件 @
84d3a5e7
...
@@ -10,8 +10,15 @@ INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
...
@@ -10,8 +10,15 @@ INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
INCLUDE_DIRECTORIES
(
inc
)
INCLUDE_DIRECTORIES
(
inc
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
IF
(
TD_LINUX_64 AND JEMALLOC_ENABLED
)
ADD_DEFINITIONS
(
-DTD_JEMALLOC_ENABLED -I
${
CMAKE_BINARY_DIR
}
/build/include -L
${
CMAKE_BINARY_DIR
}
/build/lib -Wl,-rpath,
${
CMAKE_BINARY_DIR
}
/build/lib -ljemalloc
)
SET
(
LINK_JEMALLOC
"-L
${
CMAKE_BINARY_DIR
}
/build/lib -ljemalloc"
)
ELSE
()
SET
(
LINK_JEMALLOC
""
)
ENDIF
()
ADD_EXECUTABLE
(
taosd
${
SRC
}
)
ADD_EXECUTABLE
(
taosd
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
taosd mnode monitor http tsdb twal vnode cJson lz4 balance sync
)
TARGET_LINK_LIBRARIES
(
taosd mnode monitor http tsdb twal vnode cJson lz4 balance sync
${
LINK_JEMALLOC
}
)
IF
(
TD_SOMODE_STATIC
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
taosd taos_static
)
TARGET_LINK_LIBRARIES
(
taosd taos_static
)
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
84d3a5e7
...
@@ -253,6 +253,8 @@ static int32_t dnodeInitStorage() {
...
@@ -253,6 +253,8 @@ static int32_t dnodeInitStorage() {
dnodeCheckDataDirOpenned
(
tsDnodeDir
);
dnodeCheckDataDirOpenned
(
tsDnodeDir
);
taosGetDisk
();
taosPrintDiskInfo
();
dInfo
(
"dnode storage is initialized at %s"
,
tsDnodeDir
);
dInfo
(
"dnode storage is initialized at %s"
,
tsDnodeDir
);
return
0
;
return
0
;
}
}
...
...
src/inc/tbn.h
浏览文件 @
84d3a5e7
...
@@ -31,6 +31,7 @@ void bnReset();
...
@@ -31,6 +31,7 @@ void bnReset();
int32_t
bnAllocVnodes
(
struct
SVgObj
*
pVgroup
);
int32_t
bnAllocVnodes
(
struct
SVgObj
*
pVgroup
);
int32_t
bnAlterDnode
(
struct
SDnodeObj
*
pDnode
,
int32_t
vnodeId
,
int32_t
dnodeId
);
int32_t
bnAlterDnode
(
struct
SDnodeObj
*
pDnode
,
int32_t
vnodeId
,
int32_t
dnodeId
);
int32_t
bnDropDnode
(
struct
SDnodeObj
*
pDnode
);
int32_t
bnDropDnode
(
struct
SDnodeObj
*
pDnode
);
int32_t
bnDnodeCanCreateMnode
(
struct
SDnodeObj
*
pDnode
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/kit/shell/CMakeLists.txt
浏览文件 @
84d3a5e7
...
@@ -11,10 +11,17 @@ IF (TD_LINUX)
...
@@ -11,10 +11,17 @@ IF (TD_LINUX)
LIST
(
REMOVE_ITEM SRC ./src/shellDarwin.c
)
LIST
(
REMOVE_ITEM SRC ./src/shellDarwin.c
)
ADD_EXECUTABLE
(
shell
${
SRC
}
)
ADD_EXECUTABLE
(
shell
${
SRC
}
)
IF
(
TD_LINUX_64 AND JEMALLOC_ENABLED
)
ADD_DEFINITIONS
(
-DTD_JEMALLOC_ENABLED -I
${
CMAKE_BINARY_DIR
}
/build/include -L
${
CMAKE_BINARY_DIR
}
/build/lib -Wl,-rpath,
${
CMAKE_BINARY_DIR
}
/build/lib -ljemalloc
)
SET
(
LINK_JEMALLOC
"-L
${
CMAKE_BINARY_DIR
}
/build/lib -ljemalloc"
)
ELSE
()
SET
(
LINK_JEMALLOC
""
)
ENDIF
()
IF
(
TD_SOMODE_STATIC
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
shell taos_static
)
TARGET_LINK_LIBRARIES
(
shell taos_static
${
LINK_JEMALLOC
}
)
ELSE
()
ELSE
()
TARGET_LINK_LIBRARIES
(
shell taos
)
TARGET_LINK_LIBRARIES
(
shell taos
${
LINK_JEMALLOC
}
)
ENDIF
()
ENDIF
()
SET_TARGET_PROPERTIES
(
shell PROPERTIES OUTPUT_NAME taos
)
SET_TARGET_PROPERTIES
(
shell PROPERTIES OUTPUT_NAME taos
)
...
...
src/kit/taosdemo/CMakeLists.txt
浏览文件 @
84d3a5e7
...
@@ -55,14 +55,21 @@ ENDIF ()
...
@@ -55,14 +55,21 @@ ENDIF ()
MESSAGE
(
"TD_VERSION_NUMBER is:"
${
TD_VERSION_NUMBER
}
)
MESSAGE
(
"TD_VERSION_NUMBER is:"
${
TD_VERSION_NUMBER
}
)
ADD_DEFINITIONS
(
-DTD_VERNUMBER=
"
${
TD_VERSION_NUMBER
}
"
)
ADD_DEFINITIONS
(
-DTD_VERNUMBER=
"
${
TD_VERSION_NUMBER
}
"
)
IF
(
TD_LINUX_64 AND JEMALLOC_ENABLED
)
ADD_DEFINITIONS
(
-DTD_JEMALLOC_ENABLED -I
${
CMAKE_BINARY_DIR
}
/build/include -L
${
CMAKE_BINARY_DIR
}
/build/lib -Wl,-rpath,
${
CMAKE_BINARY_DIR
}
/build/lib -ljemalloc
)
SET
(
LINK_JEMALLOC
"-L
${
CMAKE_BINARY_DIR
}
/build/lib -ljemalloc"
)
ELSE
()
SET
(
LINK_JEMALLOC
""
)
ENDIF
()
IF
(
TD_LINUX
)
IF
(
TD_LINUX
)
AUX_SOURCE_DIRECTORY
(
. SRC
)
AUX_SOURCE_DIRECTORY
(
. SRC
)
ADD_EXECUTABLE
(
taosdemo
${
SRC
}
)
ADD_EXECUTABLE
(
taosdemo
${
SRC
}
)
IF
(
TD_SOMODE_STATIC
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
taosdemo taos_static cJson
)
TARGET_LINK_LIBRARIES
(
taosdemo taos_static cJson
${
LINK_JEMALLOC
}
)
ELSE
()
ELSE
()
TARGET_LINK_LIBRARIES
(
taosdemo taos cJson
)
TARGET_LINK_LIBRARIES
(
taosdemo taos cJson
${
LINK_JEMALLOC
}
)
ENDIF
()
ENDIF
()
ELSEIF
(
TD_WINDOWS
)
ELSEIF
(
TD_WINDOWS
)
AUX_SOURCE_DIRECTORY
(
. SRC
)
AUX_SOURCE_DIRECTORY
(
. SRC
)
...
@@ -71,7 +78,7 @@ ELSEIF (TD_WINDOWS)
...
@@ -71,7 +78,7 @@ ELSEIF (TD_WINDOWS)
IF
(
TD_SOMODE_STATIC
)
IF
(
TD_SOMODE_STATIC
)
TARGET_LINK_LIBRARIES
(
taosdemo taos_static cJson
)
TARGET_LINK_LIBRARIES
(
taosdemo taos_static cJson
)
ELSE
()
ELSE
()
TARGET_LINK_LIBRARIES
(
taosdemo taos cJson
}
)
TARGET_LINK_LIBRARIES
(
taosdemo taos cJson
)
ENDIF
()
ENDIF
()
ELSEIF
(
TD_DARWIN
)
ELSEIF
(
TD_DARWIN
)
# missing a few dependencies, such as <argp.h>
# missing a few dependencies, such as <argp.h>
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
84d3a5e7
...
@@ -79,10 +79,9 @@ enum TEST_MODE {
...
@@ -79,10 +79,9 @@ enum TEST_MODE {
#define MAX_SQL_SIZE 65536
#define MAX_SQL_SIZE 65536
#define BUFFER_SIZE (65536*2)
#define BUFFER_SIZE (65536*2)
#define COND_BUF_LEN
BUFFER_SIZE - 30
#define COND_BUF_LEN
(BUFFER_SIZE - 30)
#define MAX_USERNAME_SIZE 64
#define MAX_USERNAME_SIZE 64
#define MAX_PASSWORD_SIZE 64
#define MAX_PASSWORD_SIZE 64
#define MAX_DB_NAME_SIZE 64
#define MAX_HOSTNAME_SIZE 64
#define MAX_HOSTNAME_SIZE 64
#define MAX_TB_NAME_SIZE 64
#define MAX_TB_NAME_SIZE 64
#define MAX_DATA_SIZE (16*1024)+20 // max record len: 16*1024, timestamp string and ,('') need extra space
#define MAX_DATA_SIZE (16*1024)+20 // max record len: 16*1024, timestamp string and ,('') need extra space
...
@@ -90,7 +89,7 @@ enum TEST_MODE {
...
@@ -90,7 +89,7 @@ enum TEST_MODE {
#define OPT_ABORT 1
/* –abort */
#define OPT_ABORT 1
/* –abort */
#define STRING_LEN 60000
#define STRING_LEN 60000
#define MAX_PREPARED_RAND 1000000
#define MAX_PREPARED_RAND 1000000
#define MAX_FILE_NAME_LEN 256
#define MAX_FILE_NAME_LEN 256
// max file name length on linux is 255.
#define MAX_SAMPLES_ONCE_FROM_FILE 10000
#define MAX_SAMPLES_ONCE_FROM_FILE 10000
#define MAX_NUM_DATATYPE 10
#define MAX_NUM_DATATYPE 10
...
@@ -195,13 +194,6 @@ enum _describe_table_index {
...
@@ -195,13 +194,6 @@ enum _describe_table_index {
TSDB_MAX_DESCRIBE_METRIC
TSDB_MAX_DESCRIBE_METRIC
};
};
typedef
struct
{
char
field
[
TSDB_COL_NAME_LEN
+
1
];
char
type
[
16
];
int
length
;
char
note
[
128
];
}
SColDes
;
/* Used by main to communicate with parse_opt. */
/* Used by main to communicate with parse_opt. */
static
char
*
g_dupstr
=
NULL
;
static
char
*
g_dupstr
=
NULL
;
...
@@ -247,16 +239,16 @@ typedef struct SArguments_S {
...
@@ -247,16 +239,16 @@ typedef struct SArguments_S {
}
SArguments
;
}
SArguments
;
typedef
struct
SColumn_S
{
typedef
struct
SColumn_S
{
char
field
[
TSDB_COL_NAME_LEN
+
1
];
char
field
[
TSDB_COL_NAME_LEN
];
char
dataType
[
MAX_TB_NAME_SIZE
];
char
dataType
[
16
];
uint32_t
dataLen
;
uint32_t
dataLen
;
char
note
[
128
];
char
note
[
128
];
}
StrColumn
;
}
StrColumn
;
typedef
struct
SSuperTable_S
{
typedef
struct
SSuperTable_S
{
char
sTblName
[
MAX_TB_NAME_SIZE
+
1
];
char
sTblName
[
TSDB_TABLE_NAME_LEN
];
char
dataSource
[
MAX_TB_NAME_SIZE
+
1
];
// rand_gen or sample
char
dataSource
[
MAX_TB_NAME_SIZE
];
// rand_gen or sample
char
childTblPrefix
[
MAX_TB_NAME_SIZE
];
char
childTblPrefix
[
TSDB_TABLE_NAME_LEN
-
20
];
// 20 characters reserved for seq
char
insertMode
[
MAX_TB_NAME_SIZE
];
// taosc, rest
char
insertMode
[
MAX_TB_NAME_SIZE
];
// taosc, rest
uint16_t
childTblExists
;
uint16_t
childTblExists
;
int64_t
childTblCount
;
int64_t
childTblCount
;
...
@@ -277,8 +269,8 @@ typedef struct SSuperTable_S {
...
@@ -277,8 +269,8 @@ typedef struct SSuperTable_S {
int64_t
timeStampStep
;
int64_t
timeStampStep
;
char
startTimestamp
[
MAX_TB_NAME_SIZE
];
char
startTimestamp
[
MAX_TB_NAME_SIZE
];
char
sampleFormat
[
MAX_TB_NAME_SIZE
];
// csv, json
char
sampleFormat
[
MAX_TB_NAME_SIZE
];
// csv, json
char
sampleFile
[
MAX_FILE_NAME_LEN
+
1
];
char
sampleFile
[
MAX_FILE_NAME_LEN
];
char
tagsFile
[
MAX_FILE_NAME_LEN
+
1
];
char
tagsFile
[
MAX_FILE_NAME_LEN
];
uint32_t
columnCount
;
uint32_t
columnCount
;
StrColumn
columns
[
MAX_COLUMN_COUNT
];
StrColumn
columns
[
MAX_COLUMN_COUNT
];
...
@@ -305,7 +297,7 @@ typedef struct SSuperTable_S {
...
@@ -305,7 +297,7 @@ typedef struct SSuperTable_S {
}
SSuperTable
;
}
SSuperTable
;
typedef
struct
{
typedef
struct
{
char
name
[
TSDB_DB_NAME_LEN
+
1
];
char
name
[
TSDB_DB_NAME_LEN
];
char
create_time
[
32
];
char
create_time
[
32
];
int64_t
ntables
;
int64_t
ntables
;
int32_t
vgroups
;
int32_t
vgroups
;
...
@@ -341,11 +333,11 @@ typedef struct SDbCfg_S {
...
@@ -341,11 +333,11 @@ typedef struct SDbCfg_S {
int
cache
;
int
cache
;
int
blocks
;
int
blocks
;
int
quorum
;
int
quorum
;
char
precision
[
MAX_TB_NAME_SIZE
];
char
precision
[
8
];
}
SDbCfg
;
}
SDbCfg
;
typedef
struct
SDataBase_S
{
typedef
struct
SDataBase_S
{
char
dbName
[
MAX_DB_NAME_SIZE
];
char
dbName
[
TSDB_DB_NAME_LEN
];
bool
drop
;
// 0: use exists, 1: if exists, drop then new create
bool
drop
;
// 0: use exists, 1: if exists, drop then new create
SDbCfg
dbCfg
;
SDbCfg
dbCfg
;
uint64_t
superTblCount
;
uint64_t
superTblCount
;
...
@@ -353,14 +345,14 @@ typedef struct SDataBase_S {
...
@@ -353,14 +345,14 @@ typedef struct SDataBase_S {
}
SDataBase
;
}
SDataBase
;
typedef
struct
SDbs_S
{
typedef
struct
SDbs_S
{
char
cfgDir
[
MAX_FILE_NAME_LEN
+
1
];
char
cfgDir
[
MAX_FILE_NAME_LEN
];
char
host
[
MAX_HOSTNAME_SIZE
];
char
host
[
MAX_HOSTNAME_SIZE
];
struct
sockaddr_in
serv_addr
;
struct
sockaddr_in
serv_addr
;
uint16_t
port
;
uint16_t
port
;
char
user
[
MAX_USERNAME_SIZE
];
char
user
[
MAX_USERNAME_SIZE
];
char
password
[
MAX_PASSWORD_SIZE
];
char
password
[
MAX_PASSWORD_SIZE
];
char
resultFile
[
MAX_FILE_NAME_LEN
+
1
];
char
resultFile
[
MAX_FILE_NAME_LEN
];
bool
use_metric
;
bool
use_metric
;
bool
insert_only
;
bool
insert_only
;
bool
do_aggreFunc
;
bool
do_aggreFunc
;
...
@@ -387,7 +379,7 @@ typedef struct SpecifiedQueryInfo_S {
...
@@ -387,7 +379,7 @@ typedef struct SpecifiedQueryInfo_S {
bool
subscribeRestart
;
bool
subscribeRestart
;
int
subscribeKeepProgress
;
int
subscribeKeepProgress
;
char
sql
[
MAX_QUERY_SQL_COUNT
][
MAX_QUERY_SQL_LENGTH
+
1
];
char
sql
[
MAX_QUERY_SQL_COUNT
][
MAX_QUERY_SQL_LENGTH
+
1
];
char
result
[
MAX_QUERY_SQL_COUNT
][
MAX_FILE_NAME_LEN
+
1
];
char
result
[
MAX_QUERY_SQL_COUNT
][
MAX_FILE_NAME_LEN
];
int
resubAfterConsume
[
MAX_QUERY_SQL_COUNT
];
int
resubAfterConsume
[
MAX_QUERY_SQL_COUNT
];
int
endAfterConsume
[
MAX_QUERY_SQL_COUNT
];
int
endAfterConsume
[
MAX_QUERY_SQL_COUNT
];
TAOS_SUB
*
tsub
[
MAX_QUERY_SQL_COUNT
];
TAOS_SUB
*
tsub
[
MAX_QUERY_SQL_COUNT
];
...
@@ -398,7 +390,7 @@ typedef struct SpecifiedQueryInfo_S {
...
@@ -398,7 +390,7 @@ typedef struct SpecifiedQueryInfo_S {
}
SpecifiedQueryInfo
;
}
SpecifiedQueryInfo
;
typedef
struct
SuperQueryInfo_S
{
typedef
struct
SuperQueryInfo_S
{
char
sTblName
[
MAX_TB_NAME_SIZE
+
1
];
char
sTblName
[
TSDB_TABLE_NAME_LEN
];
uint64_t
queryInterval
;
// 0: unlimit > 0 loop/s
uint64_t
queryInterval
;
// 0: unlimit > 0 loop/s
uint32_t
threadCnt
;
uint32_t
threadCnt
;
uint32_t
asyncMode
;
// 0: sync, 1: async
uint32_t
asyncMode
;
// 0: sync, 1: async
...
@@ -407,10 +399,10 @@ typedef struct SuperQueryInfo_S {
...
@@ -407,10 +399,10 @@ typedef struct SuperQueryInfo_S {
int
subscribeKeepProgress
;
int
subscribeKeepProgress
;
uint64_t
queryTimes
;
uint64_t
queryTimes
;
int64_t
childTblCount
;
int64_t
childTblCount
;
char
childTblPrefix
[
MAX_TB_NAME_SIZE
];
char
childTblPrefix
[
TSDB_TABLE_NAME_LEN
-
20
];
// 20 characters reserved for seq
int
sqlCount
;
int
sqlCount
;
char
sql
[
MAX_QUERY_SQL_COUNT
][
MAX_QUERY_SQL_LENGTH
+
1
];
char
sql
[
MAX_QUERY_SQL_COUNT
][
MAX_QUERY_SQL_LENGTH
+
1
];
char
result
[
MAX_QUERY_SQL_COUNT
][
MAX_FILE_NAME_LEN
+
1
];
char
result
[
MAX_QUERY_SQL_COUNT
][
MAX_FILE_NAME_LEN
];
int
resubAfterConsume
;
int
resubAfterConsume
;
int
endAfterConsume
;
int
endAfterConsume
;
TAOS_SUB
*
tsub
[
MAX_QUERY_SQL_COUNT
];
TAOS_SUB
*
tsub
[
MAX_QUERY_SQL_COUNT
];
...
@@ -420,13 +412,13 @@ typedef struct SuperQueryInfo_S {
...
@@ -420,13 +412,13 @@ typedef struct SuperQueryInfo_S {
}
SuperQueryInfo
;
}
SuperQueryInfo
;
typedef
struct
SQueryMetaInfo_S
{
typedef
struct
SQueryMetaInfo_S
{
char
cfgDir
[
MAX_FILE_NAME_LEN
+
1
];
char
cfgDir
[
MAX_FILE_NAME_LEN
];
char
host
[
MAX_HOSTNAME_SIZE
];
char
host
[
MAX_HOSTNAME_SIZE
];
uint16_t
port
;
uint16_t
port
;
struct
sockaddr_in
serv_addr
;
struct
sockaddr_in
serv_addr
;
char
user
[
MAX_USERNAME_SIZE
];
char
user
[
MAX_USERNAME_SIZE
];
char
password
[
MAX_PASSWORD_SIZE
];
char
password
[
MAX_PASSWORD_SIZE
];
char
dbName
[
MAX_DB_NAME_SIZE
+
1
];
char
dbName
[
TSDB_DB_NAME_LEN
];
char
queryMode
[
MAX_TB_NAME_SIZE
];
// taosc, rest
char
queryMode
[
MAX_TB_NAME_SIZE
];
// taosc, rest
SpecifiedQueryInfo
specifiedQueryInfo
;
SpecifiedQueryInfo
specifiedQueryInfo
;
...
@@ -438,11 +430,11 @@ typedef struct SThreadInfo_S {
...
@@ -438,11 +430,11 @@ typedef struct SThreadInfo_S {
TAOS
*
taos
;
TAOS
*
taos
;
TAOS_STMT
*
stmt
;
TAOS_STMT
*
stmt
;
int
threadID
;
int
threadID
;
char
db_name
[
MAX_DB_NAME_SIZE
+
1
];
char
db_name
[
TSDB_DB_NAME_LEN
];
uint32_t
time_precision
;
uint32_t
time_precision
;
char
filePath
[
4096
];
char
filePath
[
4096
];
FILE
*
fp
;
FILE
*
fp
;
char
tb_prefix
[
MAX_TB_NAME_SIZE
];
char
tb_prefix
[
TSDB_TABLE_NAME_LEN
];
uint64_t
start_table_from
;
uint64_t
start_table_from
;
uint64_t
end_table_to
;
uint64_t
end_table_to
;
int64_t
ntables
;
int64_t
ntables
;
...
@@ -2497,6 +2489,13 @@ static int getChildNameOfSuperTableWithLimitAndOffset(TAOS * taos,
...
@@ -2497,6 +2489,13 @@ static int getChildNameOfSuperTableWithLimitAndOffset(TAOS * taos,
char
*
pTblName
=
childTblName
;
char
*
pTblName
=
childTblName
;
while
((
row
=
taos_fetch_row
(
res
))
!=
NULL
)
{
while
((
row
=
taos_fetch_row
(
res
))
!=
NULL
)
{
int32_t
*
len
=
taos_fetch_lengths
(
res
);
int32_t
*
len
=
taos_fetch_lengths
(
res
);
if
(
0
==
strlen
((
char
*
)
row
[
0
]))
{
errorPrint
(
"%s() LN%d, No.%"
PRId64
" table return empty name
\n
"
,
__func__
,
__LINE__
,
count
);
exit
(
-
1
);
}
tstrncpy
(
pTblName
,
(
char
*
)
row
[
0
],
len
[
0
]
+
1
);
tstrncpy
(
pTblName
,
(
char
*
)
row
[
0
],
len
[
0
]
+
1
);
//printf("==== sub table name: %s\n", pTblName);
//printf("==== sub table name: %s\n", pTblName);
count
++
;
count
++
;
...
@@ -3031,7 +3030,7 @@ static int startMultiThreadCreateChildTable(
...
@@ -3031,7 +3030,7 @@ static int startMultiThreadCreateChildTable(
for
(
int64_t
i
=
0
;
i
<
threads
;
i
++
)
{
for
(
int64_t
i
=
0
;
i
<
threads
;
i
++
)
{
threadInfo
*
pThreadInfo
=
infos
+
i
;
threadInfo
*
pThreadInfo
=
infos
+
i
;
pThreadInfo
->
threadID
=
i
;
pThreadInfo
->
threadID
=
i
;
tstrncpy
(
pThreadInfo
->
db_name
,
db_name
,
MAX_DB_NAME_SIZE
);
tstrncpy
(
pThreadInfo
->
db_name
,
db_name
,
TSDB_DB_NAME_LEN
);
pThreadInfo
->
superTblInfo
=
superTblInfo
;
pThreadInfo
->
superTblInfo
=
superTblInfo
;
verbosePrint
(
"%s() %d db_name: %s
\n
"
,
__func__
,
__LINE__
,
db_name
);
verbosePrint
(
"%s() %d db_name: %s
\n
"
,
__func__
,
__LINE__
,
db_name
);
pThreadInfo
->
taos
=
taos_connect
(
pThreadInfo
->
taos
=
taos_connect
(
...
@@ -3322,7 +3321,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
...
@@ -3322,7 +3321,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
//tstrncpy(superTbls->columns[k].dataType, dataType->valuestring, MAX_TB_NAME_SIZE);
//tstrncpy(superTbls->columns[k].dataType, dataType->valuestring, MAX_TB_NAME_SIZE);
tstrncpy
(
columnCase
.
dataType
,
dataType
->
valuestring
,
MAX_TB_NAME_SIZE
);
tstrncpy
(
columnCase
.
dataType
,
dataType
->
valuestring
,
strlen
(
dataType
->
valuestring
)
+
1
);
cJSON
*
dataLen
=
cJSON_GetObjectItem
(
column
,
"len"
);
cJSON
*
dataLen
=
cJSON_GetObjectItem
(
column
,
"len"
);
if
(
dataLen
&&
dataLen
->
type
==
cJSON_Number
)
{
if
(
dataLen
&&
dataLen
->
type
==
cJSON_Number
)
{
...
@@ -3337,7 +3336,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
...
@@ -3337,7 +3336,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
for
(
int
n
=
0
;
n
<
count
;
++
n
)
{
for
(
int
n
=
0
;
n
<
count
;
++
n
)
{
tstrncpy
(
superTbls
->
columns
[
index
].
dataType
,
tstrncpy
(
superTbls
->
columns
[
index
].
dataType
,
columnCase
.
dataType
,
MAX_TB_NAME_SIZE
);
columnCase
.
dataType
,
strlen
(
columnCase
.
dataType
)
+
1
);
superTbls
->
columns
[
index
].
dataLen
=
columnCase
.
dataLen
;
superTbls
->
columns
[
index
].
dataLen
=
columnCase
.
dataLen
;
index
++
;
index
++
;
}
}
...
@@ -3393,7 +3392,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
...
@@ -3393,7 +3392,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
__func__
,
__LINE__
);
__func__
,
__LINE__
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tstrncpy
(
columnCase
.
dataType
,
dataType
->
valuestring
,
MAX_TB_NAME_SIZE
);
tstrncpy
(
columnCase
.
dataType
,
dataType
->
valuestring
,
strlen
(
dataType
->
valuestring
)
+
1
);
cJSON
*
dataLen
=
cJSON_GetObjectItem
(
tag
,
"len"
);
cJSON
*
dataLen
=
cJSON_GetObjectItem
(
tag
,
"len"
);
if
(
dataLen
&&
dataLen
->
type
==
cJSON_Number
)
{
if
(
dataLen
&&
dataLen
->
type
==
cJSON_Number
)
{
...
@@ -3408,7 +3407,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
...
@@ -3408,7 +3407,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
for
(
int
n
=
0
;
n
<
count
;
++
n
)
{
for
(
int
n
=
0
;
n
<
count
;
++
n
)
{
tstrncpy
(
superTbls
->
tags
[
index
].
dataType
,
columnCase
.
dataType
,
tstrncpy
(
superTbls
->
tags
[
index
].
dataType
,
columnCase
.
dataType
,
MAX_TB_NAME_SIZE
);
strlen
(
columnCase
.
dataType
)
+
1
);
superTbls
->
tags
[
index
].
dataLen
=
columnCase
.
dataLen
;
superTbls
->
tags
[
index
].
dataLen
=
columnCase
.
dataLen
;
index
++
;
index
++
;
}
}
...
@@ -3631,7 +3630,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3631,7 +3630,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
printf
(
"ERROR: failed to read json, db name not found
\n
"
);
printf
(
"ERROR: failed to read json, db name not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tstrncpy
(
g_Dbs
.
db
[
i
].
dbName
,
dbName
->
valuestring
,
MAX_DB_NAME_SIZE
);
tstrncpy
(
g_Dbs
.
db
[
i
].
dbName
,
dbName
->
valuestring
,
TSDB_DB_NAME_LEN
);
cJSON
*
drop
=
cJSON_GetObjectItem
(
dbinfo
,
"drop"
);
cJSON
*
drop
=
cJSON_GetObjectItem
(
dbinfo
,
"drop"
);
if
(
drop
&&
drop
->
type
==
cJSON_String
&&
drop
->
valuestring
!=
NULL
)
{
if
(
drop
&&
drop
->
type
==
cJSON_String
&&
drop
->
valuestring
!=
NULL
)
{
...
@@ -3652,10 +3651,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3652,10 +3651,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
if
(
precision
&&
precision
->
type
==
cJSON_String
if
(
precision
&&
precision
->
type
==
cJSON_String
&&
precision
->
valuestring
!=
NULL
)
{
&&
precision
->
valuestring
!=
NULL
)
{
tstrncpy
(
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
precision
->
valuestring
,
tstrncpy
(
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
precision
->
valuestring
,
MAX_DB_NAME_SIZE
);
8
);
}
else
if
(
!
precision
)
{
}
else
if
(
!
precision
)
{
//tstrncpy(g_Dbs.db[i].dbCfg.precision, "ms", MAX_DB_NAME_SIZE);
memset
(
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
0
,
8
);
memset
(
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
0
,
MAX_DB_NAME_SIZE
);
}
else
{
}
else
{
printf
(
"ERROR: failed to read json, precision not found
\n
"
);
printf
(
"ERROR: failed to read json, precision not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
...
@@ -3832,7 +3830,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3832,7 +3830,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sTblName
,
stbName
->
valuestring
,
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sTblName
,
stbName
->
valuestring
,
MAX_TB_NAME_SIZE
);
TSDB_TABLE_NAME_LEN
);
cJSON
*
prefix
=
cJSON_GetObjectItem
(
stbInfo
,
"childtable_prefix"
);
cJSON
*
prefix
=
cJSON_GetObjectItem
(
stbInfo
,
"childtable_prefix"
);
if
(
!
prefix
||
prefix
->
type
!=
cJSON_String
||
prefix
->
valuestring
==
NULL
)
{
if
(
!
prefix
||
prefix
->
type
!=
cJSON_String
||
prefix
->
valuestring
==
NULL
)
{
...
@@ -3840,7 +3838,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3840,7 +3838,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblPrefix
,
prefix
->
valuestring
,
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblPrefix
,
prefix
->
valuestring
,
MAX_DB_NAME_SIZE
);
TSDB_TABLE_NAME_LEN
-
20
);
cJSON
*
autoCreateTbl
=
cJSON_GetObjectItem
(
stbInfo
,
"auto_create_table"
);
cJSON
*
autoCreateTbl
=
cJSON_GetObjectItem
(
stbInfo
,
"auto_create_table"
);
if
(
autoCreateTbl
if
(
autoCreateTbl
...
@@ -3908,9 +3906,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3908,9 +3906,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
if
(
dataSource
&&
dataSource
->
type
==
cJSON_String
if
(
dataSource
&&
dataSource
->
type
==
cJSON_String
&&
dataSource
->
valuestring
!=
NULL
)
{
&&
dataSource
->
valuestring
!=
NULL
)
{
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
dataSource
,
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
dataSource
,
dataSource
->
valuestring
,
MAX_DB_NAME_SIZE
);
dataSource
->
valuestring
,
TSDB_DB_NAME_LEN
);
}
else
if
(
!
dataSource
)
{
}
else
if
(
!
dataSource
)
{
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
dataSource
,
"rand"
,
MAX_DB_NAME_SIZE
);
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
dataSource
,
"rand"
,
TSDB_DB_NAME_LEN
);
}
else
{
}
else
{
errorPrint
(
"%s() LN%d, failed to read json, data_source not found
\n
"
,
errorPrint
(
"%s() LN%d, failed to read json, data_source not found
\n
"
,
__func__
,
__LINE__
);
__func__
,
__LINE__
);
...
@@ -3968,10 +3966,10 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3968,10 +3966,10 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
cJSON
*
ts
=
cJSON_GetObjectItem
(
stbInfo
,
"start_timestamp"
);
cJSON
*
ts
=
cJSON_GetObjectItem
(
stbInfo
,
"start_timestamp"
);
if
(
ts
&&
ts
->
type
==
cJSON_String
&&
ts
->
valuestring
!=
NULL
)
{
if
(
ts
&&
ts
->
type
==
cJSON_String
&&
ts
->
valuestring
!=
NULL
)
{
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
startTimestamp
,
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
startTimestamp
,
ts
->
valuestring
,
MAX_DB_NAME_SIZE
);
ts
->
valuestring
,
TSDB_DB_NAME_LEN
);
}
else
if
(
!
ts
)
{
}
else
if
(
!
ts
)
{
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
startTimestamp
,
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
startTimestamp
,
"now"
,
MAX_DB_NAME_SIZE
);
"now"
,
TSDB_DB_NAME_LEN
);
}
else
{
}
else
{
printf
(
"ERROR: failed to read json, start_timestamp not found
\n
"
);
printf
(
"ERROR: failed to read json, start_timestamp not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
...
@@ -3991,9 +3989,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3991,9 +3989,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
if
(
sampleFormat
&&
sampleFormat
->
type
if
(
sampleFormat
&&
sampleFormat
->
type
==
cJSON_String
&&
sampleFormat
->
valuestring
!=
NULL
)
{
==
cJSON_String
&&
sampleFormat
->
valuestring
!=
NULL
)
{
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFormat
,
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFormat
,
sampleFormat
->
valuestring
,
MAX_DB_NAME_SIZE
);
sampleFormat
->
valuestring
,
TSDB_DB_NAME_LEN
);
}
else
if
(
!
sampleFormat
)
{
}
else
if
(
!
sampleFormat
)
{
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFormat
,
"csv"
,
MAX_DB_NAME_SIZE
);
tstrncpy
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFormat
,
"csv"
,
TSDB_DB_NAME_LEN
);
}
else
{
}
else
{
printf
(
"ERROR: failed to read json, sample_format not found
\n
"
);
printf
(
"ERROR: failed to read json, sample_format not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
...
@@ -4238,7 +4236,7 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
...
@@ -4238,7 +4236,7 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
cJSON
*
dbs
=
cJSON_GetObjectItem
(
root
,
"databases"
);
cJSON
*
dbs
=
cJSON_GetObjectItem
(
root
,
"databases"
);
if
(
dbs
&&
dbs
->
type
==
cJSON_String
&&
dbs
->
valuestring
!=
NULL
)
{
if
(
dbs
&&
dbs
->
type
==
cJSON_String
&&
dbs
->
valuestring
!=
NULL
)
{
tstrncpy
(
g_queryInfo
.
dbName
,
dbs
->
valuestring
,
MAX_DB_NAME_SIZE
);
tstrncpy
(
g_queryInfo
.
dbName
,
dbs
->
valuestring
,
TSDB_DB_NAME_LEN
);
}
else
if
(
!
dbs
)
{
}
else
if
(
!
dbs
)
{
printf
(
"ERROR: failed to read json, databases not found
\n
"
);
printf
(
"ERROR: failed to read json, databases not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
...
@@ -4488,7 +4486,7 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
...
@@ -4488,7 +4486,7 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
if
(
stblname
&&
stblname
->
type
==
cJSON_String
if
(
stblname
&&
stblname
->
type
==
cJSON_String
&&
stblname
->
valuestring
!=
NULL
)
{
&&
stblname
->
valuestring
!=
NULL
)
{
tstrncpy
(
g_queryInfo
.
superQueryInfo
.
sTblName
,
stblname
->
valuestring
,
tstrncpy
(
g_queryInfo
.
superQueryInfo
.
sTblName
,
stblname
->
valuestring
,
MAX_TB_NAME_SIZE
);
TSDB_TABLE_NAME_LEN
);
}
else
{
}
else
{
errorPrint
(
"%s() LN%d, failed to read json, super table name input error
\n
"
,
errorPrint
(
"%s() LN%d, failed to read json, super table name input error
\n
"
,
__func__
,
__LINE__
);
__func__
,
__LINE__
);
...
@@ -6000,6 +5998,12 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
...
@@ -6000,6 +5998,12 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
verbosePrint
(
"%s() LN%d: tid=%d seq=%"
PRId64
" tableName=%s
\n
"
,
verbosePrint
(
"%s() LN%d: tid=%d seq=%"
PRId64
" tableName=%s
\n
"
,
__func__
,
__LINE__
,
__func__
,
__LINE__
,
pThreadInfo
->
threadID
,
tableSeq
,
tableName
);
pThreadInfo
->
threadID
,
tableSeq
,
tableName
);
if
(
0
==
strlen
(
tableName
))
{
errorPrint
(
"[%d] %s() LN%d, getTableName return null
\n
"
,
pThreadInfo
->
threadID
,
__func__
,
__LINE__
);
free
(
pThreadInfo
->
buffer
);
return
NULL
;
}
int64_t
remainderBufLen
=
maxSqlLen
;
int64_t
remainderBufLen
=
maxSqlLen
;
char
*
pstr
=
pThreadInfo
->
buffer
;
char
*
pstr
=
pThreadInfo
->
buffer
;
...
@@ -6290,16 +6294,6 @@ static void startMultiThreadInsertData(int threads, char* db_name,
...
@@ -6290,16 +6294,6 @@ static void startMultiThreadInsertData(int threads, char* db_name,
}
}
}
}
// read sample data from file first
if
((
superTblInfo
)
&&
(
0
==
strncasecmp
(
superTblInfo
->
dataSource
,
"sample"
,
strlen
(
"sample"
))))
{
if
(
0
!=
prepareSampleDataForSTable
(
superTblInfo
))
{
errorPrint
(
"%s() LN%d, prepare sample data for stable failed!
\n
"
,
__func__
,
__LINE__
);
exit
(
-
1
);
}
}
TAOS
*
taos0
=
taos_connect
(
TAOS
*
taos0
=
taos_connect
(
g_Dbs
.
host
,
g_Dbs
.
user
,
g_Dbs
.
host
,
g_Dbs
.
user
,
g_Dbs
.
password
,
db_name
,
g_Dbs
.
port
);
g_Dbs
.
password
,
db_name
,
g_Dbs
.
port
);
...
@@ -6405,7 +6399,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
...
@@ -6405,7 +6399,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
for
(
int
i
=
0
;
i
<
threads
;
i
++
)
{
for
(
int
i
=
0
;
i
<
threads
;
i
++
)
{
threadInfo
*
pThreadInfo
=
infos
+
i
;
threadInfo
*
pThreadInfo
=
infos
+
i
;
pThreadInfo
->
threadID
=
i
;
pThreadInfo
->
threadID
=
i
;
tstrncpy
(
pThreadInfo
->
db_name
,
db_name
,
MAX_DB_NAME_SIZE
);
tstrncpy
(
pThreadInfo
->
db_name
,
db_name
,
TSDB_DB_NAME_LEN
);
pThreadInfo
->
time_precision
=
timePrec
;
pThreadInfo
->
time_precision
=
timePrec
;
pThreadInfo
->
superTblInfo
=
superTblInfo
;
pThreadInfo
->
superTblInfo
=
superTblInfo
;
...
@@ -6849,7 +6843,7 @@ static void *specifiedTableQuery(void *sarg) {
...
@@ -6849,7 +6843,7 @@ static void *specifiedTableQuery(void *sarg) {
}
}
}
}
char
sqlStr
[
MAX_DB_NAME_SIZE
+
5
];
char
sqlStr
[
TSDB_DB_NAME_LEN
+
5
];
sprintf
(
sqlStr
,
"use %s"
,
g_queryInfo
.
dbName
);
sprintf
(
sqlStr
,
"use %s"
,
g_queryInfo
.
dbName
);
if
(
0
!=
queryDbExec
(
pThreadInfo
->
taos
,
sqlStr
,
NO_INSERT_TYPE
,
false
))
{
if
(
0
!=
queryDbExec
(
pThreadInfo
->
taos
,
sqlStr
,
NO_INSERT_TYPE
,
false
))
{
taos_close
(
pThreadInfo
->
taos
);
taos_close
(
pThreadInfo
->
taos
);
...
@@ -7325,12 +7319,6 @@ static void *superSubscribe(void *sarg) {
...
@@ -7325,12 +7319,6 @@ static void *superSubscribe(void *sarg) {
performancePrint
(
"st: %"
PRIu64
" et: %"
PRIu64
" delta: %"
PRIu64
"
\n
"
,
st
,
et
,
(
et
-
st
));
performancePrint
(
"st: %"
PRIu64
" et: %"
PRIu64
" delta: %"
PRIu64
"
\n
"
,
st
,
et
,
(
et
-
st
));
if
(
res
)
{
if
(
res
)
{
if
(
g_queryInfo
.
superQueryInfo
.
result
[
pThreadInfo
->
querySeq
][
0
]
!=
0
)
{
sprintf
(
pThreadInfo
->
filePath
,
"%s-%d"
,
g_queryInfo
.
superQueryInfo
.
result
[
pThreadInfo
->
querySeq
],
pThreadInfo
->
threadID
);
fetchResult
(
res
,
pThreadInfo
);
}
if
(
g_queryInfo
.
superQueryInfo
.
result
[
pThreadInfo
->
querySeq
][
0
]
!=
0
)
{
if
(
g_queryInfo
.
superQueryInfo
.
result
[
pThreadInfo
->
querySeq
][
0
]
!=
0
)
{
sprintf
(
pThreadInfo
->
filePath
,
"%s-%d"
,
sprintf
(
pThreadInfo
->
filePath
,
"%s-%d"
,
g_queryInfo
.
superQueryInfo
.
result
[
pThreadInfo
->
querySeq
],
g_queryInfo
.
superQueryInfo
.
result
[
pThreadInfo
->
querySeq
],
...
@@ -7437,10 +7425,10 @@ static void *specifiedSubscribe(void *sarg) {
...
@@ -7437,10 +7425,10 @@ static void *specifiedSubscribe(void *sarg) {
sprintf
(
pThreadInfo
->
filePath
,
"%s-%d"
,
sprintf
(
pThreadInfo
->
filePath
,
"%s-%d"
,
g_queryInfo
.
specifiedQueryInfo
.
result
[
pThreadInfo
->
querySeq
],
g_queryInfo
.
specifiedQueryInfo
.
result
[
pThreadInfo
->
querySeq
],
pThreadInfo
->
threadID
);
pThreadInfo
->
threadID
);
}
fetchResult
(
fetchResult
(
g_queryInfo
.
specifiedQueryInfo
.
res
[
pThreadInfo
->
threadID
],
g_queryInfo
.
specifiedQueryInfo
.
res
[
pThreadInfo
->
threadID
],
pThreadInfo
);
pThreadInfo
);
}
g_queryInfo
.
specifiedQueryInfo
.
consumed
[
pThreadInfo
->
threadID
]
++
;
g_queryInfo
.
specifiedQueryInfo
.
consumed
[
pThreadInfo
->
threadID
]
++
;
if
((
g_queryInfo
.
specifiedQueryInfo
.
resubAfterConsume
[
pThreadInfo
->
querySeq
]
!=
-
1
)
if
((
g_queryInfo
.
specifiedQueryInfo
.
resubAfterConsume
[
pThreadInfo
->
querySeq
]
!=
-
1
)
...
@@ -7677,9 +7665,9 @@ static void setParaFromArg(){
...
@@ -7677,9 +7665,9 @@ static void setParaFromArg(){
g_Dbs
.
dbCount
=
1
;
g_Dbs
.
dbCount
=
1
;
g_Dbs
.
db
[
0
].
drop
=
true
;
g_Dbs
.
db
[
0
].
drop
=
true
;
tstrncpy
(
g_Dbs
.
db
[
0
].
dbName
,
g_args
.
database
,
MAX_DB_NAME_SIZE
);
tstrncpy
(
g_Dbs
.
db
[
0
].
dbName
,
g_args
.
database
,
TSDB_DB_NAME_LEN
);
g_Dbs
.
db
[
0
].
dbCfg
.
replica
=
g_args
.
replica
;
g_Dbs
.
db
[
0
].
dbCfg
.
replica
=
g_args
.
replica
;
tstrncpy
(
g_Dbs
.
db
[
0
].
dbCfg
.
precision
,
"ms"
,
MAX_DB_NAME_SIZE
);
tstrncpy
(
g_Dbs
.
db
[
0
].
dbCfg
.
precision
,
"ms"
,
8
);
tstrncpy
(
g_Dbs
.
resultFile
,
g_args
.
output_file
,
MAX_FILE_NAME_LEN
);
tstrncpy
(
g_Dbs
.
resultFile
,
g_args
.
output_file
,
MAX_FILE_NAME_LEN
);
...
@@ -7701,7 +7689,7 @@ static void setParaFromArg(){
...
@@ -7701,7 +7689,7 @@ static void setParaFromArg(){
if
(
g_args
.
use_metric
)
{
if
(
g_args
.
use_metric
)
{
g_Dbs
.
db
[
0
].
superTblCount
=
1
;
g_Dbs
.
db
[
0
].
superTblCount
=
1
;
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
sTblName
,
"meters"
,
MAX_TB_NAME_SIZE
);
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
sTblName
,
"meters"
,
TSDB_TABLE_NAME_LEN
);
g_Dbs
.
db
[
0
].
superTbls
[
0
].
childTblCount
=
g_args
.
num_of_tables
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
childTblCount
=
g_args
.
num_of_tables
;
g_Dbs
.
threadCount
=
g_args
.
num_of_threads
;
g_Dbs
.
threadCount
=
g_args
.
num_of_threads
;
g_Dbs
.
threadCountByCreateTbl
=
g_args
.
num_of_threads
;
g_Dbs
.
threadCountByCreateTbl
=
g_args
.
num_of_threads
;
...
@@ -7712,7 +7700,7 @@ static void setParaFromArg(){
...
@@ -7712,7 +7700,7 @@ static void setParaFromArg(){
g_Dbs
.
db
[
0
].
superTbls
[
0
].
disorderRange
=
g_args
.
disorderRange
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
disorderRange
=
g_args
.
disorderRange
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
disorderRatio
=
g_args
.
disorderRatio
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
disorderRatio
=
g_args
.
disorderRatio
;
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
childTblPrefix
,
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
childTblPrefix
,
g_args
.
tb_prefix
,
MAX_TB_NAME_SIZE
);
g_args
.
tb_prefix
,
TSDB_TABLE_NAME_LEN
-
20
);
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
dataSource
,
"rand"
,
MAX_TB_NAME_SIZE
);
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
dataSource
,
"rand"
,
MAX_TB_NAME_SIZE
);
g_Dbs
.
db
[
0
].
superTbls
[
0
].
iface
=
g_args
.
iface
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
iface
=
g_args
.
iface
;
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
startTimestamp
,
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
startTimestamp
,
...
@@ -7729,7 +7717,7 @@ static void setParaFromArg(){
...
@@ -7729,7 +7717,7 @@ static void setParaFromArg(){
}
}
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataType
,
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataType
,
data_type
[
i
],
MAX_TB_NAME_SIZE
);
data_type
[
i
],
strlen
(
data_type
[
i
])
+
1
);
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataLen
=
g_args
.
len_of_binary
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataLen
=
g_args
.
len_of_binary
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
++
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
++
;
}
}
...
@@ -7740,18 +7728,18 @@ static void setParaFromArg(){
...
@@ -7740,18 +7728,18 @@ static void setParaFromArg(){
for
(
int
i
=
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
;
for
(
int
i
=
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
;
i
<
g_args
.
num_of_CPR
;
i
++
)
{
i
<
g_args
.
num_of_CPR
;
i
++
)
{
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataType
,
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataType
,
"INT"
,
MAX_TB_NAME_SIZE
);
"INT"
,
strlen
(
"INT"
)
+
1
);
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataLen
=
0
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columns
[
i
].
dataLen
=
0
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
++
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
++
;
}
}
}
}
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tags
[
0
].
dataType
,
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tags
[
0
].
dataType
,
"INT"
,
MAX_TB_NAME_SIZE
);
"INT"
,
strlen
(
"INT"
)
+
1
);
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tags
[
0
].
dataLen
=
0
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tags
[
0
].
dataLen
=
0
;
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tags
[
1
].
dataType
,
tstrncpy
(
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tags
[
1
].
dataType
,
"BINARY"
,
MAX_TB_NAME_SIZE
);
"BINARY"
,
strlen
(
"BINARY"
)
+
1
);
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tags
[
1
].
dataLen
=
g_args
.
len_of_binary
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tags
[
1
].
dataLen
=
g_args
.
len_of_binary
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tagCount
=
2
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
tagCount
=
2
;
}
else
{
}
else
{
...
@@ -7887,11 +7875,11 @@ static void queryResult() {
...
@@ -7887,11 +7875,11 @@ static void queryResult() {
pThreadInfo
->
end_table_to
=
g_Dbs
.
db
[
0
].
superTbls
[
0
].
childTblCount
-
1
;
pThreadInfo
->
end_table_to
=
g_Dbs
.
db
[
0
].
superTbls
[
0
].
childTblCount
-
1
;
pThreadInfo
->
superTblInfo
=
&
g_Dbs
.
db
[
0
].
superTbls
[
0
];
pThreadInfo
->
superTblInfo
=
&
g_Dbs
.
db
[
0
].
superTbls
[
0
];
tstrncpy
(
pThreadInfo
->
tb_prefix
,
tstrncpy
(
pThreadInfo
->
tb_prefix
,
g_Dbs
.
db
[
0
].
superTbls
[
0
].
childTblPrefix
,
MAX_TB_NAME_SIZE
);
g_Dbs
.
db
[
0
].
superTbls
[
0
].
childTblPrefix
,
TSDB_TABLE_NAME_LEN
-
20
);
}
else
{
}
else
{
pThreadInfo
->
ntables
=
g_args
.
num_of_tables
;
pThreadInfo
->
ntables
=
g_args
.
num_of_tables
;
pThreadInfo
->
end_table_to
=
g_args
.
num_of_tables
-
1
;
pThreadInfo
->
end_table_to
=
g_args
.
num_of_tables
-
1
;
tstrncpy
(
pThreadInfo
->
tb_prefix
,
g_args
.
tb_prefix
,
MAX_TB_NAME_SIZE
);
tstrncpy
(
pThreadInfo
->
tb_prefix
,
g_args
.
tb_prefix
,
TSDB_TABLE_NAME_LEN
);
}
}
pThreadInfo
->
taos
=
taos_connect
(
pThreadInfo
->
taos
=
taos_connect
(
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
84d3a5e7
...
@@ -1858,13 +1858,13 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
...
@@ -1858,13 +1858,13 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
converStringToReadable
((
char
*
)
row
[
col
],
length
[
col
],
tbuf
,
COMMAND_SIZE
);
converStringToReadable
((
char
*
)
row
[
col
],
length
[
col
],
tbuf
,
COMMAND_SIZE
);
//pstr = stpcpy(pstr, tbuf);
//pstr = stpcpy(pstr, tbuf);
//*(pstr++) = '\'';
//*(pstr++) = '\'';
pstr
+=
sprintf
(
pstr
+
curr_sqlstr_len
,
"
\'
%s
\'
"
,
tbuf
);
curr_sqlstr_len
+=
sprintf
(
pstr
+
curr_sqlstr_len
,
"
\'
%s
\'
"
,
tbuf
);
break
;
break
;
}
}
case
TSDB_DATA_TYPE_NCHAR
:
{
case
TSDB_DATA_TYPE_NCHAR
:
{
char
tbuf
[
COMMAND_SIZE
]
=
{
0
};
char
tbuf
[
COMMAND_SIZE
]
=
{
0
};
convertNCharToReadable
((
char
*
)
row
[
col
],
length
[
col
],
tbuf
,
COMMAND_SIZE
);
convertNCharToReadable
((
char
*
)
row
[
col
],
length
[
col
],
tbuf
,
COMMAND_SIZE
);
pstr
+=
sprintf
(
pstr
+
curr_sqlstr_len
,
"
\'
%s
\'
"
,
tbuf
);
curr_sqlstr_len
+=
sprintf
(
pstr
+
curr_sqlstr_len
,
"
\'
%s
\'
"
,
tbuf
);
break
;
break
;
}
}
case
TSDB_DATA_TYPE_TIMESTAMP
:
case
TSDB_DATA_TYPE_TIMESTAMP
:
...
@@ -1897,7 +1897,8 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
...
@@ -1897,7 +1897,8 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
total_sqlstr_len
+=
curr_sqlstr_len
;
total_sqlstr_len
+=
curr_sqlstr_len
;
if
((
count
>=
arguments
->
data_batch
)
||
(
sql_buf_len
-
total_sqlstr_len
<
TSDB_MAX_BYTES_PER_ROW
))
{
if
((
count
>=
arguments
->
data_batch
)
||
(
sql_buf_len
-
total_sqlstr_len
<
TSDB_MAX_BYTES_PER_ROW
))
{
fprintf
(
fp
,
";
\n
"
);
fprintf
(
fp
,
";
\n
"
);
count
=
0
;
count
=
0
;
}
//else {
}
//else {
...
@@ -1905,6 +1906,8 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
...
@@ -1905,6 +1906,8 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
//}
//}
}
}
printf
(
"total_sqlstr_len: %d
\n
"
,
total_sqlstr_len
);
fprintf
(
fp
,
"
\n
"
);
fprintf
(
fp
,
"
\n
"
);
atomic_add_fetch_64
(
&
totalDumpOutRows
,
totalRows
);
atomic_add_fetch_64
(
&
totalDumpOutRows
,
totalRows
);
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
84d3a5e7
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include "os.h"
#include "os.h"
#include "tgrant.h"
#include "tgrant.h"
#include "tbn.h"
#include "tglobal.h"
#include "tglobal.h"
#include "tconfig.h"
#include "tconfig.h"
#include "tutil.h"
#include "tutil.h"
...
@@ -101,6 +100,8 @@ static int32_t mnodeDnodeActionInsert(SSdbRow *pRow) {
...
@@ -101,6 +100,8 @@ static int32_t mnodeDnodeActionInsert(SSdbRow *pRow) {
pDnode
->
offlineReason
=
TAOS_DN_OFF_STATUS_NOT_RECEIVED
;
pDnode
->
offlineReason
=
TAOS_DN_OFF_STATUS_NOT_RECEIVED
;
}
}
pDnode
->
customScore
=
0
;
dnodeUpdateEp
(
pDnode
->
dnodeId
,
pDnode
->
dnodeEp
,
pDnode
->
dnodeFqdn
,
&
pDnode
->
dnodePort
);
dnodeUpdateEp
(
pDnode
->
dnodeId
,
pDnode
->
dnodeEp
,
pDnode
->
dnodeFqdn
,
&
pDnode
->
dnodePort
);
mnodeUpdateDnodeEps
();
mnodeUpdateDnodeEps
();
...
@@ -630,7 +631,8 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
...
@@ -630,7 +631,8 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
}
}
int32_t
numOfMnodes
=
mnodeGetMnodesNum
();
int32_t
numOfMnodes
=
mnodeGetMnodesNum
();
if
(
numOfMnodes
<
tsNumOfMnodes
&&
numOfMnodes
<
mnodeGetOnlineDnodesNum
()
&&
!
pDnode
->
isMgmt
)
{
if
(
numOfMnodes
<
tsNumOfMnodes
&&
numOfMnodes
<
mnodeGetOnlineDnodesNum
()
&&
bnDnodeCanCreateMnode
(
pDnode
))
{
bnNotify
();
bnNotify
();
}
}
...
...
src/os/inc/osDef.h
浏览文件 @
84d3a5e7
...
@@ -40,10 +40,9 @@ extern "C" {
...
@@ -40,10 +40,9 @@ extern "C" {
#define ASSERT(x)
#define ASSERT(x)
#endif
#endif
#ifdef UNUSED
#ifndef UNUSED
#undefine UNUSED
#endif
#define UNUSED(x) ((void)(x))
#define UNUSED(x) ((void)(x))
#endif
#ifdef UNUSED_FUNC
#ifdef UNUSED_FUNC
#undefine UNUSED_FUNC
#undefine UNUSED_FUNC
...
...
src/os/inc/osMemory.h
浏览文件 @
84d3a5e7
...
@@ -22,6 +22,10 @@
...
@@ -22,6 +22,10 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#ifdef TD_JEMALLOC_ENABLED
#include <jemalloc/jemalloc.h>
#endif
typedef
enum
{
typedef
enum
{
TAOS_ALLOC_MODE_DEFAULT
=
0
,
TAOS_ALLOC_MODE_DEFAULT
=
0
,
TAOS_ALLOC_MODE_RANDOM_FAIL
=
1
,
TAOS_ALLOC_MODE_RANDOM_FAIL
=
1
,
...
...
src/os/inc/osSysinfo.h
浏览文件 @
84d3a5e7
...
@@ -36,6 +36,7 @@ bool taosGetCpuUsage(float *sysCpuUsage, float *procCpuUsage) ;
...
@@ -36,6 +36,7 @@ bool taosGetCpuUsage(float *sysCpuUsage, float *procCpuUsage) ;
bool
taosGetProcMemory
(
float
*
memoryUsedMB
)
;
bool
taosGetProcMemory
(
float
*
memoryUsedMB
)
;
bool
taosGetSysMemory
(
float
*
memoryUsedMB
);
bool
taosGetSysMemory
(
float
*
memoryUsedMB
);
void
taosPrintOsInfo
();
void
taosPrintOsInfo
();
void
taosPrintDiskInfo
();
int
taosSystem
(
const
char
*
cmd
)
;
int
taosSystem
(
const
char
*
cmd
)
;
void
taosKillSystem
();
void
taosKillSystem
();
bool
taosGetSystemUid
(
char
*
uid
);
bool
taosGetSystemUid
(
char
*
uid
);
...
...
src/os/src/darwin/darwinSysInfo.c
浏览文件 @
84d3a5e7
...
@@ -137,9 +137,6 @@ void taosPrintOsInfo() {
...
@@ -137,9 +137,6 @@ void taosPrintOsInfo() {
// uInfo(" os openMax: %" PRId64, tsOpenMax);
// uInfo(" os openMax: %" PRId64, tsOpenMax);
// uInfo(" os streamMax: %" PRId64, tsStreamMax);
// uInfo(" os streamMax: %" PRId64, tsStreamMax);
uInfo
(
" os numOfCores: %d"
,
tsNumOfCores
);
uInfo
(
" os numOfCores: %d"
,
tsNumOfCores
);
uInfo
(
" os totalDisk: %f(GB)"
,
tsTotalDataDirGB
);
uInfo
(
" os usedDisk: %f(GB)"
,
tsUsedDataDirGB
);
uInfo
(
" os availDisk: %f(GB)"
,
tsAvailDataDirGB
);
uInfo
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
uInfo
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
struct
utsname
buf
;
struct
utsname
buf
;
...
@@ -155,6 +152,14 @@ void taosPrintOsInfo() {
...
@@ -155,6 +152,14 @@ void taosPrintOsInfo() {
uInfo
(
"=================================="
);
uInfo
(
"=================================="
);
}
}
void
taosPrintDiskInfo
()
{
uInfo
(
"=================================="
);
uInfo
(
" os totalDisk: %f(GB)"
,
tsTotalDataDirGB
);
uInfo
(
" os usedDisk: %f(GB)"
,
tsUsedDataDirGB
);
uInfo
(
" os availDisk: %f(GB)"
,
tsAvailDataDirGB
);
uInfo
(
"=================================="
);
}
void
taosKillSystem
()
{
void
taosKillSystem
()
{
uError
(
"function taosKillSystem, exit!"
);
uError
(
"function taosKillSystem, exit!"
);
exit
(
0
);
exit
(
0
);
...
...
src/os/src/detail/osSysinfo.c
浏览文件 @
84d3a5e7
...
@@ -506,9 +506,6 @@ void taosPrintOsInfo() {
...
@@ -506,9 +506,6 @@ void taosPrintOsInfo() {
uInfo
(
" os openMax: %"
PRId64
,
tsOpenMax
);
uInfo
(
" os openMax: %"
PRId64
,
tsOpenMax
);
uInfo
(
" os streamMax: %"
PRId64
,
tsStreamMax
);
uInfo
(
" os streamMax: %"
PRId64
,
tsStreamMax
);
uInfo
(
" os numOfCores: %d"
,
tsNumOfCores
);
uInfo
(
" os numOfCores: %d"
,
tsNumOfCores
);
uInfo
(
" os totalDisk: %f(GB)"
,
tsTotalDataDirGB
);
uInfo
(
" os usedDisk: %f(GB)"
,
tsUsedDataDirGB
);
uInfo
(
" os availDisk: %f(GB)"
,
tsAvailDataDirGB
);
uInfo
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
uInfo
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
struct
utsname
buf
;
struct
utsname
buf
;
...
@@ -523,6 +520,14 @@ void taosPrintOsInfo() {
...
@@ -523,6 +520,14 @@ void taosPrintOsInfo() {
uInfo
(
" os machine: %s"
,
buf
.
machine
);
uInfo
(
" os machine: %s"
,
buf
.
machine
);
}
}
void
taosPrintDiskInfo
()
{
uInfo
(
"=================================="
);
uInfo
(
" os totalDisk: %f(GB)"
,
tsTotalDataDirGB
);
uInfo
(
" os usedDisk: %f(GB)"
,
tsUsedDataDirGB
);
uInfo
(
" os availDisk: %f(GB)"
,
tsAvailDataDirGB
);
uInfo
(
"=================================="
);
}
void
taosKillSystem
()
{
void
taosKillSystem
()
{
// SIGINT
// SIGINT
uInfo
(
"taosd will shut down soon"
);
uInfo
(
"taosd will shut down soon"
);
...
...
src/os/src/windows/wSysinfo.c
浏览文件 @
84d3a5e7
...
@@ -205,10 +205,15 @@ void taosGetSystemInfo() {
...
@@ -205,10 +205,15 @@ void taosGetSystemInfo() {
void
taosPrintOsInfo
()
{
void
taosPrintOsInfo
()
{
uInfo
(
" os numOfCores: %d"
,
tsNumOfCores
);
uInfo
(
" os numOfCores: %d"
,
tsNumOfCores
);
uInfo
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
uInfo
(
"=================================="
);
}
void
taosPrintDiskInfo
()
{
uInfo
(
"=================================="
);
uInfo
(
" os totalDisk: %f(GB)"
,
tsTotalDataDirGB
);
uInfo
(
" os totalDisk: %f(GB)"
,
tsTotalDataDirGB
);
uInfo
(
" os usedDisk: %f(GB)"
,
tsUsedDataDirGB
);
uInfo
(
" os usedDisk: %f(GB)"
,
tsUsedDataDirGB
);
uInfo
(
" os availDisk: %f(GB)"
,
tsAvailDataDirGB
);
uInfo
(
" os availDisk: %f(GB)"
,
tsAvailDataDirGB
);
uInfo
(
" os totalMemory: %d(MB)"
,
tsTotalMemoryMB
);
uInfo
(
"=================================="
);
uInfo
(
"=================================="
);
}
}
...
...
src/query/src/qExecutor.c
浏览文件 @
84d3a5e7
...
@@ -6720,6 +6720,10 @@ int32_t initQInfo(SQueryTableMsg *pQueryMsg, void *tsdb, int32_t vgId, SQInfo *p
...
@@ -6720,6 +6720,10 @@ int32_t initQInfo(SQueryTableMsg *pQueryMsg, void *tsdb, int32_t vgId, SQInfo *p
if
(
pQueryMsg
->
tsLen
>
0
)
{
// open new file to save the result
if
(
pQueryMsg
->
tsLen
>
0
)
{
// open new file to save the result
char
*
tsBlock
=
(
char
*
)
pQueryMsg
+
pQueryMsg
->
tsOffset
;
char
*
tsBlock
=
(
char
*
)
pQueryMsg
+
pQueryMsg
->
tsOffset
;
pTsBuf
=
tsBufCreateFromCompBlocks
(
tsBlock
,
pQueryMsg
->
tsNumOfBlocks
,
pQueryMsg
->
tsLen
,
pQueryMsg
->
tsOrder
,
vgId
);
pTsBuf
=
tsBufCreateFromCompBlocks
(
tsBlock
,
pQueryMsg
->
tsNumOfBlocks
,
pQueryMsg
->
tsLen
,
pQueryMsg
->
tsOrder
,
vgId
);
if
(
pTsBuf
==
NULL
)
{
code
=
TSDB_CODE_QRY_NO_DISKSPACE
;
goto
_error
;
}
tsBufResetPos
(
pTsBuf
);
tsBufResetPos
(
pTsBuf
);
bool
ret
=
tsBufNextPos
(
pTsBuf
);
bool
ret
=
tsBufNextPos
(
pTsBuf
);
...
...
src/query/src/qTsbuf.c
浏览文件 @
84d3a5e7
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include "taoserror.h"
#include "taoserror.h"
#include "tscompression.h"
#include "tscompression.h"
#include "tutil.h"
#include "tutil.h"
#include "queryLog.h"
static
int32_t
getDataStartOffset
();
static
int32_t
getDataStartOffset
();
static
void
TSBufUpdateGroupInfo
(
STSBuf
*
pTSBuf
,
int32_t
index
,
STSGroupBlockInfo
*
pBlockInfo
);
static
void
TSBufUpdateGroupInfo
(
STSBuf
*
pTSBuf
,
int32_t
index
,
STSGroupBlockInfo
*
pBlockInfo
);
...
@@ -633,10 +634,15 @@ int32_t STSBufUpdateHeader(STSBuf* pTSBuf, STSBufFileHeader* pHeader) {
...
@@ -633,10 +634,15 @@ int32_t STSBufUpdateHeader(STSBuf* pTSBuf, STSBufFileHeader* pHeader) {
int32_t
r
=
fseek
(
pTSBuf
->
f
,
0
,
SEEK_SET
);
int32_t
r
=
fseek
(
pTSBuf
->
f
,
0
,
SEEK_SET
);
if
(
r
!=
0
)
{
if
(
r
!=
0
)
{
qError
(
"fseek failed, errno:%d"
,
errno
);
return
-
1
;
return
-
1
;
}
}
fwrite
(
pHeader
,
sizeof
(
STSBufFileHeader
),
1
,
pTSBuf
->
f
);
size_t
ws
=
fwrite
(
pHeader
,
sizeof
(
STSBufFileHeader
),
1
,
pTSBuf
->
f
);
if
(
ws
!=
1
)
{
qError
(
"ts update header fwrite failed, size:%d, expected size:%d"
,
(
int32_t
)
ws
,
(
int32_t
)
sizeof
(
STSBufFileHeader
));
return
-
1
;
}
return
0
;
return
0
;
}
}
...
@@ -856,9 +862,17 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
...
@@ -856,9 +862,17 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
TSBufUpdateGroupInfo
(
pTSBuf
,
pTSBuf
->
numOfGroups
-
1
,
pBlockInfo
);
TSBufUpdateGroupInfo
(
pTSBuf
,
pTSBuf
->
numOfGroups
-
1
,
pBlockInfo
);
int32_t
ret
=
fseek
(
pTSBuf
->
f
,
pBlockInfo
->
offset
,
SEEK_SET
);
int32_t
ret
=
fseek
(
pTSBuf
->
f
,
pBlockInfo
->
offset
,
SEEK_SET
);
UNUSED
(
ret
);
if
(
ret
==
-
1
)
{
qError
(
"fseek failed, errno:%d"
,
errno
);
tsBufDestroy
(
pTSBuf
);
return
NULL
;
}
size_t
sz
=
fwrite
((
void
*
)
pData
,
1
,
len
,
pTSBuf
->
f
);
size_t
sz
=
fwrite
((
void
*
)
pData
,
1
,
len
,
pTSBuf
->
f
);
UNUSED
(
sz
);
if
(
sz
!=
len
)
{
qError
(
"ts data fwrite failed, write size:%d, expected size:%d"
,
(
int32_t
)
sz
,
len
);
tsBufDestroy
(
pTSBuf
);
return
NULL
;
}
pTSBuf
->
fileSize
+=
len
;
pTSBuf
->
fileSize
+=
len
;
pTSBuf
->
tsOrder
=
order
;
pTSBuf
->
tsOrder
=
order
;
...
@@ -866,9 +880,16 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
...
@@ -866,9 +880,16 @@ STSBuf* tsBufCreateFromCompBlocks(const char* pData, int32_t numOfBlocks, int32_
STSBufFileHeader
header
=
{
STSBufFileHeader
header
=
{
.
magic
=
TS_COMP_FILE_MAGIC
,
.
numOfGroup
=
pTSBuf
->
numOfGroups
,
.
tsOrder
=
pTSBuf
->
tsOrder
};
.
magic
=
TS_COMP_FILE_MAGIC
,
.
numOfGroup
=
pTSBuf
->
numOfGroups
,
.
tsOrder
=
pTSBuf
->
tsOrder
};
STSBufUpdateHeader
(
pTSBuf
,
&
header
);
if
(
STSBufUpdateHeader
(
pTSBuf
,
&
header
)
<
0
)
{
tsBufDestroy
(
pTSBuf
);
return
NULL
;
}
fsync
(
fileno
(
pTSBuf
->
f
));
if
(
fsync
(
fileno
(
pTSBuf
->
f
))
==
-
1
)
{
qError
(
"fsync failed, errno:%d"
,
errno
);
tsBufDestroy
(
pTSBuf
);
return
NULL
;
}
return
pTSBuf
;
return
pTSBuf
;
}
}
...
...
src/query/tests/astTest.cpp
浏览文件 @
84d3a5e7
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wwrite-strings"
#pragma GCC diagnostic ignored "-Wwrite-strings"
#pragma GCC diagnostic ignored "-Wunused-function"
typedef
struct
ResultObj
{
typedef
struct
ResultObj
{
int32_t
numOfResult
;
int32_t
numOfResult
;
...
...
src/query/tests/histogramTest.cpp
浏览文件 @
84d3a5e7
...
@@ -5,6 +5,10 @@
...
@@ -5,6 +5,10 @@
#include "taos.h"
#include "taos.h"
#include "qHistogram.h"
#include "qHistogram.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
namespace
{
namespace
{
void
doHistogramAddTest
()
{
void
doHistogramAddTest
()
{
SHistogramInfo
*
pHisto
=
NULL
;
SHistogramInfo
*
pHisto
=
NULL
;
...
...
src/query/tests/patternMatchTest.cpp
浏览文件 @
84d3a5e7
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
#include "qAggMain.h"
#include "qAggMain.h"
#include "tcompare.h"
#include "tcompare.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
TEST
(
testCase
,
patternMatchTest
)
{
TEST
(
testCase
,
patternMatchTest
)
{
SPatternCompareInfo
info
=
PATTERN_COMPARE_INFO_INITIALIZER
;
SPatternCompareInfo
info
=
PATTERN_COMPARE_INFO_INITIALIZER
;
...
...
src/query/tests/percentileTest.cpp
浏览文件 @
84d3a5e7
...
@@ -7,6 +7,9 @@
...
@@ -7,6 +7,9 @@
#include "qPercentile.h"
#include "qPercentile.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
namespace
{
namespace
{
tMemBucket
*
createBigIntDataBucket
(
int32_t
start
,
int32_t
end
)
{
tMemBucket
*
createBigIntDataBucket
(
int32_t
start
,
int32_t
end
)
{
tMemBucket
*
pBucket
=
tMemBucketCreate
(
sizeof
(
int64_t
),
TSDB_DATA_TYPE_BIGINT
,
start
,
end
);
tMemBucket
*
pBucket
=
tMemBucketCreate
(
sizeof
(
int64_t
),
TSDB_DATA_TYPE_BIGINT
,
start
,
end
);
...
...
src/query/tests/resultBufferTest.cpp
浏览文件 @
84d3a5e7
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
#include "taos.h"
#include "taos.h"
#include "tsdb.h"
#include "tsdb.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
namespace
{
namespace
{
// simple test
// simple test
void
simpleTest
()
{
void
simpleTest
()
{
...
...
src/query/tests/tsBufTest.cpp
浏览文件 @
84d3a5e7
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
#include "ttoken.h"
#include "ttoken.h"
#include "tutil.h"
#include "tutil.h"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
namespace
{
namespace
{
/**
/**
*
*
...
...
src/query/tests/unitTest.cpp
浏览文件 @
84d3a5e7
...
@@ -6,14 +6,17 @@
...
@@ -6,14 +6,17 @@
#include "taos.h"
#include "taos.h"
#include "tsdb.h"
#include "tsdb.h"
#pragma GCC diagnostic ignored "-Wwrite-strings"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#include "../../client/inc/tscUtil.h"
#include "../../client/inc/tscUtil.h"
#include "tutil.h"
#include "tutil.h"
#include "tvariant.h"
#include "tvariant.h"
#include "ttokendef.h"
#include "ttokendef.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wwrite-strings"
namespace
{
namespace
{
int32_t
testValidateName
(
char
*
name
)
{
int32_t
testValidateName
(
char
*
name
)
{
SStrToken
token
=
{
0
};
SStrToken
token
=
{
0
};
...
...
src/sync/src/syncMain.c
浏览文件 @
84d3a5e7
...
@@ -869,7 +869,7 @@ static void syncRestartPeer(SSyncPeer *pPeer) {
...
@@ -869,7 +869,7 @@ static void syncRestartPeer(SSyncPeer *pPeer) {
sDebug
(
"%s, peer conn is restart and set sstatus:%s"
,
pPeer
->
id
,
syncStatus
[
pPeer
->
sstatus
]);
sDebug
(
"%s, peer conn is restart and set sstatus:%s"
,
pPeer
->
id
,
syncStatus
[
pPeer
->
sstatus
]);
int32_t
ret
=
strcmp
(
pPeer
->
fqdn
,
tsNodeFqdn
);
int32_t
ret
=
strcmp
(
pPeer
->
fqdn
,
tsNodeFqdn
);
if
(
ret
>
0
||
(
ret
==
0
&&
pPeer
->
port
>
tsSyncPort
))
{
if
(
pPeer
->
nodeId
==
0
||
ret
>
0
||
(
ret
==
0
&&
pPeer
->
port
>
tsSyncPort
))
{
sDebug
(
"%s, check peer connection in 1000 ms"
,
pPeer
->
id
);
sDebug
(
"%s, check peer connection in 1000 ms"
,
pPeer
->
id
);
taosTmrReset
(
syncCheckPeerConnection
,
SYNC_CHECK_INTERVAL
,
(
void
*
)
pPeer
->
rid
,
tsSyncTmrCtrl
,
&
pPeer
->
timer
);
taosTmrReset
(
syncCheckPeerConnection
,
SYNC_CHECK_INTERVAL
,
(
void
*
)
pPeer
->
rid
,
tsSyncTmrCtrl
,
&
pPeer
->
timer
);
}
}
...
...
tests/pytest/dockerCluster/OneMnodeMultipleVnodesTest.py
浏览文件 @
84d3a5e7
...
@@ -12,9 +12,6 @@
...
@@ -12,9 +12,6 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
basic
import
*
from
basic
import
*
from
util.sql
import
tdSql
class
TDTestCase
:
class
TDTestCase
:
...
@@ -36,4 +33,6 @@ td = TDTestCase()
...
@@ -36,4 +33,6 @@ td = TDTestCase()
td
.
init
()
td
.
init
()
## usage: python3 OneMnodeMultipleVnodesTest.py
tests/pytest/dockerCluster/basic.py
浏览文件 @
84d3a5e7
...
@@ -45,6 +45,15 @@ class BuildDockerCluser:
...
@@ -45,6 +45,15 @@ class BuildDockerCluser:
"qdebugFlag"
:
"135"
,
"qdebugFlag"
:
"135"
,
"maxSQLLength"
:
"1048576"
"maxSQLLength"
:
"1048576"
}
}
cmd
=
"mkdir -p %s"
%
self
.
dockerDir
self
.
execCmd
(
cmd
)
cmd
=
"cp *.yml %s"
%
self
.
dockerDir
self
.
execCmd
(
cmd
)
cmd
=
"cp Dockerfile %s"
%
self
.
dockerDir
self
.
execCmd
(
cmd
)
# execute command, and return the output
# execute command, and return the output
# ref: https://blog.csdn.net/wowocpp/article/details/80775650
# ref: https://blog.csdn.net/wowocpp/article/details/80775650
...
@@ -108,10 +117,14 @@ class BuildDockerCluser:
...
@@ -108,10 +117,14 @@ class BuildDockerCluser:
self
.
execCmd
(
cmd
)
self
.
execCmd
(
cmd
)
def
updateLocalhosts
(
self
):
def
updateLocalhosts
(
self
):
cmd
=
"grep '172.27.0.7 *tdnode1' /etc/hosts"
cmd
=
"grep '172.27.0.7 *tdnode1' /etc/hosts
| sed 's: ::g'
"
result
=
self
.
execCmdAndGetOutput
(
cmd
)
result
=
self
.
execCmdAndGetOutput
(
cmd
)
if
result
and
not
result
.
isspace
():
print
(
result
)
if
result
is
None
or
result
.
isspace
():
print
(
"=========="
)
cmd
=
"echo '172.27.0.7 tdnode1' >> /etc/hosts"
cmd
=
"echo '172.27.0.7 tdnode1' >> /etc/hosts"
display
=
"echo %s"
%
cmd
self
.
execCmd
(
display
)
self
.
execCmd
(
cmd
)
self
.
execCmd
(
cmd
)
def
deploy
(
self
):
def
deploy
(
self
):
...
@@ -138,13 +151,13 @@ class BuildDockerCluser:
...
@@ -138,13 +151,13 @@ class BuildDockerCluser:
if
self
.
numOfNodes
<
2
or
self
.
numOfNodes
>
10
:
if
self
.
numOfNodes
<
2
or
self
.
numOfNodes
>
10
:
print
(
"the number of nodes must be between 2 and 10"
)
print
(
"the number of nodes must be between 2 and 10"
)
exit
(
0
)
exit
(
0
)
self
.
clearEnv
()
self
.
createDirs
()
self
.
updateLocalhosts
()
self
.
updateLocalhosts
()
self
.
deploy
()
self
.
deploy
()
def
run
(
self
):
def
run
(
self
):
cmd
=
"./buildClusterEnv.sh -n %d -v %s -d %s"
%
(
self
.
numOfNodes
,
self
.
getTaosdVersion
(),
self
.
dockerDir
)
cmd
=
"./buildClusterEnv.sh -n %d -v %s -d %s"
%
(
self
.
numOfNodes
,
self
.
getTaosdVersion
(),
self
.
dockerDir
)
display
=
"echo %s"
%
cmd
self
.
execCmd
(
display
)
self
.
execCmd
(
cmd
)
self
.
execCmd
(
cmd
)
self
.
getConnection
()
self
.
getConnection
()
self
.
createDondes
()
self
.
createDondes
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录