mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Attempt to implement streaming optimization in DiskS3
.
This commit is contained in:
parent
718523b0ee
commit
67f9d8124b
@ -26,9 +26,28 @@ public:
|
||||
|
||||
off_t seek(off_t off, int whence) override
|
||||
{
|
||||
swap(*nested);
|
||||
off_t position = nested->seek(off, whence);
|
||||
swap(*nested);
|
||||
off_t position = getPosition();
|
||||
|
||||
if (whence == SEEK_CUR)
|
||||
{
|
||||
off += position;
|
||||
whence = SEEK_SET;
|
||||
}
|
||||
|
||||
if (whence == SEEK_SET && off >= position && off < position + 1024*1024)
|
||||
{
|
||||
swap(*nested);
|
||||
nested->ignore(off - position);
|
||||
swap(*nested);
|
||||
position = off;
|
||||
}
|
||||
else
|
||||
{
|
||||
swap(*nested);
|
||||
position = nested->seek(off, whence);
|
||||
swap(*nested);
|
||||
}
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user