Make query_classifier part of core.

The query classifier interface is now built as an integral
part of MaxScale core.
This commit is contained in:
Johan Wikman 2016-02-08 11:26:35 +02:00
parent 834d04ed6c
commit 4a4f22c9a7
14 changed files with 33 additions and 42 deletions

View File

@ -165,7 +165,6 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-ggdb")
include_directories(utils)
include_directories(log_manager)
include_directories(query_classifier)
include_directories(server/include)
include_directories(server/include/maxscale)
include_directories(server/inih)

View File

@ -1,11 +1,3 @@
add_library(query_classifier SHARED query_classifier.cc)
target_link_libraries(query_classifier maxscale-common)
set_target_properties(query_classifier PROPERTIES VERSION "1.0.0")
set_target_properties(query_classifier PROPERTIES LINK_FLAGS -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/query_classifier.map)
set_target_properties(query_classifier PROPERTIES LINK_FLAGS -Wl,-z,defs)
install(TARGETS query_classifier COMPONENT lib DESTINATION ${MAXSCALE_LIBDIR})
add_subdirectory(qc_mysqlembedded)
if(BUILD_TESTS)

View File

@ -17,5 +17,5 @@ endif()
add_subdirectory(canonical_tests)
add_executable(classify classify.c)
target_link_libraries(classify query_classifier maxscale-common)
target_link_libraries(classify maxscale-common)
add_test(Internal-TestQueryClassifier classify ${CMAKE_CURRENT_SOURCE_DIR}/input.sql ${CMAKE_CURRENT_SOURCE_DIR}/expected.sql)

View File

@ -8,7 +8,7 @@ else()
endif()
endif()
add_executable(canonizer canonizer.c)
target_link_libraries(canonizer query_classifier maxscale-common)
target_link_libraries(canonizer maxscale-common)
add_test(NAME Internal-CanonicalQuery COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/canontest.sh
${CMAKE_CURRENT_BINARY_DIR}/test.log
${CMAKE_CURRENT_SOURCE_DIR}/input.sql

View File

@ -1,4 +1,4 @@
add_library(maxscale-common SHARED adminusers.c atomic.c buffer.c config.c dbusers.c dcb.c filter.c externcmd.c gwbitmask.c gwdirs.c gw_utils.c hashtable.c hint.c housekeeper.c load_utils.c maxscale_pcre2.c memlog.c modutil.c monitor.c poll.c random_jkiss.c resultset.c secrets.c server.c service.c session.c spinlock.c thread.c users.c utils.c ${CMAKE_SOURCE_DIR}/log_manager/log_manager.cc ${CMAKE_SOURCE_DIR}/utils/skygw_utils.cc statistics.c)
add_library(maxscale-common SHARED adminusers.c atomic.c buffer.c config.c dbusers.c dcb.c filter.c externcmd.c gwbitmask.c gwdirs.c gw_utils.c hashtable.c hint.c housekeeper.c load_utils.c maxscale_pcre2.c memlog.c modutil.c monitor.c query_classifier.c poll.c random_jkiss.c resultset.c secrets.c server.c service.c session.c spinlock.c thread.c users.c utils.c ${CMAKE_SOURCE_DIR}/log_manager/log_manager.cc ${CMAKE_SOURCE_DIR}/utils/skygw_utils.cc statistics.c)
target_link_libraries(maxscale-common ${MARIADB_CONNECTOR_LIBRARIES} ${LZMA_LINK_FLAGS} ${PCRE2_LIBRARIES} ${CURL_LIBRARIES} ssl aio pthread crypt dl crypto inih z rt m stdc++)
@ -21,15 +21,15 @@ elseif(WITH_TCMALLOC)
target_link_libraries(maxscale ${TCMALLOC_LIBRARIES})
endif()
target_link_libraries(maxscale maxscale-common query_classifier)
target_link_libraries(maxscale maxscale-common)
install(TARGETS maxscale DESTINATION ${MAXSCALE_BINDIR})
add_executable(maxkeys maxkeys.c)
target_link_libraries(maxkeys maxscale-common query_classifier)
target_link_libraries(maxkeys maxscale-common)
install(TARGETS maxkeys DESTINATION ${MAXSCALE_BINDIR})
add_executable(maxpasswd maxpasswd.c)
target_link_libraries(maxpasswd maxscale-common query_classifier)
target_link_libraries(maxpasswd maxscale-common)
install(TARGETS maxpasswd DESTINATION ${MAXSCALE_BINDIR})
if(BUILD_TESTS)

View File

@ -15,22 +15,22 @@ add_executable(test_users testusers.c)
add_executable(testfeedback testfeedback.c)
add_executable(testmaxscalepcre2 testmaxscalepcre2.c)
add_executable(testmemlog testmemlog.c)
target_link_libraries(test_adminusers maxscale-common query_classifier)
target_link_libraries(test_buffer maxscale-common query_classifier)
target_link_libraries(test_dcb maxscale-common query_classifier)
target_link_libraries(test_filter maxscale-common query_classifier)
target_link_libraries(test_hash maxscale-common query_classifier)
target_link_libraries(test_hint maxscale-common query_classifier)
target_link_libraries(test_modutil maxscale-common query_classifier)
target_link_libraries(test_mysql_users MySQLClient maxscale-common query_classifier)
target_link_libraries(test_poll maxscale-common query_classifier)
target_link_libraries(test_server maxscale-common query_classifier)
target_link_libraries(test_service maxscale-common query_classifier)
target_link_libraries(test_spinlock maxscale-common query_classifier)
target_link_libraries(test_users maxscale-common query_classifier)
target_link_libraries(testfeedback maxscale-common query_classifier)
target_link_libraries(testmaxscalepcre2 maxscale-common query_classifier)
target_link_libraries(testmemlog maxscale-common query_classifier)
target_link_libraries(test_adminusers maxscale-common)
target_link_libraries(test_buffer maxscale-common)
target_link_libraries(test_dcb maxscale-common)
target_link_libraries(test_filter maxscale-common)
target_link_libraries(test_hash maxscale-common)
target_link_libraries(test_hint maxscale-common)
target_link_libraries(test_modutil maxscale-common)
target_link_libraries(test_mysql_users MySQLClient maxscale-common)
target_link_libraries(test_poll maxscale-common)
target_link_libraries(test_server maxscale-common)
target_link_libraries(test_service maxscale-common)
target_link_libraries(test_spinlock maxscale-common)
target_link_libraries(test_users maxscale-common)
target_link_libraries(testfeedback maxscale-common)
target_link_libraries(testmaxscalepcre2 maxscale-common)
target_link_libraries(testmemlog maxscale-common)
add_test(Internal-TestAdminUsers test_adminusers)
add_test(Internal-TestBuffer test_buffer)
add_test(Internal-TestDCB test_dcb)

View File

@ -2,7 +2,7 @@ if(BUILD_RABBITMQ)
if(RABBITMQ_FOUND)
include_directories(${RABBITMQ_HEADERS})
add_library(mqfilter SHARED mqfilter.c)
target_link_libraries(mqfilter query_classifier maxscale-common ${RABBITMQ_LIBRARIES})
target_link_libraries(mqfilter maxscale-common ${RABBITMQ_LIBRARIES})
add_dependencies(mqfilter pcre2)
install(TARGETS mqfilter DESTINATION ${MAXSCALE_LIBDIR})
else()
@ -37,7 +37,7 @@ set_target_properties(topfilter PROPERTIES VERSION "1.0.1")
install(TARGETS topfilter DESTINATION ${MAXSCALE_LIBDIR})
add_library(dbfwfilter SHARED dbfwfilter.c)
target_link_libraries(dbfwfilter maxscale-common query_classifier)
target_link_libraries(dbfwfilter maxscale-common)
set_target_properties(dbfwfilter PROPERTIES VERSION "1.0.0")
install(TARGETS dbfwfilter DESTINATION ${MAXSCALE_LIBDIR})
@ -49,7 +49,7 @@ install(TARGETS namedserverfilter DESTINATION ${MAXSCALE_LIBDIR})
if(BUILD_SLAVELAG)
add_library(slavelag SHARED slavelag.c)
target_link_libraries(slavelag maxscale-common query_classifier)
target_link_libraries(slavelag maxscale-common)
set_target_properties(slavelag PROPERTIES VERSION "1.1.0")
install(TARGETS slavelag DESTINATION ${MAXSCALE_LIBDIR})
endif()
@ -57,7 +57,7 @@ endif()
if(BUILD_TOOLS)
add_executable(ruleparser dbfwfilter.c)
target_compile_definitions(ruleparser PUBLIC "BUILD_RULE_PARSER")
target_link_libraries(ruleparser maxscale-common query_classifier)
target_link_libraries(ruleparser maxscale-common)
install(TARGETS ruleparser DESTINATION ${MAXSCALE_BINDIR})
endif()

View File

@ -1,8 +1,8 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(harness_ui harness_ui.c harness_common.c)
add_executable(harness harness_util.c harness_common.c)
target_link_libraries(harness_ui maxscale-common query_classifier)
target_link_libraries(harness maxscale-common query_classifier)
target_link_libraries(harness_ui maxscale-common)
target_link_libraries(harness maxscale-common)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${ERRMSG} ${CMAKE_CURRENT_BINARY_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/harness.cnf ${CMAKE_CURRENT_BINARY_DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testdriver.sh ${CMAKE_CURRENT_BINARY_DIR}/testdriver.sh @ONLY)

View File

@ -6,7 +6,7 @@ install(TARGETS binlogrouter DESTINATION ${MAXSCALE_LIBDIR})
add_executable(maxbinlogcheck maxbinlogcheck.c blr_file.c blr_cache.c blr_master.c blr_slave.c blr.c)
# maxbinlogcheck refers to my_uuid_init and my_uuin. They are non-public functions and
# should not be used. They are found only from the embedded lib.
target_link_libraries(maxbinlogcheck maxscale-common query_classifier ${MYSQL_EMBEDDED_LIBRARIES})
target_link_libraries(maxbinlogcheck maxscale-common ${MYSQL_EMBEDDED_LIBRARIES})
install(TARGETS maxbinlogcheck DESTINATION bin)

View File

@ -2,6 +2,6 @@ if(BUILD_TESTS)
add_executable(testbinlogrouter testbinlog.c ../blr.c ../blr_slave.c ../blr_master.c ../blr_file.c ../blr_cache.c)
# testbinlogrouter refers to my_uuid_init and my_uuin. They are non-public functions and
# should not be used. They are found only from the embedded lib.
target_link_libraries(testbinlogrouter maxscale-common query_classifier ${MYSQL_EMBEDDED_LIBRARIES})
target_link_libraries(testbinlogrouter maxscale-common ${MYSQL_EMBEDDED_LIBRARIES})
add_test(TestBinlogRouter ${CMAKE_CURRENT_BINARY_DIR}/testbinlogrouter)
endif()

View File

@ -1,5 +1,5 @@
add_library(readwritesplit SHARED readwritesplit.c)
target_link_libraries(readwritesplit maxscale-common query_classifier)
target_link_libraries(readwritesplit maxscale-common)
set_target_properties(readwritesplit PROPERTIES VERSION "1.0.2")
install(TARGETS readwritesplit DESTINATION ${MAXSCALE_LIBDIR})
if(BUILD_TESTS)

View File

@ -1,11 +1,11 @@
add_library(schemarouter SHARED schemarouter.c sharding_common.c)
target_link_libraries(schemarouter maxscale-common query_classifier)
target_link_libraries(schemarouter maxscale-common)
add_dependencies(schemarouter pcre2)
set_target_properties(schemarouter PROPERTIES VERSION "1.0.0")
install(TARGETS schemarouter DESTINATION ${MAXSCALE_LIBDIR})
add_library(shardrouter SHARED shardrouter.c svcconn.c sharding_common.c)
target_link_libraries(shardrouter maxscale-common query_classifier)
target_link_libraries(shardrouter maxscale-common)
add_dependencies(shardrouter pcre2)
set_target_properties(shardrouter PROPERTIES VERSION "1.0.0")
install(TARGETS shardrouter DESTINATION ${MAXSCALE_LIBDIR})