Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
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
Harbor 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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
178cc08d
Commit
178cc08d
authored
3 years ago
by
Tigran Mkrtchyan
Browse files
Options
Downloads
Patches
Plain Diff
cta-dcache: add cancel retrieve request operation
parent
c669e1b6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cta-dcache/FrontendGRpcSvc.cpp
+31
-0
31 additions, 0 deletions
cta-dcache/FrontendGRpcSvc.cpp
cta-dcache/FrontendGRpcSvc.h
+1
-0
1 addition, 0 deletions
cta-dcache/FrontendGRpcSvc.h
cta-dcache/grpc-proto/protobuf/cta_dcache.proto
+15
-1
15 additions, 1 deletion
cta-dcache/grpc-proto/protobuf/cta_dcache.proto
with
47 additions
and
1 deletion
cta-dcache/FrontendGRpcSvc.cpp
+
31
−
0
View file @
178cc08d
...
...
@@ -190,6 +190,37 @@ Status CtaRpcImpl::Retrieve(::grpc::ServerContext* context, const ::cta::dcache:
return
Status
::
OK
;
}
Status
CtaRpcImpl
::
CancelRetrieve
(
::
grpc
::
ServerContext
*
context
,
const
::
cta
::
dcache
::
rpc
::
CancelRetrieveRequest
*
request
,
::
google
::
protobuf
::
Empty
*
response
)
{
cta
::
log
::
LogContext
lc
(
*
m_log
);
cta
::
log
::
ScopedParamContainer
sp
(
lc
);
sp
.
add
(
"remoteHost"
,
context
->
peer
());
lc
.
log
(
cta
::
log
::
DEBUG
,
"CancelRetrieve request"
);
sp
.
add
(
"request"
,
"cancel"
);
auto
instance
=
request
->
instance
().
name
();
// Unpack message
cta
::
common
::
dataStructures
::
CancelRetrieveRequest
cancelRequest
;
cancelRequest
.
requester
.
name
=
request
->
cli
().
user
().
username
();
cancelRequest
.
requester
.
group
=
request
->
cli
().
user
().
groupname
();
cancelRequest
.
archiveFileID
=
request
->
fid
();
cancelRequest
.
retrieveRequestId
=
request
->
reqid
();
sp
.
add
(
"instance"
,
instance
);
sp
.
add
(
"username"
,
request
->
cli
().
user
().
username
());
sp
.
add
(
"groupname"
,
request
->
cli
().
user
().
groupname
());
sp
.
add
(
"fileID"
,
request
->
fid
());
sp
.
add
(
"schedulerJobID"
,
request
->
reqid
());
m_scheduler
->
abortRetrieve
(
instance
,
cancelRequest
,
lc
);
lc
.
log
(
cta
::
log
::
INFO
,
"retrieve request canceled."
);
return
Status
::
OK
;
}
void
CtaRpcImpl
::
run
(
const
std
::
string
server_address
)
{
ServerBuilder
builder
;
...
...
This diff is collapsed.
Click to expand it.
cta-dcache/FrontendGRpcSvc.h
+
1
−
0
View file @
178cc08d
...
...
@@ -48,6 +48,7 @@ public:
Status
Archive
(
::
grpc
::
ServerContext
*
context
,
const
::
cta
::
dcache
::
rpc
::
ArchiveRequest
*
request
,
::
cta
::
dcache
::
rpc
::
ArchiveResponse
*
response
);
Status
Retrieve
(
::
grpc
::
ServerContext
*
context
,
const
::
cta
::
dcache
::
rpc
::
RetrieveRequest
*
request
,
::
cta
::
dcache
::
rpc
::
RetrieveResponse
*
response
);
Status
Delete
(
::
grpc
::
ServerContext
*
context
,
const
::
cta
::
dcache
::
rpc
::
DeleteRequest
*
request
,
::
google
::
protobuf
::
Empty
*
response
);
Status
CancelRetrieve
(
::
grpc
::
ServerContext
*
context
,
const
::
cta
::
dcache
::
rpc
::
CancelRetrieveRequest
*
request
,
::
google
::
protobuf
::
Empty
*
response
);
};
#endif //CTA_FRONTENDGRPCSVC_H
This diff is collapsed.
Click to expand it.
cta-dcache/grpc-proto/protobuf/cta_dcache.proto
+
15
−
1
View file @
178cc08d
...
...
@@ -52,7 +52,7 @@ message ArchiveRequest {
}
/*
*
ARCHI
VE request.
*
RETRIE
VE request.
*/
message
RetrieveRequest
{
cta.common.Service
instance
=
1
;
// client instance ID
...
...
@@ -62,6 +62,9 @@ message RetrieveRequest {
uint64
archiveId
=
5
;
// tape system unique file ID
}
/*
* DELETE request.
*/
message
DeleteRequest
{
cta.common.Service
instance
=
1
;
// client instance ID
cta.eos.Client
cli
=
2
;
// requester information
...
...
@@ -69,11 +72,22 @@ message DeleteRequest {
uint64
archiveId
=
4
;
// tape system unique file ID
}
/*
* CANCEL RETRIEVE request.
*/
message
CancelRetrieveRequest
{
cta.common.Service
instance
=
1
;
// client instance ID
cta.eos.Client
cli
=
2
;
// requester information
uint64
fid
=
3
;
// tape system unique file ID
string
reqId
=
4
;
// tape request scheduler ID, used to cancel the request
}
service
CtaRpc
{
rpc
Version
(
google.protobuf.Empty
)
returns
(
cta.admin.Version
)
{}
rpc
Archive
(
ArchiveRequest
)
returns
(
ArchiveResponse
)
{}
rpc
Retrieve
(
RetrieveRequest
)
returns
(
RetrieveResponse
)
{}
rpc
Delete
(
DeleteRequest
)
returns
(
google.protobuf.Empty
)
{}
rpc
CancelRetrieve
(
CancelRetrieveRequest
)
returns
(
google.protobuf.Empty
)
{}
}
\ No newline at end of file
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