diff --git a/Array.cc b/Array.cc index 36b3a6e9c..a57a274ce 100644 --- a/Array.cc +++ b/Array.cc @@ -1337,6 +1337,8 @@ void Array::dump(std::ostream &strm) const { */ void Array::set_var_storage_info(const var_storage_info &my_vs_info) { + vs_info.has_filled_chunks = my_vs_info.has_filled_chunks; + vs_info.filter = my_vs_info.filter; for (const auto &def_lev : my_vs_info.deflate_levels) diff --git a/Array.h b/Array.h index 472089621..27b60acb0 100644 --- a/Array.h +++ b/Array.h @@ -191,6 +191,7 @@ class Array : public Vector { /** @brief Storage layout and filter metadata for direct-I/O reads. */ struct var_storage_info { + bool has_filled_chunks; ///< Whether this array has chunks that only contain filled values. string filter; ///< Filter pipeline description. vector deflate_levels; ///< Deflate levels per filter stage. vector chunk_dims; ///< Chunk dimensions in row-major order. @@ -205,6 +206,8 @@ class Array : public Vector { bool direct_io_flag = false; var_storage_info vs_info; + float storage_size_ratio = 1; + void update_dimension_pointers(D4Group *grp); void print_dim_element(const XMLWriter &xml, const dimension &d, bool constrained); @@ -502,6 +505,17 @@ class Array : public Vector { * @param my_vs_info New storage metadata. */ void set_var_storage_info(const var_storage_info &my_vs_info); + + // The following methods are for the applications that care about storage size. + + /** @brief Returns the ratio of logical size to the real storage size for this array. */ + float get_storage_size_ratio() const { return storage_size_ratio; } + + /** + * @brief set the ratio of the logical size to the real storage size for this array. + * @param the ratio of the logical size to the real storage size for this array. + */ + void set_storage_size_ratio(float sr) { storage_size_ratio = sr; } }; } // namespace libdap