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
1e5393c7
Commit
1e5393c7
authored
3 years ago
by
Tigran Mkrtchyan
Browse files
Options
Downloads
Patches
Plain Diff
frontend-gprc: initialize scheduler
parent
5b7ac24a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend_svc/gRPC/FrontendGRpcSvc.cpp
+18
-4
18 additions, 4 deletions
frontend_svc/gRPC/FrontendGRpcSvc.cpp
frontend_svc/gRPC/FrontendGRpcSvc.h
+1
-1
1 addition, 1 deletion
frontend_svc/gRPC/FrontendGRpcSvc.h
with
19 additions
and
5 deletions
frontend_svc/gRPC/FrontendGRpcSvc.cpp
+
18
−
4
View file @
1e5393c7
...
@@ -124,18 +124,22 @@ void CtaRpcImpl::run(const std::string server_address) {
...
@@ -124,18 +124,22 @@ void CtaRpcImpl::run(const std::string server_address) {
server
->
Wait
();
server
->
Wait
();
}
}
CtaRpcImpl
::
CtaRpcImpl
(
cta
::
log
::
LogContext
*
lc
,
std
::
unique_ptr
<
cta
::
catalogue
::
Catalogue
>
&
catalogue
)
:
CtaRpcImpl
::
CtaRpcImpl
(
cta
::
log
::
LogContext
*
lc
,
std
::
unique_ptr
<
cta
::
catalogue
::
Catalogue
>
&
catalogue
,
std
::
unique_ptr
<
cta
::
Scheduler
>
&
scheduler
)
:
m_catalogue
(
std
::
move
(
catalogue
))
{
m_catalogue
(
std
::
move
(
catalogue
))
,
m_scheduler
(
std
::
move
(
scheduler
))
{
m_log
=
lc
;
m_log
=
lc
;
}
}
using
namespace
cta
;
using
namespace
cta
;
using
namespace
cta
::
common
;
int
main
(
const
int
argc
,
char
*
const
*
const
argv
)
{
int
main
(
const
int
argc
,
char
*
const
*
const
argv
)
{
std
::
unique_ptr
<
cta
::
log
::
Logger
>
logger
=
std
::
unique_ptr
<
cta
::
log
::
Logger
>
(
new
log
::
StdoutLogger
(
"cta-dev"
,
"cta-grpc-frontend"
,
true
));
std
::
unique_ptr
<
cta
::
log
::
Logger
>
logger
=
std
::
unique_ptr
<
cta
::
log
::
Logger
>
(
new
log
::
StdoutLogger
(
"cta-dev"
,
"cta-grpc-frontend"
,
true
));
log
::
LogContext
lc
(
*
logger
);
log
::
LogContext
lc
(
*
logger
);
// use castor config to avoid dependency on xroot-ssi
Configuration
config
(
"/etc/cta/cta.conf"
);
std
::
string
server_address
(
"0.0.0.0:17017"
);
std
::
string
server_address
(
"0.0.0.0:17017"
);
// Initialise the Catalogue
// Initialise the Catalogue
...
@@ -155,6 +159,16 @@ int main(const int argc, char *const *const argv) {
...
@@ -155,6 +159,16 @@ int main(const int argc, char *const *const argv) {
exit
(
1
);
exit
(
1
);
}
}
CtaRpcImpl
svc
(
&
lc
,
catalogue
);
// Initialise the Scheduler
auto
backed
=
config
.
getConfEntString
(
"ObjectStore"
,
"BackendPath"
);
lc
.
log
(
log
::
INFO
,
"Using scheduler backend: "
+
backed
);
auto
sInit
=
cta
::
make_unique
<
SchedulerDBInit_t
>
(
"Frontend"
,
backed
,
*
logger
);
auto
scheddb
=
sInit
->
getSchedDB
(
*
catalogue
,
*
logger
);
scheddb
->
setBottomHalfQueueSize
(
25000
);
auto
scheduler
=
cta
::
make_unique
<
cta
::
Scheduler
>
(
*
catalogue
,
*
scheddb
,
5
,
2
*
1000
*
1000
);
CtaRpcImpl
svc
(
&
lc
,
catalogue
,
scheduler
);
svc
.
run
(
server_address
);
svc
.
run
(
server_address
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend_svc/gRPC/FrontendGRpcSvc.h
+
1
−
1
View file @
1e5393c7
...
@@ -40,7 +40,7 @@ private:
...
@@ -40,7 +40,7 @@ private:
cta
::
log
::
LogContext
*
m_log
;
cta
::
log
::
LogContext
*
m_log
;
public:
public:
CtaRpcImpl
(
cta
::
log
::
LogContext
*
lc
,
std
::
unique_ptr
<
cta
::
catalogue
::
Catalogue
>
&
catalogue
);
CtaRpcImpl
(
cta
::
log
::
LogContext
*
lc
,
std
::
unique_ptr
<
cta
::
catalogue
::
Catalogue
>
&
catalogue
,
std
::
unique_ptr
<
cta
::
Scheduler
>
&
scheduler
);
void
run
(
const
std
::
string
server_address
);
void
run
(
const
std
::
string
server_address
);
Status
Version
(
::
grpc
::
ServerContext
*
context
,
const
::
google
::
protobuf
::
Empty
*
request
,
::
cta
::
admin
::
Version
*
response
);
Status
Version
(
::
grpc
::
ServerContext
*
context
,
const
::
google
::
protobuf
::
Empty
*
request
,
::
cta
::
admin
::
Version
*
response
);
Status
GetTapes
(
::
grpc
::
ServerContext
*
context
,
const
::
google
::
protobuf
::
Empty
*
request
,
::
grpc
::
ServerWriter
<::
cta
::
admin
::
TapeLsItem
>*
writer
);
Status
GetTapes
(
::
grpc
::
ServerContext
*
context
,
const
::
google
::
protobuf
::
Empty
*
request
,
::
grpc
::
ServerWriter
<::
cta
::
admin
::
TapeLsItem
>*
writer
);
...
...
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