Minor refactors before PR

This commit is contained in:
Jakub Kuklis 2021-11-16 13:35:21 +00:00
parent c4421d6866
commit b8ef47006c
5 changed files with 5 additions and 10 deletions

View File

@ -28,7 +28,7 @@ struct DiskBlobStorageSettings final
int thread_pool_size_,
int objects_chunk_size_to_delete_);
UInt64 max_single_part_upload_size;
size_t max_single_part_upload_size;
UInt64 min_bytes_for_seek;
int thread_pool_size;
int objects_chunk_size_to_delete;

View File

@ -139,7 +139,6 @@ void registerDiskBlobStorage(DiskFactory & factory)
String cache_path = config.getString(config_prefix + ".cache_path", context->getPath() + "disks/" + name + "/cache/");
if (metadata_path == cache_path)
// TODO maybe provide the cache_path in the error message too.
throw Exception("Metadata and cache path should be different: " + metadata_path, ErrorCodes::BAD_ARGUMENTS);
auto cache_disk = std::make_shared<DiskLocal>("blob-storage-cache", cache_path, 0);

View File

@ -94,7 +94,7 @@ off_t ReadBufferFromBlobStorage::seek(off_t offset_, int whence)
off_t ReadBufferFromBlobStorage::getPosition()
{
// TODO: which one is the right one? In S3: return offset - available();
// TODO: why is it `return offset - available()` in S3?
return offset;
}
@ -118,15 +118,13 @@ void ReadBufferFromBlobStorage::initialize()
}
catch (const Azure::Storage::StorageException & e)
{
// TODO log the download options to
LOG_INFO(log, "Exception caught during Azure Download for file {} : {}", path, e.Message);
LOG_INFO(log, "Exception caught during Azure Download for file {} at offset {} : {}", path, offset, e.Message);
throw e;
}
if (data_stream == nullptr)
// TODO log the download options and the context
throw Exception("Null data stream obtained while downloading a file from Blob Storage", ErrorCodes::RECEIVED_EMPTY_DATA);
throw Exception(ErrorCodes::RECEIVED_EMPTY_DATA, "Null data stream obtained while downloading file {} from Blob Storage", path);
total_size = data_stream->Length() + offset;

View File

@ -37,7 +37,6 @@ void WriteBufferFromBlobStorage::nextImpl()
if (!offset())
return;
auto pos = working_buffer.begin();
auto * pos = working_buffer.begin();
auto len = offset();
auto block_blob_client = blob_container_client->GetBlockBlobClient(blob_path);

View File

@ -24,7 +24,7 @@ public:
explicit WriteBufferFromBlobStorage(
std::shared_ptr<Azure::Storage::Blobs::BlobContainerClient> blob_container_client_,
const String & blob_path_,
UInt64 max_single_part_upload_size_,
size_t max_single_part_upload_size_,
size_t buf_size_);
void nextImpl() override;
@ -35,7 +35,6 @@ private:
std::vector<std::string> block_ids;
std::shared_ptr<Azure::Storage::Blobs::BlobContainerClient> blob_container_client;
UInt64 max_single_part_upload_size;
size_t max_single_part_upload_size;
const String blob_path;
bool finalized = false;