Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpc-workflow-manager
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
FIJI
hpc-workflow-manager
Commits
7ae949cd
Commit
7ae949cd
authored
7 years ago
by
Jan Kožusznik
Browse files
Options
Downloads
Patches
Plain Diff
Fix: create method getHaaSClient
Merge request comments:
https://code.it4i.cz/fiji/haas-java-client/merge_requests/14
parent
3c1fc6c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!14
Iss1026
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
haas-imagej-client/src/main/java/cz/it4i/fiji/haas/Job.java
+15
-11
15 additions, 11 deletions
haas-imagej-client/src/main/java/cz/it4i/fiji/haas/Job.java
with
15 additions
and
11 deletions
haas-imagej-client/src/main/java/cz/it4i/fiji/haas/Job.java
+
15
−
11
View file @
7ae949cd
...
...
@@ -56,7 +56,7 @@ public class Job {
public
Job
(
JobManager4Job
jobManager
,
String
name
,
Path
basePath
,
Supplier
<
HaaSClient
>
haasClientSupplier
)
throws
IOException
{
this
(
jobManager
,
haasClientSupplier
);
HaaSClient
client
=
this
.
h
aa
s
Client
Supplier
.
get
();
HaaSClient
client
=
getH
aa
S
Client
();
long
id
=
client
.
createJob
(
name
,
Collections
.
emptyList
());
jobDir
=
basePath
.
resolve
(
""
+
id
);
propertyHolder
=
new
PropertyHolder
(
jobDir
.
resolve
(
JOB_INFO_FILE
));
...
...
@@ -76,7 +76,7 @@ public class Job {
}
public
void
uploadFiles
(
Iterable
<
UploadingFile
>
files
,
Progress
notifier
)
{
HaaSClient
client
=
this
.
h
aa
s
Client
Supplier
.
get
();
HaaSClient
client
=
getH
aa
S
Client
();
try
(
HaaSFileTransfer
transfer
=
client
.
startFileTransfer
(
getId
(),
new
P_ProgressNotifierAdapter
(
notifier
))){
transfer
.
upload
(
files
);
}
...
...
@@ -89,7 +89,7 @@ public class Job {
}
public
void
submit
()
{
HaaSClient
client
=
this
.
h
aa
s
Client
Supplier
.
get
();
HaaSClient
client
=
getH
aa
S
Client
();
client
.
submitJob
(
jobId
);
}
...
...
@@ -120,8 +120,8 @@ public class Job {
}
synchronized
public
void
download
(
Predicate
<
String
>
predicate
,
Progress
notifier
)
{
try
(
HaaSFileTransfer
fileTransfer
=
h
aa
s
Client
Supplier
.
get
().
startFileTransfer
(
jobId
,
new
P_ProgressNotifierAdapter
(
notifier
)))
{
fileTransfer
.
download
(
h
aa
s
Client
Supplier
.
get
().
getChangedFiles
(
jobId
).
stream
().
filter
(
predicate
).
collect
(
Collectors
.
toList
()),
jobDir
);
try
(
HaaSFileTransfer
fileTransfer
=
getH
aa
S
Client
().
startFileTransfer
(
jobId
,
new
P_ProgressNotifierAdapter
(
notifier
)))
{
fileTransfer
.
download
(
getH
aa
S
Client
().
getChangedFiles
(
jobId
).
stream
().
filter
(
predicate
).
collect
(
Collectors
.
toList
()),
jobDir
);
}
}
...
...
@@ -145,7 +145,7 @@ public class Job {
HaaSClient
.
SynchronizableFiles
taskFileOffset
=
new
HaaSClient
.
SynchronizableFiles
();
long
taskId
=
(
Long
)
getJobInfo
().
getTasks
().
toArray
()[
0
];
output
.
forEach
(
file
->
taskFileOffset
.
addFile
(
taskId
,
file
.
getType
(),
file
.
getOffset
()));
return
h
aa
s
Client
Supplier
.
get
().
downloadPartsOfJobFiles
(
jobId
,
taskFileOffset
).
stream
().
map
(
f
->
f
.
getContent
())
return
getH
aa
S
Client
().
downloadPartsOfJobFiles
(
jobId
,
taskFileOffset
).
stream
().
map
(
f
->
f
.
getContent
())
.
collect
(
Collectors
.
toList
());
}
...
...
@@ -186,6 +186,10 @@ public class Job {
return
result
;
}
private
HaaSClient
getHaaSClient
()
{
return
this
.
haasClientSupplier
.
get
();
}
private
JobInfo
getJobInfo
()
{
if
(
jobInfo
==
null
)
{
updateJobInfo
();
...
...
@@ -194,7 +198,7 @@ public class Job {
}
private
void
updateJobInfo
()
{
jobInfo
=
h
aa
s
Client
Supplier
.
get
().
obtainJobInfo
(
getId
());
jobInfo
=
getH
aa
S
Client
().
obtainJobInfo
(
getId
());
}
private
static
boolean
isValidPath
(
Path
path
)
{
...
...
@@ -245,22 +249,22 @@ public class Job {
}
public
Collection
<
String
>
getChangedFiles
()
{
return
h
aa
s
Client
Supplier
.
get
().
getChangedFiles
(
getId
());
return
getH
aa
S
Client
().
getChangedFiles
(
getId
());
}
public
void
cancelJob
()
{
h
aa
s
Client
Supplier
.
get
().
cancelJob
(
jobId
);
getH
aa
S
Client
().
cancelJob
(
jobId
);
}
public
List
<
Long
>
getFileSizes
(
List
<
String
>
names
)
{
try
(
HaaSFileTransfer
transfer
=
h
aa
s
Client
Supplier
.
get
().
startFileTransfer
(
getId
(),
new
DummyProgressNotifier
()))
{
try
(
HaaSFileTransfer
transfer
=
getH
aa
S
Client
().
startFileTransfer
(
getId
(),
new
DummyProgressNotifier
()))
{
return
transfer
.
obtainSize
(
names
);
}
}
public
List
<
String
>
getFileContents
(
List
<
String
>
logs
)
{
try
(
HaaSFileTransfer
transfer
=
h
aa
s
Client
Supplier
.
get
().
startFileTransfer
(
getId
(),
new
DummyProgressNotifier
()))
{
try
(
HaaSFileTransfer
transfer
=
getH
aa
S
Client
().
startFileTransfer
(
getId
(),
new
DummyProgressNotifier
()))
{
return
transfer
.
getContent
(
logs
);
}
}
...
...
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