Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f50bd07c
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f50bd07c
编写于
10月 04, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/3.0' into feature/dnode3
上级
d20aa8f8
3f593dc8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
100 addition
and
3 deletion
+100
-3
include/client/consumer/consumer.h
include/client/consumer/consumer.h
+48
-1
include/libs/wal/wal.h
include/libs/wal/wal.h
+52
-2
未找到文件。
include/client/consumer/consumer.h
浏览文件 @
f50bd07c
...
...
@@ -20,8 +20,55 @@
extern
"C"
{
#endif
//consumer handle
struct
tmq_consumer_t
;
typedef
struct
tmq_consumer_t
tmq_consumer_t
;
//consumer config
struct
tmq_consumer_config_t
;
typedef
struct
tmq_consumer_config_t
tmq_consumer_config_t
;
//response err
struct
tmq_resp_err_t
;
typedef
struct
tmq_resp_err_t
tmq_resp_err_t
;
//topic list
//resouces are supposed to be free by users by calling tmq_list_destroy
struct
tmq_topic_list_t
;
typedef
struct
tmq_topic_list_t
tmq_topic_list_t
;
int32_t
tmq_topic_list_add
(
tmq_topic_list_t
*
,
const
char
*
);
void
tmq_topic_list_destroy
(
tmq_topic_list_t
*
);
//get content of message
tmq_col_batch_t
*
tmq_get_msg_col_by_idx
(
tmq_message_t
*
,
int32_t
);
tmq_col_batch_t
*
tmq_get_msg_col_by_name
(
tmq_message_t
*
,
const
char
*
);
//consumer config
int32_t
tmq_conf_set
(
tmq_consumer_config_t
*
,
const
char
*
config_key
,
const
char
*
config_value
,
char
*
errstr
,
int32_t
errstr_cap
);
//consumer initialization
//resouces are supposed to be free by users by calling tmq_consumer_destroy
tmq_consumer_t
*
tmq_consumer_new
(
tmq_consumer_config_t
*
,
char
*
errstr
,
int32_t
errstr_cap
);
//subscribe
tmq_resp_err_t
tmq_subscribe
(
tmq_consumer_t
*
,
const
tmq_topic_list_t
*
);
//consume
//resouces are supposed to be free by users by calling tmq_message_destroy
tmq_message_t
tmq_consume_poll
(
tmq_consumer_t
*
,
int64_t
blocking_time
);
//destroy message and free memory
void
tmq_message_destroy
(
tmq_message_t
*
);
//close consumer
int32_t
tmq_consumer_close
(
tmq_consumer_t
*
);
//destroy consumer
void
tmq_consumer_destroy
(
tmq_message_t
*
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_CONSUMER_H_*/
\ No newline at end of file
#endif
/*_TD_CONSUMER_H_*/
include/libs/wal/wal.h
浏览文件 @
f50bd07c
...
...
@@ -12,7 +12,6 @@
* 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/>.
*/
#ifndef _TD_WAL_H_
#define _TD_WAL_H_
...
...
@@ -20,8 +19,59 @@
extern
"C"
{
#endif
typedef
enum
{
TAOS_WAL_NOLOG
=
0
,
TAOS_WAL_WRITE
=
1
}
EWalType
;
typedef
struct
{
int8_t
msgType
;
int8_t
sver
;
// sver 2 for WAL SDataRow/SMemRow compatibility
int8_t
reserved
[
2
];
int32_t
len
;
int64_t
version
;
uint32_t
signature
;
uint32_t
cksum
;
char
cont
[];
}
SWalHead
;
typedef
struct
{
int32_t
vgId
;
int32_t
fsyncPeriod
;
// millisecond
EWalType
walLevel
;
// wal level
}
SWalCfg
;
typedef
void
*
twalh
;
// WAL HANDLE
typedef
int32_t
FWalWrite
(
void
*
ahandle
,
void
*
pHead
,
int32_t
qtype
,
void
*
pMsg
);
//module initialization
int32_t
walInit
();
void
walCleanUp
();
//handle open and ctl
twalh
walOpen
(
char
*
path
,
SWalCfg
*
pCfg
);
int32_t
walAlter
(
twalh
,
SWalCfg
*
pCfg
);
void
walStop
(
twalh
);
void
walClose
(
twalh
);
//write
int32_t
walWrite
(
twalh
,
int8_t
msgType
,
void
*
body
,
uint32_t
bodyLen
);
void
walWaitFsync
(
twalh
,
bool
forceHint
);
//int32_t walCommit(twalh, uint64_t ver);
//int32_t walRollback(twalh, uint64_t ver);
//read
int32_t
walRead
(
twalh
,
SWalHead
**
,
int64_t
ver
);
int32_t
walReadWithFp
(
twalh
,
FWalWrite
writeFp
,
int64_t
verStart
,
int
readNum
);
//life cycle
int32_t
walDataPersisted
(
twalh
,
int64_t
ver
);
int32_t
walFirstVer
(
twalh
);
int32_t
walLastVer
(
twal
);
//int32_t walDataCorrupted(twalh);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_WAL_H_*/
\ No newline at end of file
#endif // _TD_WAL_H_
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录