Directly construct a log file that sets key to val.
| 137 | |
| 138 | // Directly construct a log file that sets key to val. |
| 139 | void MakeLogFile(uint64_t lognum, SequenceNumber seq, Slice key, Slice val) { |
| 140 | std::string fname = LogFileName(dbname_, lognum); |
| 141 | WritableFile* file; |
| 142 | ASSERT_OK(env_->NewWritableFile(fname, &file)); |
| 143 | log::Writer writer(file); |
| 144 | WriteBatch batch; |
| 145 | batch.Put(key, val); |
| 146 | WriteBatchInternal::SetSequence(&batch, seq); |
| 147 | ASSERT_OK(writer.AddRecord(WriteBatchInternal::Contents(&batch))); |
| 148 | ASSERT_OK(file->Flush()); |
| 149 | delete file; |
| 150 | } |
| 151 | |
| 152 | private: |
| 153 | std::string dbname_; |
nothing calls this directly
no test coverage detected