1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Revert "chore(codemanagement, build): build refactoring stage2"

This reverts commit 9fc3cd8c8f.
This commit is contained in:
Leonid Fedorov
2025-07-31 15:18:41 +00:00
parent e172d5d3b1
commit a58edcd5f5
49 changed files with 252 additions and 115 deletions

View File

@@ -6,4 +6,4 @@ set(batchloader_LIB_SRCS batchloader.cpp)
columnstore_library(batchloader ${batchloader_LIB_SRCS})
columnstore_link(batchloader ${NETSNMP_LIBRARIES} oamcpp loggingcpp)
columnstore_link(batchloader ${NETSNMP_LIBRARIES} 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 boost_thread)
columnstore_link(cacheutils messageqcpp)

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 boost_thread)
columnstore_link(cloudio idbdatafile messageqcpp)
add_executable(cloudio_component_test component_test.cpp)
add_executable(cloudio_end_to_end_test end_to_end_test.cpp)

View File

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

View File

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

View File

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

View File

@@ -25,7 +25,7 @@
#include <iostream>
#include <memory>
#include "exceptclasses.h"
#include "basic/conststring.h"
#include "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 "basic/collation.h"
#include "collation.h"
#include "joblisttypes.h"
#include "string_prefixes.h"

157
utils/common/syncstream.h Normal file
View File

@@ -0,0 +1,157 @@
/* 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 "basic/collation.h"
#include "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 "basic/collation.h"
#include "collation.h"
#include "functor_json.h"
#include "functor_str.h"
#include "basic/collation.h"
#include "collation.h"
#include "rowgroup.h"
#include "treenode.h"
#include "functioncolumn.h"

View File

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

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 rowgroup datatypes compress)
columnstore_link(joiner PRIVATE loggingcpp)

View File

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

View File

@@ -0,0 +1,127 @@
/* Copyright (C) 2024 MariaDB Corp.
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. */
#include <string>
#include "samenodepseudosocket.h"
#include "iosocket.h"
namespace messageqcpp
{
SameNodePseudoSocket::SameNodePseudoSocket(joblist::DistributedEngineComm* exeMgrDecPtr) : dec_(exeMgrDecPtr)
{
assert(dec_);
}
SameNodePseudoSocket::~SameNodePseudoSocket()
{
}
void SameNodePseudoSocket::open()
{
}
void SameNodePseudoSocket::close()
{
}
Socket* SameNodePseudoSocket::clone() const
{
return nullptr;
}
SameNodePseudoSocket::SameNodePseudoSocket(const SameNodePseudoSocket& /*rhs*/)
{
}
SameNodePseudoSocket& SameNodePseudoSocket::operator=(const SameNodePseudoSocket& /*rhs*/)
{
return *this;
}
const SBS SameNodePseudoSocket::read(const struct ::timespec* /*timeout*/, bool* /*isTimeOut*/, Stats* /*stats*/) const
{
return nullptr;
}
// This is the only working method of this class. It puts SBS directly into DEC queue.
void SameNodePseudoSocket::write(SBS msg, Stats* /*stats*/)
{
dec_->addDataToOutput(msg);
}
void SameNodePseudoSocket::write(const ByteStream& /*msg*/, Stats* /*stats*/)
{
}
void SameNodePseudoSocket::write_raw(const ByteStream& /*msg*/, Stats* /*stats*/) const
{
}
void SameNodePseudoSocket::connect(const sockaddr* /*serv_addr*/)
{
}
void SameNodePseudoSocket::bind(const sockaddr* /*serv_addr*/)
{
}
const IOSocket SameNodePseudoSocket::accept(const struct timespec* /*timeout*/)
{
return IOSocket();
}
void SameNodePseudoSocket::listen(int /*backlog*/)
{
}
const std::string SameNodePseudoSocket::toString() const
{
return "";
}
const std::string SameNodePseudoSocket::addr2String() const
{
return "";
}
bool SameNodePseudoSocket::isSameAddr(const Socket* /*rhs*/) const
{
return false;
}
bool SameNodePseudoSocket::isSameAddr(const struct in_addr& /*ipv4Addr*/) const
{
return false;
}
int SameNodePseudoSocket::ping(const std::string& /*ipaddr*/, const struct timespec* /*timeout*/)
{
return 0;
}
bool SameNodePseudoSocket::isConnected() const
{
return true;
}
bool SameNodePseudoSocket::hasData() const
{
return false;
}
} // namespace messageqcpp

View File

@@ -0,0 +1,99 @@
/* Copyright (C) 2024 MariaDB Corp.
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. */
#pragma once
#include "../../dbcon/joblist/distributedenginecomm.h"
#include "socket.h"
#include "socketparms.h"
#include "bytestream.h"
namespace messageqcpp
{
class IOSocket;
// This class is a dummy replacement for a TCP socket
// wrapper to communicate with the same node.
class SameNodePseudoSocket : public Socket
{
public:
explicit SameNodePseudoSocket(joblist::DistributedEngineComm* exeMgrDecPtr);
~SameNodePseudoSocket() override;
void write(SBS msg, Stats* stats = nullptr) override;
private:
void bind(const sockaddr* serv_addr) override;
SameNodePseudoSocket(const SameNodePseudoSocket& rhs);
virtual SameNodePseudoSocket& operator=(const SameNodePseudoSocket& rhs);
void connectionTimeout(const struct ::timespec* /*timeout*/) override
{
}
void syncProto(bool /*use*/) override
{
}
int getConnectionNum() const override
{
return 1;
}
inline void socketParms(const SocketParms& /*socket*/) override
{
}
inline const SocketParms socketParms() const override
{
return SocketParms();
}
// all these virtual methods are to stay inaccessable.
inline void sa(const sockaddr* sa) override;
void open() override;
void close() override;
inline bool isOpen() const override;
const SBS read(const struct timespec* timeout = nullptr, bool* isTimeOut = nullptr,
Stats* stats = nullptr) const override;
void write(const ByteStream& msg, Stats* stats = nullptr) override;
void write_raw(const ByteStream& msg, Stats* stats = nullptr) const override;
void listen(int backlog = 5) override;
const IOSocket accept(const struct timespec* timeout = nullptr) override;
void connect(const sockaddr* serv_addr) override;
Socket* clone() const override;
virtual const std::string toString() const;
const std::string addr2String() const override;
bool isSameAddr(const Socket* rhs) const override;
bool isSameAddr(const struct in_addr& ipv4Addr) const override;
static int ping(const std::string& ipaddr, const struct timespec* timeout = nullptr);
bool isConnected() const override;
bool hasData() const override;
joblist::DistributedEngineComm* dec_ = nullptr;
};
inline bool SameNodePseudoSocket::isOpen() const
{
return true;
}
inline void SameNodePseudoSocket::sa(const sockaddr* /*sa*/)
{
}
} // namespace messageqcpp

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 messageqcpp)
columnstore_link(querystats PRIVATE loggingcpp)

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} boost_thread)
columnstore_link(querytele ${THRIFT_LIBRARY})
target_include_directories(querytele PRIVATE ${THRIFT_INCLUDE_DIRS})
add_dependencies(querytele external_thrift)
add_dependencies(querytele external_boost 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 messageqcpp)
columnstore_link(regr PRIVATE loggingcpp)
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 "basic/collation.h"
#include "collation.h"
#define EXPORT
@@ -277,7 +277,7 @@ class Moda_impl_T<std::string> : public mcsv1_UDAF
{
public:
// Defaults OK
Moda_impl_T() : cs(8) {};
Moda_impl_T() : cs(8){};
~Moda_impl_T() override = default;
mcsv1_UDAF::ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
@@ -305,7 +305,7 @@ class moda : public mcsv1_UDAF
{
public:
// Defaults OK
moda() : mcsv1_UDAF() {};
moda() : mcsv1_UDAF(){};
~moda() override = default;
mcsv1_UDAF::ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;

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 compress)
columnstore_link(rowgroup PRIVATE ${NETSNMP_LIBRARIES} funcexp loggingcpp)
add_dependencies(rowgroup external_boost)

View File

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

View File

@@ -2,4 +2,6 @@ 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 boost_thread loggingcpp messageqcpp)
columnstore_link(threadpool PRIVATE boost_chrono loggingcpp)
add_dependencies(threadpool external_boost)

View File

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