Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hidra
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steinbac
hidra
Commits
cd70a1f4
Commit
cd70a1f4
authored
8 years ago
by
Manuela Kuhn
Browse files
Options
Downloads
Patches
Plain Diff
SignalHandler: Extended nextRequNode for multiple requestSets
parent
13faaa70
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
src/sender/SignalHandler.py
+21
-14
21 additions, 14 deletions
src/sender/SignalHandler.py
with
21 additions
and
14 deletions
src/sender/SignalHandler.py
+
21
−
14
View file @
cd70a1f4
...
...
@@ -51,7 +51,8 @@ class SignalHandler():
self
.
openRequVari
=
[]
self
.
openRequPerm
=
[]
self
.
allowedQueries
=
[]
self
.
nextRequNode
=
0
# to rotate throu the open permanent requests
self
.
nextRequNode
=
[]
# to rotate through the open permanent requests
# self.nextRequNode = 0 # to rotate throu the open permanent requests
self
.
whiteList
=
[]
...
...
@@ -160,11 +161,12 @@ class SignalHandler():
# openRequests = copy.deepcopy(self.openRequPerm)
for
requestSet
in
self
.
openRequPerm
:
if
requestSet
:
tmp
=
requestSet
[
self
.
nextRequNode
]
index
=
self
.
openRequPerm
.
index
(
requestSet
)
tmp
=
requestSet
[
self
.
nextRequNode
[
index
]]
openRequests
.
append
(
copy
.
deepcopy
(
tmp
))
# dist
i
rbute in round-robin order
# distr
i
bute in round-robin order
# TODO multiple request sets need multiple nextRequNode
self
.
nextRequNode
=
(
self
.
nextRequNode
+
1
)
%
len
(
requestSet
)
self
.
nextRequNode
[
index
]
=
(
self
.
nextRequNode
[
index
]
+
1
)
%
len
(
requestSet
)
for
requestSet
in
self
.
openRequVari
:
if
requestSet
:
...
...
@@ -265,6 +267,9 @@ class SignalHandler():
def
reactToSignal
(
self
,
signal
,
socketIds
):
# React to signal
###########################
## START_STREAM ##
###########################
if
signal
==
"
START_STREAM
"
:
self
.
log
.
info
(
"
Received signal:
"
+
signal
+
"
for hosts
"
+
str
(
socketIds
))
connectionFound
=
False
...
...
@@ -294,6 +299,7 @@ class SignalHandler():
# send signal back to receiver
self
.
sendResponse
(
signal
)
self
.
openRequPerm
.
append
(
copy
.
deepcopy
(
sorted
(
tmpAllowed
)))
self
.
nextRequNode
.
append
(
0
)
del
tmpAllowed
else
:
...
...
@@ -314,6 +320,9 @@ class SignalHandler():
return
###########################
## STOP_STREAM ##
###########################
elif
signal
==
"
STOP_STREAM
"
:
self
.
log
.
info
(
"
Received signal:
"
+
signal
+
"
for host
"
+
str
(
socketIds
))
connectionNotFound
=
False
...
...
@@ -348,18 +357,16 @@ class SignalHandler():
socketId
=
element
[
0
]
for
i
in
range
(
len
(
self
.
openRequPerm
)):
self
.
openRequPerm
[
i
].
remove
(
element
)
self
.
log
.
debug
(
"
Remove
"
+
str
(
socketId
)
+
"
from openRequPerm.
"
)
if
element
in
self
.
openRequPerm
[
i
]:
self
.
openRequPerm
[
i
].
remove
(
element
)
self
.
log
.
debug
(
"
Remove
"
+
str
(
socketId
)
+
"
from openRequPerm.
"
)
if
not
self
.
openRequPerm
[
i
]:
del
self
.
openRequPerm
[
i
]
if
not
self
.
openRequPerm
[
i
]:
del
self
.
openRequPerm
[
i
]
self
.
nextRequNode
.
pop
(
i
)
else
:
self
.
nextRequNode
[
i
]
=
self
.
nextRequNode
[
i
]
%
len
(
self
.
openRequPerm
[
i
])
#FIXME
# socketId = socketIds[0][0]
# self.log.info("Received signal: " + signal + " to host " + str(socketId[0]))
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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