Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
047955ab
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
047955ab
编写于
11月 08, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change int to int32
上级
a194ea05
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
11 deletion
+12
-11
src/cq/src/cqMain.c
src/cq/src/cqMain.c
+7
-7
src/inc/tcq.h
src/inc/tcq.h
+3
-3
src/inc/twal.h
src/inc/twal.h
+2
-1
未找到文件。
src/cq/src/cqMain.c
浏览文件 @
047955ab
...
@@ -39,16 +39,16 @@
...
@@ -39,16 +39,16 @@
#define cTrace(...) { if (cqDebugFlag & DEBUG_TRACE) { taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__); }}
#define cTrace(...) { if (cqDebugFlag & DEBUG_TRACE) { taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__); }}
typedef
struct
{
typedef
struct
{
int
vgId
;
int
32_t
vgId
;
char
user
[
TSDB_USER_LEN
];
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_PASSWORD_LEN
];
char
pass
[
TSDB_PASSWORD_LEN
];
char
db
[
TSDB_DB_NAME_LEN
];
char
db
[
TSDB_DB_NAME_LEN
];
FCqWrite
cqWrite
;
FCqWrite
cqWrite
;
void
*
ahandle
;
void
*
ahandle
;
int
num
;
// number of continuous streams
int
32_t
num
;
// number of continuous streams
struct
SCqObj
*
pHead
;
struct
SCqObj
*
pHead
;
void
*
dbConn
;
void
*
dbConn
;
int
master
;
int
32_t
master
;
void
*
tmrCtrl
;
void
*
tmrCtrl
;
pthread_mutex_t
mutex
;
pthread_mutex_t
mutex
;
}
SCqContext
;
}
SCqContext
;
...
@@ -57,7 +57,7 @@ typedef struct SCqObj {
...
@@ -57,7 +57,7 @@ typedef struct SCqObj {
tmr_h
tmrId
;
tmr_h
tmrId
;
uint64_t
uid
;
uint64_t
uid
;
int32_t
tid
;
// table ID
int32_t
tid
;
// table ID
int
rowSize
;
// bytes of a row
int
32_t
rowSize
;
// bytes of a row
char
*
sqlStr
;
// SQL string
char
*
sqlStr
;
// SQL string
STSchema
*
pSchema
;
// pointer to schema array
STSchema
*
pSchema
;
// pointer to schema array
void
*
pStream
;
void
*
pStream
;
...
@@ -175,7 +175,7 @@ void cqStop(void *handle) {
...
@@ -175,7 +175,7 @@ void cqStop(void *handle) {
pthread_mutex_unlock
(
&
pContext
->
mutex
);
pthread_mutex_unlock
(
&
pContext
->
mutex
);
}
}
void
*
cqCreate
(
void
*
handle
,
uint64_t
uid
,
int
tid
,
char
*
sqlStr
,
STSchema
*
pSchema
)
{
void
*
cqCreate
(
void
*
handle
,
uint64_t
uid
,
int
32_t
tid
,
char
*
sqlStr
,
STSchema
*
pSchema
)
{
SCqContext
*
pContext
=
handle
;
SCqContext
*
pContext
=
handle
;
SCqObj
*
pObj
=
calloc
(
sizeof
(
SCqObj
),
1
);
SCqObj
*
pObj
=
calloc
(
sizeof
(
SCqObj
),
1
);
...
@@ -237,7 +237,7 @@ void cqDrop(void *handle) {
...
@@ -237,7 +237,7 @@ void cqDrop(void *handle) {
pthread_mutex_unlock
(
&
pContext
->
mutex
);
pthread_mutex_unlock
(
&
pContext
->
mutex
);
}
}
static
void
doCreateStream
(
void
*
param
,
TAOS_RES
*
result
,
int
code
)
{
static
void
doCreateStream
(
void
*
param
,
TAOS_RES
*
result
,
int
32_t
code
)
{
SCqObj
*
pObj
=
(
SCqObj
*
)
param
;
SCqObj
*
pObj
=
(
SCqObj
*
)
param
;
SCqContext
*
pContext
=
pObj
->
pContext
;
SCqContext
*
pContext
=
pObj
->
pContext
;
SSqlObj
*
pSql
=
(
SSqlObj
*
)
result
;
SSqlObj
*
pSql
=
(
SSqlObj
*
)
result
;
...
@@ -288,7 +288,7 @@ static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
...
@@ -288,7 +288,7 @@ static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
cDebug
(
"vgId:%d, id:%d CQ:%s stream result is ready"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
cDebug
(
"vgId:%d, id:%d CQ:%s stream result is ready"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
int
size
=
sizeof
(
SWalHead
)
+
sizeof
(
SSubmitMsg
)
+
sizeof
(
SSubmitBlk
)
+
TD_DATA_ROW_HEAD_SIZE
+
pObj
->
rowSize
;
int
32_t
size
=
sizeof
(
SWalHead
)
+
sizeof
(
SSubmitMsg
)
+
sizeof
(
SSubmitBlk
)
+
TD_DATA_ROW_HEAD_SIZE
+
pObj
->
rowSize
;
char
*
buffer
=
calloc
(
size
,
1
);
char
*
buffer
=
calloc
(
size
,
1
);
SWalHead
*
pHead
=
(
SWalHead
*
)
buffer
;
SWalHead
*
pHead
=
(
SWalHead
*
)
buffer
;
...
...
src/inc/tcq.h
浏览文件 @
047955ab
...
@@ -24,7 +24,7 @@ extern "C" {
...
@@ -24,7 +24,7 @@ extern "C" {
typedef
int32_t
(
*
FCqWrite
)(
void
*
ahandle
,
void
*
pHead
,
int32_t
qtype
,
void
*
pMsg
);
typedef
int32_t
(
*
FCqWrite
)(
void
*
ahandle
,
void
*
pHead
,
int32_t
qtype
,
void
*
pMsg
);
typedef
struct
{
typedef
struct
{
int
vgId
;
int
32_t
vgId
;
char
user
[
TSDB_USER_LEN
];
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_PASSWORD_LEN
];
char
pass
[
TSDB_PASSWORD_LEN
];
char
db
[
TSDB_DB_NAME_LEN
];
char
db
[
TSDB_DB_NAME_LEN
];
...
@@ -42,12 +42,12 @@ void cqStart(void *handle);
...
@@ -42,12 +42,12 @@ void cqStart(void *handle);
void
cqStop
(
void
*
handle
);
void
cqStop
(
void
*
handle
);
// cqCreate is called by TSDB to start an instance of CQ
// cqCreate is called by TSDB to start an instance of CQ
void
*
cqCreate
(
void
*
handle
,
uint64_t
uid
,
int
sid
,
char
*
sqlStr
,
STSchema
*
pSchema
);
void
*
cqCreate
(
void
*
handle
,
uint64_t
uid
,
int
32_t
sid
,
char
*
sqlStr
,
STSchema
*
pSchema
);
// cqDrop is called by TSDB to stop an instance of CQ, handle is the return value of cqCreate
// cqDrop is called by TSDB to stop an instance of CQ, handle is the return value of cqCreate
void
cqDrop
(
void
*
handle
);
void
cqDrop
(
void
*
handle
);
extern
int
cqDebugFlag
;
extern
int
32_t
cqDebugFlag
;
#ifdef __cplusplus
#ifdef __cplusplus
...
...
src/inc/twal.h
浏览文件 @
047955ab
...
@@ -32,7 +32,8 @@ typedef enum {
...
@@ -32,7 +32,8 @@ typedef enum {
typedef
struct
{
typedef
struct
{
int8_t
msgType
;
int8_t
msgType
;
int8_t
reserved
[
3
];
int8_t
sver
;
int8_t
reserved
[
2
];
int32_t
len
;
int32_t
len
;
uint64_t
version
;
uint64_t
version
;
uint32_t
signature
;
uint32_t
signature
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录