mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
- Remove `CurrentThread.h` from high-fan-out headers: `ProcessList.h`, `IQueryPlanStep.h`, `DDLWorker.h`, `TCPHandler.h`, `AggregatingTransform.h`, `ParallelParsingInputFormat.h`, `StorageTableFunction.h`, `parseSyslogLevel.h`, `EmbeddedRocksDBBulkSink.h`, `BlockIO.h`, `LocalConnection.h`, `StorageMaterializedView.h`, `HTTPHandler.h` - Extract `QueryScope` from `CurrentThread` into standalone `Common/QueryScope.h` with its own `.cpp`, replacing the nested `CurrentThread::QueryScope` class - Extract `getCurrentThreadGroup` free function into `Common/ThreadGroupSwitcher.h`, replacing `CurrentThread::getGroup()` in template headers: `threadPoolCallbackRunner.h`, `ParallelFormattingOutputFormat.h`, `HashedDictionaryParallelLoader.h`, `UniqExactSet.h`, `HashedDictionary.h`, `StatusRequestsPool.h` - De-inline `MemoryTrackerSwitcher` ctor/dtor into `MemoryTrackerSwitcher.cpp` - De-inline `ResourceGuard::Request::wait` into `ResourceGuard.cpp` - De-inline `ManyAggregatedData` destructor into `AggregatingTransform.cpp` - De-inline `QueryStatus::updateProgressIn/Out` into `ProcessList.cpp` - Add explicit `CurrentThread.h` includes to `.cpp` files that relied on transitive includes through the trimmed headers Co-Authored-By: Claude Opus 4.6 <[email protected]>
86 lines
2.3 KiB
C++
86 lines
2.3 KiB
C++
#pragma once
|
|
|
|
#include <Client/ClientApplicationBase.h>
|
|
#include <Common/QueryScope.h>
|
|
|
|
|
|
namespace BuzzHouse
|
|
{
|
|
class FuzzConfig;
|
|
class ExternalIntegrations;
|
|
};
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class Client : public ClientApplicationBase
|
|
{
|
|
public:
|
|
using Arguments = ClientApplicationBase::Arguments;
|
|
|
|
Client();
|
|
~Client() override;
|
|
|
|
void initialize(Poco::Util::Application & self) override;
|
|
|
|
int main(const std::vector<String> & /*args*/) override;
|
|
|
|
bool tryToReconnect(uint32_t max_reconnection_attempts, uint32_t time_to_sleep_between) override;
|
|
protected:
|
|
Poco::Util::LayeredConfiguration & getClientConfiguration() override;
|
|
|
|
bool processWithASTFuzzer(std::string_view full_query) override;
|
|
bool buzzHouse() override;
|
|
bool processASTFuzzerStep(const String & query_to_execute, const ASTPtr & parsed_query);
|
|
|
|
#if USE_JWT_CPP && USE_SSL
|
|
void login();
|
|
#endif
|
|
|
|
void connect() override;
|
|
|
|
void processError(std::string_view query) const override;
|
|
|
|
String getName() const override { return "client"; }
|
|
|
|
void printHelpMessage(const OptionsDescription & options_description) override;
|
|
|
|
void addExtraOptions(OptionsDescription & options_description) override;
|
|
|
|
void processOptions(
|
|
const OptionsDescription & options_description,
|
|
const CommandLineOptions & options,
|
|
const std::vector<Arguments> & external_tables_arguments,
|
|
const std::vector<Arguments> & hosts_and_ports_arguments) override;
|
|
|
|
void processConfig() override;
|
|
|
|
void readArguments(
|
|
int argc,
|
|
char ** argv,
|
|
Arguments & common_arguments,
|
|
std::vector<Arguments> & external_tables_arguments,
|
|
std::vector<Arguments> & hosts_and_ports_arguments) override;
|
|
|
|
private:
|
|
void printChangedSettings() const;
|
|
void showWarnings();
|
|
#if USE_BUZZHOUSE
|
|
std::unique_ptr<BuzzHouse::FuzzConfig> fuzz_config;
|
|
std::unique_ptr<BuzzHouse::ExternalIntegrations> external_integrations;
|
|
|
|
bool logAndProcessQuery(std::ofstream & outf, const String & full_query);
|
|
bool processBuzzHouseQuery(const String & full_query);
|
|
bool fuzzLoopReconnect();
|
|
#endif
|
|
std::vector<String> loadWarningMessages();
|
|
|
|
QueryScope query_scope;
|
|
|
|
#if USE_JWT_CPP && USE_SSL
|
|
std::shared_ptr<JWTProvider> jwt_provider;
|
|
bool login_was_auto_added = false;
|
|
#endif
|
|
};
|
|
}
|