Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210310676
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210310676
Commits
0b41031c
Commit
0b41031c
authored
3 years ago
by
dragondriver
Committed by
zhenshan.cao
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add channelsTimeTicker to proxy (#5462)
Signed-off-by:
dragondriver
<
jiquan.long@zilliz.com
>
parent
a2dd1647
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
internal/proxynode/proxy_node.go
+20
-0
20 additions, 0 deletions
internal/proxynode/proxy_node.go
with
20 additions
and
0 deletions
internal/proxynode/proxy_node.go
+
20
−
0
View file @
0b41031c
...
...
@@ -59,6 +59,8 @@ type ProxyNode struct {
sched
*
TaskScheduler
tick
*
timeTick
chTicker
channelsTimeTicker
idAllocator
*
allocator
.
IDAllocator
tsoAllocator
*
TimestampAllocator
segAssigner
*
SegIDAssigner
...
...
@@ -238,6 +240,14 @@ func (node *ProxyNode) Init() error {
node
.
tick
=
newTimeTick
(
node
.
ctx
,
node
.
tsoAllocator
,
time
.
Millisecond
*
200
,
node
.
sched
.
TaskDoneTest
,
node
.
msFactory
)
// TODO(dragondriver): read this from config
interval
:=
time
.
Millisecond
*
200
// TODO(dragondriver): use scheduler's method
getStats
:=
func
(
ch
pChan
)
(
pChanStatistics
,
error
)
{
return
pChanStatistics
{},
nil
}
node
.
chTicker
=
newChannelsTimeTicker
(
node
.
ctx
,
interval
,
[]
string
{},
getStats
,
tsoAllocator
)
return
nil
}
...
...
@@ -266,6 +276,12 @@ func (node *ProxyNode) Start() error {
node
.
tick
.
Start
()
log
.
Debug
(
"start time tick ..."
)
err
=
node
.
chTicker
.
start
()
if
err
!=
nil
{
return
err
}
log
.
Debug
(
"start channelsTimeTicker"
)
// Start callbacks
for
_
,
cb
:=
range
node
.
startCallbacks
{
cb
()
...
...
@@ -286,6 +302,10 @@ func (node *ProxyNode) Stop() error {
node
.
sched
.
Close
()
node
.
queryMsgStream
.
Close
()
node
.
tick
.
Close
()
err
:=
node
.
chTicker
.
close
()
if
err
!=
nil
{
return
err
}
node
.
wg
.
Wait
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment