Debug code

This commit is contained in:
divanik 2024-07-17 09:24:33 +00:00
parent d2eded16aa
commit 0bfe345a46
3 changed files with 12 additions and 7 deletions

View File

@ -50,10 +50,11 @@ std::unique_ptr<ReadBufferFromFileBase> LocalObjectStorage::readObjects( /// NOL
{ {
auto modified_settings = patchSettings(read_settings); auto modified_settings = patchSettings(read_settings);
auto global_context = Context::getGlobalContextInstance(); auto global_context = Context::getGlobalContextInstance();
auto read_buffer_creator = auto read_buffer_creator = [=](bool /* restricted_seek */, const StoredObject & object) -> std::unique_ptr<ReadBufferFromFileBase>
[=] (bool /* restricted_seek */, const StoredObject & object)
-> std::unique_ptr<ReadBufferFromFileBase>
{ {
LOG_DEBUG(&Poco::Logger::get("Read"), "Remote Path: {}", object.remote_path);
auto from_file_storage = createReadBufferFromFileBase(object.remote_path, modified_settings, read_hint, file_size);
return createReadBufferFromFileBase(object.remote_path, modified_settings, read_hint, file_size); return createReadBufferFromFileBase(object.remote_path, modified_settings, read_hint, file_size);
}; };

View File

@ -38,10 +38,7 @@ public:
ConfigurationPtr clone() override { return std::make_shared<StorageLocalConfiguration>(*this); } ConfigurationPtr clone() override { return std::make_shared<StorageLocalConfiguration>(*this); }
ObjectStoragePtr createObjectStorage(ContextPtr, bool) override ObjectStoragePtr createObjectStorage(ContextPtr, bool) override { return std::make_shared<LocalObjectStorage>("/"); }
{
return std::make_shared<LocalObjectStorage>(fs::path{path}.parent_path());
}
void addStructureAndFormatToArgs(ASTs &, const String &, const String &, ContextPtr) override { } void addStructureAndFormatToArgs(ASTs &, const String &, const String &, ContextPtr) override { }

View File

@ -388,7 +388,12 @@ StorageObjectStorageSource::ReaderHolder StorageObjectStorageSource::createReade
else else
{ {
compression_method = chooseCompressionMethod(object_info->getFileName(), configuration->compression_method); compression_method = chooseCompressionMethod(object_info->getFileName(), configuration->compression_method);
LOG_DEBUG(&Poco::Logger::get("Info relative path"), "Info: {}", object_info->relative_path);
read_buf = createReadBuffer(*object_info, object_storage, context_, log); read_buf = createReadBuffer(*object_info, object_storage, context_, log);
auto new_read_buf = createReadBuffer(*object_info, object_storage, context_, log);
std::string answer(1000, ' ');
size_t read_bytes = new_read_buf->read(answer.data(), 1000);
LOG_DEBUG(&Poco::Logger::get("Read buffer"), "Read bytes: {}, string: {}", read_bytes, answer.substr(0, read_bytes));
} }
auto input_format = FormatFactory::instance().getInput( auto input_format = FormatFactory::instance().getInput(
@ -471,6 +476,8 @@ std::unique_ptr<ReadBuffer> StorageObjectStorageSource::createReadBuffer(
{ {
LOG_TRACE(log, "Downloading object of size {} with initial prefetch", object_size); LOG_TRACE(log, "Downloading object of size {} with initial prefetch", object_size);
LOG_DEBUG(&Poco::Logger::get("Read"), "Path: {}, object size: {}", object_info.getPath(), object_size);
auto async_reader = object_storage->readObjects( auto async_reader = object_storage->readObjects(
StoredObjects{StoredObject{object_info.getPath(), /* local_path */ "", object_size}}, read_settings); StoredObjects{StoredObject{object_info.getPath(), /* local_path */ "", object_size}}, read_settings);