Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
777 lines (724 sloc) 14 KB
# Copyright 2018 The Ripple Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Description:
# ripple - binlog server/router for mysql
licenses(["notice"]) # Apache 2.0
cc_binary(
name = "rippled",
srcs = [
"rippled.cc",
"rippled.h",
],
deps = [
":base",
":binlog",
":file",
":listener",
":management_session",
":manager",
":monitoring",
":mysql_init",
":mysql_master_session",
":mysql_server_port",
":mysql_slave_session",
":plugin",
":plugin_h",
":purge_thread",
":session_factory",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "listener",
srcs = [
"listener.cc",
],
hdrs = [
"listener.h",
],
deps = [
":mysql_init",
":mysql_server_port",
":session",
":session_factory",
],
)
cc_library(
name = "purge_thread",
srcs = [
"purge_thread.cc",
],
hdrs = [
"purge_thread.h",
],
deps = [
":base",
":binlog",
":session",
],
)
cc_library(
name = "session",
srcs = [
"session.cc",
],
hdrs = [
"session.h",
],
deps = [
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "manager",
srcs = [
"manager.cc",
],
hdrs = [
"manager.h",
],
deps = [
":management_cc_proto",
":mysql_client_connection",
":mysql_master_session",
":mysql_slave_session",
":session_factory",
],
)
cc_library(
name = "management_session",
srcs = [
"management_session.cc",
],
hdrs = [
"management_session.h",
],
deps = [
":base",
":manager",
":mysql_server_port",
":session",
],
)
cc_library(
name = "mysql_master_session",
srcs = [
"mysql_master_session.cc",
],
hdrs = [
"mysql_master_session.h",
],
deps = [
":base",
":binlog",
":byte_order",
":log_event",
":monitoring",
":mysql_client_connection",
":mysql_constants",
":mysql_init",
":mysql_protocol",
":session",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "mysql_slave_session",
srcs = [
"mysql_slave_session.cc",
],
hdrs = ["mysql_slave_session.h"],
deps = [
":base",
":binlog",
":binlog_reader",
":byte_order",
":executor",
":gtid",
":monitoring",
":mysql_init",
":mysql_protocol",
":mysql_server_connection",
":resultset",
":session",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "session_factory",
srcs = [
"session_factory.cc",
],
hdrs = [
"session_factory.h",
],
deps = [
":base",
":binlog",
":connection",
":executor",
":monitoring",
":mysql_server_connection",
":mysql_slave_session",
],
)
cc_library(
name = "base",
srcs = [
"flags.cc",
"init.cc",
],
hdrs = [
"flags.h",
"init.h",
"logging.h",
],
deps = [
"@com_github_gflags_gflags//:gflags",
"@com_google_glog//:glog",
],
)
cc_library(
name = "mysql_constants",
srcs = [
"mysql_constants.cc",
],
hdrs = [
"mysql_constants.h",
],
)
cc_library(
name = "mysql_init",
srcs = [
"mysql_init.cc",
],
hdrs = [
"mysql_init.h",
],
deps = ["@external_libs//:mysqlclient"],
)
cc_library(
name = "mysql_protocol",
srcs = [
"mysql_protocol.cc",
],
hdrs = [
"mysql_protocol.h",
],
deps = [
":base",
":buffer",
":byte_order",
":log_event",
":mysql_server_connection",
":resultset",
"@external_libs//:mysqlclient",
"@external_libs//:zlib",
],
)
cc_library(
name = "mysql_util",
hdrs = ["mysql_util.h"],
deps = ["@external_libs//:mysqlclient"],
)
cc_library(
name = "resultset",
hdrs = ["resultset.h"],
deps = [":mysql_constants"],
)
cc_library(
name = "mysql_client_connection",
srcs = [
"mysql_client_connection.cc",
],
hdrs = [
"mysql_client_connection.h",
],
deps = [
":base",
":buffer",
":byte_order",
":connection",
":gtid",
":monitoring",
":mysql_constants",
":mysql_protocol",
":mysql_util",
"@com_google_absl//absl/strings",
"@external_libs//:mysqlclient",
],
)
cc_library(
name = "mysql_server_connection",
srcs = [
"mysql_server_connection.cc",
],
hdrs = [
"mysql_server_connection.h",
],
deps = [
":buffer",
":connection",
":monitoring",
"@external_libs//:mysqlclient",
],
)
cc_library(
name = "mysql_server_port",
srcs = [
"mysql_server_port.cc",
],
hdrs = [
"mysql_server_port.h",
],
deps = [
":base",
":mysql_server_connection",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "file_base",
hdrs = [
"file_base.h",
],
deps = [
":buffer",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "file_FILE",
srcs = [
"file_FILE.cc",
],
hdrs = [
"file_FILE.h",
],
deps = [
":file_base",
],
)
cc_library(
name = "file",
hdrs = [
"file.h",
],
deps = [
":file_FILE",
],
)
cc_library(
name = "my_crypt",
srcs = [
"my_crypt.cc",
"my_crypt_constants.h",
"my_crypt_key_management.cc",
"my_crypt_key_management.h",
"my_crypt_key_management_impl.cc",
],
hdrs = ["my_crypt.h"],
deps = [
"@external_libs//:mysqlclient",
"@external_libs//:openssl",
],
)
cc_library(
name = "encryption",
srcs = [
"encryption.cc",
],
hdrs = [
"encryption.h",
],
# Reuse encryption support added to mariadb
deps = [
":base",
":buffer",
":byte_order",
":file",
":file_util",
":log_event",
":monitoring",
":my_crypt",
":mysql_constants",
"@com_google_absl//absl/strings",
"@external_libs//:mysqlclient",
],
)
cc_library(
name = "monitoring",
srcs = [
"monitoring.cc",
],
hdrs = [
"monitoring.h",
],
deps = [
"@com_google_absl//absl/strings",
],
)
proto_library(
name = "management_proto",
srcs = ["management.proto"],
deps = [
"@com_google_protobuf//:wrappers_proto",
],
)
cc_proto_library(
name = "management_cc_proto",
deps = ["management_proto"],
)
cc_test(
name = "binlog_position_unittest",
size = "small",
srcs = [
"binlog_position_unittest.cc",
],
deps = [
":binlog_position",
":buffer",
":gtid",
":log_event",
":monitoring",
":mysql_constants",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gtid_unittest",
size = "small",
srcs = [
"gtid_unittest.cc",
],
deps = [
":gtid",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "file_position_unittest",
size = "small",
srcs = [
"file_position_unittest.cc",
],
deps = [
":file_position",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "binlog_index_unittest",
size = "small",
srcs = [
"binlog_index_unittest.cc",
],
deps = [
":binlog_index",
":binlog_reader",
":file",
":gtid",
":monitoring",
"@com_google_googletest//:gtest_main",
"@com_google_absl//absl/strings",
],
)
cc_test(
name = "mysql_server_port_unittest",
size = "small",
srcs = [
"mysql_server_port_unittest.cc",
],
deps = [
":base",
":executor",
":mysql_server_port",
":plugin",
":plugin_h",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "log_event_unittest",
size = "small",
srcs = [
"log_event_unittest.cc",
],
deps = [
":buffer",
":encryption",
":log_event",
":mysql_constants",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "file_unittest",
size = "small",
srcs = [
"file_unittest.cc",
],
deps = [
":file",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "encryption_unittest",
size = "small",
srcs = [
"encryption_unittest.cc",
],
deps = [
":encryption",
":file",
":log_event",
":mysql_constants",
":plugin",
"@com_google_googletest//:gtest_main",
],
)
plugin_list = [
"mysql_server_port_tcpip",
]
# Generate plugin.cc.
genrule(
name = "plugin_cc",
srcs = ["plugin.cc.in"],
outs = ["plugin.cc"],
cmd = (
"sed" +
" -e 's!@plugins@!" +
",".join(["plugin_%s" % i for i in plugin_list]) +
",!'" +
" -e 's!@pluginptrs@!" +
",".join(["\&plugin_%s" % i for i in plugin_list]) +
",!'" +
" $< > $@"
),
)
cc_library(
name = "plugin",
srcs = ["plugin.cc"],
deps = [
":mysql_server_port_tcpip",
":plugin_h",
],
alwayslink = 1,
)
cc_library(
name = "plugin_h",
hdrs = ["plugin.h"],
)
cc_library(
name = "mysql_server_port_tcpip",
srcs = [
"mysql_server_port_tcpip.cc",
],
hdrs = ["mysql_server_port_tcpip.h"],
deps = [
":base",
":mysql_constants",
":mysql_server_port",
":plugin_h",
"@external_libs//:mysqlclient",
],
)
cc_library(
name = "binlog",
srcs = [
"binlog.cc",
],
hdrs = [
"binlog.h",
],
deps = [
":base",
":binlog_index",
":binlog_position",
":binlog_reader",
":encryption",
":file",
":gtid",
":log_event",
":monitoring",
":mysql_client_connection",
":mysql_constants",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "binlog_index",
srcs = [
"binlog_index.cc",
],
hdrs = [
"binlog_index.h",
],
deps = [
":base",
":binlog_position",
":file",
":file_util",
":gtid",
":monitoring",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
],
)
cc_library(
name = "binlog_position",
srcs = [
"binlog_position.cc",
],
hdrs = [
"binlog_position.h",
],
deps = [
":base",
":file_position",
":gtid",
":log_event",
":monitoring",
":mysql_constants",
],
)
cc_library(
name = "binlog_reader",
srcs = [
"binlog_reader.cc",
],
hdrs = [
"binlog_reader.h",
],
deps = [
":base",
":binlog_index",
":binlog_position",
":buffer",
":encryption",
":file",
":file_util",
":log_event",
":monitoring",
":mysql_constants",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
],
)
cc_library(
name = "buffer",
hdrs = ["buffer.h"],
deps = [
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "byte_order",
hdrs = ["byte_order.h"],
)
cc_library(
name = "connection",
srcs = [
"connection.cc",
],
hdrs = [
"connection.h",
],
deps = [
"@com_google_absl//absl/synchronization",
],
)
cc_library(
name = "executor",
srcs = [
"executor.cc",
],
hdrs = [
"executor.h",
],
deps = [
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "file_util",
srcs = [
"file_util.cc",
],
hdrs = [
"file_util.h",
],
deps = [
":base",
":buffer",
":file",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "file_position",
srcs = [
"file_position.cc",
],
hdrs = [
"file_position.h",
],
deps = [
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "gtid",
srcs = [
"gtid.cc",
"mysql_compat.cc",
],
hdrs = [
"gtid.h",
"mysql_compat.h",
],
deps = [
":base",
":byte_order",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "log_event",
srcs = [
"log_event.cc",
],
hdrs = [
"log_event.h",
],
deps = [
":buffer",
":byte_order",
":gtid",
":mysql_constants",
],
)
You can’t perform that action at this time.