MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / GoBackToLastBlock

Method GoBackToLastBlock

src/log/log_reader.cc:269–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269void Reader::GoBackToLastBlock() {
270 size_t offset_in_block = last_end_of_buffer_offset_ % block_size_;
271 uint64_t block_start_location = 0;
272 if (last_end_of_buffer_offset_ > offset_in_block) {
273 block_start_location = last_end_of_buffer_offset_ - offset_in_block;
274 }
275 DEBUGLOG("go back block from[%lu] to [%lu]", end_of_buffer_offset_,
276 block_start_location);
277 end_of_buffer_offset_ = block_start_location;
278 buffer_.clear();
279 file_->Seek(block_start_location);
280}
281
282void Reader::GoBackToStart() {
283 uint64_t block_start_location = 0;

Callers 1

SyncDataMethod · 0.80

Calls 2

clearMethod · 0.80
SeekMethod · 0.45

Tested by

no test coverage detected