Skip to content

Commit

Permalink
Remove all deprecated APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis committed Jul 3, 2024
1 parent df74fdb commit 8f912be
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 3,699 deletions.
102 changes: 0 additions & 102 deletions tiledb/api/c_api/group/group_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,58 +294,6 @@ capi_return_t tiledb_group_get_member_count(
return TILEDB_OK;
}

capi_return_t tiledb_group_get_member_by_index(
tiledb_group_handle_t* group,
uint64_t index,
char** uri,
tiledb_object_t* type,
char** name) {
ensure_group_is_valid(group);
ensure_output_pointer_is_valid(uri);
ensure_output_pointer_is_valid(type);
ensure_output_pointer_is_valid(name);

LOG_WARN(
"tiledb_group_get_member_by_index is deprecated. Please use "
"tiledb_group_get_member_by_index_v2 instead.");

char* tmp_uri = nullptr;
char* tmp_name = nullptr;

auto&& [uri_str, object_type, name_str] =
group->group().member_by_index(index);

tmp_uri = copy_string(uri_str);
if (tmp_uri == nullptr) {
goto error;
}

if (name_str.has_value()) {
tmp_name = copy_string(name_str.value());
if (tmp_name == nullptr) {
goto error;
}
}

*uri = tmp_uri;
*type = static_cast<tiledb_object_t>(object_type);
*name = tmp_name;

return TILEDB_OK;

error:

if (tmp_uri != nullptr) {
std::free(tmp_uri);
}

if (tmp_name != nullptr) {
std::free(tmp_name);
}

return TILEDB_OK;
}

capi_return_t tiledb_group_get_member_by_index_v2(
tiledb_group_handle_t* group,
uint64_t index,
Expand Down Expand Up @@ -374,33 +322,6 @@ capi_return_t tiledb_group_get_member_by_index_v2(
return TILEDB_OK;
}

capi_return_t tiledb_group_get_member_by_name(
tiledb_group_handle_t* group,
const char* name,
char** uri,
tiledb_object_t* type) {
ensure_group_is_valid(group);
ensure_name_argument_is_valid(name);
ensure_output_pointer_is_valid(uri);
ensure_output_pointer_is_valid(type);

LOG_WARN(
"tiledb_group_get_member_by_name is deprecated. Please use "
"tiledb_group_get_member_by_name_v2 instead.");

auto&& [uri_str, object_type, name_str, ignored_relative] =
group->group().member_by_name(name);

*uri = copy_string(uri_str);
if (*uri == nullptr) {
return TILEDB_ERR;
}

*type = static_cast<tiledb_object_t>(object_type);

return TILEDB_OK;
}

capi_return_t tiledb_group_get_member_by_name_v2(
tiledb_group_handle_t* group,
const char* name,
Expand Down Expand Up @@ -751,18 +672,6 @@ CAPI_INTERFACE(
ctx, group, count);
}

CAPI_INTERFACE(
group_get_member_by_index,
tiledb_ctx_t* ctx,
tiledb_group_t* group,
uint64_t index,
char** uri,
tiledb_object_t* type,
char** name) {
return api_entry_context<tiledb::api::tiledb_group_get_member_by_index>(
ctx, group, index, uri, type, name);
}

CAPI_INTERFACE(
group_get_member_by_index_v2,
tiledb_ctx_t* ctx,
Expand All @@ -775,17 +684,6 @@ CAPI_INTERFACE(
ctx, group, index, uri, type, name);
}

CAPI_INTERFACE(
group_get_member_by_name,
tiledb_ctx_t* ctx,
tiledb_group_t* group,
const char* name,
char** uri,
tiledb_object_t* type) {
return api_entry_context<tiledb::api::tiledb_group_get_member_by_name>(
ctx, group, name, uri, type);
}

CAPI_INTERFACE(
group_get_member_by_name_v2,
tiledb_ctx_t* ctx,
Expand Down
83 changes: 1 addition & 82 deletions tiledb/api/c_api/group/group_api_external.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,47 +422,6 @@ TILEDB_EXPORT capi_return_t tiledb_group_remove_member(
TILEDB_EXPORT capi_return_t tiledb_group_get_member_count(
tiledb_ctx_t* ctx, tiledb_group_t* group, uint64_t* count) TILEDB_NOEXCEPT;

#ifndef TILEDB_REMOVE_DEPRECATIONS
/**
* Get a member of a group by index and details of group.
* Deprecated, use \p tiledb_group_get_member_by_index_v2 instead.
*
* **Example:**
*
* @code{.c}
* tiledb_group_t* group;
* tiledb_group_alloc(ctx, "s3://tiledb_bucket/my_group", &group);
* tiledb_group_open(ctx, group, TILEDB_WRITE);
* tiledb_group_add_member(ctx, group, "s3://tiledb_bucket/my_array");
* tiledb_group_add_member(ctx, group, "s3://tiledb_bucket/my_group_2");
*
* tiledb_group_close(ctx, group);
* tiledb_group_open(ctx, group, TILEDB_READ);
* char *uri;
* tiledb_object_t type;
* tiledb_group_get_member_by_index(ctx, group, 0, &uri, &type);
*
* free(uri);
*
* @endcode
*
* @param ctx The TileDB context.
* @param group An group opened in READ mode.
* @param index index of member to fetch
* @param uri URI of member.
* @param type type of member
* @param name name of member. NULL if name was not set
* @return `TILEDB_OK` for success and `TILEDB_ERR` for error.
*/
TILEDB_DEPRECATED_EXPORT capi_return_t tiledb_group_get_member_by_index(
tiledb_ctx_t* ctx,
tiledb_group_t* group,
uint64_t index,
char** uri,
tiledb_object_t* type,
char** name) TILEDB_NOEXCEPT;
#endif // TILEDB_REMOVE_DEPRECATIONS

/**
* Get a member of a group by index and details of group
*
Expand Down Expand Up @@ -502,46 +461,6 @@ TILEDB_EXPORT capi_return_t tiledb_group_get_member_by_index_v2(
tiledb_object_t* type,
tiledb_string_t** name) TILEDB_NOEXCEPT;

#ifndef TILEDB_REMOVE_DEPRECATIONS
/**
* Get a member of a group by name and details of group.
* Deprecated, use \p tiledb_group_get_member_by_name_v2.
*
* **Example:**
*
* @code{.c}
* tiledb_group_t* group;
* tiledb_group_alloc(ctx, "s3://tiledb_bucket/my_group", &group);
* tiledb_group_open(ctx, group, TILEDB_WRITE);
* tiledb_group_add_member(ctx, group, "s3://tiledb_bucket/my_array", "array1");
* tiledb_group_add_member(ctx, group, "s3://tiledb_bucket/my_group_2",
* "group2");
*
* tiledb_group_close(ctx, group);
* tiledb_group_open(ctx, group, TILEDB_READ);
* char *uri;
* tiledb_object_t type;
* tiledb_group_get_member_by_name(ctx, group, "array1", &uri, &type);
*
* free(uri);
*
* @endcode
*
* @param ctx The TileDB context.
* @param group An group opened in READ mode.
* @param name name of member to fetch
* @param uri URI of member
* @param type type of member
* @return `TILEDB_OK` for success and `TILEDB_ERR` for error.
*/
TILEDB_DEPRECATED_EXPORT capi_return_t tiledb_group_get_member_by_name(
tiledb_ctx_t* ctx,
tiledb_group_t* group,
const char* name,
char** uri,
tiledb_object_t* type) TILEDB_NOEXCEPT;
#endif // TILEDB_REMOVE_DEPRECATIONS

/**
* Get a member of a group by name and details of group.
*
Expand All @@ -559,7 +478,7 @@ TILEDB_DEPRECATED_EXPORT capi_return_t tiledb_group_get_member_by_name(
* tiledb_group_open(ctx, group, TILEDB_READ);
* tilledb_string_t *uri;
* tiledb_object_t type;
* tiledb_group_get_member_by_name(ctx, group, "array1", &uri, &type);
* tiledb_group_get_member_by_name_v2(ctx, group, "array1", &uri, &type);
*
* tiledb_string_free(uri);
*
Expand Down
Loading

0 comments on commit 8f912be

Please sign in to comment.