1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-05 16:15:50 +03:00

chore(codemanagement, build): build refactoring stage2

This commit is contained in:
Leonid Fedorov
2025-05-28 23:59:45 +00:00
parent 19023f90aa
commit 9fc3cd8c8f
49 changed files with 115 additions and 252 deletions

View File

@@ -20,7 +20,7 @@
#include <sstream>
#include <boost/any.hpp>
#include "exceptclasses.h"
#include "conststring.h"
#include "basic/conststring.h"
#include "mcs_datatype_basic.h"
#include "mcs_numeric_limits.h"
#include "mcs_data_condition.h"
@@ -1102,7 +1102,8 @@ class TypeHandlerBit : public TypeHandler
idbassert(0); // QQ
return 1;
}
std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override
std::string format(const SimpleValue& /*v*/,
const SystemCatalog::TypeAttributesStd& /*attr*/) const override
{
return "0"; // QQ
}
@@ -2033,7 +2034,8 @@ class TypeHandlerReal : public TypeHandler
{
return {}; // QQ: real types were not handled in IDB_format()
}
std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override
std::string format(const SimpleValue& /*v*/,
const SystemCatalog::TypeAttributesStd& /*attr*/) const override
{
return "0"; // QQ
}
@@ -2329,7 +2331,8 @@ class TypeHandlerBlob : public TypeHandlerStr
{
return storeValueToFieldBlobText(row, pos, f);
}
std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override
std::string format(const SimpleValue& /*v*/,
const SystemCatalog::TypeAttributesStd& /*attr*/) const override
{
return "0"; // QQ
}
@@ -2355,7 +2358,8 @@ class TypeHandlerText : public TypeHandlerStr
{
return storeValueToFieldBlobText(row, pos, f);
}
std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override
std::string format(const SimpleValue& /*v*/,
const SystemCatalog::TypeAttributesStd& /*attr*/) const override
{
return "0"; // QQ
}
@@ -2386,7 +2390,8 @@ class TypeHandlerClob : public TypeHandlerStr
idbassert(0); // QQ
return 1;
}
std::string format(const SimpleValue& /*v*/, const SystemCatalog::TypeAttributesStd& /*attr*/) const override
std::string format(const SimpleValue& /*v*/,
const SystemCatalog::TypeAttributesStd& /*attr*/) const override
{
return "0"; // QQ
}

View File

@@ -17,8 +17,8 @@
#pragma once
#include "conststring.h"
#include "collation.h" // class Charset
#include "basic/conststring.h"
#include "basic/collation.h" // class Charset
namespace datatypes
{

View File

@@ -42,4 +42,4 @@ columnstore_library(
${FLEX_ddl_scan_OUTPUTS}
)
columnstore_link(ddlpackage loggingcpp)
columnstore_link(ddlpackage loggingcpp messageqcpp)

View File

@@ -27,7 +27,7 @@
*/
#include <stdexcept>
#include "collation.h" // CHARSET_INFO
#include "basic/collation.h" // CHARSET_INFO
#include "ddlpkg.h"
#include "mariadb_my_sys.h" // myf, MYF()

View File

@@ -13,4 +13,4 @@ set(ddlpackageproc_LIB_SRCS
)
columnstore_library(ddlpackageproc ${ddlpackageproc_LIB_SRCS})
columnstore_link(ddlpackageproc ${NETSNMP_LIBRARIES} loggingcpp)
columnstore_link(ddlpackageproc ${NETSNMP_LIBRARIES} loggingcpp oamcpp messageqcpp)

View File

@@ -41,4 +41,4 @@ columnstore_library(
${FLEX_dml_scan_OUTPUTS}
)
columnstore_link(dmlpackage loggingcpp)
columnstore_link(dmlpackage loggingcpp messageqcpp)

View File

@@ -13,4 +13,4 @@ set(dmlpackageproc_LIB_SRCS
)
columnstore_library(dmlpackageproc ${dmlpackageproc_LIB_SRCS})
columnstore_link(dmlpackageproc ${NETSNMP_LIBRARIES} loggingcpp)
columnstore_link(dmlpackageproc ${NETSNMP_LIBRARIES} loggingcpp oamcpp messageqcpp)

View File

@@ -46,4 +46,13 @@ set(execplan_LIB_SRCS
)
columnstore_library(execplan ${execplan_LIB_SRCS})
columnstore_link(execplan messageqcpp ${NETSNMP_LIBRARIES} ${ENGINE_DT_LIB} pron loggingcpp)
columnstore_link(
execplan
messageqcpp
${NETSNMP_LIBRARIES}
${ENGINE_DT_LIB}
pron
oamcpp
loggingcpp
querytele
)

View File

@@ -49,7 +49,7 @@
#undef max
#include "mcs_datatype.h"
#include "collation.h" // CHARSET_INFO, class Charset
#include "basic/collation.h" // CHARSET_INFO, class Charset
#include "nullstring.h"
class ExecPlanTest;
@@ -75,7 +75,8 @@ const int32_t IDB_VTABLE_ID = CNX_VTABLE_ID;
/**
* A struct to hold a list of table partitions.
*/
struct Partitions {
struct Partitions
{
std::vector<std::string> fPartNames;
void serialize(messageqcpp::ByteStream& b) const
{
@@ -96,7 +97,6 @@ struct Partitions {
b >> t;
fPartNames.push_back(t);
}
}
};
bool operator<(const Partitions& a, const Partitions& b);
@@ -259,9 +259,9 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
public:
ColType() = default;
ColType(const ColType& rhs);
ColType(int32_t colWidth_, int32_t scale_, int32_t precision_,
const ConstraintType& constraintType_, const DictOID& ddn_, int32_t colPosition_,
int32_t compressionType_, OID columnOID_, const ColDataType& colDataType_);
ColType(int32_t colWidth_, int32_t scale_, int32_t precision_, const ConstraintType& constraintType_,
const DictOID& ddn_, int32_t colPosition_, int32_t compressionType_, OID columnOID_,
const ColDataType& colDataType_);
ColType& operator=(const ColType& rhs);
CHARSET_INFO* getCharset() const;

View File

@@ -39,7 +39,7 @@
#include "returnedcolumn.h"
#include "dataconvert.h"
#include "collation.h" // CHARSET_INFO
#include "basic/collation.h" // CHARSET_INFO
namespace messageqcpp
{

View File

@@ -28,7 +28,7 @@ using namespace std;
#include "basic/string_utils.h"
#include "bytestream.h"
#include "collation.h"
#include "basic/collation.h"
using namespace messageqcpp;

View File

@@ -68,7 +68,7 @@ columnstore_library(joblist ${joblist_LIB_SRCS})
target_include_directories(
joblist BEFORE PUBLIC ${OPENSSL_INCLUDE_DIR} ${LIBMARIADB_BININC_DIR} ${LIBMARIADB_SRCINC_DIR}
)
columnstore_link(joblist loggingcpp)
columnstore_link(joblist loggingcpp boost_thread oamcpp querytele messageqcpp)
if(WITH_ORDERBY_UT)
columnstore_executable(job_orderby_tests orderby-tests.cpp)

View File

@@ -5,6 +5,6 @@ include_directories(${ENGINE_COMMON_INCLUDES})
set(oamcpp_LIB_SRCS liboamcpp.cpp oamcache.cpp)
columnstore_library(oamcpp ${oamcpp_LIB_SRCS})
columnstore_link(oamcpp loggingcpp)
columnstore_link(oamcpp loggingcpp idbboot)
target_compile_options(oamcpp PRIVATE -Wno-unused-result)

View File

@@ -3,25 +3,26 @@ include_directories(${ENGINE_COMMON_INCLUDES} ../blockcache ../linux-port)
# ########## next target ###############
set(PrimProc_SRCS
primproc.cpp
activestatementcounter.cpp
batchprimitiveprocessor.cpp
bppseeder.cpp
bppsendthread.cpp
columncommand.cpp
command.cpp
dictstep.cpp
femsghandler.cpp
filtercommand.cpp
logger.cpp
passthrucommand.cpp
primitiveserver.cpp
primproc.cpp
pseudocc.cpp
rssmonfcn.cpp
rtscommand.cpp
umsocketselector.cpp
samenodepseudosocket.cpp
serviceexemgr.cpp
sqlfrontsessionthread.cpp
rssmonfcn.cpp
activestatementcounter.cpp
femsghandler.cpp
umsocketselector.cpp
../../utils/common/crashtrace.cpp
)

View File

@@ -64,7 +64,7 @@ configure_file(
link_directories(${CMAKE_BINARY_DIR}/lib)
set(CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/../lib)
columnstore_library(storagemanager SHARED ${storagemanager_SRCS})
columnstore_library(storagemanager ${storagemanager_SRCS})
add_dependencies(storagemanager marias3 external_boost)
target_compile_definitions(storagemanager PUBLIC BOOST_NO_CXX11_SCOPED_ENUMS)

View File

@@ -35,7 +35,7 @@
#include "mcsconfig.h"
#include "exceptclasses.h"
#include "conststring.h"
#include "basic/conststring.h"
/*
Redefine definitions used by MariaDB m_ctype.h.

View File

@@ -6,4 +6,4 @@ set(batchloader_LIB_SRCS batchloader.cpp)
columnstore_library(batchloader ${batchloader_LIB_SRCS})
columnstore_link(batchloader ${NETSNMP_LIBRARIES} loggingcpp)
columnstore_link(batchloader ${NETSNMP_LIBRARIES} oamcpp loggingcpp)

View File

@@ -5,4 +5,4 @@ include_directories(${ENGINE_COMMON_INCLUDES})
set(cacheutils_LIB_SRCS cacheutils.cpp)
columnstore_library(cacheutils ${cacheutils_LIB_SRCS})
columnstore_link(cacheutils messageqcpp)
columnstore_link(cacheutils messageqcpp boost_thread)

View File

@@ -14,7 +14,7 @@ columnstore_library(cloudio ${cloudio_LIB_SRCS})
# IDBDataFile currently depends on cloudio, which is backward. Once cloudio has been turned into a proper plugin for
# idbdatafile, we should be able to reverse the dependency like so:
columnstore_link(cloudio idbdatafile messageqcpp)
columnstore_link(cloudio idbdatafile messageqcpp boost_thread)
add_executable(cloudio_component_test component_test.cpp)
add_executable(cloudio_end_to_end_test end_to_end_test.cpp)

View File

@@ -17,7 +17,7 @@
#pragma once
#include "conststring.h"
#include "basic/conststring.h"
namespace genericparser
{

View File

@@ -18,7 +18,7 @@
#pragma once
#include "hasher.h"
#include "collation.h"
#include "basic/collation.h"
namespace utils
{

View File

@@ -25,7 +25,7 @@
#include <iostream>
#include <memory>
#include "exceptclasses.h"
#include "conststring.h"
#include "basic/conststring.h"
#include "mcs_datatype_basic.h"
namespace utils

View File

@@ -18,7 +18,7 @@
/* handling of the conversion of string prefixes to int64_t for quick range checking */
#include "collation.h"
#include "basic/collation.h"
#include "joblisttypes.h"
#include "string_prefixes.h"

View File

@@ -1,157 +0,0 @@
/* Copyright (C) 2014 InfiniDB, Inc.
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 Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
/** @file */
/*
* classes isyncstream and osyncstream provide a C++ iostream interface
* for C stdio FILE* streams. The current implementation does not provide
* the necessary methods to support seeking. The I/O buffering of the
* input FILE* is used. The C++ iostream library calls syncbuf::sync()
* for every line, so output buffering is line-by-line.
* */
/*
#include "syncstream.h"
void copyStream(istream& iss, ostream& oss)
{
string line;
getline(iss, line);
while (iss.good())
{
oss << line << endl;
getline(iss, line);
}
}
main()
{
FILE* ifp;
FILE* ofp;
...
isyncstream iss(ifp);
osyncstream oss(ofp);
copyStream(iss, oss);
...
}
*/
#pragma once
#include <iostream>
#include <cstdio>
namespace syncstream
{
/** A streambuf implementation for C stdio FILE* streams.
*
* Adapted from http://www.drdobbs.com/184401305
*/
class syncbuf : public std::streambuf
{
public:
/** ctor */
syncbuf(FILE* f) : std::streambuf(), fptr(f)
{
}
protected:
/** Write character in the case of overflow */
virtual int overflow(int c = EOF)
{
return (c != EOF ? fputc(c, fptr) : EOF);
}
/** Get character in the case of overflow */
virtual int underflow()
{
int c = getc(fptr);
if (c != EOF)
ungetc(c, fptr);
return c;
}
/** Get character in the case of overflow and advance get pointer */
virtual int uflow()
{
return getc(fptr);
}
/** put character back in the case of backup underflow */
virtual int pbackfail(int c = EOF)
{
return (c != EOF ? ungetc(c, fptr) : EOF);
}
/** Synchronize stream buffer */
virtual int sync()
{
return fflush(fptr);
}
private:
FILE* fptr;
};
/** An istream adaptor for input FILE* streams */
class isyncstream : public std::istream
{
public:
/** ctor */
isyncstream() : istream(&buf), buf(0)
{
}
/** ctor */
isyncstream(FILE* fptr) : istream(&buf), buf(fptr)
{
}
/** const streambuf accessor */
const syncbuf* rdbuf() const
{
return &buf;
}
private:
syncbuf buf;
};
/** An ostream adaptor for output FILE* streams */
class osyncstream : public std::ostream
{
public:
/** ctor */
osyncstream() : ostream(&buf), buf(0)
{
}
/** ctor */
osyncstream(FILE* fptr) : ostream(&buf), buf(fptr)
{
}
/** const streambuf accessor */
const syncbuf* rdbuf() const
{
return &buf;
}
private:
syncbuf buf;
};
} // namespace syncstream

View File

@@ -7,7 +7,7 @@
#include <my_sys.h>
#include <json_lib.h>
#include "collation.h"
#include "basic/collation.h"
#include "functor_bool.h"
#include "functor_int.h"
#include "functor_str.h"

View File

@@ -10,10 +10,10 @@
#include <my_sys.h>
// #include <json_lib.h>
#include "collation.h"
#include "basic/collation.h"
#include "functor_json.h"
#include "functor_str.h"
#include "collation.h"
#include "basic/collation.h"
#include "rowgroup.h"
#include "treenode.h"
#include "functioncolumn.h"

View File

@@ -14,4 +14,12 @@ set(idbdatafile_LIB_SRCS
)
columnstore_library(idbdatafile ${idbdatafile_LIB_SRCS})
columnstore_link(idbdatafile PRIVATE ${NETSNMP_LIBRARIES} ${ENGINE_OAM_LIBS} boost_filesystem boost_system)
columnstore_link(
idbdatafile
PRIVATE
${NETSNMP_LIBRARIES}
${ENGINE_OAM_LIBS}
boost_filesystem
boost_system
compress
)

View File

@@ -5,4 +5,4 @@ include_directories(${ENGINE_COMMON_INCLUDES})
set(joiner_LIB_SRCS tuplejoiner.cpp joinpartition.cpp)
columnstore_library(joiner ${joiner_LIB_SRCS})
columnstore_link(joiner PRIVATE loggingcpp)
columnstore_link(joiner PRIVATE loggingcpp rowgroup datatypes compress)

View File

@@ -8,7 +8,6 @@ set(messageqcpp_LIB_SRCS
iosocket.cpp
messagequeue.cpp
messagequeuepool.cpp
samenodepseudosocket.cpp
socketparms.cpp
)

View File

@@ -5,4 +5,4 @@ include_directories(${ENGINE_COMMON_INCLUDES})
set(querystats_LIB_SRCS querystats.cpp)
columnstore_library(querystats ${querystats_LIB_SRCS})
columnstore_link(querystats PRIVATE loggingcpp)
columnstore_link(querystats PRIVATE loggingcpp messageqcpp)

View File

@@ -5,7 +5,7 @@ set(querytele_LIB_SRCS querytele.cpp queryteleclient.cpp querytele_constants.cpp
)
columnstore_library(querytele ${querytele_LIB_SRCS})
columnstore_link(querytele ${THRIFT_LIBRARY})
columnstore_link(querytele ${THRIFT_LIBRARY} boost_thread)
target_include_directories(querytele PRIVATE ${THRIFT_INCLUDE_DIRS})
add_dependencies(querytele external_boost external_thrift)
add_dependencies(querytele external_thrift)

View File

@@ -21,7 +21,7 @@ set(regr_LIB_SRCS
add_definitions(-DMYSQL_DYNAMIC_PLUGIN)
columnstore_library(regr ${regr_LIB_SRCS})
columnstore_link(regr PRIVATE loggingcpp)
columnstore_link(regr PRIVATE loggingcpp messageqcpp)
set(regr_mysql_LIB_SRCS regrmysql.cpp modamysql.cpp)

View File

@@ -45,7 +45,7 @@
#include "calpontsystemcatalog.h"
#include "windowfunctioncolumn.h"
#include "hasher.h"
#include "collation.h"
#include "basic/collation.h"
#define EXPORT

View File

@@ -5,5 +5,5 @@ include_directories(${ENGINE_COMMON_INCLUDES})
set(rowgroup_LIB_SRCS rowaggregation.cpp rowgroup.cpp rowstorage.cpp)
columnstore_library(rowgroup ${rowgroup_LIB_SRCS})
columnstore_link(rowgroup PRIVATE ${NETSNMP_LIBRARIES} funcexp loggingcpp)
columnstore_link(rowgroup PRIVATE ${NETSNMP_LIBRARIES} funcexp loggingcpp compress)
add_dependencies(rowgroup external_boost)

View File

@@ -53,7 +53,7 @@
#include "branchpred.h"
#include "datatypes/mcs_int128.h"
#include "collation.h"
#include "basic/collation.h"
#include "common/hashfamily.h"
#include "buffertypes.h"

View File

@@ -2,6 +2,4 @@ include_directories(${ENGINE_COMMON_INCLUDES})
set(threadpool_LIB_SRCS weightedthreadpool.cpp threadpool.cpp prioritythreadpool.cpp fair_threadpool.cpp)
columnstore_library(threadpool ${threadpool_LIB_SRCS})
columnstore_link(threadpool PRIVATE boost_chrono loggingcpp)
add_dependencies(threadpool external_boost)
columnstore_link(threadpool PRIVATE boost_chrono boost_thread loggingcpp messageqcpp)

View File

@@ -11,7 +11,7 @@ set(udfsdk_LIB_SRCS
)
columnstore_library(udfsdk ${udfsdk_LIB_SRCS})
columnstore_link(udfsdk PRIVATE loggingcpp)
columnstore_link(udfsdk PRIVATE loggingcpp messageqcpp)
# Do anyone use it?
add_definitions(-DMYSQL_DYNAMIC_PLUGIN)

View File

@@ -34,7 +34,7 @@ set(brm_LIB_SRCS
)
columnstore_library(brm ${brm_LIB_SRCS})
columnstore_link(brm loggingcpp datatypes)
columnstore_link(brm loggingcpp datatypes oamcpp boost_thread messageqcpp)
# ########## next target ###############

View File

@@ -38,7 +38,7 @@ remove_definitions(-D_FILE_OFFSET_BITS=64)
set(cpimport.bin_SRCS cpimport.cpp)
columnstore_executable(cpimport.bin ${cpimport.bin_SRCS})
add_dependencies(cpimport.bin marias3)
columnstore_link(
cpimport.bin
${ENGINE_LDFLAGS}
@@ -47,4 +47,5 @@ columnstore_link(
${S3API_DEPS}
we_bulk
we_xml
marias3
)

View File

@@ -5,7 +5,4 @@ include_directories(${ENGINE_COMMON_INCLUDES})
set(writeengineclient_LIB_SRCS we_clients.cpp we_ddlcommandclient.cpp we_dmlcommandclient.cpp)
columnstore_library(writeengineclient ${writeengineclient_LIB_SRCS})
add_dependencies(writeengineclient loggingcpp)
columnstore_link(writeengineclient ${NETSNMP_LIBRARIES})
columnstore_link(writeengineclient ${NETSNMP_LIBRARIES} boost_thread oamcpp messageqcpp loggingcpp)

View File

@@ -7,9 +7,6 @@ set(writeengineredistribute_LIB_SRCS we_redistribute.cpp we_redistributecontrol.
)
columnstore_library(writeengineredistribute ${writeengineredistribute_LIB_SRCS})
add_dependencies(writeengineredistribute loggingcpp)
columnstore_link(writeengineredistribute ${NETSNMP_LIBRARIES})
columnstore_link(writeengineredistribute ${NETSNMP_LIBRARIES} loggingcpp oamcpp boost_thread messageqcpp)
target_compile_definitions(writeengineredistribute PUBLIC BOOST_NO_CXX11_SCOPED_ENUMS)

View File

@@ -18,9 +18,12 @@ set(WriteEngineServer_SRCS
)
columnstore_executable(WriteEngineServer ${WriteEngineServer_SRCS})
add_dependencies(WriteEngineServer loggingcpp)
columnstore_link(
WriteEngineServer ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS} threadpool writeengineredistribute
WriteEngineServer
${ENGINE_LDFLAGS}
${NETSNMP_LIBRARIES}
${ENGINE_WRITE_LIBS}
threadpool
writeengineredistribute
loggingcpp
)

View File

@@ -40,7 +40,7 @@
#include "IDBDataFile.h"
#include "IDBPolicy.h"
#include "nullstring.h"
#include "collation.h" // For CHARSET_INFO struct
#include "basic/collation.h" // For CHARSET_INFO struct
#undef EXPORT
#undef DELETE
@@ -447,10 +447,9 @@ struct JobColumn /** @brief Job Column Structure */
, cs(nullptr)
{
}
JobColumn(const std::string& colName_, OID mapOid_, const std::string& typeName_,
int width_, int definedWidth_, int compressionType_, int dctnryCompressionType_,
int64_t minIntSat_, uint64_t maxIntSat_, bool withDefault_,
unsigned long long defaultUInt_)
JobColumn(const std::string& colName_, OID mapOid_, const std::string& typeName_, int width_,
int definedWidth_, int compressionType_, int dctnryCompressionType_, int64_t minIntSat_,
uint64_t maxIntSat_, bool withDefault_, unsigned long long defaultUInt_)
: colName(colName_)
, mapOid(mapOid_)
, dataType(execplan::CalpontSystemCatalog::INT)

View File

@@ -16,8 +16,6 @@ set(cpimport_SRCS
columnstore_executable(cpimport ${cpimport_SRCS})
add_dependencies(cpimport loggingcpp)
columnstore_link(
cpimport
${ENGINE_LDFLAGS}
@@ -27,4 +25,5 @@ columnstore_link(
threadpool
marias3
boost_program_options
loggingcpp
)

View File

@@ -37,7 +37,12 @@ set(writeengine_LIB_SRCS
add_definitions(-D_FILE_OFFSET_BITS=64)
columnstore_library(writeengine ${writeengine_LIB_SRCS})
add_dependencies(writeengine loggingcpp)
columnstore_link(writeengine ${NETSNMP_LIBRARIES})
columnstore_link(
writeengine
${NETSNMP_LIBRARIES}
loggingcpp
oamcpp
boost_thread
compress
messageqcpp
)

View File

@@ -6,6 +6,5 @@ set(we_xml_STAT_SRCS we_xmlop.cpp we_xmljob.cpp we_xmlgendata.cpp we_xmlgenproc.
add_definitions(-D_FILE_OFFSET_BITS=64)
add_library(we_xml STATIC ${we_xml_STAT_SRCS})
add_dependencies(we_xml loggingcpp)
columnstore_static_library(we_xml ${we_xml_STAT_SRCS})
columnstore_link(we_xml loggingcpp)