MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / rewind

Method rewind

src/IO/AsynchronousReadBufferFromFileDescriptor.cpp:285–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283
284
285void AsynchronousReadBufferFromFileDescriptor::rewind()
286{
287 if (prefetch_future.valid())
288 {
289 prefetch_future.wait();
290 prefetch_future = {};
291 }
292
293 /// Clearing the buffer with existing data. New data will be read on subsequent call to 'next'.
294 working_buffer.resize(0);
295 pos = working_buffer.begin();
296 file_offset_of_buffer_end = 0;
297 bytes_to_ignore = 0;
298
299 /// A previous read cycle may have failed, leaving the buffer in a canceled state.
300 /// Reset so the next read cycle can proceed normally after rewind.
301 canceled = false;
302}
303
304std::optional<size_t> AsynchronousReadBufferFromFileDescriptor::tryGetFileSize()
305{

Callers

nothing calls this directly

Calls 4

validMethod · 0.45
waitMethod · 0.45
resizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected