163 struct LogReporter :
public log::Reader::Reporter {
167 virtual void Corruption(
size_t bytes,
const Status& s) {
169 Log(info_log,
"Log #%llu: dropping %d bytes; %s",
170 (
unsigned long long) lognum,
171 static_cast<int>(bytes),
172 s.ToString().c_str());
178 SequentialFile* lfile;
185 LogReporter reporter;
188 reporter.lognum = log;
193 log::Reader reader(lfile, &reporter,
false,
200 MemTable* mem =
new MemTable(
icmp_);
203 while (reader.ReadRecord(&record, &scratch)) {
204 if (record.size() < 12) {
215 (
unsigned long long) log,
216 status.ToString().c_str());
226 Iterator* iter = mem->NewIterator();
232 if (meta.file_size > 0) {
237 (
unsigned long long) log,
239 (
unsigned long long) meta.number,
240 status.ToString().c_str());
std::string const dbname_
static Status InsertInto(const WriteBatch *batch, MemTable *memtable)
void Log(Logger *info_log, const char *format,...)
static Status Corruption(const Slice &msg, const Slice &msg2=Slice())
static void SetContents(WriteBatch *batch, const Slice &contents)
InternalKeyComparator const icmp_
TableCache * table_cache_
static int Count(const WriteBatch *batch)
std::vector< uint64_t > table_numbers_
virtual Status NewSequentialFile(const std::string &fname, SequentialFile **result)=0
std::string LogFileName(const std::string &name, uint64_t number)
Status BuildTable(const std::string &dbname, Env *env, const Options &options, TableCache *table_cache, Iterator *iter, FileMetaData *meta)
uint64_t next_file_number_