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
Merge requests
!15
Iss1051 data transfer
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Iss1051 data transfer
iss1051-dataTransfer
into
master
Overview
55
Commits
11
Pipelines
0
Changes
42
Closed
Jan Kožusznik
requested to merge
iss1051-dataTransfer
into
master
7 years ago
Overview
20
Commits
11
Pipelines
0
Changes
42
Expand
0
0
Merge request reports
Compare
master
version 11
4443a618
7 years ago
version 10
67f4213f
7 years ago
version 9
a824a71b
7 years ago
version 8
c061348b
7 years ago
version 7
3e64abb4
7 years ago
version 6
4f9de5ad
7 years ago
version 5
11045b48
7 years ago
version 4
afdc6ee4
7 years ago
version 3
e39cb915
7 years ago
version 2
b17dbb69
7 years ago
version 1
0675d0da
7 years ago
master (base)
and
latest version
latest version
4443a618
11 commits,
7 years ago
version 11
4443a618
36 commits,
7 years ago
version 10
67f4213f
35 commits,
7 years ago
version 9
a824a71b
33 commits,
7 years ago
version 8
c061348b
33 commits,
7 years ago
version 7
3e64abb4
32 commits,
7 years ago
version 6
4f9de5ad
31 commits,
7 years ago
version 5
11045b48
30 commits,
7 years ago
version 4
afdc6ee4
27 commits,
7 years ago
version 3
e39cb915
26 commits,
7 years ago
version 2
b17dbb69
25 commits,
7 years ago
version 1
0675d0da
24 commits,
7 years ago
42 files
+
309
−
290
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
42
Search (e.g. *.vue) (Ctrl+P)
haas-imagej-client/src/main/java/cz/it4i/fiji/haas/data_transfer/PersistentIndex.java
+
17
−
17
Options
@@ -17,49 +17,49 @@ public class PersistentIndex<T> {
public
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
cz
.
it4i
.
fiji
.
haas
.
data_transfer
.
PersistentIndex
.
class
);
private
Path
workingFile
;
private
final
Path
workingFile
;
private
Set
<
T
>
f
iles
=
new
LinkedHashSet
<>();
private
final
Set
<
T
>
indexedF
iles
=
new
LinkedHashSet
<>();
private
Function
<
String
,
T
>
fromString
;
private
final
Function
<
String
,
T
>
fromString
Convertor
;
public
PersistentIndex
(
Path
workingFile
,
Function
<
String
,
T
>
fromString
)
throws
IOException
{
public
PersistentIndex
(
Path
workingFile
,
Function
<
String
,
T
>
fromString
Convertor
)
throws
IOException
{
this
.
workingFile
=
workingFile
;
this
.
fromString
=
fromString
;
loadFromFile
();
this
.
fromString
Convertor
=
fromString
Convertor
;
loadFrom
Working
File
();
}
public
synchronized
void
storeToFile
()
throws
IOException
{
public
synchronized
void
storeTo
Working
File
()
throws
IOException
{
try
(
BufferedWriter
bw
=
Files
.
newBufferedWriter
(
workingFile
))
{
for
(
T
file
:
f
iles
)
{
for
(
T
file
:
indexedF
iles
)
{
bw
.
write
(
file
.
toString
()
+
"\n"
);
}
}
}
public
synchronized
boolean
insert
(
T
file
)
{
return
f
iles
.
add
(
file
);
return
indexedF
iles
.
add
(
file
);
}
public
synchronized
void
remove
(
T
p
)
{
f
iles
.
remove
(
p
);
indexedF
iles
.
remove
(
p
);
}
public
synchronized
void
fillQueue
(
Queue
<
T
>
toUpload
)
{
toUpload
.
addAll
(
f
iles
);
toUpload
.
addAll
(
indexedF
iles
);
}
public
synchronized
void
clear
()
throws
IOException
{
f
iles
.
clear
();
storeToFile
();
indexedF
iles
.
clear
();
storeTo
Working
File
();
}
public
synchronized
boolean
contains
(
Path
file
)
{
return
f
iles
.
contains
(
file
);
return
indexedF
iles
.
contains
(
file
);
}
private
void
loadFromFile
()
throws
IOException
{
f
iles
.
clear
();
private
void
loadFrom
Working
File
()
throws
IOException
{
indexedF
iles
.
clear
();
if
(
Files
.
exists
(
workingFile
))
{
try
(
BufferedReader
br
=
Files
.
newBufferedReader
(
workingFile
))
{
String
line
;
@@ -71,7 +71,7 @@ public class PersistentIndex<T> {
}
private
void
processLine
(
String
line
)
{
f
iles
.
add
(
fromString
.
apply
(
line
));
indexedF
iles
.
add
(
fromString
Convertor
.
apply
(
line
));
}
Loading