Skip to content

Commit cfc619c

Browse files
committed
Update comments and docs.
1 parent 9f13d3f commit cfc619c

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

test/src/unit-cppapi-enumerations.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,17 +334,12 @@ TEST_CASE_METHOD(
334334
CPPEnumerationFx,
335335
"CPP API: Load All Enumerations - All Schemas",
336336
"[enumeration][array][load-all-enumerations][all-schemas][rest]") {
337-
auto cfg = ctx_.config();
338-
cfg["rest.use_refactored_array_open"] = "false";
339-
cfg["rest.use_refactored_array_open_and_query_submit"] = "false";
340-
vfs_test_setup_.update_config(cfg.ptr().get());
341-
ctx_ = vfs_test_setup_.ctx();
342337
create_array();
343338

344339
// Loading the array with array open v1 will only initialize the latest schema
345340
// For the first test this is fine, we only need to load enumerations for the
346341
// latest schema. In subsequent tests we will need to call
347-
// ArrayExperimental::load_all_enumerations.
342+
// ArrayExperimental::load_enumerations_all_schemas.
348343
auto array = tiledb::Array(ctx_, uri_, TILEDB_READ);
349344
auto schema = array.load_schema(ctx_, uri_);
350345
REQUIRE(

tiledb/sm/array/array.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -959,11 +959,11 @@ void Array::load_all_enumerations(bool all_schemas) {
959959
}
960960
// Load all enumerations, discarding the returned list of loaded enumerations.
961961
if (all_schemas) {
962-
// TODO: The enumerations are all here in a single request, they just need
963-
// to be stored in a schema. Since array open v1 does not initialize
964-
// array_schemas_all, we need to either serialize the full schemas with
965-
// LoadEnumerationsResponse, or reopen the array using array open v2 (only
966-
// if the config is set to use v1).
962+
// Since array open v1 does not initialize array_schemas_all, we need to
963+
// either serialize the full schemas with LoadEnumerationsResponse, or
964+
// reopen the array using array open v2 (only if the config is set to use
965+
// v1) so that we can store the enumerations from the response in the
966+
// correct schemas using the schema names.
967967

968968
// For now, reopen the array if it's found to be using array open v1.
969969
// Once we update to use post_array_schema_from_rest we will always have

tiledb/sm/array/array.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ class Array {
573573
*
574574
* This function retrieves the enumeration for the given name. If the
575575
* corresponding enumeration has not been loaded from storage it is
576-
* loaded before this function returns.
576+
* loaded and stored in the latest schema before this function returns.
577577
*
578578
* @param enumeration_name The name of the enumeration.
579579
* @return shared_ptr<const Enumeration> or nullptr on failure.
@@ -583,6 +583,9 @@ class Array {
583583

584584
/**
585585
* Load enumerations on all schemas for the array's opened timestamp range.
586+
* This function will store all loaded enumerations into their corresponding
587+
* schemas. The returned enumerations are provided as a convenience to the
588+
* caller and can be discarded if loading the enumerations is sufficient.
586589
*
587590
* @return Map of schema names and a list of all loaded enumerations.
588591
*/

tiledb/sm/serialization/enumeration.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ load_enumerations_response_from_capnp(
201201
loaded_enmrs.push_back(
202202
enumeration_from_capnp(enmr_reader, memory_tracker));
203203
}
204-
// The name of the array schema will not be used if we only loaded
205-
// enumerations on the latest array schema.
204+
// The name of the latest array schema will not be serialized in the
205+
// response if we are only loading enumerations from the latest schema.
206206
return {{array.array_schema_latest().name(), loaded_enmrs}};
207207
} else if (reader.hasAllEnumerations()) {
208208
auto all_enmrs_reader = reader.getAllEnumerations();

tiledb/sm/serialization/tiledb-rest.capnp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,10 +1266,12 @@ struct LoadEnumerationsRequest {
12661266

12671267
struct LoadEnumerationsResponse {
12681268
enumerations @0 :List(Enumeration);
1269-
# The loaded enumerations
1269+
# The loaded enumerations for the latest array schema
1270+
# This field is only used if enumerations are requested for the latest schema
12701271

12711272
allEnumerations @1 :MapEnumeration;
12721273
# The loaded enumerations for all array schemas
1274+
# This field is only used if enumerations are requested for all schemas
12731275
}
12741276

12751277
struct LoadArraySchemaRequest {

0 commit comments

Comments
 (0)