| 137 | SSTableReader::Impl::~Impl() {} |
| 138 | |
| 139 | bool SSTableReader::Impl::LoadFile(const std::string &path) { |
| 140 | CHECK(!file_base_.get()) << "the sstable is already opened."; |
| 141 | path_ = path; |
| 142 | MutexLocker l(&mutex_); |
| 143 | file_base_.reset(File::Open(path, "r")); |
| 144 | if (!file_base_.get()) { |
| 145 | LOG(ERROR)<< "open sstable failed: " << path; |
| 146 | return false; |
| 147 | } |
| 148 | |
| 149 | return LoadFileInfo(file_base_.get(), data_index_.get(), file_info_.get(), file_trailer_.get()); |
| 150 | } |
| 151 | |
| 152 | const std::string SSTableReader::Impl::GetMetaData(const std::string &key) const { |
| 153 | std::vector<std::pair<std::string, std::string> >::const_iterator iter = file_info_->meta_items |