Replaces uses of config_get_param() in modules either with contains()
or get_string(). The config_get_param() is moved to internal headers,
as it allows seeing inside a config setting.
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
The schemarouter now also uses versioned configurations implemented by
shared pointers to configuration objects. Moved all the configuration
management into the Config class. Removed router options from
schemarouter.
Using the same implementation of the Backend and SessionCommand classes in
both schemarouter and readwritesplit will prevent duplication of code.
This commit only splits the generic parts of the class to a Backend class
which the schemarouter then extends. The session commands for both routers
are similar so they require no special handling.
The SERVER_REF and DCB members of the Backend class are now
private. Access to the stored SERVER_REF is provided with the backend()
function. No accompanying setter function is provided as the backend
server should not change during the lifetime of the session.
The creation of the internal DCB is hidden behind the connect()
function. It simplifies the process of connecting to a server by removing
the need to manually do the bookkeeping of the server reference connection
counts. Access to the DCB is provided by the dcb() function.
The closing of the backend is done with the close() function which
contains the code that was previously in closeSession. If the backend
isn't closed when the destructor is called, it will be done
automatically. This should prevent connection leakage.
The pending command queues and the methods used to write them are now also
internal to the backends. They are simple wrappers around dcb->func.write
and the interfaces provided by the Buffer class. The mapping command queue
is still public. It needs to be combined with the generic command queue.
The schemarouter now uses shared pointers. This removes the need to copy
the class.
Following changes move the member variables inside the Backend class.
Cleaned up the headers, removed unused structures. Changed some members to
strings instead of char arrays. Switch to router templates should now be
easier.
The sharding implementation now uses a class to abstract the details of
the shard. This allows for different design where each session makes a
copy of the global shard map which is then used for the duration of the
session. In addition to making the desing a bit clearer to understand, it
also removes lock competition between threads.
Due to the change to C++, the main entry points need to be wrapped in the
exception-safety macros. The next step in the refactoring will be to use
the router template. This will remove the need to manually define them.
The schemarouter now uses the new session commands. It uses a standard
library container to manage the execution and storage of session commands.
The session command history is disabled until a more complete refactoring
can be done.