table_properties_(nullptr) {}
PlainTableReader::~PlainTableReader() {
+ // Should fix?
+ status_.PermitUncheckedError();
}
Status PlainTableReader::Open(
InternalIterator* PlainTableReader::NewIterator(
const ReadOptions& options, const SliceTransform* /* prefix_extractor */,
Arena* arena, bool /*skip_filters*/, TableReaderCaller /*caller*/,
- size_t /*compaction_readahead_size*/) {
+ size_t /*compaction_readahead_size*/,
+ bool /* allow_unprepared_value */) {
// Not necessarily used here, but make sure this has been initialized
assert(table_properties_);
Status PlainTableReader::MmapDataIfNeeded() {
if (file_info_.is_mmap_mode) {
// Get mmapped memory.
- return file_info_.file->Read(0, static_cast<size_t>(file_size_), &file_info_.file_data, nullptr);
+ return file_info_.file->Read(IOOptions(), 0,
+ static_cast<size_t>(file_size_),
+ &file_info_.file_data, nullptr, nullptr);
}
return Status::OK();
}
}
// point to sub-index, need to do a binary search
- uint32_t upper_bound;
+ uint32_t upper_bound = 0;
const char* base_ptr =
index_.GetSubIndexBasePtrAndUpperBound(prefix_index_offset, &upper_bound);
uint32_t low = 0;
uint32_t high = upper_bound;
ParsedInternalKey mid_key;
ParsedInternalKey parsed_target;
- if (!ParseInternalKey(target, &parsed_target)) {
- return Status::Corruption(Slice());
- }
+ Status s = ParseInternalKey(target, &parsed_target,
+ false /* log_err_key */); // TODO
+ if (!s.ok()) return s;
// The key is between [low, high). Do a binary search between it.
while (high - low > 1) {
uint32_t mid = (high + low) / 2;
uint32_t file_offset = GetFixed32Element(base_ptr, mid);
uint32_t tmp;
- Status s = decoder->NextKeyNoValue(file_offset, &mid_key, nullptr, &tmp);
+ s = decoder->NextKeyNoValue(file_offset, &mid_key, nullptr, &tmp);
if (!s.ok()) {
return s;
}
ParsedInternalKey low_key;
uint32_t tmp;
uint32_t low_key_offset = GetFixed32Element(base_ptr, low);
- Status s = decoder->NextKeyNoValue(low_key_offset, &low_key, nullptr, &tmp);
+ s = decoder->NextKeyNoValue(low_key_offset, &low_key, nullptr, &tmp);
if (!s.ok()) {
return s;
}
}
ParsedInternalKey found_key;
ParsedInternalKey parsed_target;
- if (!ParseInternalKey(target, &parsed_target)) {
- return Status::Corruption(Slice());
- }
+ s = ParseInternalKey(target, &parsed_target,
+ false /* log_err_key */); // TODO
+ if (!s.ok()) return s;
+
Slice found_value;
while (offset < file_info_.data_end_offset) {
s = Next(&decoder, &offset, &found_key, nullptr, &found_value);