MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / open_for_writes

Method open_for_writes

tiledb/sm/array/array.cc:1776–1802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1774}
1775
1776tuple<
1777 shared_ptr<ArraySchema>,
1778 std::unordered_map<std::string, shared_ptr<ArraySchema>>>
1779Array::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
1804void Array::do_load_metadata() {
1805 if (!array_directory().loaded()) {

Callers

nothing calls this directly

Calls 7

ArrayExceptionClass · 0.85
supports_uri_schemeMethod · 0.80
vfsMethod · 0.80
load_array_schemasMethod · 0.80
start_timerMethod · 0.45
statsMethod · 0.45
versionMethod · 0.45

Tested by

no test coverage detected