Put column family information in LiveFileMetaData

Summary: As summary

Test Plan: compiles :)

Reviewers: dhruba, haobo, sdong, yhchiang

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D18405
This commit is contained in:
Igor Canadi 2014-04-30 16:24:52 -04:00
parent a3ab998ef9
commit 096f5be0ed
2 changed files with 3 additions and 1 deletions

View File

@ -2742,6 +2742,7 @@ void VersionSet::GetLiveFilesMetaData(std::vector<LiveFileMetaData>* metadata) {
for (int level = 0; level < cfd->NumberLevels(); level++) { for (int level = 0; level < cfd->NumberLevels(); level++) {
for (const auto& file : cfd->current()->files_[level]) { for (const auto& file : cfd->current()->files_[level]) {
LiveFileMetaData filemetadata; LiveFileMetaData filemetadata;
filemetadata.column_family_name = cfd->GetName();
filemetadata.name = TableFileName("", file->number); filemetadata.name = TableFileName("", file->number);
filemetadata.level = level; filemetadata.level = level;
filemetadata.size = file->file_size; filemetadata.size = file->file_size;

View File

@ -54,7 +54,8 @@ class Env;
// Metadata associated with each SST file. // Metadata associated with each SST file.
struct LiveFileMetaData { struct LiveFileMetaData {
std::string name; // Name of the file std::string column_family_name; // Name of the column family
std::string name; // Name of the file
int level; // Level at which this file resides. int level; // Level at which this file resides.
size_t size; // File size in bytes. size_t size; // File size in bytes.
std::string smallestkey; // Smallest user defined key in the file. std::string smallestkey; // Smallest user defined key in the file.