Commit Graph

245 Commits

Author SHA1 Message Date
415001a4cd Merge branch '2.1' into develop 2017-03-09 10:02:36 +02:00
41ff01d16d Merge branch '2.0' into 2.1 2017-03-09 10:01:38 +02:00
e1a1959bc2 Replace strerror_r with mxs_strerror
The mxs_strerror function requires no local buffer, thus making it simpler
and cleaner to use.
2017-03-09 09:36:57 +02:00
8be44a8cda Merge branch '2.1' into develop 2017-03-06 11:25:44 +02:00
bb22b82461 Merge branch '2.0' into 2.1 2017-03-06 10:38:07 +02:00
b3e8ea9b5a Merge branch '2.1' into develop 2017-03-03 13:37:14 +02:00
789c14197d Merge branch '2.0' into 2.1 2017-03-02 14:05:42 +02:00
560bd1e507 Update MXS_ROUTER_OBJECT APIs
Now the type MXS_ROUTER_SESSION is used in MXS_ROUTER_OBJECT.
All routers updated accordingly.
2017-02-27 10:17:57 +02:00
c3cc46ae04 Add deflate compression to avrorouter
The avrorouter can now compress the Avro files using the deflate algorithm
provided by zlib.
2017-02-21 16:19:09 +02:00
c47ef968f7 Add initial support for deflate compression in maxavro
Maxavro now supports reading records with the zlib deflate
algorithm.

With this change, each data block is read into memory in one IO
operation. This allows the library to decompress the data block if
necessary.

The avrorouter does not yet use compression when writing the records.
2017-02-21 16:14:47 +02:00
61f2d96a58 Merge branch '2.0' into 2.1 2017-02-20 11:17:49 +02:00
49cc2b52e3 Merge branch '2.1.0' into 2.1 2017-02-15 08:44:55 +02:00
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
2a49cd6451 getCapabilities now get the instance as argument
Allows the capabilities to be different depending on how the
filter/router has been configured.
2017-02-14 13:55:22 +02:00
7e23789364 Fix one last compilation error
Fix one ignored return value in Avro, caused compilation to fail.
2017-02-13 14:46:43 +02:00
eb1e163bdf Only update index file if file is flushed to disk
There's no point in indexing the file if it hasn't been synced to
disk. Any attempts to index the file will fail if the file still has an
open data block.
2017-02-12 04:38:24 +02:00
d2c3be8728 Fix compiler flag usage
The compiler flags overwrote the default values that CMake generates
instead of appending to them.
2017-02-10 17:19:46 +02:00
a6698c6f07 Merge branch '2.1.0' into 2.1 2017-02-08 09:30:34 +02:00
c82831cc10 Fix merge conflict
An old define name caused the build to fail.
2017-02-08 09:29:26 +02:00
67888f3596 Merge branch '2.0' into 2.1.0 2017-02-08 09:27:00 +02:00
7149775163 Use correct enum values in avrorouter
The file flushing enums weren't used.
2017-02-07 10:21:58 +02:00
d61f0d0afd Remove useless debug assertion
The debug assertion assumes that the table definition is always in the
binlogs. If a binlog row event without a table definition is read, debug
versions would crash even though the situation is acceptable and expected.
2017-02-07 10:21:58 +02:00
e64a641bcd Merge branch '2.0' into develop 2017-02-01 09:35:13 +02:00
8b83bf834e Clean up router.h
Nothing moved to core, just rename and cleanup.
2017-01-26 16:14:17 +02:00
7d51864402 Clean config.h some more
Moved some typedefs to router.h and server.h, changed a few
constants to these enums. Renamed some types in config.h to
remove "Gateway".

There are still some functions in the public header which are
only used in core, but they seem to fit the theme of public functions
so were not moved.
2017-01-25 16:05:51 +02:00
6e38276a20 Rename files, removing "gw"-prefix
Also gwdirs.h.in -> paths.h.in
2017-01-20 12:55:52 +02:00
5fc7b277da Change SESSION to MXS_SESSION
Some modules didn't use the new MXS_SESSION structure.
2017-01-18 08:31:47 +02:00
a48be9badf Format router modules
Formatted router modules with Astyle.
2017-01-17 14:48:43 +02:00
5b92a1f467 Remove explicit module name from log messages
The module name doesn't need to be logged as MXS_MODULE_NAME will be
automatically added as a prefix to all messages logged by the module.
2017-01-17 12:51:08 +02:00
2cabcea211 Add definitions of MXS_MODULE_NAME to all modules
All modules now declare a name for the module. This is name is added as a
prefix to all messages logged by a module. The prefix should help
determine which part of the system logs a message.
2017-01-16 11:28:34 +02:00
60d4e17996 Allow restriction of module command arguments
The module commands now support an optional flag for arguments that when
enabled checks that the argument module name matches the registered domain
name. This can be used to enforce argument type validity for arguments
that are given to modules that expect objects of a certain type.

For example, this is used by the cache and dbfwfilter to prevent valid
filters but of the wrong type being given as arguments.
2017-01-13 15:28:36 +02:00
73a1388468 Check and create binlogdir and avrodir before use
The binlog and avro file directories should be checked before they are
used and if they don't exist, they should be created.
2017-01-10 16:52:29 +02:00
a2a38f952a Add [process|thread] [init|finish] functions to modules
The MXS_MODULDE object now contains optinal pointers for functions
to be called att process and thread startup and shutdown. Since the
functions were added to the end, strictly speaking, all structures
would not have needed to have been modified, but better to be
explicit. In a subsequent change, these will be called.

C++ does not support flexible arrays, so for the time being C++
modules are restricted to 10 parameters. Better approach is to
factor out the parameters to a separate array and then just store
a pointer to that array in MXS_MODULE.
2017-01-05 14:44:02 +02:00
410ba7726e Copy avrorouter options to parameters
The avrorouter router_options values can now also be defined as
parameters. This should make the configuration definition a lot cleaner.
2017-01-05 10:50:02 +02:00
2e074f4eb4 Introduce common SQLite header
The header declares the missing v2 handle closing function for older
versions of SQLite.
2017-01-05 09:58:11 +02:00
c96bd64aa8 Rename MODULE_INFO to MXS_MODULE
The MODULE_INFO is now the main object which is used by modules to convey
information to the MaxScale core. The MXS_MODULE name is more apt as it
now contains the actual module definition.

The old MODULES structure was moved into load_utils.c as an internal
implementation and was renamed so that it is not confused with the new
MODULE structure.
2017-01-03 18:01:14 +02:00
b00e0328d5 Create a macro for module declarations
The modules are now declared with a common macro. This allows future
additions to the module loading process while also making the loaded
symbol name a constant.
2017-01-03 18:01:13 +02:00
ae0577c695 Move module object inside MODULE_INFO
This allows modules to only expose one entry point with a consistent
signature. In the future, this could be used to implement declarations of
module parameters.
2017-01-03 18:01:13 +02:00
eaf3633728 Only flush tables to disk at the end of the binlog
Currently, when the avrorouter finishes reading a binlog file or when a
certain number of rows or transactions is reached, it will flush all
tables to disk. This is quite slow as events can easily be written faster
into the binlog than they can be processed by avrorouter.

A solution to this would be to only sync the tables (close the Avro block)
instead of flushing them to disk. This would allow more efficient
processing of the files while still retaining the safe shutdown that
flushing offers.
2017-01-02 09:31:21 +02:00
b40872e600 Prefix le[int|str]-functions with "mxs_" 2016-12-29 10:10:11 +02:00
269a97b2de Fix DECIMAL handling in Avrorouter
The DECIMAL value type is now properly handled in Avrorouter. It is
processed into an Avro double value when before it was ignored and
replaced with a zero integer.
2016-12-19 10:33:55 +02:00
488a9d24e3 Stop the Avrorouter when MaxScale is shutting down
This allows for a faster controlled shutdown when binary log files are
being indexed.
2016-12-19 10:33:55 +02:00
4ae85dc754 Merge branch '2.0' into develop 2016-12-05 21:19:59 +02:00
f5280fecfe Fix avrouter/CMakeLists.txt
Needed to be updated when binlog was renamed to binlogrouter.
2016-12-01 15:55:25 +02:00
aef6c7b099 Make directory name equal to the library name
* avro -> avrorouter
* binlog -> binlogrouter
2016-12-01 15:23:42 +02:00