Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-transfer-service
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-transfer-service
Commits
4cd1f08b
Commit
4cd1f08b
authored
Apr 26, 2021
by
Cristiano Urban
Browse files
Options
Downloads
Patches
Plain Diff
Added variables to track the progress of the job + some code cleanup.
Signed-off-by:
Cristiano Urban
<
cristiano.urban@inaf.it
>
parent
b13d92a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
transfer_service/retrieve_executor.py
+10
-14
10 additions, 14 deletions
transfer_service/retrieve_executor.py
with
10 additions
and
14 deletions
transfer_service/retrieve_executor.py
+
10
−
14
View file @
4cd1f08b
...
@@ -40,7 +40,9 @@ class RetrieveExecutor(TaskExecutor):
...
@@ -40,7 +40,9 @@ class RetrieveExecutor(TaskExecutor):
self
.
jobId
=
None
self
.
jobId
=
None
self
.
nodeList
=
[]
self
.
nodeList
=
[]
self
.
fileList
=
[]
self
.
fileList
=
[]
self
.
numBlocks
=
None
self
.
numBlocks
=
0
self
.
procBlocks
=
0
self
.
totalSize
=
0
super
(
RetrieveExecutor
,
self
).
__init__
()
super
(
RetrieveExecutor
,
self
).
__init__
()
def
buildFileList
(
self
):
def
buildFileList
(
self
):
...
@@ -98,6 +100,7 @@ class RetrieveExecutor(TaskExecutor):
...
@@ -98,6 +100,7 @@ class RetrieveExecutor(TaskExecutor):
blockSize
=
0
blockSize
=
0
for
fileInfo
in
self
.
fileList
:
for
fileInfo
in
self
.
fileList
:
fileSize
=
fileInfo
[
"
fileSize
"
]
fileSize
=
fileInfo
[
"
fileSize
"
]
self
.
totalSize
+=
fileSize
# controlla se il file ha dimensione superiore alla dimensione di un blocco
# controlla se il file ha dimensione superiore alla dimensione di un blocco
if
fileSize
>
self
.
maxBlockSize
:
if
fileSize
>
self
.
maxBlockSize
:
# chiudi il blocco corrente, se non vuoto, altrimenti usa quello?
# chiudi il blocco corrente, se non vuoto, altrimenti usa quello?
...
@@ -107,15 +110,9 @@ class RetrieveExecutor(TaskExecutor):
...
@@ -107,15 +110,9 @@ class RetrieveExecutor(TaskExecutor):
blockIdx
+=
1
blockIdx
+=
1
fileInfo
[
"
blockIdx
"
]
=
blockIdx
fileInfo
[
"
blockIdx
"
]
=
blockIdx
blockIdx
+=
1
blockIdx
+=
1
#self.blockList.append(currentBlock.copy())
#currentBlock.clear()
#currentBlock.append(fileInfo.copy())
else
:
else
:
fileInfo
[
"
blockIdx
"
]
=
blockIdx
fileInfo
[
"
blockIdx
"
]
=
blockIdx
blockIdx
+=
1
blockIdx
+=
1
#currentBlock.append(fileInfo.copy())
#self.blockList.append(currentBlock.copy())
#currentBlock.clear()
blockSize
=
0
blockSize
=
0
else
:
else
:
# il file sta dentro un blocco, quindi controlla se
# il file sta dentro un blocco, quindi controlla se
...
@@ -124,7 +121,6 @@ class RetrieveExecutor(TaskExecutor):
...
@@ -124,7 +121,6 @@ class RetrieveExecutor(TaskExecutor):
if
blockSize
+
fileSize
<=
self
.
maxBlockSize
:
if
blockSize
+
fileSize
<=
self
.
maxBlockSize
:
# se si, aggiungi il file al blocco e vai avanti col prossimo
# se si, aggiungi il file al blocco e vai avanti col prossimo
fileInfo
[
"
blockIdx
"
]
=
blockIdx
fileInfo
[
"
blockIdx
"
]
=
blockIdx
#currentBlock.append(fileInfo.copy())
blockSize
+=
fileSize
blockSize
+=
fileSize
else
:
else
:
# se no, chiudi il blocco attuale e aggiungilo alla lista blocchi
# se no, chiudi il blocco attuale e aggiungilo alla lista blocchi
...
@@ -132,13 +128,9 @@ class RetrieveExecutor(TaskExecutor):
...
@@ -132,13 +128,9 @@ class RetrieveExecutor(TaskExecutor):
blockIdx
+=
1
blockIdx
+=
1
fileInfo
[
"
blockIdx
"
]
=
blockIdx
fileInfo
[
"
blockIdx
"
]
=
blockIdx
blockSize
=
fileSize
blockSize
=
fileSize
#self.blockList.append(currentBlock.copy())
#currentBlock.clear()
#blockSize = 0
#currentBlock.append(fileInfo.copy())
#blockSize += fileSize
if
self
.
fileList
:
if
self
.
fileList
:
self
.
numBlocks
=
blockIdx
+
1
self
.
numBlocks
=
blockIdx
+
1
self
.
dbConn
.
setTotalBlocks
(
self
.
jobId
,
self
.
numBlocks
)
print
(
f
"
numBlocks =
{
self
.
numBlocks
}
"
)
print
(
f
"
numBlocks =
{
self
.
numBlocks
}
"
)
if
os
.
path
.
exists
(
"
blocks.txt
"
):
if
os
.
path
.
exists
(
"
blocks.txt
"
):
os
.
remove
(
"
blocks.txt
"
)
os
.
remove
(
"
blocks.txt
"
)
...
@@ -185,6 +177,8 @@ class RetrieveExecutor(TaskExecutor):
...
@@ -185,6 +177,8 @@ class RetrieveExecutor(TaskExecutor):
self
.
tapeClient
.
disconnect
()
self
.
tapeClient
.
disconnect
()
blockFileList
.
clear
()
blockFileList
.
clear
()
self
.
procBlocks
+=
1
self
.
dbConn
.
updateProcessedBlocks
(
self
.
jobId
,
self
.
procBlocks
)
return
True
return
True
...
@@ -204,7 +198,9 @@ class RetrieveExecutor(TaskExecutor):
...
@@ -204,7 +198,9 @@ class RetrieveExecutor(TaskExecutor):
self
.
fileList
.
clear
()
self
.
fileList
.
clear
()
self
.
nodeList
.
clear
()
self
.
nodeList
.
clear
()
self
.
storageType
=
None
self
.
storageType
=
None
self
.
numBlocks
=
None
self
.
numBlocks
=
0
self
.
procBlocks
=
0
self
.
totalSize
=
0
def
run
(
self
):
def
run
(
self
):
print
(
"
Starting retrieve executor...
"
)
print
(
"
Starting retrieve executor...
"
)
...
...
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
sign in
to comment