| 1774 | } |
| 1775 | |
| 1776 | tuple< |
| 1777 | shared_ptr<ArraySchema>, |
| 1778 | std::unordered_map<std::string, shared_ptr<ArraySchema>>> |
| 1779 | Array::open_for_writes() { |
| 1780 | auto timer_se = |
| 1781 | resources_.stats().start_timer("array_open_write_load_schemas"); |
| 1782 | // Checks |
| 1783 | if (!resources_.vfs().supports_uri_scheme(array_uri_)) { |
| 1784 | throw ArrayException("Cannot open array; URI scheme unsupported."); |
| 1785 | } |
| 1786 | |
| 1787 | // Load array schemas |
| 1788 | auto&& [array_schema_latest, array_schemas_all] = |
| 1789 | array_directory().load_array_schemas(*encryption_key(), memory_tracker_); |
| 1790 | |
| 1791 | // The library should not be able to write to newer-versioned arrays |
| 1792 | // (but it is ok to write to older arrays) |
| 1793 | auto version = array_schema_latest->version(); |
| 1794 | if (version > constants::format_version) { |
| 1795 | throw ArrayException( |
| 1796 | "Cannot open array for writes; Array format version (" + |
| 1797 | std::to_string(version) + ") is newer than library format version (" + |
| 1798 | std::to_string(constants::format_version) + ")"); |
| 1799 | } |
| 1800 | |
| 1801 | return {array_schema_latest, array_schemas_all}; |
| 1802 | } |
| 1803 | |
| 1804 | void Array::do_load_metadata() { |
| 1805 | if (!array_directory().loaded()) { |
nothing calls this directly
no test coverage detected