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

Function tiledb_ctx_get_data_protocol

tiledb/api/c_api/context/context_api.cc:145–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145capi_return_t tiledb_ctx_get_data_protocol(
146 tiledb_ctx_t* ctx, const char* uri, tiledb_data_protocol_t* data_protocol) {
147 ensure_context_is_valid(ctx);
148 ensure_output_pointer_is_valid(data_protocol);
149
150 auto uri_to_check = tiledb::sm::URI(uri);
151 if (uri_to_check.is_invalid()) {
152 throw CAPIException("Cannot get data protocol; Invalid URI");
153 }
154
155 if (tiledb::sm::URI::is_tiledb(uri)) {
156 if (!ctx->has_rest_client()) {
157 throw CAPIException(
158 "Cannot get data protocol; REST client not configured");
159 }
160
161 if (ctx->rest_client().rest_legacy()) {
162 *data_protocol = TILEDB_DATA_PROTOCOL_v2;
163 } else {
164 *data_protocol = TILEDB_DATA_PROTOCOL_v3;
165 }
166 } else {
167 *data_protocol = TILEDB_DATA_PROTOCOL_v2;
168 }
169
170 return TILEDB_OK;
171}
172
173} // namespace tiledb::api
174

Callers 2

data_protocolMethod · 0.85
unit-ctx.ccFile · 0.85

Calls 8

ensure_context_is_validFunction · 0.85
CAPIExceptionClass · 0.85
is_invalidMethod · 0.80
URIClass · 0.50
has_rest_clientMethod · 0.45
rest_legacyMethod · 0.45
rest_clientMethod · 0.45

Tested by

no test coverage detected