Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4fd2fb06
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4fd2fb06
编写于
6月 02, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
d5a5dcf9
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
25 addition
and
17 deletion
+25
-17
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+2
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-0
source/client/src/clientMain.c
source/client/src/clientMain.c
+15
-10
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+3
-4
source/libs/scheduler/src/schJob.c
source/libs/scheduler/src/schJob.c
+2
-2
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+2
-1
未找到文件。
source/client/inc/clientInt.h
浏览文件 @
4fd2fb06
...
@@ -46,6 +46,8 @@ extern "C" {
...
@@ -46,6 +46,8 @@ extern "C" {
#define ERROR_MSG_BUF_DEFAULT_SIZE 512
#define ERROR_MSG_BUF_DEFAULT_SIZE 512
#define HEARTBEAT_INTERVAL 1500 // ms
#define HEARTBEAT_INTERVAL 1500 // ms
#define SYNC_ON_TOP_OF_ASYNC 0
enum
{
enum
{
RES_TYPE__QUERY
=
1
,
RES_TYPE__QUERY
=
1
,
RES_TYPE__TMQ
,
RES_TYPE__TMQ
,
...
...
source/client/src/clientImpl.c
浏览文件 @
4fd2fb06
...
@@ -1083,6 +1083,7 @@ void* doAsyncFetchRow(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUc
...
@@ -1083,6 +1083,7 @@ void* doAsyncFetchRow(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUc
SSyncQueryParam
*
pParam
=
pRequest
->
body
.
param
;
SSyncQueryParam
*
pParam
=
pRequest
->
body
.
param
;
taos_fetch_rows_a
(
pRequest
,
syncFetchFn
,
pParam
);
taos_fetch_rows_a
(
pRequest
,
syncFetchFn
,
pParam
);
tsem_wait
(
&
pParam
->
sem
);
}
}
if
(
setupOneRowPtr
)
{
if
(
setupOneRowPtr
)
{
...
...
source/client/src/clientMain.c
浏览文件 @
4fd2fb06
...
@@ -189,7 +189,16 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) {
...
@@ -189,7 +189,16 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) {
}
}
STscObj
*
pTscObj
=
(
STscObj
*
)
taos
;
STscObj
*
pTscObj
=
(
STscObj
*
)
taos
;
#if 0
#if SYNC_ON_TOP_OF_ASYNC
SSyncQueryParam
*
param
=
taosMemoryCalloc
(
1
,
sizeof
(
struct
SSyncQueryParam
));
tsem_init
(
&
param
->
sem
,
0
,
0
);
taos_query_a
(
pTscObj
,
sql
,
syncQueryFn
,
param
);
tsem_wait
(
&
param
->
sem
);
return
param
->
pRequest
;
#else
size_t
sqlLen
=
strlen
(
sql
);
size_t
sqlLen
=
strlen
(
sql
);
if
(
sqlLen
>
(
size_t
)
TSDB_MAX_ALLOWED_SQL_LEN
)
{
if
(
sqlLen
>
(
size_t
)
TSDB_MAX_ALLOWED_SQL_LEN
)
{
tscError
(
"sql string exceeds max length:%d"
,
TSDB_MAX_ALLOWED_SQL_LEN
);
tscError
(
"sql string exceeds max length:%d"
,
TSDB_MAX_ALLOWED_SQL_LEN
);
...
@@ -199,14 +208,6 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) {
...
@@ -199,14 +208,6 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) {
return
execQuery
(
pTscObj
,
sql
,
sqlLen
);
return
execQuery
(
pTscObj
,
sql
,
sqlLen
);
#endif
#endif
SSyncQueryParam
*
param
=
taosMemoryCalloc
(
1
,
sizeof
(
struct
SSyncQueryParam
));
tsem_init
(
&
param
->
sem
,
0
,
0
);
taos_query_a
(
pTscObj
,
sql
,
syncQueryFn
,
param
);
tsem_wait
(
&
param
->
sem
);
return
param
->
pRequest
;
}
}
TAOS_ROW
taos_fetch_row
(
TAOS_RES
*
res
)
{
TAOS_ROW
taos_fetch_row
(
TAOS_RES
*
res
)
{
...
@@ -221,8 +222,12 @@ TAOS_ROW taos_fetch_row(TAOS_RES *res) {
...
@@ -221,8 +222,12 @@ TAOS_ROW taos_fetch_row(TAOS_RES *res) {
return
NULL
;
return
NULL
;
}
}
#if SYNC_ON_TOP_OF_ASYNC
return
doAsyncFetchRow
(
pRequest
,
true
,
true
);
return
doAsyncFetchRow
(
pRequest
,
true
,
true
);
// return doFetchRows(pRequest, true, true);
#else
return
doFetchRows
(
pRequest
,
true
,
true
);
#endif
}
else
if
(
TD_RES_TMQ
(
res
))
{
}
else
if
(
TD_RES_TMQ
(
res
))
{
SMqRspObj
*
msg
=
((
SMqRspObj
*
)
res
);
SMqRspObj
*
msg
=
((
SMqRspObj
*
)
res
);
SReqResultInfo
*
pResultInfo
;
SReqResultInfo
*
pResultInfo
;
...
...
source/client/test/clientTests.cpp
浏览文件 @
4fd2fb06
...
@@ -94,7 +94,7 @@ TEST(testCase, driverInit_Test) {
...
@@ -94,7 +94,7 @@ TEST(testCase, driverInit_Test) {
// taosInitGlobalCfg();
// taosInitGlobalCfg();
// taos_init();
// taos_init();
}
}
#if 0
TEST
(
testCase
,
connect_Test
)
{
TEST
(
testCase
,
connect_Test
)
{
// taos_options(TSDB_OPTION_CONFIGDIR, "/home/ubuntu/first/cfg");
// taos_options(TSDB_OPTION_CONFIGDIR, "/home/ubuntu/first/cfg");
...
@@ -645,7 +645,7 @@ TEST(testCase, projection_query_tables) {
...
@@ -645,7 +645,7 @@ TEST(testCase, projection_query_tables) {
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
for(int32_t i = 0; i < 10000
00
; i += 20) {
for
(
int32_t
i
=
0
;
i
<
10000
;
i
+=
20
)
{
char
sql
[
1024
]
=
{
0
};
char
sql
[
1024
]
=
{
0
};
sprintf
(
sql
,
sprintf
(
sql
,
"insert into tu values(now+%da, %d)(now+%da, %d)(now+%da, %d)(now+%da, %d)"
"insert into tu values(now+%da, %d)(now+%da, %d)(now+%da, %d)(now+%da, %d)"
...
@@ -772,10 +772,9 @@ TEST(testCase, agg_query_tables) {
...
@@ -772,10 +772,9 @@ TEST(testCase, agg_query_tables) {
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
taos_close
(
pConn
);
taos_close
(
pConn
);
}
}
#endif
/*
/*
--- copy the following script in the shell to setup the environment
.
--- copy the following script in the shell to setup the environment
---
create database test;
create database test;
use test;
use test;
...
...
source/libs/scheduler/src/schJob.c
浏览文件 @
4fd2fb06
...
@@ -21,9 +21,9 @@
...
@@ -21,9 +21,9 @@
#include "tref.h"
#include "tref.h"
#include "trpc.h"
#include "trpc.h"
FORCE_INLINE
SSchJob
*
schAcquireJob
(
int64_t
refId
)
{
return
(
SSchJob
*
)
taosAcquireRef
(
schMgmt
.
jobRef
,
refId
);
}
FORCE_INLINE
SSchJob
*
schAcquireJob
(
int64_t
refId
)
{
qDebug
(
"acquire job:0x%"
PRIx64
,
refId
);
return
(
SSchJob
*
)
taosAcquireRef
(
schMgmt
.
jobRef
,
refId
);
}
FORCE_INLINE
int32_t
schReleaseJob
(
int64_t
refId
)
{
return
taosReleaseRef
(
schMgmt
.
jobRef
,
refId
);
}
FORCE_INLINE
int32_t
schReleaseJob
(
int64_t
refId
)
{
qDebug
(
"release job:0x%"
PRIx64
,
refId
);
return
taosReleaseRef
(
schMgmt
.
jobRef
,
refId
);
}
int32_t
schInitTask
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
SSubplan
*
pPlan
,
SSchLevel
*
pLevel
)
{
int32_t
schInitTask
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
SSubplan
*
pPlan
,
SSchLevel
*
pLevel
)
{
pTask
->
plan
=
pPlan
;
pTask
->
plan
=
pPlan
;
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
4fd2fb06
...
@@ -124,7 +124,8 @@ int32_t schedulerAsyncFetchRows(int64_t job, schedulerFetchCallback fp, void* pa
...
@@ -124,7 +124,8 @@ int32_t schedulerAsyncFetchRows(int64_t job, schedulerFetchCallback fp, void* pa
SSchJob
*
pJob
=
schAcquireJob
(
job
);
SSchJob
*
pJob
=
schAcquireJob
(
job
);
if
(
NULL
==
pJob
)
{
if
(
NULL
==
pJob
)
{
qError
(
"acquire job from jobRef list failed, may be dropped, refId:%"
PRIx64
,
job
);
qError
(
"acquire job from jobRef list failed, may be dropped, refId:%"
PRIx64
,
job
);
SCH_ERR_RET
(
TSDB_CODE_SCH_STATUS_ERROR
);
fp
(
NULL
,
param
,
TSDB_CODE_SCH_STATUS_ERROR
);
return
TSDB_CODE_SCH_STATUS_ERROR
;
}
}
pJob
->
attr
.
syncSchedule
=
false
;
pJob
->
attr
.
syncSchedule
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录