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

Method SkipToInitialBlock

src/log/log_reader.cc:83–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83bool Reader::SkipToInitialBlock() {
84 size_t offset_in_block = initial_offset_ % block_size_;
85 uint64_t block_start_location = initial_offset_ - offset_in_block;
86
87 // Don't search a block if we'd be in the trailer
88 if (offset_in_block > (size_t)(block_size_ - 6)) {
89 block_start_location += block_size_;
90 }
91
92 end_of_buffer_offset_ = block_start_location;
93
94 // Skip to start of first block that can contain the initial record
95 if (block_start_location > 0) {
96 Status skip_status = file_->Skip(block_start_location);
97 if (!skip_status.ok()) {
98 ReportDrop(block_start_location, skip_status);
99 return false;
100 }
101 }
102 return true;
103}
104
105Status Reader::ReadRecord(Slice* record, std::string* scratch) {
106 if (last_record_offset_ < initial_offset_) {

Callers

nothing calls this directly

Calls 2

SkipMethod · 0.80
okMethod · 0.80

Tested by

no test coverage detected