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
d1aea05f
Commit
d1aea05f
authored
8 years ago
by
Manuela Kuhn
Browse files
Options
Downloads
Patches
Plain Diff
Fixed store in dataTransferApi
parent
3c0cc20f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
APIs/dataTransferAPI.py
+3
-5
3 additions, 5 deletions
APIs/dataTransferAPI.py
conf/dataReceiver.conf
+1
-1
1 addition, 1 deletion
conf/dataReceiver.conf
src/receiver/DataReceiver.py
+6
-5
6 additions, 5 deletions
src/receiver/DataReceiver.py
with
10 additions
and
11 deletions
APIs/dataTransferAPI.py
+
3
−
5
View file @
d1aea05f
...
...
@@ -420,12 +420,13 @@ class dataTransfer():
payload
=
dataObject
[
1
]
if
type
(
payloadMetadata
)
is
not
dict
or
type
(
payload
)
is
not
list
:
if
type
(
payloadMetadata
)
is
not
dict
:
raise
FormatError
(
"
payload: Wrong input format in
'
store
'"
)
#save all chunks to file
while
True
:
#TODO check if payload != cPickle.dumps(None) ?
if
payloadMetadata
and
payload
:
#append to file
try
:
...
...
@@ -458,8 +459,6 @@ class dataTransfer():
def
__appendChunksToFile
(
self
,
targetBasePath
,
configDict
,
payload
):
chunkCount
=
len
(
payload
)
#generate target filepath
targetFilepath
=
self
.
generateTargetFilepath
(
targetBasePath
,
configDict
)
self
.
log
.
debug
(
"
new file is going to be created at:
"
+
targetFilepath
)
...
...
@@ -492,8 +491,7 @@ class dataTransfer():
#only write data if a payload exist
try
:
if
payload
!=
None
:
for
chunk
in
payload
:
newFile
.
write
(
chunk
)
newFile
.
write
(
payload
)
newFile
.
close
()
except
:
self
.
log
.
error
(
"
Unable to append data to file.
"
)
...
...
This diff is collapsed.
Click to expand it.
conf/dataReceiver.conf
+
1
−
1
View file @
d1aea05f
# Where incoming data will be stored to
targetDir
= /
space
/
projects
/
zeromq
-
data
-
transfer
/
data
/
target
targetDir
= /
space
/
projects
/
zeromq
-
data
-
transfer
/
data
/
zmq_
target
# Local IP to connect dataStream to
dataStreamIp
=
131
.
169
.
185
.
121
;
# zitpcx19282.desy.de
...
...
This diff is collapsed.
Click to expand it.
src/receiver/DataReceiver.py
+
6
−
5
View file @
d1aea05f
...
...
@@ -104,14 +104,15 @@ def argumentParsing():
class
DataReceiver
:
def
__init__
(
self
,
outpu
tDir
,
dataIp
,
dataPort
):
def
__init__
(
self
,
targe
tDir
,
dataIp
,
dataPort
):
self
.
outputDir
=
os
.
path
.
normpath
(
outputDir
)
self
.
log
=
self
.
getLogger
()
self
.
targetDir
=
os
.
path
.
normpath
(
targetDir
)
self
.
dataIp
=
dataIp
self
.
dataPort
=
dataPort
self
.
log
=
self
.
getLogger
()
self
.
log
.
debug
(
"
Init
"
)
self
.
log
.
info
(
"
Writing to directory
'"
+
self
.
targetDir
+
"'
.
"
)
self
.
dataTransfer
=
dataTransfer
(
"
stream
"
,
useLog
=
True
)
...
...
@@ -146,7 +147,7 @@ class DataReceiver:
raise
try
:
self
.
dataTransfer
.
store
(
self
.
outpu
tDir
,
[
payloadMetadata
,
payload
]
)
self
.
dataTransfer
.
store
(
self
.
targe
tDir
,
[
payloadMetadata
,
payload
]
)
except
KeyboardInterrupt
:
return
except
:
...
...
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