Changeset View
Changeset View
Standalone View
Standalone View
src/leveldb/db/log_reader.cc
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | bool Reader::ReadRecord(Slice* record, std::string* scratch) { | ||||
return false; | return false; | ||||
} | } | ||||
uint64_t Reader::LastRecordOffset() { | uint64_t Reader::LastRecordOffset() { | ||||
return last_record_offset_; | return last_record_offset_; | ||||
} | } | ||||
void Reader::ReportCorruption(uint64_t bytes, const char* reason) { | void Reader::ReportCorruption(uint64_t bytes, const char* reason) { | ||||
ReportDrop(bytes, Status::Corruption(reason)); | ReportDrop(bytes, Status::Corruption(reason, file_->GetName())); | ||||
} | } | ||||
void Reader::ReportDrop(uint64_t bytes, const Status& reason) { | void Reader::ReportDrop(uint64_t bytes, const Status& reason) { | ||||
if (reporter_ != NULL && | if (reporter_ != NULL && | ||||
end_of_buffer_offset_ - buffer_.size() - bytes >= initial_offset_) { | end_of_buffer_offset_ - buffer_.size() - bytes >= initial_offset_) { | ||||
reporter_->Corruption(static_cast<size_t>(bytes), reason); | reporter_->Corruption(static_cast<size_t>(bytes), reason); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |