After the introduction of the Fair I/O Queueing mechanism in Seastar, it is possible to add requests to a specific priority class, that will end up being serviced fairly. This patch introduces a Priority Manager service, that manages the priority each class of request will get. At this moment, having a class for that may sound like an overkill. However, the most interesting feature of the Fair I/O queue comes from being able to adjust the priorities dynamically as workloads changes: so we will benefit from having them all in the same place. This is designed to behave like one of our services, with the exception that it won't use the distributed interface. This is mainly because there is no reason to introduce that complexity at this point - since we can do thread local registration as we have been doing in Seastar, and because that would require us to change most of our tests to start a new service. Signed-off-by: Glauber Costa <glauber@scylladb.com>
28 lines
897 B
C++
28 lines
897 B
C++
/*
|
|
* Copyright 2016 ScyllaDB
|
|
*/
|
|
/*
|
|
* This file is part of Scylla.
|
|
*
|
|
* Scylla is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Scylla is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with Scylla. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#include "priority_manager.hh"
|
|
|
|
namespace service {
|
|
priority_manager& get_local_priority_manager() {
|
|
static thread_local priority_manager pm = priority_manager();
|
|
return pm;
|
|
}
|
|
}
|