Documentation
¶
Index ¶
- type ExporterInfo
- type ExporterProgress
- type ExporterStatusCode
- type ExporterTable
- type MetaClearAllExporterInfoArgs
- type MetaClearAllExporterInfoReply
- type MetaDeleteExporterInfoArgs
- type MetaDeleteExporterInfoReply
- type MetaExporterHasJoinArgs
- type MetaExporterHasJoinReply
- type MetaGetAllExporterInfoArgs
- type MetaGetAllExporterInfoReply
- type MetaGetExporterInfoArgs
- type MetaGetExporterInfoReply
- type MetaGetExporterProgressArgs
- type MetaGetExporterProgressReply
- type MetaGetExporterResolverArgs
- type MetaGetExporterResolverReply
- type MetaGetExporterStatusArgs
- type MetaGetExporterStatusReply
- type MetaGetExporterTableArgs
- type MetaGetExporterTableReply
- type MetaNewExporterInfoArgs
- type MetaNewExporterInfoReply
- type MetaUpdateExporterProgressArgs
- type MetaUpdateExporterProgressReply
- type MetaUpdateExporterStatusArgs
- type MetaUpdateExporterStatusReply
- type MqClearMessageArgs
- type MqClearMessageReply
- type MqFilterMessageArgs
- type MqFilterMessageReply
- type MqMessage
- type MqPushMessageArgs
- type MqPushMessageReply
- type ReceiverDataPackage
- type ReceiverDataRequest
- type ReceiverDataResponse
- type ReceiverJoinRequest
- type ReceiverJoinResponse
- type ReceiverQueryRequest
- type ReceiverQueryResponse
- type ReceiverQuitRequest
- type ReceiverQuitResponse
- type ResolverShutdownArgs
- type ResolverShutdownReply
- type ResolverStartArgs
- type ResolverStartReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExporterInfo ¶
type ExporterInfo struct {
ResolverTag string `json:"resolver_tag"`
Table ExporterTable `json:"table"`
JoinTimestamp common.Timestamp `json:"join_timestamp"`
QuitTimestamp common.Timestamp `json:"quit_timestamp"` // update
StatusCode ExporterStatusCode `json:"status_code"` // update
CurrentProgress ExporterProgress `json:"current_progress"` // update
}
ExporterInfo 保存 exporter 对应的相关元信息:resolver、progress、db table
type ExporterProgress ¶
type ExporterStatusCode ¶
type ExporterStatusCode int
const ( StatusActive ExporterStatusCode = iota StatusLazyQuit StatusDead StatusUnknown )
type ExporterTable ¶
type ExporterTable struct {
TableNameSnapshotData string `json:"table_name_snapshot_data"`
TableNameSnapshotSync string `json:"table_name_snapshot_sync"`
TableNameState string `json:"table_name_state"`
TableNameRevision string `json:"table_name_revision"`
TableNameEventOrphan string `json:"table_name_event_orphan"`
}
type MetaClearAllExporterInfoArgs ¶
type MetaClearAllExporterInfoArgs struct {
}
type MetaDeleteExporterInfoArgs ¶
type MetaDeleteExporterInfoArgs struct {
Key string `json:"key"`
}
type MetaDeleteExporterInfoReply ¶
type MetaDeleteExporterInfoReply struct {
HasJoin bool `json:"has_join"`
OK bool `json:"ok"`
Info ExporterInfo `json:"info"`
}
type MetaExporterHasJoinArgs ¶
type MetaExporterHasJoinArgs struct {
Key string `json:"key"`
}
type MetaGetAllExporterInfoArgs ¶
type MetaGetAllExporterInfoArgs struct {
}
type MetaGetAllExporterInfoReply ¶
type MetaGetAllExporterInfoReply struct {
OK bool `json:"ok"`
ExporterInfo map[string]ExporterInfo `json:"exporter_info"`
}
type MetaGetExporterInfoArgs ¶
type MetaGetExporterInfoArgs struct {
Key string `json:"key"`
}
type MetaGetExporterInfoReply ¶
type MetaGetExporterInfoReply struct {
HasJoin bool `json:"has_join"`
OK bool `json:"ok"`
Info ExporterInfo `json:"info"`
}
type MetaGetExporterProgressArgs ¶
type MetaGetExporterProgressArgs struct {
Key string `json:"key"`
}
type MetaGetExporterProgressReply ¶
type MetaGetExporterProgressReply struct {
HasJoin bool `json:"has_join"`
OK bool `json:"ok"`
CurrentProgress ExporterProgress `json:"current_progress"`
}
type MetaGetExporterResolverArgs ¶
type MetaGetExporterResolverArgs struct {
Key string `json:"key"`
}
type MetaGetExporterStatusArgs ¶
type MetaGetExporterStatusArgs struct {
Key string `json:"key"`
}
type MetaGetExporterTableArgs ¶
type MetaGetExporterTableArgs struct {
Key string `json:"key"`
}
type MetaGetExporterTableReply ¶
type MetaGetExporterTableReply struct {
HasJoin bool `json:"has_join"`
OK bool `json:"ok"`
Table ExporterTable `json:"table"`
}
type MetaNewExporterInfoArgs ¶
type MetaNewExporterInfoArgs struct {
Key string `json:"key"`
Info ExporterInfo `json:"info"`
}
type MetaUpdateExporterProgressArgs ¶
type MetaUpdateExporterProgressArgs struct {
Key string `json:"key"`
CurrentProgress ExporterProgress `json:"current_progress"`
}
type MetaUpdateExporterStatusArgs ¶
type MetaUpdateExporterStatusArgs struct {
Key string `json:"key"`
StatusCode ExporterStatusCode `json:"status_code"`
// for StatusLazyQuit
QuitTimestamp common.Timestamp `json:"quit_timestamp"`
}
type MqClearMessageArgs ¶
type MqClearMessageArgs struct {
Tag string `json:"tag"`
}
MqClearMessageArgs 通过 Tag 过滤得到相关消息,清空并删除 tag
type MqClearMessageReply ¶
type MqClearMessageReply struct {
Number int `json:"number"` // 清理数目
OK bool `json:"ok"` // 是否清理成功
}
MqClearMessageReply 通过 Tag 过滤得到相关消息,清空并删除 tag
type MqFilterMessageArgs ¶
type MqFilterMessageArgs struct {
Tag string `json:"tag"`
}
MqFilterMessageArgs 通过 Tag 过滤得到一个消息,这个消息是所有 Tag 匹配的第一个消息
type MqFilterMessageReply ¶
type MqFilterMessageReply struct {
Message MqMessage `json:"message"`
HasNext bool `json:"has_next"` // 判断是否有后续消息待消费
OK bool `json:"ok"` // 是否过滤匹配成功
}
MqFilterMessageReply 通过 Tag 过滤得到一个消息,这个消息是所有 Tag 匹配的第一个消息
type MqPushMessageArgs ¶
type MqPushMessageArgs struct {
Message MqMessage `json:"message"`
}
MqPushMessageArgs 添加一个消息
type MqPushMessageReply ¶
type MqPushMessageReply struct {
OK bool `json:"ok"`
}
MqPushMessageReply 是否添加成功
type ReceiverDataPackage ¶
type ReceiverDataRequest ¶
type ReceiverDataRequest struct {
ExporterTag string `json:"exporter_tag"` // 标识当前接收到的数据来自哪一个 exporter
DataPackage ReceiverDataPackage `json:"data_package"`
CurrentProgress ExporterProgress `json:"current_progress"`
}
ReceiverDataRequest POST 来自 Exporter, 用于上报原始快照数据
type ReceiverDataResponse ¶
type ReceiverDataResponse struct {
OK bool `json:"ok"` // data package 是否成功放入 mq
}
ReceiverDataResponse 响应,为空 由于会 retry,所以必定不会丢数据(大概率) TODO 需要测试,概率是多少,能否接受
type ReceiverJoinRequest ¶
type ReceiverJoinRequest struct {
ExporterTag string `json:"exporter_tag"` // 按照顺序检查该 tag,检查通过分配 resolver,失败返回错误信息
}
ReceiverJoinRequest GET exporter 加入,开启采集任务,不存在会创建
type ReceiverJoinResponse ¶
type ReceiverJoinResponse struct {
OK bool `json:"ok"` // 是否加入成功
Msg string `json:"msg"` // 开启成功时为 resolver id,失败时为错误信息
Info ExporterInfo `json:"info"`
}
ReceiverJoinResponse 返回加入结果和相关消息
type ReceiverQueryRequest ¶
type ReceiverQueryRequest struct {
ExporterTag string `json:"exporter_tag"` // 按照顺序检查该 tag
}
ReceiverQueryRequest GET 查询 exporter 进度等信息,不存在不会创建
type ReceiverQueryResponse ¶
type ReceiverQueryResponse struct {
OK bool `json:"ok"` // 是否查询成功
Msg string `json:"msg"` // 查询成功时为 resolver id,失败时为错误信息,未存在或者已删除
Info ExporterInfo `json:"info"`
}
ReceiverQueryResponse 返回查询结果和相关消息
type ReceiverQuitRequest ¶
type ReceiverQuitRequest struct {
ExporterTag string `json:"exporter_tag"` // 按照顺序检查该 tag,检查通过分配 resolver,失败返回错误信息
LazyQuit bool `json:"lazy_quit"` // 中止 resolver 时是否等处理完所有消息,或者直接终止清空该 tag 的消息,默认 false
}
ReceiverQuitRequest GET exporter 退出,中止采集任务,会清空 exporter 的元信息
type ReceiverQuitResponse ¶
type ReceiverQuitResponse struct {
OK bool `json:"ok"` // 是否退出成功
Msg string `json:"msg"` // 中止成功时为 resolver id,失败时为错误信息,未存在、已存在或者已删除
}
ReceiverQuitResponse 返回退出结果和相关消息
type ResolverShutdownArgs ¶
type ResolverShutdownArgs struct {
ExporterTag string `json:"exporter_tag"`
LazyShutdown bool `json:"lazy_shutdown"` // 等到消费完消息后再关闭,或者直接关闭
}
ResolverShutdownArgs 根据提供的 ExporterTag 中止并删除 Resolver,要记得检查是否 exporter 已经正确关闭,否则可能造成 mq 中的 exporter 消息永远无法被消费
type ResolverShutdownReply ¶
type ResolverShutdownReply struct {
OK bool `json:"ok"`
}
ResolverShutdownReply 返回 ok
type ResolverStartArgs ¶
type ResolverStartArgs struct {
ExporterTag string `json:"exporter_tag"`
}
ResolverStartArgs 根据提供的 ExporterTag 为其分配一个 Resolver
type ResolverStartReply ¶
ResolverStartReply 返回分配的 Resolver 的 Tag