Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vdt-plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
vdt-plugin
Commits
0eef8004
Commit
0eef8004
authored
Dec 26, 2015
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimized list of dependency files - using cache
parent
f2a02373
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
24 deletions
+31
-24
Tool.java
src/com/elphel/vdt/core/tools/params/Tool.java
+28
-22
ToolSequence.java
src/com/elphel/vdt/core/tools/params/ToolSequence.java
+3
-2
No files found.
src/com/elphel/vdt/core/tools/params/Tool.java
View file @
0eef8004
...
...
@@ -127,7 +127,8 @@ public class Tool extends Context implements Cloneable, Inheritable {
// TODO: Compare dependFiles with literary result of other tools, if match - these are states, not files
private
List
<
Parameter
>
dependStates
;
// snapshot names
private
List
<
Parameter
>
dependFiles
;
private
List
<
Parameter
>
dependFiles
;
private
List
<
String
>
dependFilesCache
=
null
;
// list of resolved file relative paths calculated earlier
private
Map
<
String
,
String
>
dependStatesTimestamps
;
private
Map
<
String
,
String
>
dependFilesTimestamps
;
...
...
@@ -250,7 +251,8 @@ public class Tool extends Context implements Cloneable, Inheritable {
restoreTool
=
null
;
result
=
null
;
dependStates
=
null
;
dependFiles
=
null
;
dependFiles
=
null
;
dependFilesCache
=
null
;
DEBUG_PRINT
(
"Created tool"
+
name
+
" disabledString = "
+
disabledString
);
pinned
=
false
;
openState
=
null
;
...
...
@@ -668,28 +670,32 @@ public class Tool extends Context implements Cloneable, Inheritable {
}
}
}
}
}
public
List
<
String
>
getDependFiles
(){
DEBUG_PRINT
(
"------ getDependFiles()"
);
setTreeReparse
(
true
);
// Set actual dependence
if
((
dependFiles
==
null
)
||
(
dependFiles
.
size
()==
0
))
return
null
;
List
<
String
>
list
=
new
ArrayList
<
String
>();
for
(
Iterator
<
Parameter
>
iter
=
dependFiles
.
iterator
();
iter
.
hasNext
();)
{
List
<
String
>
vList
=
iter
.
next
().
getValue
(
new
FormatProcessor
(
this
));
// null for topFormatProcessor
if
(
vList
!=
null
)
{
for
(
String
item:
vList
){
if
((
item
!=
null
)
&&
(
item
.
trim
().
length
()>
0
)){
list
.
add
(
item
.
trim
());
}
}
// list.addAll(vList);
}
}
for
(
String
item:
list
){
dependFilesCache
=
null
;
//invalidate, will be recreated
}
public
List
<
String
>
getDependFiles
(
boolean
rebuild
){
if
(
rebuild
||
(
dependFilesCache
==
null
))
{
DEBUG_PRINT
(
"------ getDependFiles(rebuild="
+
rebuild
+
"), rebuilding"
);
setTreeReparse
(
true
);
// Set actual dependence
if
((
dependFiles
==
null
)
||
(
dependFiles
.
size
()==
0
))
return
null
;
dependFilesCache
=
new
ArrayList
<
String
>();
for
(
Iterator
<
Parameter
>
iter
=
dependFiles
.
iterator
();
iter
.
hasNext
();)
{
List
<
String
>
vList
=
iter
.
next
().
getValue
(
new
FormatProcessor
(
this
));
// null for topFormatProcessor
if
(
vList
!=
null
)
{
for
(
String
item:
vList
){
if
((
item
!=
null
)
&&
(
item
.
trim
().
length
()>
0
)){
dependFilesCache
.
add
(
item
.
trim
());
}
}
}
}
}
else
{
DEBUG_PRINT
(
"------ getDependFiles(rebuild="
+
rebuild
+
"), using cache"
);
}
for
(
String
item:
dependFilesCache
){
DEBUG_PRINT
(
"-----> "
+
getName
()+
".getDependFiles()->"
+
item
);
}
return
list
;
}
return
dependFilesCache
;
}
public
List
<
String
>
getDependStates
(){
...
...
src/com/elphel/vdt/core/tools/params/ToolSequence.java
View file @
0eef8004
...
...
@@ -1720,8 +1720,9 @@ java.lang.NullPointerException
}
private
Map
<
String
,
String
>
makeDependFiles
(
Tool
tool
,
boolean
failOnMissing
){
DEBUG_PRINT
(
"++++++ makeDependFiles("
+
tool
.
getName
()+
")"
);
Map
<
String
,
String
>
depFiles
=
new
Hashtable
<
String
,
String
>();
List
<
String
>
dependFileNames
=
tool
.
getDependFiles
();
// files on which this tool depends - make cached version
Map
<
String
,
String
>
depFiles
=
new
Hashtable
<
String
,
String
>();
// Use depend files cache if available
List
<
String
>
dependFileNames
=
tool
.
getDependFiles
(
false
);
// files on which this tool depends - make cached version
if
(
dependFileNames
!=
null
)
{
IProject
project
=
SelectedResourceManager
.
getDefault
().
getSelectedProject
();
// should not be null when we got here
for
(
String
depFile:
dependFileNames
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment