Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-file-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
Releases
Package registry
Container 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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-file-service
Commits
51f5c82b
Commit
51f5c82b
authored
4 years ago
by
Sonia Zorba
Browse files
Options
Downloads
Patches
Plain Diff
Used job_id instead of busy_state
parent
14e76602
No related branches found
No related tags found
No related merge requests found
Pipeline
#1983
passed
4 years ago
Stage: test
Stage: dockerize
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/it/inaf/ia2/transfer/controller/PutFileController.java
+2
-2
2 additions, 2 deletions
...va/it/inaf/ia2/transfer/controller/PutFileController.java
src/main/java/it/inaf/ia2/transfer/persistence/FileDAO.java
+8
-3
8 additions, 3 deletions
src/main/java/it/inaf/ia2/transfer/persistence/FileDAO.java
with
10 additions
and
5 deletions
src/main/java/it/inaf/ia2/transfer/controller/PutFileController.java
+
2
−
2
View file @
51f5c82b
...
@@ -101,7 +101,7 @@ public class PutFileController extends FileController {
...
@@ -101,7 +101,7 @@ public class PutFileController extends FileController {
}
}
try
{
try
{
fileDAO
.
setBusy
(
fileInfo
.
getNodeId
(),
true
);
fileDAO
.
setBusy
(
fileInfo
.
getNodeId
(),
jobId
);
Files
.
copy
(
is
,
file
.
toPath
());
Files
.
copy
(
is
,
file
.
toPath
());
if
(
fileInfo
.
getContentType
()
==
null
)
{
if
(
fileInfo
.
getContentType
()
==
null
)
{
...
@@ -126,7 +126,7 @@ public class PutFileController extends FileController {
...
@@ -126,7 +126,7 @@ public class PutFileController extends FileController {
}
}
throw
ex
;
throw
ex
;
}
finally
{
}
finally
{
fileDAO
.
setBusy
(
fileInfo
.
getNodeId
(),
false
);
fileDAO
.
setBusy
(
fileInfo
.
getNodeId
(),
null
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/it/inaf/ia2/transfer/persistence/FileDAO.java
+
8
−
3
View file @
51f5c82b
...
@@ -11,6 +11,7 @@ import java.sql.Array;
...
@@ -11,6 +11,7 @@ import java.sql.Array;
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.sql.Types
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
...
@@ -118,13 +119,17 @@ public class FileDAO {
...
@@ -118,13 +119,17 @@ public class FileDAO {
return
Arrays
.
asList
((
String
[])
array
.
getArray
());
return
Arrays
.
asList
((
String
[])
array
.
getArray
());
}
}
public
void
setBusy
(
int
nodeId
,
boolean
busy
)
{
public
void
setBusy
(
int
nodeId
,
String
jobId
)
{
String
sql
=
"UPDATE node SET
busy_state
= ? WHERE node_id = ?"
;
String
sql
=
"UPDATE node SET
job_id
= ? WHERE node_id = ?"
;
jdbcTemplate
.
update
(
conn
->
{
jdbcTemplate
.
update
(
conn
->
{
PreparedStatement
ps
=
conn
.
prepareStatement
(
sql
);
PreparedStatement
ps
=
conn
.
prepareStatement
(
sql
);
ps
.
setBoolean
(
1
,
busy
);
if
(
jobId
==
null
)
{
ps
.
setNull
(
1
,
Types
.
VARCHAR
);
}
else
{
ps
.
setString
(
1
,
jobId
);
}
ps
.
setInt
(
2
,
nodeId
);
ps
.
setInt
(
2
,
nodeId
);
return
ps
;
return
ps
;
});
});
...
...
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