Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
csun5285 committed Dec 16, 2024
1 parent 87d418d commit 6e3c516
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
6 changes: 6 additions & 0 deletions cloud/src/meta-service/keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ void stats_tablet_num_segs_key(const StatsTabletKeyInfo& in, std::string* out);
void stats_tablet_index_size_key(const StatsTabletKeyInfo& in, std::string* out);
void stats_tablet_segment_size_key(const StatsTabletKeyInfo& in, std::string* out);
static inline std::string stats_tablet_key(const StatsTabletKeyInfo& in) { std::string s; stats_tablet_key(in, &s); return s; }
static inline std::string stats_tablet_data_size_key(const StatsTabletKeyInfo& in) { std::string s; stats_tablet_data_size_key(in, &s); return s; }
static inline std::string stats_tablet_num_rows_key(const StatsTabletKeyInfo& in) { std::string s; stats_tablet_num_rows_key(in, &s); return s; }
static inline std::string stats_tablet_num_rowsets_key(const StatsTabletKeyInfo& in) { std::string s; stats_tablet_num_rowsets_key(in, &s); return s; }
static inline std::string stats_tablet_num_segs_key(const StatsTabletKeyInfo& in) { std::string s; stats_tablet_num_segs_key(in, &s); return s; }
static inline std::string stats_tablet_index_size_key(const StatsTabletKeyInfo& in) { std::string s; stats_tablet_index_size_key(in, &s); return s; }
static inline std::string stats_tablet_segment_size_key(const StatsTabletKeyInfo& in) { std::string s; stats_tablet_segment_size_key(in, &s); return s; }

void job_recycle_key(const JobRecycleKeyInfo& in, std::string* out);
void job_check_key(const JobRecycleKeyInfo& in, std::string* out);
Expand Down
21 changes: 7 additions & 14 deletions cloud/test/meta_service_tablet_stats_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,33 @@ TEST(MetaServiceTabletStatsTest, test_get_detached_tablet_stats) {

// key->TabletStatsPB
TabletStatsPB tablet_stat;
std::string tablet_stat_key;
std::string tablet_stat_value;
stats_tablet_key(tablet_key_info, &tablet_stat_key);
auto tablet_stat_key = stats_tablet_key(tablet_key_info);
tablet_stat.SerializeToString(&tablet_stat_value);
stats_kvs.emplace_back(tablet_stat_key, tablet_stat_value);

// key->data_size
std::string tablet_stat_data_size_key;
stats_tablet_data_size_key(tablet_key_info, &tablet_stat_data_size_key);
auto tablet_stat_data_size_key = stats_tablet_data_size_key(tablet_key_info);
stats_kvs.emplace_back(tablet_stat_data_size_key, size_value(100));

// key->num_rows
std::string tablet_stat_num_rows_key;
stats_tablet_num_rows_key(tablet_key_info, &tablet_stat_num_rows_key);
auto tablet_stat_num_rows_key = stats_tablet_num_rows_key(tablet_key_info);
stats_kvs.emplace_back(tablet_stat_num_rows_key, size_value(10));

// key->num_rowsets
std::string tablet_stat_num_rowsets_key;
stats_tablet_num_rowsets_key(tablet_key_info, &tablet_stat_num_rowsets_key);
auto tablet_stat_num_rowsets_key = stats_tablet_num_rowsets_key(tablet_key_info);
stats_kvs.emplace_back(tablet_stat_num_rowsets_key, size_value(1));

// key->num_segs
std::string tablet_stat_num_segs_key;
stats_tablet_num_segs_key(tablet_key_info, &tablet_stat_num_segs_key);
auto tablet_stat_num_segs_key = stats_tablet_num_segs_key(tablet_key_info);
stats_kvs.emplace_back(tablet_stat_num_segs_key, size_value(1));

// key->index_size
std::string tablet_stat_index_size_key;
stats_tablet_index_size_key(tablet_key_info, &tablet_stat_index_size_key);
auto tablet_stat_index_size_key = stats_tablet_index_size_key(tablet_key_info);
stats_kvs.emplace_back(tablet_stat_index_size_key, size_value(50));

// key->segment_size
std::string tablet_stat_segment_size_key;
stats_tablet_segment_size_key(tablet_key_info, &tablet_stat_segment_size_key);
auto tablet_stat_segment_size_key = stats_tablet_segment_size_key(tablet_key_info);
stats_kvs.emplace_back(tablet_stat_segment_size_key, size_value(50));

TabletStats res1;
Expand Down

0 comments on commit 6e3c516

Please sign in to comment.