77 for (
size_t i = 0; i <
new_files_.size(); i++) {
98 static bool GetLevel(Slice* input,
int* level) {
101 v < config::kNumLevels) {
112 const char* msg = NULL;
129 msg =
"comparator name";
145 msg =
"previous log number";
153 msg =
"next file number";
161 msg =
"last sequence number";
166 if (GetLevel(&input, &level) &&
167 GetInternalKey(&input, &key)) {
170 msg =
"compaction pointer";
175 if (GetLevel(&input, &level) &&
179 msg =
"deleted file";
184 if (GetLevel(&input, &level) &&
187 GetInternalKey(&input, &f.
smallest) &&
188 GetInternalKey(&input, &f.
largest)) {
189 new_files_.push_back(std::make_pair(level, f));
191 msg =
"new-file entry";
201 if (msg == NULL && !input.
empty()) {
214 r.append(
"VersionEdit {");
216 r.append(
"\n Comparator: ");
220 r.append(
"\n LogNumber: ");
224 r.append(
"\n PrevLogNumber: ");
228 r.append(
"\n NextFile: ");
232 r.append(
"\n LastSeq: ");
236 r.append(
"\n CompactPointer: ");
241 for (DeletedFileSet::const_iterator iter =
deleted_files_.begin();
244 r.append(
"\n DeleteFile: ");
249 for (
size_t i = 0; i <
new_files_.size(); i++) {
251 r.append(
"\n AddFile: ");
void DecodeFrom(const Slice &s)
uint64_t prev_log_number_
void PutVarint64(std::string *dst, uint64_t v)
static Status Corruption(const Slice &msg, const Slice &msg2=Slice())
std::vector< std::pair< int, InternalKey > > compact_pointers_
DeletedFileSet deleted_files_
SequenceNumber last_sequence_
std::vector< std::pair< int, FileMetaData > > new_files_
bool has_next_file_number_
void PutLengthPrefixedSlice(std::string *dst, const Slice &value)
unsigned long long uint64_t
bool has_prev_log_number_
Status DecodeFrom(const Slice &src)
std::string DebugString() const
void EncodeTo(std::string *dst) const
bool GetVarint64(Slice *input, uint64_t *value)
uint64_t next_file_number_
bool GetVarint32(Slice *input, uint32_t *value)
std::string DebugString() const
const char * GetLengthPrefixedSlice(const char *p, const char *limit, Slice *result)
std::string ToString() const
void PutVarint32(std::string *dst, uint32_t v)
void AppendNumberTo(std::string *str, uint64_t num)