Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
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
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
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
dCache
cta
Commits
707bc3bd
Commit
707bc3bd
authored
10 years ago
by
Giuseppe Lo Presti
Browse files
Options
Downloads
Patches
Plain Diff
Added transferType to disk-to-disk copies
parent
0154d69e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
castor/scheduler/diskmanager/activitycontrol.py
+8
-5
8 additions, 5 deletions
castor/scheduler/diskmanager/activitycontrol.py
with
8 additions
and
5 deletions
castor/scheduler/diskmanager/activitycontrol.py
+
8
−
5
View file @
707bc3bd
...
...
@@ -33,7 +33,7 @@ import base64
import
connectionpool
,
dlf
,
clientsreplier
from
commonexceptions
import
TransferCanceled
,
TransferFailed
,
SourceNotStarted
from
diskmanagerdlf
import
msgs
from
transfer
import
TransferType
,
RunningTransfer
from
transfer
import
TransferType
,
D2DTransferType
,
RunningTransfer
def
signBase64
(
content
,
RSAKey
):
'''
signs content with the given key and encode the result in base64
'''
...
...
@@ -42,11 +42,12 @@ def signBase64(content, RSAKey):
signature
=
signer
.
sign
(
contentHash
)
return
base64
.
b64encode
(
signature
)
def
buildXrootURL
(
self
,
diskserver
,
path
):
def
buildXrootURL
(
self
,
diskserver
,
path
,
transferType
):
'''
Builds a xroot valid url for the given path on the given diskserver
'''
# base url and key parameter
url
=
'
root://
'
+
diskserver
+
'
:1095//
'
+
path
+
'
?
'
opaque_dict
=
{
'
castor2fs.pfn1
'
:
path
,
'
castor.txtype
'
:
transferType
,
'
castor2fs.exptime
'
:
str
(
int
(
time
.
time
())
+
3600
)}
# signature part
...
...
@@ -57,6 +58,7 @@ def buildXrootURL(self, diskserver, path):
key
=
RSA
.
importKey
(
open
(
keyFile
,
'
r
'
).
read
())
# sign opaque part obtained by concatenating the values
opaque_token
=
''
.
join
([
opaque_dict
[
'
castor2fs.pfn1
'
],
opaque_dict
[
'
castor.txtype
'
],
"
0
"
,
# accessop
opaque_dict
[
'
castor2fs.exptime
'
]])
signature
=
signBase64
(
opaque_token
,
key
)
...
...
@@ -114,13 +116,14 @@ class ActivityControlThread(threading.Thread):
def
startD2DTransfer
(
self
,
scheduler
,
transfer
,
srcDcPath
,
destDcPath
):
'''
effectively starts a disk to disk transfer
'''
# build command line
transferType
=
'
d2d
'
+
D2DTransferType
.
toStr
(
transfer
.
replicationType
)
srcDS
,
srcPath
=
srcDcPath
.
split
(
'
:
'
,
1
)
cmdLine
=
[
'
xrdcp
'
,
buildXrootURL
(
self
,
srcDS
,
srcPath
),
\
buildXrootURL
(
self
,
'
localhost
'
,
destDcPath
)]
cmdLine
=
[
'
xrdcp
'
,
buildXrootURL
(
self
,
srcDS
,
srcPath
,
transferType
),
\
buildXrootURL
(
self
,
'
localhost
'
,
destDcPath
,
transferType
)]
# "Transfer starting" message
dlf
.
write
(
msgs
.
TRANSFERSTARTING
,
subreqid
=
transfer
.
transferId
,
reqid
=
transfer
.
reqId
,
fileId
=
transfer
.
fileId
,
T
transferType
=
TransferType
.
toStr
(
transfer
.
transferType
),
transferType
=
TransferType
.
toStr
(
transfer
.
transferType
),
cmdLine
=
'
'
.
join
(
cmdLine
))
# start transfer process
process
=
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