summaryrefslogtreecommitdiff
path: root/libservices
diff options
context:
space:
mode:
authorKartik Soneji <kartiksoneji@rocketmail.com>2021-08-31 14:09:47 +0200
committerSergei Golubchik <serg@mariadb.org>2021-10-27 15:55:14 +0200
commitbf8b699f649b7f947e8ad8eeeb48c3d5f973be39 (patch)
treef7aaf1d7f2557c4f970e76f94735acfe44128930 /libservices
parentc356714d77150433e096fe8f04a2184495d42efb (diff)
downloadmariadb-git-bf8b699f649b7f947e8ad8eeeb48c3d5f973be39.tar.gz
MDEV-12933 sort out the compression library chaos
bzip2/lz4/lzma/lzo/snappy compression is now provided via *services* they're almost like normal services, but in include/providers/ and they're supposed to provide exactly the same interface as original compression libraries (but not everything, only enough of if for the code to compile). the services are implemented via dummy functions that return corresponding error values (LZMA_PROG_ERROR, LZO_E_INTERNAL_ERROR, etc). the actual compression libraries are linked into corresponding provider plugins. Providers are daemon plugins that when loaded replace service pointers to point to actual compression functions. That is, run-time dependency on compression libraries is now on plugins, and the server doesn't need any compression libraries to run, but will automatically support the compression when a plugin is loaded. InnoDB and Mroonga use compression plugins now. RocksDB doesn't, because it comes with standalone utility binaries that cannot load plugins.
Diffstat (limited to 'libservices')
-rw-r--r--libservices/CMakeLists.txt7
-rw-r--r--libservices/provider_service_bzip2.c17
-rw-r--r--libservices/provider_service_lz4.c14
-rw-r--r--libservices/provider_service_lzma.c17
-rw-r--r--libservices/provider_service_lzo.c14
-rw-r--r--libservices/provider_service_snappy.c17
6 files changed, 85 insertions, 1 deletions
diff --git a/libservices/CMakeLists.txt b/libservices/CMakeLists.txt
index 6b47bb53fdb..8c559cb07f5 100644
--- a/libservices/CMakeLists.txt
+++ b/libservices/CMakeLists.txt
@@ -39,7 +39,12 @@ SET(MYSQLSERVICES_SOURCES
wsrep_service.c
json_service.c
sql_service.c
- )
+ provider_service_bzip2.c
+ provider_service_lz4.c
+ provider_service_lzma.c
+ provider_service_lzo.c
+ provider_service_snappy.c
+)
ADD_CONVENIENCE_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
diff --git a/libservices/provider_service_bzip2.c b/libservices/provider_service_bzip2.c
new file mode 100644
index 00000000000..f18ce55dd4e
--- /dev/null
+++ b/libservices/provider_service_bzip2.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2021 MariaDB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION provider_service_bzip2 = (void*) VERSION_provider_bzip2;
diff --git a/libservices/provider_service_lz4.c b/libservices/provider_service_lz4.c
new file mode 100644
index 00000000000..2653f86e26c
--- /dev/null
+++ b/libservices/provider_service_lz4.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2021 MariaDB
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION provider_service_lz4 = (void*) VERSION_provider_lz4;
diff --git a/libservices/provider_service_lzma.c b/libservices/provider_service_lzma.c
new file mode 100644
index 00000000000..79fc982140d
--- /dev/null
+++ b/libservices/provider_service_lzma.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2021 MariaDB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION provider_service_lzma = (void*) VERSION_provider_lzma;
diff --git a/libservices/provider_service_lzo.c b/libservices/provider_service_lzo.c
new file mode 100644
index 00000000000..8b72ac017ea
--- /dev/null
+++ b/libservices/provider_service_lzo.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2021 MariaDB
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION provider_service_lzo = (void*) VERSION_provider_lzo;
diff --git a/libservices/provider_service_snappy.c b/libservices/provider_service_snappy.c
new file mode 100644
index 00000000000..ac0415bad61
--- /dev/null
+++ b/libservices/provider_service_snappy.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2021 MariaDB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION provider_service_snappy= (void*) VERSION_provider_snappy;