Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove superfluous includes of logger_userful.h from headers #48570

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion src/AggregateFunctions/AggregateFunctionMaxIntersections.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include <Common/logger_useful.h>
#include <base/sort.h>

#include <DataTypes/DataTypesNumber.h>
Expand Down
1 change: 0 additions & 1 deletion src/AggregateFunctions/AggregateFunctionSparkbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <IO/WriteHelpers.h>
#include <Columns/ColumnString.h>
#include <Common/PODArray.h>
#include <Common/logger_useful.h>
#include <IO/ReadBufferFromString.h>
#include <Common/HashTable/HashMap.h>
#include <Columns/IColumn.h>
Expand Down
1 change: 0 additions & 1 deletion src/AggregateFunctions/AggregateFunctionSumMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <AggregateFunctions/IAggregateFunction.h>
#include <AggregateFunctions/FactoryHelpers.h>
#include <map>
#include <Common/logger_useful.h>
#include <Common/ClickHouseRevision.h>


Expand Down
1 change: 0 additions & 1 deletion src/BridgeHelper/IBridgeHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <Poco/Util/AbstractConfiguration.h>
#include <Poco/Net/HTTPRequest.h>
#include <Common/ShellCommand.h>
#include <Common/logger_useful.h>


namespace DB
Expand Down
1 change: 0 additions & 1 deletion src/BridgeHelper/XDBCBridgeHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <Poco/Util/AbstractConfiguration.h>
#include <Common/BridgeProtocolVersion.h>
#include <Common/ShellCommand.h>
#include <Common/logger_useful.h>
#include <IO/ConnectionTimeouts.h>
#include <base/range.h>
#include <BridgeHelper/IBridgeHelper.h>
Expand Down
3 changes: 2 additions & 1 deletion src/Client/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
#include <Common/StringUtils/StringUtils.h>
#include <Common/OpenSSLHelpers.h>
#include <Common/randomSeed.h>
#include "Core/Block.h"
#include <Common/logger_useful.h>
#include <Core/Block.h>
#include <Interpreters/ClientInfo.h>
#include <Interpreters/OpenTelemetrySpanLog.h>
#include <Compression/CompressionFactory.h>
Expand Down
1 change: 0 additions & 1 deletion src/Client/Connection.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include <Common/logger_useful.h>

#include <Poco/Net/StreamSocket.h>

Expand Down
1 change: 1 addition & 0 deletions src/Client/LocalConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <Processors/Executors/PushingAsyncPipelineExecutor.h>
#include <Storages/IStorage.h>
#include <Common/ConcurrentBoundedQueue.h>
#include <Common/CurrentThread.h>
#include <Core/Protocol.h>


Expand Down
1 change: 1 addition & 0 deletions src/Client/LocalConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <Interpreters/Session.h>
#include <Interpreters/ProfileEventsExt.h>
#include <Storages/ColumnsDescription.h>
#include <Common/CurrentThread.h>


namespace DB
Expand Down
1 change: 1 addition & 0 deletions src/Common/AsynchronousMetrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <Common/setThreadName.h>
#include <Common/CurrentMetrics.h>
#include <Common/filesystemHelpers.h>
#include <Common/logger_useful.h>
#include <IO/UncompressedCache.h>
#include <IO/MMappedFileCache.h>
#include <IO/ReadHelpers.h>
Expand Down
1 change: 0 additions & 1 deletion src/Common/CacheBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <mutex>
#include <unordered_map>

#include <Common/logger_useful.h>
#include <base/defines.h>


Expand Down
1 change: 1 addition & 0 deletions src/Common/Config/ConfigProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <Common/Exception.h>
#include <Common/getResource.h>
#include <Common/XMLUtils.h>
#include <Common/logger_useful.h>
#include <base/errnoToString.h>
#include <base/sort.h>
#include <IO/WriteBufferFromString.h>
Expand Down
3 changes: 2 additions & 1 deletion src/Common/Config/ConfigProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
#include <Poco/DirectoryIterator.h>
#include <Poco/ConsoleChannel.h>
#include <Poco/Util/AbstractConfiguration.h>
#include <Common/logger_useful.h>


namespace Poco { class Logger; }

namespace zkutil
{
class ZooKeeperNodeCache;
Expand Down
8 changes: 4 additions & 4 deletions src/Common/Config/YAMLParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include "config.h"

#include <string>

#include <Common/ErrorCodes.h>
#include <Common/Exception.h>
#include <base/types.h>
#include <Poco/DOM/Document.h>
#include "Poco/DOM/AutoPtr.h"
#include <Common/logger_useful.h>
#include <Poco/DOM/AutoPtr.h>

#if USE_YAML_CPP

Expand Down
1 change: 1 addition & 0 deletions src/Common/Config/configReadClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "ConfigProcessor.h"
#include <filesystem>
#include <iostream>
#include <base/types.h>

namespace fs = std::filesystem;

Expand Down
1 change: 1 addition & 0 deletions src/Common/DNSResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <Common/Exception.h>
#include <Common/ProfileEvents.h>
#include <Common/thread_local_rng.h>
#include <Common/logger_useful.h>
#include <Core/Names.h>
#include <base/types.h>
#include <Poco/Net/IPAddress.h>
Expand Down
3 changes: 2 additions & 1 deletion src/Common/DNSResolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#include <base/types.h>
#include <Core/Names.h>
#include <boost/noncopyable.hpp>
#include <Common/logger_useful.h>


namespace Poco { class Logger; }

namespace DB
{

Expand Down
1 change: 0 additions & 1 deletion src/Common/ErrorHandlers.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include <Poco/ErrorHandler.h>
#include <Common/logger_useful.h>
#include <Common/Exception.h>


Expand Down
6 changes: 5 additions & 1 deletion src/Common/FileChecker.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <Common/FileChecker.h>
#include <Common/escapeForFileName.h>
#include <Common/logger_useful.h>
#include <Common/ErrorCodes.h>
#include <Disks/IDisk.h>
#include <IO/WriteBufferFromFile.h>
#include <IO/ReadBufferFromFile.h>
Expand All @@ -25,7 +27,9 @@ FileChecker::FileChecker(const String & file_info_path_) : FileChecker(nullptr,
{
}

FileChecker::FileChecker(DiskPtr disk_, const String & file_info_path_) : disk(std::move(disk_))
FileChecker::FileChecker(DiskPtr disk_, const String & file_info_path_)
: disk(std::move(disk_))
, log(&Poco::Logger::get("FileChecker"))
{
setPath(file_info_path_);
try
Expand Down
6 changes: 4 additions & 2 deletions src/Common/FileChecker.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#pragma once

#include <Common/logger_useful.h>
#include <Storages/CheckResults.h>
#include <map>
#include <base/types.h>

namespace Poco { class Logger; }

namespace DB
{
Expand Down Expand Up @@ -46,7 +48,7 @@ class FileChecker
size_t getRealFileSize(const String & path_) const;

const DiskPtr disk;
const Poco::Logger * log = &Poco::Logger::get("FileChecker");
const Poco::Logger * log;

String files_info_path;
std::map<String, size_t> map;
Expand Down
6 changes: 2 additions & 4 deletions src/Common/LRUCachePolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include <list>
#include <unordered_map>

#include <Common/logger_useful.h>

namespace DB
{
/// Cache policy LRU evicts entries which are not used for a long time.
Expand Down Expand Up @@ -174,7 +172,7 @@ class LRUCachePolicy : public ICachePolicy<Key, Mapped, HashFunction, WeightFunc
auto it = cells.find(key);
if (it == cells.end())
{
LOG_ERROR(&Poco::Logger::get("LRUCache"), "LRUCache became inconsistent. There must be a bug in it.");
// Queue became inconsistent
abort();
}

Expand All @@ -192,7 +190,7 @@ class LRUCachePolicy : public ICachePolicy<Key, Mapped, HashFunction, WeightFunc

if (current_size_in_bytes > (1ull << 63))
{
LOG_ERROR(&Poco::Logger::get("LRUCache"), "LRUCache became inconsistent. There must be a bug in it.");
// Queue became inconsistent
abort();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Common/OvercommitTracker.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <Common/logger_useful.h>
#include <base/types.h>
#include <Core/Types.h>
#include <boost/core/noncopyable.hpp>
#include <Poco/Logger.h>
#include <cassert>
Expand Down
11 changes: 8 additions & 3 deletions src/Common/PoolBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,17 @@ class PoolBase : private boost::noncopyable
return Entry(*items.back());
}

LOG_INFO(log, "No free connections in pool. Waiting.");

if (timeout < 0)
{
azat marked this conversation as resolved.
Show resolved Hide resolved
LOG_INFO(log, "No free connections in pool. Waiting undefinitelly.");
available.wait(lock);
}
else
available.wait_for(lock, std::chrono::microseconds(timeout));
{
auto timeout_ms = std::chrono::microseconds(timeout);
LOG_INFO(log, "No free connections in pool. Waiting {} ms.", timeout_ms.count());
available.wait_for(lock, timeout_ms);
}
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/Common/SLRUCachePolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include <list>
#include <unordered_map>

#include <Common/logger_useful.h>

namespace DB
{

Expand Down Expand Up @@ -236,7 +234,7 @@ class SLRUCachePolicy : public ICachePolicy<Key, Mapped, HashFunction, WeightFun
auto it = cells.find(key);
if (it == cells.end())
{
LOG_ERROR(&Poco::Logger::get("SLRUCache"), "SLRUCache became inconsistent. There must be a bug in it.");
// Queue became inconsistent
abort();
}

Expand Down Expand Up @@ -264,7 +262,7 @@ class SLRUCachePolicy : public ICachePolicy<Key, Mapped, HashFunction, WeightFun

if (current_size_in_bytes > (1ull << 63))
{
LOG_ERROR(&Poco::Logger::get("SLRUCache"), "SLRUCache became inconsistent. There must be a bug in it.");
// Queue became inconsistent
abort();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Common/ThreadProfileEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <boost/algorithm/string/split.hpp>

#include <base/errnoToString.h>
#include <Common/logger_useful.h>


namespace ProfileEvents
Expand Down
4 changes: 3 additions & 1 deletion src/Common/ThreadProfileEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

#include <base/types.h>
#include <base/getThreadId.h>
#include <base/defines.h>
#include <Common/Exception.h>
#include <Common/ProfileEvents.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <pthread.h>
#include <Common/logger_useful.h>
#include <boost/noncopyable.hpp>


#if defined(OS_LINUX)
Expand Down
2 changes: 2 additions & 0 deletions src/Common/ThreadStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include <Common/ThreadProfileEvents.h>
#include <Common/QueryProfiler.h>
#include <Common/ThreadStatus.h>
#include <Common/CurrentThread.h>
#include <Common/logger_useful.h>
#include <base/errnoToString.h>
#include <Interpreters/Context.h>

Expand Down
2 changes: 0 additions & 2 deletions src/Common/ZooKeeper/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
#include <functional>

#include <Common/ZooKeeper/ZooKeeper.h>
#include <Common/ZooKeeper/ZooKeeperWithFaultInjection.h>

namespace zkutil
{

using GetZooKeeper = std::function<ZooKeeperPtr()>;
using GetZooKeeperWithFaultInjection = std::function<Coordination::ZooKeeperWithFaultInjection::Ptr()>;

}
1 change: 1 addition & 0 deletions src/Common/ZooKeeper/ZooKeeper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "Common/ZooKeeper/IKeeper.h"
#include <Common/StringUtils/StringUtils.h>
#include <Common/Exception.h>
#include <Common/logger_useful.h>

#include <Poco/Net/NetException.h>
#include <Poco/Net/DNS.h>
Expand Down
1 change: 0 additions & 1 deletion src/Common/ZooKeeper/ZooKeeper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <memory>
#include <mutex>
#include <string>
#include <Common/logger_useful.h>
#include <Common/ProfileEvents.h>
#include <Common/CurrentMetrics.h>
#include <Common/Stopwatch.h>
Expand Down
2 changes: 2 additions & 0 deletions src/Common/ZooKeeper/ZooKeeperLock.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <Common/ZooKeeper/ZooKeeperLock.h>
#include <Common/logger_useful.h>
#include <Common/ErrorCodes.h>
#include <filesystem>

namespace DB
Expand Down
3 changes: 2 additions & 1 deletion src/Common/ZooKeeper/ZooKeeperLock.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include <Common/ZooKeeper/KeeperException.h>
#include <memory>
#include <string>
#include <Common/logger_useful.h>

namespace Poco { class Logger; }

namespace zkutil
{
Expand Down
1 change: 1 addition & 0 deletions src/Common/ZooKeeper/ZooKeeperWithFaultInjection.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <Common/ZooKeeper/Types.h>
#include <Common/ZooKeeper/ZooKeeper.h>
#include <Common/ZooKeeper/ZooKeeperCommon.h>
#include <Common/logger_useful.h>
#include <Common/randomSeed.h>

namespace DB
Expand Down
1 change: 0 additions & 1 deletion src/Common/scope_guard_safe.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include <base/scope_guard.h>
#include <Common/logger_useful.h>
#include <Common/LockMemoryExceptionInThread.h>

/// Same as SCOPE_EXIT() but block the MEMORY_LIMIT_EXCEEDED errors.
Expand Down
1 change: 1 addition & 0 deletions src/Coordination/KeeperDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <Common/checkStackSize.h>
#include <Common/CurrentMetrics.h>
#include <Common/ProfileEvents.h>
#include <Common/logger_useful.h>

#include <future>
#include <chrono>
Expand Down
1 change: 0 additions & 1 deletion src/Coordination/KeeperDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <Common/ConcurrentBoundedQueue.h>
#include <Poco/Util/AbstractConfiguration.h>
#include <Common/Exception.h>
#include <Common/logger_useful.h>
#include <functional>
#include <Coordination/KeeperServer.h>
#include <Coordination/CoordinationSettings.h>
Expand Down