mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
support supportsRightBoundedReads for ReadBufferFromHDFS and AsynchronousReadBufferFromHDFS
This commit is contained in:
parent
0cbf3c3b2f
commit
42c7383a12
@ -270,6 +270,21 @@ size_t AsynchronousReadBufferFromHDFS::getFileOffsetOfBufferEnd() const
|
||||
return file_offset_of_buffer_end;
|
||||
}
|
||||
|
||||
bool AsynchronousReadBufferFromHDFS::supportsRightBoundedReads() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void AsynchronousReadBufferFromHDFS::setReadUntilPosition(size_t position)
|
||||
{
|
||||
read_until_position = position;
|
||||
}
|
||||
|
||||
void AsynchronousReadBufferFromHDFS::setReadUntilEnd()
|
||||
{
|
||||
read_until_position = impl->getFileSize();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -31,6 +31,12 @@ public:
|
||||
|
||||
~AsynchronousReadBufferFromHDFS() override;
|
||||
|
||||
bool supportsRightBoundedReads() const override;
|
||||
|
||||
void setReadUntilPosition(size_t position) override;
|
||||
|
||||
void setReadUntilEnd() override;
|
||||
|
||||
off_t seek(off_t offset_, int whence) override;
|
||||
|
||||
void prefetch(Priority priority) override;
|
||||
|
@ -165,6 +165,19 @@ struct ReadBufferFromHDFS::ReadBufferFromHDFSImpl : public BufferWithOwnMemory<S
|
||||
return file_offset;
|
||||
}
|
||||
|
||||
bool supportsRightBoundedReads() const override { return true; }
|
||||
|
||||
void setReadUntilPosition(size_t position) override
|
||||
{
|
||||
read_until_position = position;
|
||||
}
|
||||
|
||||
void setReadUntilEnd() override
|
||||
{
|
||||
read_until_position = 0;
|
||||
}
|
||||
|
||||
|
||||
size_t pread(char * buffer, size_t size, size_t offset)
|
||||
{
|
||||
ResourceGuard rlock(ResourceGuard::Metrics::getIORead(), read_settings.io_scheduling.read_resource_link, size);
|
||||
@ -284,6 +297,21 @@ bool ReadBufferFromHDFS::supportsReadAt()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReadBufferFromHDFS::supportsRightBoundedReads() const
|
||||
{
|
||||
return impl->supportsRightBoundedReads();
|
||||
}
|
||||
|
||||
void ReadBufferFromHDFS::setReadUntilPosition(size_t position)
|
||||
{
|
||||
impl->setReadUntilPosition(position);
|
||||
}
|
||||
|
||||
void ReadBufferFromHDFS::setReadUntilEnd()
|
||||
{
|
||||
impl->setReadUntilEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -34,6 +34,12 @@ public:
|
||||
|
||||
~ReadBufferFromHDFS() override;
|
||||
|
||||
bool supportsRightBoundedReads() const override;
|
||||
|
||||
void setReadUntilPosition(size_t position) override;
|
||||
|
||||
void setReadUntilEnd() override;
|
||||
|
||||
bool nextImpl() override;
|
||||
|
||||
off_t seek(off_t offset_, int whence) override;
|
||||
|
Loading…
Reference in New Issue
Block a user