better method name

This commit is contained in:
Alexander Tokmakov 2024-01-23 00:30:42 +01:00
parent eb88166763
commit 4cfc8d1a34
6 changed files with 6 additions and 6 deletions

View File

@ -4841,7 +4841,7 @@ PartUUIDsPtr Context::getIgnoredPartUUIDs() const
return ignored_part_uuids;
}
AsynchronousInsertQueue * Context::getAsynchronousInsertQueue() const
AsynchronousInsertQueue * Context::tryGetAsynchronousInsertQueue() const
{
std::lock_guard lock(mutex);
return shared->async_insert_queue.get();

View File

@ -1203,7 +1203,7 @@ public:
PartUUIDsPtr getPartUUIDs() const;
PartUUIDsPtr getIgnoredPartUUIDs() const;
AsynchronousInsertQueue * getAsynchronousInsertQueue() const;
AsynchronousInsertQueue * tryGetAsynchronousInsertQueue() const;
void setAsynchronousInsertQueue(const std::shared_ptr<AsynchronousInsertQueue> & ptr);
ReadTaskCallback getReadTaskCallback() const;

View File

@ -692,7 +692,7 @@ BlockIO InterpreterSystemQuery::execute()
case Type::FLUSH_ASYNC_INSERT_QUEUE:
{
getContext()->checkAccess(AccessType::SYSTEM_FLUSH_ASYNC_INSERT_QUEUE);
auto * queue = getContext()->getAsynchronousInsertQueue();
auto * queue = getContext()->tryGetAsynchronousInsertQueue();
if (!queue)
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"Cannot flush asynchronous insert queue because it is not initialized");

View File

@ -924,7 +924,7 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
std::unique_ptr<IInterpreter> interpreter;
bool async_insert = false;
auto * queue = context->getAsynchronousInsertQueue();
auto * queue = context->tryGetAsynchronousInsertQueue();
auto * logger = &Poco::Logger::get("executeQuery");
if (insert_query && async_insert_enabled)

View File

@ -907,7 +907,7 @@ void TCPHandler::processInsertQuery()
Block processed_block;
const auto & settings = query_context->getSettingsRef();
auto * insert_queue = query_context->getAsynchronousInsertQueue();
auto * insert_queue = query_context->tryGetAsynchronousInsertQueue();
const auto & insert_query = assert_cast<const ASTInsertQuery &>(*state.parsed_query);
bool async_insert_enabled = settings.async_insert;

View File

@ -34,7 +34,7 @@ void StorageSystemAsynchronousInserts::fillData(MutableColumns & res_columns, Co
{
using namespace std::chrono;
auto * insert_queue = context->getAsynchronousInsertQueue();
auto * insert_queue = context->tryGetAsynchronousInsertQueue();
if (!insert_queue)
return;