mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Attempt to implement streaming optimization in DiskS3
.
This commit is contained in:
parent
718523b0ee
commit
67f9d8124b
@ -25,10 +25,29 @@ public:
|
||||
}
|
||||
|
||||
off_t seek(off_t off, int whence) override
|
||||
{
|
||||
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);
|
||||
off_t position = nested->seek(off, whence);
|
||||
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