@@ -30,6 +30,7 @@ namespace doris {
3030std::vector<SchemaScanner::ColumnDesc> SchemaFileCacheInfoScanner::_s_tbls_columns = {
3131 // name, type, size, is_null
3232 {" HASH" , TYPE_STRING, sizeof (StringRef), true },
33+ {" OFFSET" , TYPE_BIGINT, sizeof (int64_t ), true },
3334 {" TABLET_ID" , TYPE_BIGINT, sizeof (int64_t ), true },
3435 {" SIZE" , TYPE_BIGINT, sizeof (int64_t ), true },
3536 {" TYPE" , TYPE_STRING, sizeof (StringRef), true },
@@ -68,7 +69,7 @@ Status SchemaFileCacheInfoScanner::_fill_block_impl(vectorized::Block* block) {
6869 }
6970
7071 // Collect all cache entries from all file cache instances
71- std::vector<std::tuple<std::string, int64_t , int64_t , int , std::string>> cache_entries;
72+ std::vector<std::tuple<std::string, int64_t , int64_t , int64_t , int , std::string>> cache_entries;
7273
7374 // Get all cache instances using the public getter
7475 const auto & caches = file_cache_factory->get_caches ();
@@ -116,7 +117,8 @@ Status SchemaFileCacheInfoScanner::_fill_block_impl(vectorized::Block* block) {
116117 std::string hash_str = key.hash .to_string ();
117118
118119 // Add to cache entries
119- cache_entries.emplace_back (hash_str, key.tablet_id , value.size , value.type , cache_path);
120+ cache_entries.emplace_back (hash_str, static_cast <int64_t >(key.offset ), key.tablet_id ,
121+ static_cast <int64_t >(value.size ), value.type , cache_path);
120122
121123 iterator->next ();
122124 }
@@ -137,21 +139,21 @@ Status SchemaFileCacheInfoScanner::_fill_block_impl(vectorized::Block* block) {
137139
138140 for (size_t row_idx = 0 ; row_idx < row_num; ++row_idx) {
139141 const auto & entry = cache_entries[row_idx];
140- const auto & [hash, tablet_id, size, type, cache_path] = entry;
142+ const auto & [hash, offset, tablet_id, size, type, cache_path] = entry;
141143
142144 if (col_desc.type == TYPE_STRING) {
143145 switch (col_idx) {
144146 case 0 : // HASH
145147 column_values[row_idx] = hash;
146148 break ;
147- case 3 : // TYPE
149+ case 4 : // TYPE
148150 column_values[row_idx] = doris::io::cache_type_to_string (
149151 static_cast <doris::io::FileCacheType>(type));
150152 break ;
151- case 4 : // REMOTE_PATH
153+ case 5 : // REMOTE_PATH
152154 column_values[row_idx] = " " ; // TODO: Implement remote path retrieval
153155 break ;
154- case 5 : // CACHE_PATH
156+ case 6 : // CACHE_PATH
155157 column_values[row_idx] = cache_path;
156158 break ;
157159 default :
@@ -163,13 +165,16 @@ Status SchemaFileCacheInfoScanner::_fill_block_impl(vectorized::Block* block) {
163165 datas[row_idx] = &str_refs[row_idx];
164166 } else if (col_desc.type == TYPE_BIGINT) {
165167 switch (col_idx) {
166- case 1 : // TABLET_ID
168+ case 1 : // OFFSET
169+ int64_vals[row_idx] = offset;
170+ break ;
171+ case 2 : // TABLET_ID
167172 int64_vals[row_idx] = tablet_id;
168173 break ;
169- case 2 : // SIZE
174+ case 3 : // SIZE
170175 int64_vals[row_idx] = size;
171176 break ;
172- case 6 : // BE_ID
177+ case 7 : // BE_ID
173178 int64_vals[row_idx] = ExecEnv::GetInstance ()->cluster_info ()->backend_id ;
174179 break ;
175180 default :
0 commit comments