Merge remote-tracking branch 'upstream/develop' into odbc

This commit is contained in:
freemine 2020-10-20 19:36:23 +08:00
commit fb17a79e3c
38 changed files with 1347 additions and 335 deletions

22
Jenkinsfile vendored
View File

@ -4,10 +4,23 @@ pipeline {
WK = '/var/lib/jenkins/workspace/TDinternal'
WKC= '/var/lib/jenkins/workspace/TDinternal/community'
}
stages {
stage('pre build'){
agent{label 'master'}
when{ changeset "develop"}
steps{
sh '''
echo "check OK!"
'''
}
}
stage('Parallel test stage') {
parallel {
stage('pytest') {
when{ changeset "develop"}
agent{label 'master'}
steps {
sh '''
@ -33,13 +46,14 @@ pipeline {
}
}
stage('test_b1') {
when{ changeset "develop"}
agent{label '184'}
steps {
sh '''
date
cd ${WKC}
git checkout develop
git pull
git submodule update
cd ${WK}
git checkout develop
@ -60,12 +74,13 @@ pipeline {
stage('test_crash_gen') {
agent{label "185"}
when{ changeset "develop"}
steps {
sh '''
cd ${WKC}
git checkout develop
git pull
git submodule update
cd ${WK}
git checkout develop
@ -89,12 +104,13 @@ pipeline {
stage('test_valgrind') {
agent{label "186"}
when{ changeset "develop"}
steps {
sh '''
date
cd ${WKC}
git checkout develop
git pull
git submodule update
cd ${WK}
git checkout develop

View File

@ -31,7 +31,7 @@ ELSEIF (TD_WINDOWS)
#INSTALL(TARGETS taos RUNTIME DESTINATION driver)
#INSTALL(TARGETS shell RUNTIME DESTINATION .)
IF (TD_MVN_INSTALLED)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.0-dist.jar DESTINATION connector/jdbc)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.8-dist.jar DESTINATION connector/jdbc)
ENDIF ()
ELSEIF (TD_DARWIN)
SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh")

View File

@ -215,4 +215,6 @@ SHOW MNODES;
如果副本数为偶数当一个vnode group里一半或超过一半的vnode不工作时是无法从中选出master的。同理一半或超过一半的mnode不工作时是无法选出mnode的master的因为存在“split brain”问题。为解决这个问题TDengine引入了arbitrator的概念。Arbitrator模拟一个vnode或mnode在工作但只简单的负责网络连接不处理任何数据插入或访问。只要包含arbitrator在内超过半数的vnode或mnode工作那么该vnode group或mnode组就可以正常的提供数据插入或查询服务。比如对于副本数为2的情形如果一个节点A离线但另外一个节点B正常而且能连接到arbitrator, 那么节点B就能正常工作。
TDengine安装包里带有一个执行程序tarbitrator, 找任何一台Linux服务器运行它即可。该程序对系统资源几乎没有要求只需要保证有网络连接即可。该应用的命令行参数`-p`可以指定其对外服务的端口号缺省是6042。配置每个taosd实例时可以在配置文件taos.cfg里将参数arbitrator设置为arbitrator的End Point。如果该参数配置了当副本数为偶数数系统将自动连接配置的arbitrator。
下载最新arbitrator及之前版本的安装包请点击[安装包下载](https://www.taosdata.com/cn/all-downloads/)在TDengine Arbitrator Linux一节中选择适合的版本下载并安装。
TDengine Arbitrator安装包里带有一个执行程序tarbitrator, 找任何一台Linux服务器运行它即可。该程序对系统资源几乎没有要求只需要保证有网络连接即可。该应用的命令行参数`-p`可以指定其对外服务的端口号缺省是6042。配置每个taosd实例时可以在配置文件taos.cfg里将参数arbitrator设置为arbitrator的End Point。如果该参数配置了当副本数为偶数数系统将自动连接配置的arbitrator。

View File

@ -566,7 +566,7 @@ int tdSetKVRowDataOfCol(SKVRow *orow, int16_t colId, int8_t type, void *value) {
SKVRow nrow = NULL;
void * ptr = taosbsearch(&colId, kvRowColIdx(row), kvRowNCols(row), sizeof(SColIdx), comparTagId, TD_GE);
if (ptr == NULL || ((SColIdx *)ptr)->colId < colId) { // need to add a column value to the row
if (ptr == NULL || ((SColIdx *)ptr)->colId > colId) { // need to add a column value to the row
int diff = IS_VAR_DATA_TYPE(type) ? varDataTLen(value) : TYPE_BYTES[type];
nrow = malloc(kvRowLen(row) + sizeof(SColIdx) + diff);
if (nrow == NULL) return -1;

View File

@ -8,7 +8,7 @@ IF (TD_MVN_INSTALLED)
ADD_CUSTOM_COMMAND(OUTPUT ${JDBC_CMD_NAME}
POST_BUILD
COMMAND mvn -Dmaven.test.skip=true install -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-2.0.0-dist.jar ${LIBRARY_OUTPUT_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-2.0.8-dist.jar ${LIBRARY_OUTPUT_PATH}
COMMAND mvn -Dmaven.test.skip=true clean -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMENT "build jdbc driver")
ADD_CUSTOM_TARGET(${JDBC_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${JDBC_CMD_NAME})

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId>
<version>2.0.0</version>
<version>2.0.8</version>
<packaging>jar</packaging>
<name>JDBCDriver</name>
<url>https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc</url>

View File

@ -587,7 +587,6 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData {
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
throws SQLException {
/** add by zyyang **********/
Statement stmt = null;
if (null != conn && !conn.isClosed()) {

View File

@ -225,6 +225,7 @@ class CTaosInterface(object):
if connection.value == None:
print('connect to TDengine failed')
raise ConnectionError("connect to TDengine failed")
# sys.exit(1)
else:
print('connect to TDengine success')

View File

@ -225,6 +225,7 @@ class CTaosInterface(object):
if connection.value == None:
print('connect to TDengine failed')
raise ConnectionError("connect to TDengine failed")
# sys.exit(1)
#else:
# print('connect to TDengine success')
@ -414,4 +415,4 @@ if __name__ == '__main__':
print(data)
cinter.freeResult(result)
cinter.close(conn)
cinter.close(conn)

View File

@ -1399,16 +1399,20 @@ int32_t mnodeRetrieveShowSuperTables(SShowObj *pShow, char *data, int32_t rows,
void mnodeDropAllSuperTables(SDbObj *pDropDb) {
void * pIter= NULL;
int32_t numOfTables = 0;
int32_t dbNameLen = strlen(pDropDb->name);
SSuperTableObj *pTable = NULL;
char prefix[64] = {0};
tstrncpy(prefix, pDropDb->name, 64);
strcat(prefix, TS_PATH_DELIMITER);
int32_t prefixLen = strlen(prefix);
mInfo("db:%s, all super tables will be dropped from sdb", pDropDb->name);
while (1) {
pIter = mnodeGetNextSuperTable(pIter, &pTable);
if (pTable == NULL) break;
if (strncmp(pDropDb->name, pTable->info.tableId, dbNameLen) == 0) {
if (strncmp(prefix, pTable->info.tableId, prefixLen) == 0) {
SSdbOper oper = {
.type = SDB_OPER_LOCAL,
.table = tsSuperTableSdb,
@ -2224,16 +2228,20 @@ void mnodeDropAllChildTablesInVgroups(SVgObj *pVgroup) {
void mnodeDropAllChildTables(SDbObj *pDropDb) {
void * pIter = NULL;
int32_t numOfTables = 0;
int32_t dbNameLen = strlen(pDropDb->name);
SChildTableObj *pTable = NULL;
char prefix[64] = {0};
tstrncpy(prefix, pDropDb->name, 64);
strcat(prefix, TS_PATH_DELIMITER);
int32_t prefixLen = strlen(prefix);
mInfo("db:%s, all child tables will be dropped from sdb", pDropDb->name);
while (1) {
pIter = mnodeGetNextChildTable(pIter, &pTable);
if (pTable == NULL) break;
if (strncmp(pDropDb->name, pTable->info.tableId, dbNameLen) == 0) {
if (strncmp(prefix, pTable->info.tableId, prefixLen) == 0) {
SSdbOper oper = {
.type = SDB_OPER_LOCAL,
.table = tsChildTableSdb,

View File

@ -185,11 +185,18 @@ enum {
QUERY_RESULT_READY = 2,
};
typedef struct SMemRef {
int32_t ref;
void *mem;
void *imem;
} SMemRef;
typedef struct SQInfo {
void* signature;
int32_t code; // error code to returned to client
int64_t owner; // if it is in execution
void* tsdb;
SMemRef memRef;
int32_t vgId;
STableGroupInfo tableGroupInfo; // table <tid, last_key> list SArray<STableKeyInfo>
STableGroupInfo tableqinfoGroupInfo; // this is a group array list, including SArray<STableQueryInfo*> structure

View File

@ -20,6 +20,7 @@
#include "exception.h"
#include "../../query/inc/qAst.h" // todo move to common module
#include "../../query/inc/qExecutor.h" // todo move to common module
#include "tlosertree.h"
#include "tsdb.h"
#include "tsdbMain.h"
@ -143,6 +144,7 @@ static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey,
STsdbQueryHandle* pQueryHandle);
static int tsdbCheckInfoCompar(const void* key1, const void* key2);
static void tsdbInitDataBlockLoadInfo(SDataBlockLoadInfo* pBlockLoadInfo) {
pBlockLoadInfo->slot = -1;
pBlockLoadInfo->tid = -1;
@ -182,6 +184,27 @@ static SArray* getDefaultLoadColumns(STsdbQueryHandle* pQueryHandle, bool loadTS
return pLocalIdList;
}
static void tsdbMayTakeMemSnapshot(TsdbQueryHandleT pHandle) {
STsdbQueryHandle* pSecQueryHandle = (STsdbQueryHandle*) pHandle;
SQInfo *pQInfo = (SQInfo *)(pSecQueryHandle->qinfo);
if (pQInfo->memRef.ref++ == 0) {
tsdbTakeMemSnapshot(pSecQueryHandle->pTsdb, &pSecQueryHandle->mem, &pSecQueryHandle->imem);
pQInfo->memRef.mem = pSecQueryHandle->mem;
pQInfo->memRef.imem = pSecQueryHandle->imem;
} else {
pSecQueryHandle->mem = (SMemTable *)(pQInfo->memRef.mem);
pSecQueryHandle->imem = (SMemTable *)(pQInfo->memRef.imem);
}
}
static void tsdbMayUnTakeMemSnapshot(TsdbQueryHandleT pHandle) {
STsdbQueryHandle* pSecQueryHandle = (STsdbQueryHandle*) pHandle;
SQInfo *pQInfo = (SQInfo *)(pSecQueryHandle->qinfo);
if (--pQInfo->memRef.ref == 0) {
tsdbUnTakeMemSnapShot(pSecQueryHandle->pTsdb, pSecQueryHandle->mem, pSecQueryHandle->imem);
}
}
static SArray* createCheckInfoFromTableGroup(STsdbQueryHandle* pQueryHandle, STableGroupInfo* pGroupList, STsdbMeta* pMeta) {
size_t sizeOfGroup = taosArrayGetSize(pGroupList->pGroupList);
assert(sizeOfGroup >= 1 && pMeta != NULL);
@ -270,7 +293,7 @@ static STsdbQueryHandle* tsdbQueryTablesImpl(TSDB_REPO_T* tsdb, STsdbQueryCond*
goto out_of_memory;
}
tsdbTakeMemSnapshot(pQueryHandle->pTsdb, &pQueryHandle->mem, &pQueryHandle->imem);
tsdbMayTakeMemSnapshot(pQueryHandle);
assert(pCond != NULL && pCond->numOfCols > 0);
if (ASCENDING_TRAVERSE(pCond->order)) {
@ -2701,7 +2724,7 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) {
taosTFree(pQueryHandle->statis);
// todo check error
tsdbUnTakeMemSnapShot(pQueryHandle->pTsdb, pQueryHandle->mem, pQueryHandle->imem);
tsdbMayUnTakeMemSnapshot(pQueryHandle);
tsdbDestroyHelper(&pQueryHandle->rhelper);

View File

@ -0,0 +1,377 @@
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Text;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Collections;
namespace TDengineDriver
{
class TDengineTest
{
//connect parameters
private string host;
private string configDir;
private string user;
private string password;
private short port = 0;
//sql parameters
private string dbName;
private string tbName;
private bool isInsertData;
private bool isQueryData;
private long tableCount;
private long totalRows;
private long batchRows;
private long beginTimestamp = 1551369600000L;
private IntPtr conn = IntPtr.Zero;
private long rowsInserted = 0;
static void Main(string[] args)
{
TDengineTest tester = new TDengineTest();
tester.ReadArgument(args);
tester.InitTDengine();
tester.ConnectTDengine();
tester.createDatabase();
tester.useDatabase();
tester.checkDropTable();
tester.createTable();
tester.checkInsert();
tester.checkSelect();
tester.checkDropTable();
tester.CloseConnection();
}
public long GetArgumentAsLong(String[] argv, String argName, int minVal, int maxVal, int defaultValue)
{
int argc = argv.Length;
for (int i = 0; i < argc; ++i)
{
if (argName != argv[i])
{
continue;
}
if (i < argc - 1)
{
String tmp = argv[i + 1];
if (tmp[0] == '-')
{
Console.WriteLine("option {0:G} requires an argument", tmp);
ExitProgram();
}
long tmpVal = Convert.ToInt64(tmp);
if (tmpVal < minVal || tmpVal > maxVal)
{
Console.WriteLine("option {0:G} should in range [{1:G}, {2:G}]", argName, minVal, maxVal);
ExitProgram();
}
return tmpVal;
}
}
return defaultValue;
}
public String GetArgumentAsString(String[] argv, String argName, String defaultValue)
{
int argc = argv.Length;
for (int i = 0; i < argc; ++i)
{
if (argName != argv[i])
{
continue;
}
if (i < argc - 1)
{
String tmp = argv[i + 1];
if (tmp[0] == '-')
{
Console.WriteLine("option {0:G} requires an argument", tmp);
ExitProgram();
}
return tmp;
}
}
return defaultValue;
}
public void PrintHelp(String[] argv)
{
for (int i = 0; i < argv.Length; ++i)
{
if ("--help" == argv[i])
{
String indent = " ";
Console.WriteLine("taosTest is simple example to operate TDengine use C# Language.\n");
Console.WriteLine("{0:G}{1:G}", indent, "-h");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "TDEngine server IP address to connect");
Console.WriteLine("{0:G}{1:G}", indent, "-u");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "The TDEngine user name to use when connecting to the server, default is root");
Console.WriteLine("{0:G}{1:G}", indent, "-p");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "The TDEngine user name to use when connecting to the server, default is taosdata");
Console.WriteLine("{0:G}{1:G}", indent, "-d");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "Database used to create table or import data, default is db");
Console.WriteLine("{0:G}{1:G}", indent, "-s");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "Super Tables used to create table, default is mt");
Console.WriteLine("{0:G}{1:G}", indent, "-t");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "Table prefixs, default is t");
Console.WriteLine("{0:G}{1:G}", indent, "-w");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "Whether to insert data");
Console.WriteLine("{0:G}{1:G}", indent, "-r");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "Whether to query data");
Console.WriteLine("{0:G}{1:G}", indent, "-n");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "How many Tables to create, default is 10");
Console.WriteLine("{0:G}{1:G}", indent, "-b");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "How many rows per insert batch, default is 10");
Console.WriteLine("{0:G}{1:G}", indent, "-i");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "How many rows to insert, default is 100");
Console.WriteLine("{0:G}{1:G}", indent, "-c");
Console.WriteLine("{0:G}{1:G}{2:G}", indent, indent, "Configuration directory");
ExitProgram();
}
}
}
public void ReadArgument(String[] argv)
{
PrintHelp(argv);
host = this.GetArgumentAsString(argv, "-h", "127.0.0.1");
user = this.GetArgumentAsString(argv, "-u", "root");
password = this.GetArgumentAsString(argv, "-p", "taosdata");
dbName = this.GetArgumentAsString(argv, "-db", "test");
tbName = this.GetArgumentAsString(argv, "-s", "weather");
isInsertData = this.GetArgumentAsLong(argv, "-w", 0, 1, 1) != 0;
isQueryData = this.GetArgumentAsLong(argv, "-r", 0, 1, 1) != 0;
tableCount = this.GetArgumentAsLong(argv, "-n", 1, 10000, 10);
batchRows = this.GetArgumentAsLong(argv, "-b", 1, 1000, 500);
totalRows = this.GetArgumentAsLong(argv, "-i", 1, 10000000, 10000);
configDir = this.GetArgumentAsString(argv, "-c", "C:/TDengine/cfg");
}
public void InitTDengine()
{
TDengine.Options((int)TDengineInitOption.TDDB_OPTION_CONFIGDIR, this.configDir);
TDengine.Options((int)TDengineInitOption.TDDB_OPTION_SHELL_ACTIVITY_TIMER, "60");
TDengine.Init();
Console.WriteLine("get connection starting...");
}
public void ConnectTDengine()
{
string db = "";
this.conn = TDengine.Connect(this.host, this.user, this.password, db, this.port);
if (this.conn == IntPtr.Zero)
{
Console.WriteLine("connection failed: " + this.host);
ExitProgram();
}
else
{
Console.WriteLine("[ OK ] Connection established.");
}
}
public void createDatabase()
{
StringBuilder sql = new StringBuilder();
sql.Append("create database if not exists ").Append(this.dbName);
execute(sql.ToString());
}
public void useDatabase()
{
StringBuilder sql = new StringBuilder();
sql.Append("use ").Append(this.dbName);
execute(sql.ToString());
}
public void checkSelect()
{
StringBuilder sql = new StringBuilder();
sql.Append("select * from test.weather");
execute(sql.ToString());
}
public void createTable()
{
StringBuilder sql = new StringBuilder();
sql.Append("create table if not exists ").Append(this.dbName).Append(".").Append(this.tbName).Append("(ts timestamp, temperature float, humidity int)");
execute(sql.ToString());
}
public void checkInsert()
{
StringBuilder sql = new StringBuilder();
sql.Append("insert into test.weather (ts, temperature, humidity) values(now, 20.5, 34)");
execute(sql.ToString());
}
public void checkDropTable()
{
StringBuilder sql = new StringBuilder();
sql.Append("drop table if exists ").Append(this.dbName).Append(".").Append(this.tbName).Append("");
execute(sql.ToString());
}
public void execute(string sql)
{
DateTime dt1 = DateTime.Now;
IntPtr res = TDengine.Query(this.conn, sql.ToString());
DateTime dt2 = DateTime.Now;
TimeSpan span = dt2 - dt1;
if (res != IntPtr.Zero)
{
Console.WriteLine("[OK] time cost: " + span.ToString() + "ms, execute statement ====> " + sql.ToString());
}
else
{
Console.WriteLine(sql.ToString() + " failure, reason: " + TDengine.Error(res));
ExitProgram();
}
TDengine.FreeResult(res);
}
public void ExecuteQuery(string sql)
{
DateTime dt1 = DateTime.Now;
long queryRows = 0;
IntPtr res = TDengine.Query(conn, sql);
if (res == IntPtr.Zero)
{
Console.WriteLine(sql + " failure, reason: " + TDengine.Error(res));
ExitProgram();
}
DateTime dt2 = DateTime.Now;
TimeSpan span = dt2 - dt1;
Console.WriteLine("[OK] time cost: " + span.ToString() + "ms, execute statement ====> " + sql.ToString());
int fieldCount = TDengine.FieldCount(res);
List<TDengineMeta> metas = TDengine.FetchFields(res);
for (int j = 0; j < metas.Count; j++)
{
TDengineMeta meta = (TDengineMeta)metas[j];
}
IntPtr rowdata;
StringBuilder builder = new StringBuilder();
while ((rowdata = TDengine.FetchRows(res)) != IntPtr.Zero)
{
queryRows++;
for (int fields = 0; fields < fieldCount; ++fields)
{
TDengineMeta meta = metas[fields];
int offset = IntPtr.Size * fields;
IntPtr data = Marshal.ReadIntPtr(rowdata, offset);
builder.Append("---");
if (data == IntPtr.Zero)
{
builder.Append("NULL");
continue;
}
switch ((TDengineDataType)meta.type)
{
case TDengineDataType.TSDB_DATA_TYPE_BOOL:
bool v1 = Marshal.ReadByte(data) == 0 ? false : true;
builder.Append(v1);
break;
case TDengineDataType.TSDB_DATA_TYPE_TINYINT:
byte v2 = Marshal.ReadByte(data);
builder.Append(v2);
break;
case TDengineDataType.TSDB_DATA_TYPE_SMALLINT:
short v3 = Marshal.ReadInt16(data);
builder.Append(v3);
break;
case TDengineDataType.TSDB_DATA_TYPE_INT:
int v4 = Marshal.ReadInt32(data);
builder.Append(v4);
break;
case TDengineDataType.TSDB_DATA_TYPE_BIGINT:
long v5 = Marshal.ReadInt64(data);
builder.Append(v5);
break;
case TDengineDataType.TSDB_DATA_TYPE_FLOAT:
float v6 = (float)Marshal.PtrToStructure(data, typeof(float));
builder.Append(v6);
break;
case TDengineDataType.TSDB_DATA_TYPE_DOUBLE:
double v7 = (double)Marshal.PtrToStructure(data, typeof(double));
builder.Append(v7);
break;
case TDengineDataType.TSDB_DATA_TYPE_BINARY:
string v8 = Marshal.PtrToStringAnsi(data);
builder.Append(v8);
break;
case TDengineDataType.TSDB_DATA_TYPE_TIMESTAMP:
long v9 = Marshal.ReadInt64(data);
builder.Append(v9);
break;
case TDengineDataType.TSDB_DATA_TYPE_NCHAR:
string v10 = Marshal.PtrToStringAnsi(data);
builder.Append(v10);
break;
}
}
builder.Append("---");
if (queryRows <= 10)
{
Console.WriteLine(builder.ToString());
}
builder.Clear();
}
if (TDengine.ErrorNo(res) != 0)
{
Console.Write("Query is not complete, Error {0:G}", TDengine.ErrorNo(res), TDengine.Error(res));
}
TDengine.FreeResult(res);
}
public void CloseConnection()
{
if (this.conn != IntPtr.Zero)
{
TDengine.Close(this.conn);
Console.WriteLine("connection closed.");
}
}
static void ExitProgram()
{
TDengine.Cleanup();
System.Environment.Exit(0);
}
}
}

View File

@ -0,0 +1,154 @@
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace TDengineDriver
{
enum TDengineDataType {
TSDB_DATA_TYPE_NULL = 0, // 1 bytes
TSDB_DATA_TYPE_BOOL = 1, // 1 bytes
TSDB_DATA_TYPE_TINYINT = 2, // 1 bytes
TSDB_DATA_TYPE_SMALLINT = 3, // 2 bytes
TSDB_DATA_TYPE_INT = 4, // 4 bytes
TSDB_DATA_TYPE_BIGINT = 5, // 8 bytes
TSDB_DATA_TYPE_FLOAT = 6, // 4 bytes
TSDB_DATA_TYPE_DOUBLE = 7, // 8 bytes
TSDB_DATA_TYPE_BINARY = 8, // string
TSDB_DATA_TYPE_TIMESTAMP = 9,// 8 bytes
TSDB_DATA_TYPE_NCHAR = 10 // unicode string
}
enum TDengineInitOption
{
TSDB_OPTION_LOCALE = 0,
TSDB_OPTION_CHARSET = 1,
TSDB_OPTION_TIMEZONE = 2,
TDDB_OPTION_CONFIGDIR = 3,
TDDB_OPTION_SHELL_ACTIVITY_TIMER = 4
}
class TDengineMeta
{
public string name;
public short size;
public byte type;
public string TypeName()
{
switch ((TDengineDataType)type)
{
case TDengineDataType.TSDB_DATA_TYPE_BOOL:
return "BOOLEAN";
case TDengineDataType.TSDB_DATA_TYPE_TINYINT:
return "BYTE";
case TDengineDataType.TSDB_DATA_TYPE_SMALLINT:
return "SHORT";
case TDengineDataType.TSDB_DATA_TYPE_INT:
return "INT";
case TDengineDataType.TSDB_DATA_TYPE_BIGINT:
return "LONG";
case TDengineDataType.TSDB_DATA_TYPE_FLOAT:
return "FLOAT";
case TDengineDataType.TSDB_DATA_TYPE_DOUBLE:
return "DOUBLE";
case TDengineDataType.TSDB_DATA_TYPE_BINARY:
return "STRING";
case TDengineDataType.TSDB_DATA_TYPE_TIMESTAMP:
return "TIMESTAMP";
case TDengineDataType.TSDB_DATA_TYPE_NCHAR:
return "NCHAR";
default:
return "undefine";
}
}
}
class TDengine
{
public const int TSDB_CODE_SUCCESS = 0;
[DllImport("taos.dll", EntryPoint = "taos_init", CallingConvention = CallingConvention.Cdecl)]
static extern public void Init();
[DllImport("taos.dll", EntryPoint = "taos_cleanup", CallingConvention = CallingConvention.Cdecl)]
static extern public void Cleanup();
[DllImport("taos.dll", EntryPoint = "taos_options", CallingConvention = CallingConvention.Cdecl)]
static extern public void Options(int option, string value);
[DllImport("taos.dll", EntryPoint = "taos_connect", CallingConvention = CallingConvention.Cdecl)]
static extern public IntPtr Connect(string ip, string user, string password, string db, short port);
[DllImport("taos.dll", EntryPoint = "taos_errstr", CallingConvention = CallingConvention.Cdecl)]
static extern private IntPtr taos_errstr(IntPtr res);
static public string Error(IntPtr res)
{
IntPtr errPtr = taos_errstr(res);
return Marshal.PtrToStringAnsi(errPtr);
}
[DllImport("taos.dll", EntryPoint = "taos_errno", CallingConvention = CallingConvention.Cdecl)]
static extern public int ErrorNo(IntPtr res);
[DllImport("taos.dll", EntryPoint = "taos_query", CallingConvention = CallingConvention.Cdecl)]
static extern public IntPtr Query(IntPtr conn, string sqlstr);
[DllImport("taos.dll", EntryPoint = "taos_affected_rows", CallingConvention = CallingConvention.Cdecl)]
static extern public int AffectRows(IntPtr res);
[DllImport("taos.dll", EntryPoint = "taos_field_count", CallingConvention = CallingConvention.Cdecl)]
static extern public int FieldCount(IntPtr res);
[DllImport("taos.dll", EntryPoint = "taos_fetch_fields", CallingConvention = CallingConvention.Cdecl)]
static extern private IntPtr taos_fetch_fields(IntPtr res);
static public List<TDengineMeta> FetchFields(IntPtr res)
{
const int fieldSize = 68;
List<TDengineMeta> metas = new List<TDengineMeta>();
if (res == IntPtr.Zero)
{
return metas;
}
int fieldCount = FieldCount(res);
IntPtr fieldsPtr = taos_fetch_fields(res);
for (int i = 0; i < fieldCount; ++i)
{
int offset = i * fieldSize;
TDengineMeta meta = new TDengineMeta();
meta.name = Marshal.PtrToStringAnsi(fieldsPtr + offset);
meta.type = Marshal.ReadByte(fieldsPtr + offset + 65);
meta.size = Marshal.ReadInt16(fieldsPtr + offset + 66);
metas.Add(meta);
}
return metas;
}
[DllImport("taos.dll", EntryPoint = "taos_fetch_row", CallingConvention = CallingConvention.Cdecl)]
static extern public IntPtr FetchRows(IntPtr res);
[DllImport("taos.dll", EntryPoint = "taos_free_result", CallingConvention = CallingConvention.Cdecl)]
static extern public IntPtr FreeResult(IntPtr res);
[DllImport("taos.dll", EntryPoint = "taos_close", CallingConvention = CallingConvention.Cdecl)]
static extern public int Close(IntPtr taos);
}
}

View File

@ -5,18 +5,11 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.taosdata.jdbc</groupId>
<artifactId>jdbcdemo</artifactId>
<version>1.0-SNAPSHOT</version>
<artifactId>jdbcChecker</artifactId>
<version>SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
<version>30</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
@ -30,7 +23,7 @@
<configuration>
<archive>
<manifest>
<mainClass>TSDBSyncSample</mainClass>
<mainClass>com.taosdata.example.JdbcChecker</mainClass>
</manifest>
</archive>
<descriptorRefs>
@ -63,12 +56,18 @@
<dependency>
<groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId>
<version>2.0.4</version>
<version>2.0.8</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -2,12 +2,14 @@
TDengine's JDBC demo project is organized in a Maven way so that users can easily compile, package and run the project. If you don't have Maven on your server, you may install it using
<pre>sudo apt-get install maven</pre>
## Compile and Install JDBC Driver
TDengine's JDBC driver jar is not yet published to maven center repo, so we need to manually compile it and install it to the local Maven repository. This can be easily done with Maven. Go to source directory of the JDBC driver ``TDengine/src/connector/jdbc`` and execute
<pre>mvn clean package install</pre>
## Install TDengine Client
Make sure you have already installed a tdengine client on your current develop environment.
Download the tdengine package on our website: ``https://www.taosdata.com/cn/all-downloads/`` and install the client.
## Compile the Demo Code and Run It
To compile the demo project, go to the source directory ``TDengine/tests/examples/JDBC/JDBCDemo`` and execute
<pre>mvn clean assembly:single package</pre>
The ``pom.xml`` is configured to package all the dependencies into one executable jar file. To run it, go to ``examples/JDBC/JDBCDemo/target`` and execute
<pre>java -jar jdbcdemo-1.0-SNAPSHOT-jar-with-dependencies.jar</pre>
<pre>mvn clean package assembly:single</pre>
The ``pom.xml`` is configured to package all the dependencies into one executable jar file.
To run it, go to ``examples/JDBC/JDBCDemo/target`` and execute
<pre>java -jar jdbcChecker-SNAPSHOT-jar-with-dependencies.jar -host localhost</pre>

View File

@ -1,205 +0,0 @@
import java.sql.*;
public class TSDBSyncSample {
private static final String JDBC_PROTOCAL = "jdbc:TAOS://";
private static final String TSDB_DRIVER = "com.taosdata.jdbc.TSDBDriver";
private String host = "127.0.0.1";
private String user = "root";
private String password = "taosdata";
private int port = 0;
private String jdbcUrl = "";
private String databaseName = "db";
private String metricsName = "mt";
private String tablePrefix = "t";
private int tablesCount = 1;
private int loopCount = 2;
private int batchSize = 10;
private long beginTimestamp = 1519833600000L;
private long rowsInserted = 0;
static {
try {
Class.forName(TSDB_DRIVER);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* @param args
*/
public static void main(String[] args) {
TSDBSyncSample tester = new TSDBSyncSample();
tester.doReadArgument(args);
System.out.println("---------------------------------------------------------------");
System.out.println("Start testing...");
System.out.println("---------------------------------------------------------------");
tester.doMakeJdbcUrl();
tester.doCreateDbAndTable();
tester.doExecuteInsert();
tester.doExecuteQuery();
System.out.println("\n---------------------------------------------------------------");
System.out.println("Stop testing...");
System.out.println("---------------------------------------------------------------");
}
private void doReadArgument(String[] args) {
System.out.println("Arguments format: host tables loop batchs");
if (args.length >= 1) {
this.host = args[0];
}
if (args.length >= 2) {
this.tablesCount = Integer.parseInt(args[1]);
}
if (args.length >= 3) {
this.loopCount = Integer.parseInt(args[2]);
}
if (args.length >= 4) {
this.batchSize = Integer.parseInt(args[3]);
}
}
private void doMakeJdbcUrl() {
// jdbc:TSDB://127.0.0.1:0/dbname?user=root&password=taosdata
System.out.println("\nJDBC URL to use:");
this.jdbcUrl = String.format("%s%s:%d/%s?user=%s&password=%s", JDBC_PROTOCAL, this.host, this.port, "",
this.user, this.password);
System.out.println(this.jdbcUrl);
}
private void doCreateDbAndTable() {
System.out.println("\n---------------------------------------------------------------");
System.out.println("Start creating databases and tables...");
String sql = "";
try (Connection conn = DriverManager.getConnection(jdbcUrl);
Statement stmt = conn.createStatement()){
sql = "create database if not exists " + this.databaseName;
stmt.executeUpdate(sql);
System.out.printf("Successfully executed: %s\n", sql);
sql = "use " + this.databaseName;
stmt.executeUpdate(sql);
System.out.printf("Successfully executed: %s\n", sql);
sql = "create table if not exists " + this.metricsName + " (ts timestamp, v1 int) tags(t1 int)";
stmt.executeUpdate(sql);
System.out.printf("Successfully executed: %s\n", sql);
for (int i = 0; i < this.tablesCount; i++) {
sql = String.format("create table if not exists %s%d using %s tags(%d)", this.tablePrefix, i,
this.metricsName, i);
stmt.executeUpdate(sql);
System.out.printf("Successfully executed: %s\n", sql);
}
} catch (SQLException e) {
e.printStackTrace();
System.out.printf("Failed to execute SQL: %s\n", sql);
System.exit(4);
} catch (Exception e) {
e.printStackTrace();
System.exit(4);
}
System.out.println("Successfully created databases and tables");
}
public void doExecuteInsert() {
System.out.println("\n---------------------------------------------------------------");
System.out.println("Start inserting data...");
int start = (int) System.currentTimeMillis();
StringBuilder sql = new StringBuilder("");
try (Connection conn = DriverManager.getConnection(jdbcUrl);
Statement stmt = conn.createStatement()){
stmt.executeUpdate("use " + databaseName);
for (int loop = 0; loop < this.loopCount; loop++) {
for (int table = 0; table < this.tablesCount; ++table) {
sql = new StringBuilder("insert into ");
sql.append(this.tablePrefix).append(table).append(" values");
for (int batch = 0; batch < this.batchSize; ++batch) {
int rows = loop * this.batchSize + batch;
sql.append("(").append(this.beginTimestamp + rows).append(",").append(rows).append(")");
}
int affectRows = stmt.executeUpdate(sql.toString());
this.rowsInserted += affectRows;
}
}
} catch (SQLException e) {
e.printStackTrace();
System.out.printf("Failed to execute SQL: %s\n", sql.toString());
System.exit(4);
} catch (Exception e) {
e.printStackTrace();
System.exit(4);
}
int end = (int) System.currentTimeMillis();
System.out.println("Inserting completed!");
System.out.printf("Total %d rows inserted, %d rows failed, time spend %d seconds.\n", this.rowsInserted,
this.loopCount * this.batchSize - this.rowsInserted, (end - start) / 1000);
}
public void doExecuteQuery() {
System.out.println("\n---------------------------------------------------------------");
System.out.println("Starting querying data...");
ResultSet resSet = null;
StringBuilder sql = new StringBuilder("");
StringBuilder resRow = new StringBuilder("");
try (Connection conn = DriverManager.getConnection(jdbcUrl);
Statement stmt = conn.createStatement()){
stmt.executeUpdate("use " + databaseName);
for (int i = 0; i < this.tablesCount; ++i) {
sql = new StringBuilder("select * from ").append(this.tablePrefix).append(i);
resSet = stmt.executeQuery(sql.toString());
if (resSet == null) {
System.out.println(sql + " failed");
System.exit(4);
}
ResultSetMetaData metaData = resSet.getMetaData();
System.out.println("Retrieve metadata of " + tablePrefix + i);
for (int column = 1; column <= metaData.getColumnCount(); ++column) {
System.out.printf("Column%d: name = %s, type = %d, type name = %s, display size = %d\n", column, metaData.getColumnName(column), metaData.getColumnType(column),
metaData.getColumnTypeName(column), metaData.getColumnDisplaySize(column));
}
int rows = 0;
System.out.println("Retrieve data of " + tablePrefix + i);
while (resSet.next()) {
resRow = new StringBuilder();
for (int col = 1; col <= metaData.getColumnCount(); col++) {
resRow.append(metaData.getColumnName(col)).append("=").append(resSet.getObject(col))
.append(" ");
}
System.out.println(resRow.toString());
rows++;
}
try {
if (resSet != null)
resSet.close();
} catch (SQLException e) {
e.printStackTrace();
}
System.out.printf("Successfully executed query: %s;\nTotal rows returned: %d\n", sql.toString(), rows);
}
} catch (SQLException e) {
e.printStackTrace();
System.out.printf("Failed to execute query: %s\n", sql.toString());
System.exit(4);
} catch (Exception e) {
e.printStackTrace();
System.exit(4);
}
System.out.println("Query completed!");
}
}

View File

@ -5,7 +5,7 @@ import com.taosdata.jdbc.TSDBDriver;
import java.sql.*;
import java.util.Properties;
public class JDBCConnectorChecker {
public class JdbcChecker {
private static String host;
private static String dbName = "test";
private static String tbName = "weather";
@ -120,6 +120,7 @@ public class JDBCConnectorChecker {
printSql(sql, execute, (end - start));
} catch (SQLException e) {
e.printStackTrace();
}
}
@ -157,7 +158,7 @@ public class JDBCConnectorChecker {
return;
}
JDBCConnectorChecker checker = new JDBCConnectorChecker();
JdbcChecker checker = new JdbcChecker();
checker.init();
checker.createDatabase();
checker.useDatabase();

View File

@ -25,6 +25,7 @@ public class JdbcTaosdemo {
}
public static void main(String[] args) {
// parse config from args
JdbcTaosdemoConfig config = new JdbcTaosdemoConfig(args);
boolean isHelp = Arrays.asList(args).contains("--help");
@ -38,27 +39,51 @@ public class JdbcTaosdemo {
}
JdbcTaosdemo taosdemo = new JdbcTaosdemo(config);
// establish connection
taosdemo.init();
// drop database
taosdemo.dropDatabase();
// create database
taosdemo.createDatabase();
// use db
taosdemo.useDatabase();
// create super table
taosdemo.createSuperTable();
// create sub tables
taosdemo.createTableMultiThreads();
boolean infinite = Arrays.asList(args).contains("--infinite");
if (infinite) {
logger.info("!!! Infinite Insert Mode Started. !!!!");
logger.info("!!! Infinite Insert Mode Started. !!!");
taosdemo.insertInfinite();
} else {
// insert into table
taosdemo.insertMultiThreads();
// single table select
// select from sub table
taosdemo.selectFromTableLimit();
taosdemo.selectCountFromTable();
taosdemo.selectAvgMinMaxFromTable();
// super table select
// select last from
taosdemo.selectLastFromTable();
// select from super table
taosdemo.selectFromSuperTableLimit();
taosdemo.selectCountFromSuperTable();
taosdemo.selectAvgMinMaxFromSuperTable();
//select avg ,max from stb where tag
taosdemo.selectAvgMinMaxFromSuperTableWhereTag();
//select last from stb where location = ''
taosdemo.selectLastFromSuperTableWhere();
// select group by
taosdemo.selectGroupBy();
// select like
taosdemo.selectLike();
// select where ts >= ts<=
taosdemo.selectLastOneHour();
taosdemo.selectLastOneDay();
taosdemo.selectLastOneWeek();
taosdemo.selectLastOneMonth();
taosdemo.selectLastOneYear();
// drop super table
if (config.isDeleteTable())
taosdemo.dropSuperTable();
@ -196,6 +221,11 @@ public class JdbcTaosdemo {
executeQuery(sql);
}
private void selectLastFromTable() {
String sql = SqlSpeller.selectLastFromTableSQL(config.getDbName(), config.getTbPrefix(), 1);
executeQuery(sql);
}
private void selectFromSuperTableLimit() {
String sql = SqlSpeller.selectFromSuperTableLimitSQL(config.getDbName(), config.getStbName(), 10, 0);
executeQuery(sql);
@ -211,6 +241,52 @@ public class JdbcTaosdemo {
executeQuery(sql);
}
private void selectAvgMinMaxFromSuperTableWhereTag() {
String sql = SqlSpeller.selectAvgMinMaxFromSuperTableWhere("current", config.getDbName(), config.getStbName());
executeQuery(sql);
}
private void selectLastFromSuperTableWhere() {
String sql = SqlSpeller.selectLastFromSuperTableWhere("current", config.getDbName(), config.getStbName());
executeQuery(sql);
}
private void selectGroupBy() {
String sql = SqlSpeller.selectGroupBy("current", config.getDbName(), config.getStbName());
executeQuery(sql);
}
private void selectLike() {
String sql = SqlSpeller.selectLike(config.getDbName(), config.getStbName());
executeQuery(sql);
}
private void selectLastOneHour() {
String sql = SqlSpeller.selectLastOneHour(config.getDbName(), config.getStbName());
executeQuery(sql);
}
private void selectLastOneDay() {
String sql = SqlSpeller.selectLastOneDay(config.getDbName(), config.getStbName());
executeQuery(sql);
}
private void selectLastOneWeek() {
String sql = SqlSpeller.selectLastOneWeek(config.getDbName(), config.getStbName());
executeQuery(sql);
}
private void selectLastOneMonth() {
String sql = SqlSpeller.selectLastOneMonth(config.getDbName(), config.getStbName());
executeQuery(sql);
}
private void selectLastOneYear() {
String sql = SqlSpeller.selectLastOneYear(config.getDbName(), config.getStbName());
executeQuery(sql);
}
private void close() {
try {
if (connection != null) {
@ -241,6 +317,7 @@ public class JdbcTaosdemo {
long end = System.currentTimeMillis();
printSql(sql, execute, (end - start));
} catch (SQLException e) {
logger.error("ERROR execute SQL ===> " + sql);
logger.error(e.getMessage());
e.printStackTrace();
}
@ -258,6 +335,7 @@ public class JdbcTaosdemo {
printSql(sql, true, (end - start));
printResult(resultSet);
} catch (SQLException e) {
logger.error("ERROR execute SQL ===> " + sql);
logger.error(e.getMessage());
e.printStackTrace();
}

View File

@ -14,9 +14,9 @@ public final class JdbcTaosdemoConfig {
//Destination database. Default is 'test'
private String dbName = "test";
//keep
private int keep = 365 * 20;
private int keep = 3650;
//days
private int days = 30;
private int days = 10;
//Super table Name. Default is 'meters'
private String stbName = "meters";
@ -35,7 +35,7 @@ public final class JdbcTaosdemoConfig {
private boolean deleteTable = false;
public static void printHelp() {
System.out.println("Usage: java -jar JDBCConnectorChecker.jar [OPTION...]");
System.out.println("Usage: java -jar JdbcTaosDemo.jar [OPTION...]");
System.out.println("-h host The host to connect to TDengine. you must input one");
System.out.println("-p port The TCP/IP port number to use for the connection. Default is 6030");
System.out.println("-u user The TDengine user name to use when connecting to the server. Default is 'root'");

View File

@ -3,44 +3,49 @@ package com.taosdata.example.jdbcTaosdemo.task;
import com.taosdata.example.jdbcTaosdemo.domain.JdbcTaosdemoConfig;
import com.taosdata.example.jdbcTaosdemo.utils.ConnectionFactory;
import com.taosdata.example.jdbcTaosdemo.utils.SqlSpeller;
import com.taosdata.example.jdbcTaosdemo.utils.TimeStampUtil;
import org.apache.log4j.Logger;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.concurrent.atomic.AtomicLong;
import java.time.Duration;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
public class InsertTableTask implements Runnable {
private static final Logger logger = Logger.getLogger(InsertTableTask.class);
private static AtomicLong beginTimestamp = new AtomicLong(TimeStampUtil.datetimeToLong("2005-01-01 00:00:00.000"));
private final JdbcTaosdemoConfig config;
private final int startIndex;
private final int startTbIndex;
private final int tableNumber;
private final int recordsNumber;
private final int recordsNumberPerTable;
public InsertTableTask(JdbcTaosdemoConfig config, int startIndex, int tableNumber, int recordsNumber) {
public InsertTableTask(JdbcTaosdemoConfig config, int startTbIndex, int tableNumber, int recordsNumberPerTable) {
this.config = config;
this.startIndex = startIndex;
this.startTbIndex = startTbIndex;
this.tableNumber = tableNumber;
this.recordsNumber = recordsNumber;
this.recordsNumberPerTable = recordsNumberPerTable;
}
@Override
public void run() {
try {
Connection connection = ConnectionFactory.build(config);
int keep = config.getKeep();
Instant end = Instant.now();
Instant start = end.minus(Duration.ofDays(keep - 1));
long timeGap = ChronoUnit.MILLIS.between(start, end) / (recordsNumberPerTable - 1);
// iterate insert
for (int j = 0; j < recordsNumber; j++) {
long ts = beginTimestamp.getAndIncrement();
for (int j = 0; j < recordsNumberPerTable; j++) {
long ts = start.toEpochMilli() + (j * timeGap);
// insert data into echo table
for (int i = startIndex; i < startIndex + tableNumber; i++) {
for (int i = startTbIndex; i < startTbIndex + tableNumber; i++) {
String sql = SqlSpeller.insertOneRowSQL(config.getDbName(), config.getTbPrefix(), i + 1, ts);
logger.info(Thread.currentThread().getName() + ">>> " + sql);
Statement statement = connection.createStatement();
statement.execute(sql);
statement.close();
logger.info(Thread.currentThread().getName() + ">>> " + sql);
}
}
connection.close();

View File

@ -78,5 +78,49 @@ public class SqlSpeller {
return "select avg(" + field + "),min(" + field + "),max(" + field + ") from " + dbName + "." + stbName + "";
}
public static String selectLastFromTableSQL(String dbName, String tbPrefix, int tbIndex) {
return "select last(*) from " + dbName + "." + tbPrefix + "" + tbIndex;
}
//select avg ,max from stb where tag
public static String selectAvgMinMaxFromSuperTableWhere(String field, String dbName, String stbName) {
return "select avg(" + field + "),min(" + field + "),max(" + field + ") from " + dbName + "." + stbName + " where location = '" + locations[random.nextInt(locations.length)] + "'";
}
//select last from stb where
public static String selectLastFromSuperTableWhere(String field, String dbName, String stbName) {
return "select last(" + field + ") from " + dbName + "." + stbName + " where location = '" + locations[random.nextInt(locations.length)] + "'";
}
public static String selectGroupBy(String field, String dbName, String stbName) {
return "select avg(" + field + ") from " + dbName + "." + stbName + " group by location";
}
public static String selectLike(String dbName, String stbName) {
return "select * from " + dbName + "." + stbName + " where location like 'S%'";
}
public static String selectLastOneHour(String dbName, String stbName) {
return "select * from " + dbName + "." + stbName + " where ts >= now - 1h";
}
public static String selectLastOneDay(String dbName, String stbName) {
return "select * from " + dbName + "." + stbName + " where ts >= now - 1d";
}
public static String selectLastOneWeek(String dbName, String stbName) {
return "select * from " + dbName + "." + stbName + " where ts >= now - 1w";
}
public static String selectLastOneMonth(String dbName, String stbName) {
return "select * from " + dbName + "." + stbName + " where ts >= now - 1n";
}
public static String selectLastOneYear(String dbName, String stbName) {
return "select * from " + dbName + "." + stbName + " where ts >= now - 1y";
}
// select group by
// select like
// select ts >= ts<=
}

View File

@ -1,8 +1,10 @@
package com.taosdata.example.jdbcTaosdemo.utils;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.Instant;
import java.util.Date;
public class TimeStampUtil {
private static final String datetimeFormat = "yyyy-MM-dd HH:mm:ss.SSS";
@ -21,14 +23,14 @@ public class TimeStampUtil {
return sdf.format(new Date(time));
}
public static void main(String[] args) {
final String startTime = "2005-01-01 00:00:00.000";
public static void main(String[] args) throws ParseException {
// Instant now = Instant.now();
// System.out.println(now);
// Instant years20Ago = now.minus(Duration.ofDays(365));
// System.out.println(years20Ago);
long start = TimeStampUtil.datetimeToLong(startTime);
System.out.println(start);
String datetime = TimeStampUtil.longToDatetime(1519833600000L);
System.out.println(datetime);
}

View File

@ -0,0 +1,52 @@
package com.taosdata.example.jdbcTaosdemo.utils;
import org.junit.Test;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import static org.junit.Assert.*;
public class TimeStampUtilTest {
@Test
public void datetimeToLong() {
final String startTime = "2005-01-01 00:00:00.000";
long start = TimeStampUtil.datetimeToLong(startTime);
assertEquals(1104508800000l, start);
}
@Test
public void longToDatetime() {
String datetime = TimeStampUtil.longToDatetime(1510000000000L);
assertEquals("2017-11-07 04:26:40.000", datetime);
}
@Test
public void getStartDateTime() {
int keep = 365;
Instant end = Instant.now();
System.out.println(end.toString());
System.out.println(end.toEpochMilli());
Instant start = end.minus(Duration.ofDays(keep));
System.out.println(start.toString());
System.out.println(start.toEpochMilli());
int numberOfRecordsPerTable = 10;
long timeGap = ChronoUnit.MILLIS.between(start, end) / (numberOfRecordsPerTable - 1);
System.out.println(timeGap);
System.out.println("===========================");
for (int i = 0; i < numberOfRecordsPerTable; i++) {
long ts = start.toEpochMilli() + (i * timeGap);
System.out.println(i + " : " + ts);
}
}
}

View File

@ -0,0 +1,60 @@
const taos = require('td2.0-connector');
var host = null;
var port = 6030;
for(var i = 2; i < global.process.argv.length; i++){
var key = global.process.argv[i].split("=")[0];
var value = global.process.argv[i].split("=")[1];
if("host" == key){
host = value;
}
if("port" == key){
port = value;
}
}
if(host == null){
console.log("Usage: node nodejsChecker.js host=<hostname> port=<port>");
process.exit(0);
}
// establish connection
var conn = taos.connect({host:host, user:"root", password:"taosdata",port:port});
var cursor = conn.cursor();
// create database
executeSql("create database if not exists test", 0);
// use db
executeSql("use test", 0);
// drop table
executeSql("drop table if exists test.weather", 0);
// create table
executeSql("create table if not exists test.weather(ts timestamp, temperature float, humidity int)", 0);
// insert
executeSql("insert into test.weather (ts, temperature, humidity) values(now, 20.5, 34)", 1);
// select
executeQuery("select * from test.weather");
// close connection
conn.close();
function executeQuery(sql){
var start = new Date().getTime();
var promise = cursor.query(sql, true);
var end = new Date().getTime();
printSql(sql, promise != null,(end - start));
promise.then(function(result){
result.pretty();
});
}
function executeSql(sql, affectRows){
var start = new Date().getTime();
var promise = cursor.execute(sql);
var end = new Date().getTime();
printSql(sql, promise == affectRows, (end - start));
}
function printSql(sql, succeed, cost){
console.log("[ "+(succeed ? "OK" : "ERROR!")+" ] time cost: " + cost + " ms, execute statement ====> " + sql);
}

View File

@ -0,0 +1,114 @@
import taos
import time
import sys
import getopt
class ConnectorChecker:
def init(self):
self.host = "127.0.0.1"
self.dbName = "test"
self.tbName = "weather"
self.user = "root"
self.password = "taosdata"
def sethdt(self,FQDN,dbname,tbname):
if(FQDN):
self.host=FQDN
if(dbname):
self.dbname=dbname
if(tbname):
self.tbName
def printSql(self,sql,elapsed):
print("[ "+"OK"+" ]"+" time cost: %s ms, execute statement ====> %s"
%(elapsed,sql))
def executeQuery(self,sql):
try:
start=time.time()
execute = self.cl.execute(sql)
elapsed = (time.time()-start)*1000
self.printSql(sql,elapsed)
data = self.cl.fetchall()
numOfRows = self.cl.rowcount
numOfCols = len(self.cl.description)
for irow in range(numOfRows):
print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2]))
except Exception as e:
print("Failure sql: %s,exception: %s" %sql,str(e))
def execute(self,sql):
try:
start=time.time()
execute = self.cl.execute(sql)
elapsed = (time.time()-start)*1000
self.printSql(sql,elapsed)
except Exception as e:
print("Failure sql: %s,exception: %s" %
sql,str(e))
def close(self):
print("connetion closed.")
self.cl.close()
self.conn.close()
def createDatabase(self):
sql="create database if not exists %s" % self.dbName
self.execute(sql)
def useDatabase(self):
sql="use %s" % self.dbName
self.execute(sql)
def createTable(self):
sql="create table if not exists %s.%s (ts timestamp, temperature float, humidity int)"%(self.dbName,self.tbName)
self.execute(sql)
def checkDropTable(self):
sql="drop table if exists " + self.dbName + "." + self.tbName + ""
self.execute(sql)
def checkInsert(self):
sql="insert into test.weather (ts, temperature, humidity) values(now, 20.5, 34)"
self.execute(sql)
def checkSelect(self):
sql = "select * from test.weather"
self.executeQuery(sql)
def srun(self):
try:
self.conn = taos.connect(host=self.host,user=self.user,password=self.password)
#self.conn = taos.connect(self.host,self.user,self.password)
except Exception as e:
print("connection failed: %s"%self.host)
exit(1)
print("[ OK ] Connection established.")
self.cl = self.conn.cursor()
def main(argv):
FQDN=''
dbname=''
tbname=''
try:
opts, args = getopt.getopt(argv,"h:d:t:",["FQDN=","ifile=","ofile="])
except getopt.GetoptError:
print ('PYTHONConnectorChecker.py -h <FQDN>')
sys.exit(2)
for opt, arg in opts:
if opt in ("-h", "--FQDN"):
FQDN=arg
elif opt in ("-d", "--dbname"):
dbname = arg
elif opt in ("-t", "--tbname"):
tbname = arg
checker = ConnectorChecker()
checker.init()
checker.sethdt(FQDN,dbname,tbname)
checker.srun()
checker.createDatabase()
checker.useDatabase()
checker.checkDropTable()
checker.createTable()
checker.checkInsert()
checker.checkSelect()
checker.checkDropTable()
checker.close()
if __name__ == "__main__":
main(sys.argv[1:])

View File

@ -0,0 +1,17 @@
@echo off
echo ==== start Go connector test cases test ====
cd /d %~dp0
set severIp=%1
set serverPort=%2
if "%severIp%"=="" (set severIp=127.0.0.1)
if "%serverPort%"=="" (set serverPort=6030)
cd case001
case001.bat %severIp% %serverPort%
rem cd case002
rem case002.bat
:: cd case002
:: case002.bat

View File

@ -1,5 +1,18 @@
#!/bin/bash
bash ./case001/case001.sh
#bash ./case002/case002.sh
#bash ./case003/case003.sh
echo "==== start Go connector test cases test ===="
severIp=$1
serverPort=$2
if [ ! -n "$severIp" ]; then
severIp=127.0.0.1
fi
if [ ! -n "$serverPort" ]; then
serverPort=6030
fi
bash ./case001/case001.sh $severIp $serverPort
#bash ./case002/case002.sh $severIp $serverPort
#bash ./case003/case003.sh $severIp $serverPort

View File

@ -0,0 +1,9 @@
@echo off
echo ==== start run cases001.go
del go.*
go mod init demotest
go build
demotest.exe -h %1 -p %2
cd ..

View File

@ -16,20 +16,53 @@ package main
import (
"database/sql"
"flag"
"fmt"
_ "github.com/taosdata/driver-go/taosSql"
"log"
"strconv"
"time"
)
type config struct {
hostName string
serverPort int
user string
password string
}
var configPara config
var url string
func init() {
flag.StringVar(&configPara.hostName, "h", "127.0.0.1","The host to connect to TDengine server.")
flag.IntVar(&configPara.serverPort, "p", 6030, "The TCP/IP port number to use for the connection to TDengine server.")
flag.StringVar(&configPara.user, "u", "root", "The TDengine user name to use when connecting to the server.")
flag.StringVar(&configPara.password, "P", "taosdata", "The password to use when connecting to the server.")
flag.Parse()
}
func printAllArgs() {
fmt.Printf("\n============= args parse result: =============\n")
fmt.Printf("hostName: %v\n", configPara.hostName)
fmt.Printf("serverPort: %v\n", configPara.serverPort)
fmt.Printf("usr: %v\n", configPara.user)
fmt.Printf("password: %v\n", configPara.password)
fmt.Printf("================================================\n")
}
func main() {
printAllArgs()
taosDriverName := "taosSql"
demodb := "demodb"
demot := "demot"
fmt.Printf("\n======== start demo test ========\n")
url = "root:taosdata@/tcp(" + configPara.hostName + ":" + strconv.Itoa(configPara.serverPort) + ")/"
// open connect to taos server
db, err := sql.Open(taosDriverName, "root:taosdata@/tcp(192.168.1.217:7100)/")
db, err := sql.Open(taosDriverName, url)
if err != nil {
log.Fatalf("Open database error: %s\n", err)
}

View File

@ -1,10 +1,6 @@
#!/bin/bash
##################################################
#
# Do go test
#
##################################################
echo "==== start run cases001.go"
set +e
#set -x
@ -12,59 +8,14 @@ set +e
script_dir="$(dirname $(readlink -f $0))"
#echo "pwd: $script_dir, para0: $0"
execName=$0
execName=`echo ${execName##*/}`
goName=`echo ${execName%.*}`
###### step 1: start one taosd
scriptDir=$script_dir/../../script/sh
bash $scriptDir/stop_dnodes.sh
bash $scriptDir/deploy.sh -n dnode1 -i 1
bash $scriptDir/cfg.sh -n dnode1 -c walLevel -v 0
bash $scriptDir/exec.sh -n dnode1 -s start
###### step 2: set config item
TAOS_CFG=/etc/taos/taos.cfg
HOSTNAME=`hostname -f`
if [ ! -f ${TAOS_CFG} ]; then
touch -f $TAOS_CFG
fi
echo " " > $TAOS_CFG
echo "firstEp ${HOSTNAME}:7100" >> $TAOS_CFG
echo "secondEp ${HOSTNAME}:7200" >> $TAOS_CFG
echo "serverPort 7100" >> $TAOS_CFG
#echo "dataDir $DATA_DIR" >> $TAOS_CFG
#echo "logDir $LOG_DIR" >> $TAOS_CFG
#echo "scriptDir ${CODE_DIR}/../script" >> $TAOS_CFG
echo "numOfLogLines 100000000" >> $TAOS_CFG
echo "dDebugFlag 135" >> $TAOS_CFG
echo "mDebugFlag 135" >> $TAOS_CFG
echo "sdbDebugFlag 135" >> $TAOS_CFG
echo "rpcDebugFlag 135" >> $TAOS_CFG
echo "tmrDebugFlag 131" >> $TAOS_CFG
echo "cDebugFlag 135" >> $TAOS_CFG
echo "httpDebugFlag 135" >> $TAOS_CFG
echo "monitorDebugFlag 135" >> $TAOS_CFG
echo "udebugFlag 135" >> $TAOS_CFG
echo "tablemetakeeptimer 5" >> $TAOS_CFG
echo "wal 0" >> $TAOS_CFG
echo "asyncLog 0" >> $TAOS_CFG
echo "locale en_US.UTF-8" >> $TAOS_CFG
echo "enableCoreFile 1" >> $TAOS_CFG
echo " " >> $TAOS_CFG
ulimit -n 600000
ulimit -c unlimited
#
##sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e
#
#execName=$0
#execName=`echo ${execName##*/}`
#goName=`echo ${execName%.*}`
###### step 3: start build
cd $script_dir
rm -f go.*
go mod init $goName
go mod init demotest
go build
sleep 1s
sudo ./$goName
sleep 1s
./demotest -h $1 -p $2

View File

@ -27,6 +27,7 @@ query_sql = [
"select count(*) from test.meters where t7 like 'fi%';",
"select count(*) from test.meters where t7 like '_econd';",
"select count(*) from test.meters interval(1n) order by ts desc;",
"select max(c0) from test.meters group by tbname",
"select first(*) from test.meters;",
"select last(*) from test.meters;",
"select last_row(*) from test.meters;",
@ -56,6 +57,12 @@ query_sql = [
"select stddev(c6) from test.t1;",
"select sum(c6) from test.meters;",
"select top(c6, 2) from test.meters;",
#all vnode
"select count(*) from test.meters where t5 >2500 and t5<7500",
"select max(c0),avg(c1) from test.meters where t5 >2500 and t5<7500",
"select sum(c5),avg(c1) from test.meters where t5 >2500 and t5<7500",
"select max(c0),min(c6) from test.meters where t5 >2500 and t5<7500",
"select min(c0),avg(c6) from test.meters where t5 >2500 and t5<7500",
# second supertable
"select count(*) from test.meters1 where c1 > 50;",
"select count(*) from test.meters1 where c2 >= 50 and c2 < 100;",
@ -65,6 +72,7 @@ query_sql = [
"select count(*) from test.meters1 where t7 like 'fi%';",
"select count(*) from test.meters1 where t7 like '_econd';",
"select count(*) from test.meters1 interval(1n) order by ts desc;",
"select max(c0) from test.meters1 group by tbname",
"select first(*) from test.meters1;",
"select last(*) from test.meters1;",
"select last_row(*) from test.meters1;",
@ -93,7 +101,19 @@ query_sql = [
"select spread(c6) from test.m1 ;",
"select stddev(c6) from test.m1;",
"select sum(c6) from test.meters1;",
"select top(c6, 2) from test.meters1;"
"select top(c6, 2) from test.meters1;",
"select count(*) from test.meters1 where t5 >2500 and t5<7500",
#all vnode
"select count(*) from test.meters1 where t5 >2500 and t5<7500",
"select max(c0),avg(c1) from test.meters1 where t5 >2500 and t5<7500",
"select sum(c5),avg(c1) from test.meters1 where t5 >2500 and t5<7500",
"select max(c0),min(c6) from test.meters1 where t5 >2500 and t5<7500",
"select min(c0),avg(c6) from test.meters1 where t5 >2500 and t5<7500",
#join
"select * from meters,meters1 where meters.ts = meters1.ts and meters.t5 = meters1.t5",
"select * from meters,meters1 where meters.ts = meters1.ts and meters.t7 = meters1.t7",
"select * from meters,meters1 where meters.ts = meters1.ts and meters.t8 = meters1.t8",
"select meters.ts,meters1.c2 from meters,meters1 where meters.ts = meters1.ts and meters.t8 = meters1.t8"
]
class ConcurrentInquiry:
@ -112,6 +132,7 @@ class ConcurrentInquiry:
password,
)
cl = conn.cursor()
cl.execute("use test;")
print("Thread %d: starting" % threadID)

View File

@ -0,0 +1,80 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import taos
from util.log import tdLog
from util.cases import tdCases
from util.sql import tdSql
from util.dnodes import tdDnodes
class TDTestCase:
"""
add test data before 1970s
"""
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
print("==============step1")
tdSql.execute("create database if not exists demo keep 36500;");
print("==============create db demo keep 365000 days")
tdSql.execute("use demo;")
tdSql.execute("CREATE table if not exists test (ts timestamp, f1 int);")
print("==============create table test")
print("==============step2")
#TODO : should add more testcases
tdSql.execute("insert into test values('1930-12-12 01:19:20.345', 1);")
tdSql.execute("insert into test values('1969-12-30 23:59:59.999', 2);")
tdSql.execute("insert into test values(-3600, 3);")
tdSql.execute("insert into test values('2020-10-20 14:02:53.770', 4);")
print("==============insert data")
# tdSql.query("select * from test;")
#
# tdSql.checkRows(3)
#
# tdSql.checkData(0,0,'1969-12-12 01:19:20.345000')
# tdSql.checkData(1,0,'1970-01-01 07:00:00.000000')
# tdSql.checkData(2,0,'2020-10-20 14:02:53.770000')
print("==============step3")
tdDnodes.stopAll()
tdDnodes.start(1)
print("==============restart taosd")
print("==============step4")
tdSql.execute("use demo;")
tdSql.query("select * from test;")
# print(tdSql.queryResult)
tdSql.checkRows(4)
tdSql.checkData(0,0,'1930-12-12 01:19:20.345000')
tdSql.checkData(1,0,'1969-12-30 23:59:59.999000')
tdSql.checkData(2,0,'1970-01-01 07:00:00.000000')
tdSql.checkData(3,0,'2020-10-20 14:02:53.770000')
print("==============check data")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -0,0 +1,70 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import taos
from util.log import tdLog
from util.cases import tdCases
from util.sql import tdSql
from util.dnodes import tdDnodes
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
print("==============step1")
tdSql.execute("create database db_vplu");
tdSql.execute("use db_vplu")
tdSql.execute("CREATE table if not exists st (ts timestamp, speed int) tags(id int)")
tdSql.execute("CREATE table if not exists st_vplu (ts timestamp, speed int) tags(id int)")
print("==============step2")
tdSql.execute("drop table st")
tdSql.query("show stables")
tdSql.checkRows(1)
tdSql.checkData(0, 0, "st_vplu")
tdDnodes.stopAll()
tdDnodes.start(1)
tdSql.execute("use db_vplu")
tdSql.query("show stables")
tdSql.checkRows(1)
tdSql.checkData(0, 0, "st_vplu")
tdSql.execute("drop database db")
tdSql.query("show databases")
tdSql.checkRows(1)
tdSql.checkData(0, 0, "db_vplu")
tdDnodes.stopAll()
tdDnodes.start(1)
tdSql.query("show databases")
tdSql.checkRows(1)
tdSql.checkData(0, 0, "db_vplu")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -0,0 +1,75 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import taos
from util.log import tdLog
from util.cases import tdCases
from util.sql import tdSql
from util.dnodes import tdDnodes
class TDTestCase:
"""
remove last tow bytes of file 'wal0',then restart taosd and create new tables.
"""
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
print("==============step1")
tdSql.execute("create database if not exists demo;");
tdSql.execute("use demo;")
tdSql.execute("create table if not exists meters(ts timestamp, f1 int) tags(t1 int);");
for i in range(1,11):
tdSql.execute("CREATE table if not exists test{num} using meters tags({num});".format(num=i))
print("==============insert 10 tables")
tdSql.query('show tables;')
tdSql.checkRows(10)
print("==============step2")
tdDnodes.stopAll()
filename = '/var/lib/taos/mnode/wal/wal0'
with open(filename, 'rb') as f1:
temp = f1.read()
with open(filename, 'wb') as f2:
f2.write(temp[:-2])
tdDnodes.start(1)
print("==============remove last tow bytes of file 'wal0' and restart taosd")
print("==============step3")
tdSql.execute("use demo;")
tdSql.query('show tables;')
tdSql.checkRows(10)
for i in range(11,21):
tdSql.execute("CREATE table if not exists test{num} using meters tags({num});".format(num=i))
tdSql.query('show tables;')
tdSql.checkRows(20)
print("==============check table numbers and create 10 tables")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -199,4 +199,7 @@
./test.sh -f unique/dnode/vnode_clean.sim
./test.sh -f unique/http/admin.sim
./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim

View File

@ -81,3 +81,10 @@ cd ../../../debug; make
./test.sh -f unique/db/replica_reduce32.sim
./test.sh -f unique/db/replica_reduce31.sim
./test.sh -f unique/db/replica_part.sim
./test.sh -f unique/vnode/many.sim
./test.sh -f unique/vnode/replica2_basic2.sim
./test.sh -f unique/vnode/replica2_repeat.sim
./test.sh -f unique/vnode/replica3_basic.sim
./test.sh -f unique/vnode/replica3_repeat.sim
./test.sh -f unique/vnode/replica3_vgroup.sim

View File

@ -1,5 +1,3 @@
./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim
./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim
@ -21,12 +19,7 @@
./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim
./test.sh -f unique/vnode/many.sim
./test.sh -f unique/vnode/replica2_basic2.sim
./test.sh -f unique/vnode/replica2_repeat.sim
./test.sh -f unique/vnode/replica3_basic.sim
./test.sh -f unique/vnode/replica3_repeat.sim
./test.sh -f unique/vnode/replica3_vgroup.sim
./test.sh -f general/parser/stream_on_sys.sim
./test.sh -f general/stream/metrics_del.sim