mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #54336 from arenadata/ADQM-1157
Used assert_cast instead of dynamic_cast in ExternalDataSourceCache
This commit is contained in:
commit
d9746b5ea1
@ -57,7 +57,7 @@ LocalFileHolder::~LocalFileHolder()
|
||||
{
|
||||
if (original_readbuffer)
|
||||
{
|
||||
dynamic_cast<SeekableReadBuffer *>(original_readbuffer.get())->seek(0, SEEK_SET);
|
||||
assert_cast<SeekableReadBuffer *>(original_readbuffer.get())->seek(0, SEEK_SET);
|
||||
file_cache_controller->value().startBackgroundDownload(std::move(original_readbuffer), *thread_pool);
|
||||
}
|
||||
}
|
||||
@ -122,7 +122,7 @@ off_t RemoteReadBuffer::seek(off_t offset, int whence)
|
||||
{
|
||||
if (local_file_holder->original_readbuffer)
|
||||
{
|
||||
auto ret = dynamic_cast<SeekableReadBuffer *>(local_file_holder->original_readbuffer.get())->seek(offset, whence);
|
||||
auto ret = assert_cast<SeekableReadBuffer *>(local_file_holder->original_readbuffer.get())->seek(offset, whence);
|
||||
BufferBase::set(
|
||||
local_file_holder->original_readbuffer->buffer().begin(),
|
||||
local_file_holder->original_readbuffer->buffer().size(),
|
||||
@ -147,7 +147,7 @@ off_t RemoteReadBuffer::getPosition()
|
||||
{
|
||||
if (local_file_holder->original_readbuffer)
|
||||
{
|
||||
return dynamic_cast<SeekableReadBuffer *>(local_file_holder->original_readbuffer.get())->getPosition();
|
||||
return assert_cast<SeekableReadBuffer *>(local_file_holder->original_readbuffer.get())->getPosition();
|
||||
}
|
||||
return local_file_holder->file_buffer->getPosition();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user