Make routingworker.hh public
Given that worker.hh was public, it made sense to make routingworker.hh public as well. This removes the need to include private headers in modules and allows C++ constructs to be used in C++ code when previously only the C API was available.
This commit is contained in:
@ -15,14 +15,16 @@
|
|||||||
#include <maxscale/ccdefs.hh>
|
#include <maxscale/ccdefs.hh>
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include <vector>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
#include <maxbase/semaphore.hh>
|
#include <maxbase/semaphore.hh>
|
||||||
#include <maxbase/worker.hh>
|
#include <maxbase/worker.hh>
|
||||||
#include <maxscale/poll.h>
|
#include <maxscale/poll.h>
|
||||||
#include <maxscale/query_classifier.h>
|
#include <maxscale/query_classifier.h>
|
||||||
#include <maxscale/routingworker.h>
|
#include <maxscale/routingworker.h>
|
||||||
|
#include <maxscale/session.hh>
|
||||||
|
|
||||||
#include "session.hh"
|
|
||||||
|
|
||||||
namespace maxscale
|
namespace maxscale
|
||||||
{
|
{
|
||||||
38
include/maxscale/session.hh
Normal file
38
include/maxscale/session.hh
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 MariaDB Corporation Ab
|
||||||
|
*
|
||||||
|
* Use of this software is governed by the Business Source License included
|
||||||
|
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
|
||||||
|
*
|
||||||
|
* Change Date: 2022-01-01
|
||||||
|
*
|
||||||
|
* On the date above, in accordance with the Business Source License, use
|
||||||
|
* of this software will be governed by version 2 or later of the General
|
||||||
|
* Public License.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <maxscale/utils.hh>
|
||||||
|
|
||||||
|
namespace maxscale
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Specialization of RegistryTraits for the session registry.
|
||||||
|
*/
|
||||||
|
template<>
|
||||||
|
struct RegistryTraits<MXS_SESSION>
|
||||||
|
{
|
||||||
|
typedef uint64_t id_type;
|
||||||
|
typedef MXS_SESSION* entry_type;
|
||||||
|
|
||||||
|
static id_type get_id(entry_type entry)
|
||||||
|
{
|
||||||
|
return entry->ses_id;
|
||||||
|
}
|
||||||
|
static entry_type null_entry()
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@ -51,9 +51,9 @@
|
|||||||
#include <maxscale/service.h>
|
#include <maxscale/service.h>
|
||||||
#include <maxscale/spinlock.h>
|
#include <maxscale/spinlock.h>
|
||||||
#include <maxscale/utils.h>
|
#include <maxscale/utils.h>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include "internal/modules.h"
|
#include "internal/modules.h"
|
||||||
#include "internal/routingworker.hh"
|
|
||||||
#include "internal/session.h"
|
#include "internal/session.h"
|
||||||
|
|
||||||
using maxscale::RoutingWorker;
|
using maxscale::RoutingWorker;
|
||||||
|
|||||||
@ -58,6 +58,7 @@
|
|||||||
#include <maxscale/utils.h>
|
#include <maxscale/utils.h>
|
||||||
#include <maxscale/version.h>
|
#include <maxscale/version.h>
|
||||||
#include <maxscale/random.h>
|
#include <maxscale/random.h>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include "internal/admin.hh"
|
#include "internal/admin.hh"
|
||||||
#include "internal/config.hh"
|
#include "internal/config.hh"
|
||||||
@ -65,7 +66,6 @@
|
|||||||
#include "internal/modules.h"
|
#include "internal/modules.h"
|
||||||
#include "internal/monitor.h"
|
#include "internal/monitor.h"
|
||||||
#include "internal/poll.hh"
|
#include "internal/poll.hh"
|
||||||
#include "internal/routingworker.hh"
|
|
||||||
#include "internal/service.hh"
|
#include "internal/service.hh"
|
||||||
#include "internal/statistics.h"
|
#include "internal/statistics.h"
|
||||||
|
|
||||||
|
|||||||
@ -26,27 +26,10 @@
|
|||||||
|
|
||||||
#include "filter.hh"
|
#include "filter.hh"
|
||||||
#include "service.hh"
|
#include "service.hh"
|
||||||
|
#include "session.h"
|
||||||
|
|
||||||
namespace maxscale
|
namespace maxscale
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Specialization of RegistryTraits for the session registry.
|
|
||||||
*/
|
|
||||||
template<>
|
|
||||||
struct RegistryTraits<MXS_SESSION>
|
|
||||||
{
|
|
||||||
typedef uint64_t id_type;
|
|
||||||
typedef MXS_SESSION* entry_type;
|
|
||||||
|
|
||||||
static id_type get_id(entry_type entry)
|
|
||||||
{
|
|
||||||
return entry->ses_id;
|
|
||||||
}
|
|
||||||
static entry_type null_entry()
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct SESSION_VARIABLE
|
typedef struct SESSION_VARIABLE
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,8 +15,9 @@
|
|||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include "internal/maxscale.h"
|
#include "internal/maxscale.h"
|
||||||
#include "internal/routingworker.hh"
|
|
||||||
#include "internal/service.hh"
|
#include "internal/service.hh"
|
||||||
|
|
||||||
static time_t started;
|
static time_t started;
|
||||||
|
|||||||
@ -34,8 +34,9 @@
|
|||||||
#include <maxscale/clock.h>
|
#include <maxscale/clock.h>
|
||||||
#include <maxscale/server.h>
|
#include <maxscale/server.h>
|
||||||
#include <maxscale/statistics.h>
|
#include <maxscale/statistics.h>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include "internal/poll.hh"
|
#include "internal/poll.hh"
|
||||||
#include "internal/routingworker.hh"
|
|
||||||
|
|
||||||
using maxbase::Worker;
|
using maxbase::Worker;
|
||||||
using maxscale::RoutingWorker;
|
using maxscale::RoutingWorker;
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
#include <maxscale/modulecmd.h>
|
#include <maxscale/modulecmd.h>
|
||||||
#include <maxscale/server.hh>
|
#include <maxscale/server.hh>
|
||||||
#include <maxscale/spinlock.hh>
|
#include <maxscale/spinlock.hh>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include "internal/config_runtime.h"
|
#include "internal/config_runtime.h"
|
||||||
#include "internal/filter.hh"
|
#include "internal/filter.hh"
|
||||||
@ -33,7 +34,6 @@
|
|||||||
#include "internal/modules.h"
|
#include "internal/modules.h"
|
||||||
#include "internal/monitor.h"
|
#include "internal/monitor.h"
|
||||||
#include "internal/query_classifier.hh"
|
#include "internal/query_classifier.hh"
|
||||||
#include "internal/routingworker.hh"
|
|
||||||
#include "internal/service.hh"
|
#include "internal/service.hh"
|
||||||
#include "internal/session.h"
|
#include "internal/session.h"
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
* Public License.
|
* Public License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "internal/routingworker.hh"
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|||||||
@ -45,10 +45,10 @@
|
|||||||
#include <maxscale/http.hh>
|
#include <maxscale/http.hh>
|
||||||
#include <maxscale/maxscale.h>
|
#include <maxscale/maxscale.h>
|
||||||
#include <maxscale/server.hh>
|
#include <maxscale/server.hh>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include "internal/monitor.h"
|
#include "internal/monitor.h"
|
||||||
#include "internal/poll.hh"
|
#include "internal/poll.hh"
|
||||||
#include "internal/routingworker.hh"
|
|
||||||
#include "internal/config.hh"
|
#include "internal/config.hh"
|
||||||
#include "internal/service.hh"
|
#include "internal/service.hh"
|
||||||
#include "internal/modules.h"
|
#include "internal/modules.h"
|
||||||
|
|||||||
@ -53,12 +53,12 @@
|
|||||||
#include <maxscale/version.h>
|
#include <maxscale/version.h>
|
||||||
#include <maxscale/json_api.h>
|
#include <maxscale/json_api.h>
|
||||||
#include <maxscale/routingworker.h>
|
#include <maxscale/routingworker.h>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include "internal/config.hh"
|
#include "internal/config.hh"
|
||||||
#include "internal/filter.hh"
|
#include "internal/filter.hh"
|
||||||
#include "internal/modules.h"
|
#include "internal/modules.h"
|
||||||
#include "internal/service.hh"
|
#include "internal/service.hh"
|
||||||
#include "internal/routingworker.hh"
|
|
||||||
#include "internal/maxscale.h"
|
#include "internal/maxscale.h"
|
||||||
|
|
||||||
/** This define is needed in CentOS 6 systems */
|
/** This define is needed in CentOS 6 systems */
|
||||||
|
|||||||
@ -39,11 +39,11 @@
|
|||||||
#include <maxscale/utils.h>
|
#include <maxscale/utils.h>
|
||||||
#include <maxscale/json_api.h>
|
#include <maxscale/json_api.h>
|
||||||
#include <maxscale/protocol/mysql.h>
|
#include <maxscale/protocol/mysql.h>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include "internal/dcb.h"
|
#include "internal/dcb.h"
|
||||||
#include "internal/filter.hh"
|
#include "internal/filter.hh"
|
||||||
#include "internal/routingworker.hh"
|
#include "internal/session.hh"
|
||||||
#include "internal/session.h"
|
|
||||||
#include "internal/service.hh"
|
#include "internal/service.hh"
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|||||||
@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
#include <maxscale/config.h>
|
#include <maxscale/config.h>
|
||||||
#include <maxscale/listener.h>
|
#include <maxscale/listener.h>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include "../internal/routingworker.hh"
|
|
||||||
#include "../dcb.cc"
|
#include "../dcb.cc"
|
||||||
#include "test_utils.h"
|
#include "test_utils.h"
|
||||||
|
|
||||||
|
|||||||
@ -24,11 +24,11 @@
|
|||||||
#include <maxscale/query_classifier.h>
|
#include <maxscale/query_classifier.h>
|
||||||
#include <maxscale/paths.h>
|
#include <maxscale/paths.h>
|
||||||
#include <maxscale/alloc.h>
|
#include <maxscale/alloc.h>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include "../internal/poll.hh"
|
#include "../internal/poll.hh"
|
||||||
#include "../internal/routingworker.hh"
|
|
||||||
#include "../internal/statistics.h"
|
#include "../internal/statistics.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -12,11 +12,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <maxscale/protocol/mariadb_client.hh>
|
#include <maxscale/protocol/mariadb_client.hh>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
#include <maxscale/utils.h>
|
#include <maxscale/utils.h>
|
||||||
|
|
||||||
// TODO: Find a way to cleanly expose this
|
|
||||||
#include "../../../core/internal/routingworker.hh"
|
|
||||||
|
|
||||||
#ifdef EPOLLRDHUP
|
#ifdef EPOLLRDHUP
|
||||||
#define ERROR_EVENTS (EPOLLRDHUP | EPOLLHUP | EPOLLERR)
|
#define ERROR_EVENTS (EPOLLRDHUP | EPOLLHUP | EPOLLERR)
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -54,6 +54,7 @@
|
|||||||
#include <maxscale/utils.h>
|
#include <maxscale/utils.h>
|
||||||
#include <maxscale/version.h>
|
#include <maxscale/version.h>
|
||||||
#include <maxscale/routingworker.h>
|
#include <maxscale/routingworker.h>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
|
|
||||||
#include <debugcli.h>
|
#include <debugcli.h>
|
||||||
|
|
||||||
@ -65,7 +66,6 @@
|
|||||||
#include "../../../core/internal/poll.hh"
|
#include "../../../core/internal/poll.hh"
|
||||||
#include "../../../core/internal/session.h"
|
#include "../../../core/internal/session.h"
|
||||||
#include "../../../core/internal/filter.hh"
|
#include "../../../core/internal/filter.hh"
|
||||||
#include "../../../core/internal/routingworker.hh"
|
|
||||||
|
|
||||||
#define MAXARGS 14
|
#define MAXARGS 14
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user