mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Remove pocoext (#5036)
This commit is contained in:
parent
0641ff7a75
commit
525726a5e2
@ -185,8 +185,6 @@ target_link_libraries (clickhouse_common_io
|
||||
${LINK_LIBRARIES_ONLY_ON_X86_64}
|
||||
PUBLIC
|
||||
${DOUBLE_CONVERSION_LIBRARIES}
|
||||
PRIVATE
|
||||
pocoext
|
||||
PUBLIC
|
||||
${Poco_Net_LIBRARY}
|
||||
${Poco_Util_LIBRARY}
|
||||
@ -236,7 +234,6 @@ target_link_libraries (dbms
|
||||
PRIVATE
|
||||
clickhouse_dictionaries_embedded
|
||||
PUBLIC
|
||||
pocoext
|
||||
${MYSQLXX_LIBRARY}
|
||||
PRIVATE
|
||||
${BTRIE_LIBRARIES}
|
||||
|
@ -2,7 +2,6 @@
|
||||
#include "PingHandler.h"
|
||||
#include "ColumnInfoHandler.h"
|
||||
#include <Poco/URI.h>
|
||||
#include <Poco/Ext/SessionPoolHelpers.h>
|
||||
#include <Poco/Net/HTTPServerRequest.h>
|
||||
#include <common/logger_useful.h>
|
||||
|
||||
|
@ -11,11 +11,12 @@
|
||||
#include <IO/WriteHelpers.h>
|
||||
#include <IO/ReadHelpers.h>
|
||||
#include <Interpreters/Context.h>
|
||||
#include <Poco/Ext/SessionPoolHelpers.h>
|
||||
#include <Poco/Net/HTTPServerRequest.h>
|
||||
#include <Poco/Net/HTTPServerResponse.h>
|
||||
#include <Poco/Net/HTMLForm.h>
|
||||
#include <common/logger_useful.h>
|
||||
#include <mutex>
|
||||
#include <Poco/ThreadPool.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -31,6 +32,24 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
using PocoSessionPoolConstructor = std::function<std::shared_ptr<Poco::Data::SessionPool>()>;
|
||||
/** Is used to adjust max size of default Poco thread pool. See issue #750
|
||||
* Acquire the lock, resize pool and construct new Session.
|
||||
*/
|
||||
std::shared_ptr<Poco::Data::SessionPool> createAndCheckResizePocoSessionPool(PocoSessionPoolConstructor pool_constr)
|
||||
{
|
||||
static std::mutex mutex;
|
||||
|
||||
Poco::ThreadPool & pool = Poco::ThreadPool::defaultPool();
|
||||
|
||||
/// NOTE: The lock don't guarantee that external users of the pool don't change its capacity
|
||||
std::unique_lock lock(mutex);
|
||||
|
||||
if (pool.available() == 0)
|
||||
pool.addCapacity(2 * std::max(pool.capacity(), 1));
|
||||
|
||||
return pool_constr();
|
||||
}
|
||||
|
||||
ODBCHandler::PoolPtr ODBCHandler::getPool(const std::string & connection_str)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ list(REMOVE_ITEM clickhouse_dictionaries_sources DictionaryFactory.cpp Dictionar
|
||||
list(REMOVE_ITEM clickhouse_dictionaries_headers DictionaryFactory.h DictionarySourceFactory.h DictionaryStructure.h)
|
||||
|
||||
add_library(clickhouse_dictionaries ${LINK_MODE} ${clickhouse_dictionaries_sources})
|
||||
target_link_libraries(clickhouse_dictionaries PRIVATE dbms clickhouse_common_io pocoext ${BTRIE_LIBRARIES} PUBLIC Threads::Threads)
|
||||
target_link_libraries(clickhouse_dictionaries PRIVATE dbms clickhouse_common_io ${BTRIE_LIBRARIES} PUBLIC Threads::Threads)
|
||||
|
||||
if(Poco_SQL_FOUND AND NOT USE_INTERNAL_POCO_LIBRARY)
|
||||
target_include_directories(clickhouse_dictionaries SYSTEM PRIVATE ${Poco_SQL_INCLUDE_DIR})
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <IO/ReadWriteBufferFromHTTP.h>
|
||||
#include <IO/WriteHelpers.h>
|
||||
#include <Interpreters/Context.h>
|
||||
#include <Poco/Ext/SessionPoolHelpers.h>
|
||||
#include <Poco/Net/HTTPRequest.h>
|
||||
#include <Poco/Util/AbstractConfiguration.h>
|
||||
#include <Common/XDBCBridgeHelper.h>
|
||||
|
@ -8,7 +8,6 @@ if (USE_DEBUG_HELPERS)
|
||||
endif ()
|
||||
|
||||
add_subdirectory (libcommon)
|
||||
add_subdirectory (libpocoext)
|
||||
add_subdirectory (libdaemon)
|
||||
|
||||
if (USE_INTERNAL_MEMCPY)
|
||||
|
@ -95,8 +95,6 @@ if (NOT USE_INTERNAL_BOOST_LIBRARY)
|
||||
endif ()
|
||||
|
||||
target_link_libraries (common
|
||||
PRIVATE
|
||||
pocoext
|
||||
PUBLIC
|
||||
${Poco_Foundation_LIBRARY}
|
||||
${CITYHASH_LIBRARIES}
|
||||
|
@ -21,6 +21,5 @@ if (USE_UNWIND)
|
||||
endif ()
|
||||
|
||||
target_include_directories (daemon PUBLIC include)
|
||||
target_include_directories (daemon PRIVATE ${ClickHouse_SOURCE_DIR}/libs/libpocoext/include)
|
||||
|
||||
target_link_libraries (daemon PRIVATE clickhouse_common_io clickhouse_common_config common ${Poco_Net_LIBRARY} ${Poco_Util_LIBRARY} ${EXECINFO_LIBRARY} ${ELF_LIBRARY})
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <Poco/Observer.h>
|
||||
#include <Poco/Logger.h>
|
||||
#include <Poco/AutoPtr.h>
|
||||
#include <Poco/Ext/LevelFilterChannel.h>
|
||||
#include <common/getThreadNumber.h>
|
||||
#include <Poco/PatternFormatter.h>
|
||||
#include <Poco/ConsoleChannel.h>
|
||||
|
@ -1,19 +0,0 @@
|
||||
add_library (pocoext ${LINK_MODE}
|
||||
src/LevelFilterChannel.cpp
|
||||
src/SessionPoolHelpers.cpp
|
||||
|
||||
include/Poco/Ext/LevelFilterChannel.h
|
||||
include/Poco/Ext/SessionPoolHelpers.h)
|
||||
|
||||
if (Poco_Data_FOUND)
|
||||
target_include_directories (pocoext SYSTEM PRIVATE ${Poco_Data_INCLUDE_DIR})
|
||||
target_link_libraries(pocoext PRIVATE ${Poco_Data_LIBRARY})
|
||||
endif()
|
||||
|
||||
target_include_directories (pocoext PUBLIC include PRIVATE ${COMMON_INCLUDE_DIR})
|
||||
|
||||
if (NOT USE_INTERNAL_POCO_LIBRARY)
|
||||
target_include_directories (pocoext SYSTEM BEFORE PUBLIC ${Poco_INCLUDE_DIRS})
|
||||
endif ()
|
||||
|
||||
target_link_libraries(pocoext PUBLIC ${Poco_Foundation_LIBRARY})
|
@ -1,55 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Channel.h"
|
||||
#include "Poco/Message.h"
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
/// This channel sends messages only higher then specified level
|
||||
class Foundation_API LevelFilterChannel : public Channel
|
||||
{
|
||||
public:
|
||||
/// Sends the given Message to all
|
||||
/// attaches channels.
|
||||
void log(const Message & msg);
|
||||
|
||||
/// Sets or changes a configuration property.
|
||||
///
|
||||
/// Only the "level" property is supported, which allows setting desired level
|
||||
void setProperty(const std::string & name, const std::string & value);
|
||||
|
||||
/// Sets the destination channel to which the formatted
|
||||
/// messages are passed on.
|
||||
void setChannel(Channel * channel_);
|
||||
|
||||
/// Returns the channel to which the formatted
|
||||
/// messages are passed on.
|
||||
Channel * getChannel() const;
|
||||
|
||||
/// Opens the attached channel.
|
||||
void open();
|
||||
|
||||
/// Closes the attached channel.
|
||||
void close();
|
||||
|
||||
/// Sets the Logger's log level.
|
||||
void setLevel(Message::Priority);
|
||||
/// Sets the Logger's log level using a symbolic value.
|
||||
void setLevel(const std::string & value);
|
||||
|
||||
/// Returns the Logger's log level.
|
||||
Message::Priority getLevel() const;
|
||||
|
||||
protected:
|
||||
~LevelFilterChannel();
|
||||
|
||||
private:
|
||||
Channel * channel = nullptr;
|
||||
Message::Priority priority = Message::PRIO_ERROR;
|
||||
};
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#include <Poco/Data/SessionPool.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
||||
using PocoSessionPoolConstructor = std::function<std::shared_ptr<Poco::Data::SessionPool>()>;
|
||||
|
||||
/** Is used to adjust max size of default Poco thread pool. See issue #750
|
||||
* Acquire the lock, resize pool and construct new Session.
|
||||
*/
|
||||
std::shared_ptr<Poco::Data::SessionPool> createAndCheckResizePocoSessionPool(PocoSessionPoolConstructor pool_constr);
|
@ -1,100 +0,0 @@
|
||||
// Copyright 2008, Yandex LLC.
|
||||
// See the license of ClickHouse.
|
||||
|
||||
#include "Poco/Ext/LevelFilterChannel.h"
|
||||
#include "Poco/LoggingRegistry.h"
|
||||
#include "Poco/String.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
LevelFilterChannel::~LevelFilterChannel()
|
||||
{
|
||||
if (channel)
|
||||
channel->release();
|
||||
}
|
||||
|
||||
|
||||
void LevelFilterChannel::setChannel(Channel * channel_)
|
||||
{
|
||||
if (channel)
|
||||
channel->release();
|
||||
channel = channel_;
|
||||
if (channel)
|
||||
channel->duplicate();
|
||||
}
|
||||
|
||||
|
||||
Channel * LevelFilterChannel::getChannel() const
|
||||
{
|
||||
return channel;
|
||||
}
|
||||
|
||||
void LevelFilterChannel::open()
|
||||
{
|
||||
if (channel)
|
||||
channel->open();
|
||||
}
|
||||
|
||||
|
||||
void LevelFilterChannel::close()
|
||||
{
|
||||
if (channel)
|
||||
channel->close();
|
||||
}
|
||||
|
||||
|
||||
void LevelFilterChannel::setLevel(Message::Priority priority_)
|
||||
{
|
||||
priority = priority_;
|
||||
}
|
||||
|
||||
|
||||
void LevelFilterChannel::setLevel(const std::string & value)
|
||||
{
|
||||
if (icompare(value, "fatal") == 0)
|
||||
setLevel(Message::PRIO_FATAL);
|
||||
else if (icompare(value, "critical") == 0)
|
||||
setLevel(Message::PRIO_CRITICAL);
|
||||
else if (icompare(value, "error") == 0)
|
||||
setLevel(Message::PRIO_ERROR);
|
||||
else if (icompare(value, "warning") == 0)
|
||||
setLevel(Message::PRIO_WARNING);
|
||||
else if (icompare(value, "notice") == 0)
|
||||
setLevel(Message::PRIO_NOTICE);
|
||||
else if (icompare(value, "information") == 0)
|
||||
setLevel(Message::PRIO_INFORMATION);
|
||||
else if (icompare(value, "debug") == 0)
|
||||
setLevel(Message::PRIO_DEBUG);
|
||||
else if (icompare(value, "trace") == 0)
|
||||
setLevel(Message::PRIO_TRACE);
|
||||
else
|
||||
throw InvalidArgumentException("Not a valid log value", value);
|
||||
}
|
||||
|
||||
|
||||
Message::Priority LevelFilterChannel::getLevel() const
|
||||
{
|
||||
return priority;
|
||||
}
|
||||
|
||||
|
||||
void LevelFilterChannel::setProperty(const std::string & name, const std::string & value)
|
||||
{
|
||||
if (icompare(name, "level") == 0)
|
||||
setLevel(value);
|
||||
else if (icompare(name, "channel") == 0)
|
||||
setChannel(LoggingRegistry::defaultRegistry().channelForName(value));
|
||||
else
|
||||
Channel::setProperty(name, value);
|
||||
}
|
||||
|
||||
|
||||
void LevelFilterChannel::log(const Message& msg)
|
||||
{
|
||||
if ((priority >= msg.getPriority()) && channel)
|
||||
channel->log(msg);
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
#include <mutex>
|
||||
#include <Poco/ThreadPool.h>
|
||||
#include <Poco/Ext/SessionPoolHelpers.h>
|
||||
|
||||
|
||||
std::shared_ptr<Poco::Data::SessionPool> createAndCheckResizePocoSessionPool(PocoSessionPoolConstructor pool_constr)
|
||||
{
|
||||
static std::mutex mutex;
|
||||
|
||||
Poco::ThreadPool & pool = Poco::ThreadPool::defaultPool();
|
||||
|
||||
/// NOTE: The lock don't guarantee that external users of the pool don't change its capacity
|
||||
std::unique_lock lock(mutex);
|
||||
|
||||
if (pool.available() == 0)
|
||||
pool.addCapacity(2 * std::max(pool.capacity(), 1));
|
||||
|
||||
return pool_constr();
|
||||
}
|
@ -48,7 +48,6 @@ inc="-I. \
|
||||
-I./libs/libmysqlxx/include \
|
||||
-I./libs/libcommon/include \
|
||||
-I${BUILD_DIR}/libs/libcommon/include \
|
||||
-I./libs/libpocoext/include \
|
||||
-I./libs/libzkutil/include \
|
||||
-I./libs/libdaemon/include \
|
||||
-I./libs/consistent-hashing \
|
||||
|
Loading…
Reference in New Issue
Block a user