Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
87d9b62e
Commit
87d9b62e
authored
Oct 28, 2015
by
Eric Cano
Browse files
Added missing success() implementation for retrieve jobs.
parent
67316087
Changes
5
Hide whitespace changes
Inline
Side-by-side
objectstore/RetrieveToFileRequest.cpp
View file @
87d9b62e
...
...
@@ -54,6 +54,24 @@ void cta::objectstore::RetrieveToFileRequest::addJob(const cta::TapeFileLocation
j
->
set_fseq
(
tapeFileLocation
.
fSeq
);
}
bool
cta
::
objectstore
::
RetrieveToFileRequest
::
setJobSuccessful
(
uint16_t
copyNumber
)
{
checkPayloadWritable
();
auto
*
jl
=
m_payload
.
mutable_jobs
();
for
(
auto
j
=
jl
->
begin
();
j
!=
jl
->
end
();
j
++
)
{
if
(
j
->
copynb
()
==
copyNumber
)
{
j
->
set_status
(
serializers
::
RetrieveJobStatus
::
RJS_Complete
);
for
(
auto
j2
=
jl
->
begin
();
j2
!=
jl
->
end
();
j2
++
)
{
if
(
j2
->
status
()
!=
serializers
::
RetrieveJobStatus
::
RJS_Complete
&&
j2
->
status
()
!=
serializers
::
RetrieveJobStatus
::
RJS_Failed
)
return
false
;
}
return
true
;
}
}
throw
NoSuchJob
(
"In RetrieveToFileRequest::setJobSuccessful(): job not found"
);
}
void
cta
::
objectstore
::
RetrieveToFileRequest
::
setArchiveFile
(
const
cta
::
ArchiveFile
&
archiveFile
)
{
checkPayloadWritable
();
...
...
objectstore/RetrieveToFileRequest.hpp
View file @
87d9b62e
...
...
@@ -43,6 +43,7 @@ public:
uint16_t
maxRetiesWithinMount
,
uint16_t
maxTotalRetries
);
void
setJobSelected
(
uint16_t
copyNumber
,
const
std
::
string
&
owner
);
void
setJobPending
(
uint16_t
copyNumber
);
bool
setJobSuccessful
(
uint16_t
copyNumber
);
//< returns true if this is the last job
class
JobDump
{
public:
uint16_t
copyNb
;
...
...
scheduler/OStoreDB/OStoreDB.cpp
View file @
87d9b62e
...
...
@@ -1750,7 +1750,22 @@ OStoreDB::RetrieveJob::~RetrieveJob() {
}
void
OStoreDB
::
RetrieveJob
::
succeed
()
{
throw
NotImplemented
(
""
);
// Lock the request and set the job as successful.
objectstore
::
ScopedExclusiveLock
rtfrl
(
m_rtfr
);
m_rtfr
.
fetch
();
std
::
string
rtfrAddress
=
m_rtfr
.
getAddressIfSet
();
if
(
m_rtfr
.
setJobSuccessful
(
m_copyNb
))
{
m_rtfr
.
remove
();
}
else
{
m_rtfr
.
commit
();
}
// We no more own the job (which could be gone)
m_jobOwned
=
false
;
// Remove ownership form the agent
objectstore
::
ScopedExclusiveLock
al
(
m_agent
);
m_agent
.
fetch
();
m_agent
.
removeFromOwnership
(
rtfrAddress
);
m_agent
.
commit
();
}
...
...
scheduler/RetrieveJob.cpp
View file @
87d9b62e
...
...
@@ -43,6 +43,7 @@ cta::RetrieveJob::RetrieveJob(RetrieveMount &mount,
// complete
//------------------------------------------------------------------------------
void
cta
::
RetrieveJob
::
complete
()
{
m_dbJob
->
succeed
();
}
//------------------------------------------------------------------------------
...
...
tapeserver/castor/log/SyslogLogger.hpp
View file @
87d9b62e
...
...
@@ -409,8 +409,8 @@ protected:
// Check the parameter name, if it's an empty string set the value to
// "Undefined".
const
std
::
string
name
=
param
.
getName
()
==
""
?
"Undefined"
:
cleanString
(
param
.
getName
(),
true
);
const
std
::
string
name
=
(
param
.
getName
()
==
""
?
"Undefined"
:
cleanString
(
param
.
getName
(),
true
)
)
;
// Process the parameter value
const
std
::
string
value
=
cleanString
(
param
.
getValue
(),
false
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment