Skip to content

Commit cbec298

Browse files
authored
CDRIVER-5936 remove deprecated *_get_server_connection_id API
* remove `mongoc_apm_command_started_get_server_connection_id` * remove `mongoc_apm_command_failed_get_server_connection_id` * remove `mongoc_apm_command_succeeded_get_server_connection_id`
1 parent 6f9e482 commit cbec298

9 files changed

+1
-171
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Unreleased (2.0.0)
3838
* Support for LibreSSL (the CMake option `ENABLE_SSL=LIBRESSL`) is removed. Associated API is removed (`MONGOC_ENABLE_SSL_LIBRESSL` and `mongoc_stream_tls_libressl_new`).
3939
* `MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED` (value -1) is removed. Use `MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED` (value 0) which is handled equivalently. If specified in a URI, replace: `mongodb://host/?w=-1` with `mongodb://host/?w=0`.
4040
* The deprecated CMake option `ENABLE_AUTOMATIC_INIT_AND_CLEANUP` is removed. See [Initialization and cleanup](https://mongoc.org/libmongoc/1.30.2/init-cleanup.html) for expected use of `mongoc_init()` and `mongoc_cleanup()`.
41+
* Deprecated `mongoc_apm_command_*_get_server_connection_id` functions are removed. Use `mongoc_apm_command_*_get_server_connection_id_int64` instead.
4142

4243
### Forwarding headers (`#include <bson.h>` and `#include <mongoc.h>`)
4344

src/libmongoc/doc/mongoc_apm_command_failed_get_server_connection_id.rst

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/libmongoc/doc/mongoc_apm_command_failed_t.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ An event notification sent when the driver fails to execute a MongoDB command.
3030
mongoc_apm_command_failed_get_request_id
3131
mongoc_apm_command_failed_get_server_id
3232
mongoc_apm_command_failed_get_service_id
33-
mongoc_apm_command_failed_get_server_connection_id
3433
mongoc_apm_command_failed_get_server_connection_id_int64
3534

3635
.. seealso::

src/libmongoc/doc/mongoc_apm_command_started_get_server_connection_id.rst

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/libmongoc/doc/mongoc_apm_command_started_t.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,5 @@ An event notification sent when the driver begins executing a MongoDB command.
3232
mongoc_apm_command_started_get_request_id
3333
mongoc_apm_command_started_get_server_id
3434
mongoc_apm_command_started_get_service_id
35-
mongoc_apm_command_started_get_server_connection_id
3635
mongoc_apm_command_started_get_server_connection_id_int64
3736

src/libmongoc/doc/mongoc_apm_command_succeeded_get_server_connection_id.rst

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/libmongoc/doc/mongoc_apm_command_succeeded_t.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,5 @@ An event notification sent when the driver successfully executes a MongoDB comma
3333
mongoc_apm_command_succeeded_get_request_id
3434
mongoc_apm_command_succeeded_get_server_id
3535
mongoc_apm_command_succeeded_get_service_id
36-
mongoc_apm_command_succeeded_get_server_connection_id
3736
mongoc_apm_command_succeeded_get_server_connection_id_int64
3837

src/libmongoc/src/mongoc/mongoc-apm.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -378,20 +378,6 @@ mongoc_apm_command_started_get_service_id (const mongoc_apm_command_started_t *e
378378
}
379379

380380

381-
int32_t
382-
mongoc_apm_command_started_get_server_connection_id (const mongoc_apm_command_started_t *event)
383-
{
384-
if (event->server_connection_id > INT32_MAX || event->server_connection_id < INT32_MIN) {
385-
MONGOC_WARNING ("Server connection ID %" PRId64 " is outside of int32 range. Returning -1. Use "
386-
"mongoc_apm_command_started_get_server_connection_id_int64.",
387-
event->server_connection_id);
388-
return MONGOC_NO_SERVER_CONNECTION_ID;
389-
}
390-
391-
return (int32_t) event->server_connection_id;
392-
}
393-
394-
395381
int64_t
396382
mongoc_apm_command_started_get_server_connection_id_int64 (const mongoc_apm_command_started_t *event)
397383
{
@@ -474,20 +460,6 @@ mongoc_apm_command_succeeded_get_service_id (const mongoc_apm_command_succeeded_
474460
}
475461

476462

477-
int32_t
478-
mongoc_apm_command_succeeded_get_server_connection_id (const mongoc_apm_command_succeeded_t *event)
479-
{
480-
if (event->server_connection_id > INT32_MAX || event->server_connection_id < INT32_MIN) {
481-
MONGOC_WARNING ("Server connection ID %" PRId64 " is outside of int32 range. Returning -1. Use "
482-
"mongoc_apm_command_succeeded_get_server_connection_id_int64.",
483-
event->server_connection_id);
484-
return MONGOC_NO_SERVER_CONNECTION_ID;
485-
}
486-
487-
return (int32_t) event->server_connection_id;
488-
}
489-
490-
491463
int64_t
492464
mongoc_apm_command_succeeded_get_server_connection_id_int64 (const mongoc_apm_command_succeeded_t *event)
493465
{
@@ -570,20 +542,6 @@ mongoc_apm_command_failed_get_service_id (const mongoc_apm_command_failed_t *eve
570542
}
571543

572544

573-
int32_t
574-
mongoc_apm_command_failed_get_server_connection_id (const mongoc_apm_command_failed_t *event)
575-
{
576-
if (event->server_connection_id > INT32_MAX || event->server_connection_id < INT32_MIN) {
577-
MONGOC_WARNING ("Server connection ID %" PRId64 " is outside of int32 range. Returning -1. Use "
578-
"mongoc_apm_command_failed_get_server_connection_id_int64.",
579-
event->server_connection_id);
580-
return MONGOC_NO_SERVER_CONNECTION_ID;
581-
}
582-
583-
return (int32_t) event->server_connection_id;
584-
}
585-
586-
587545
int64_t
588546
mongoc_apm_command_failed_get_server_connection_id_int64 (const mongoc_apm_command_failed_t *event)
589547
{

src/libmongoc/src/mongoc/mongoc-apm.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ mongoc_apm_command_started_get_server_id (const mongoc_apm_command_started_t *ev
101101
MONGOC_EXPORT (const bson_oid_t *)
102102
mongoc_apm_command_started_get_service_id (const mongoc_apm_command_started_t *event);
103103

104-
BSON_DEPRECATED_FOR (mongoc_apm_command_started_get_server_connection_id_int64)
105-
MONGOC_EXPORT (int32_t) mongoc_apm_command_started_get_server_connection_id (const mongoc_apm_command_started_t *event);
106-
107104
MONGOC_EXPORT (int64_t)
108105
mongoc_apm_command_started_get_server_connection_id_int64 (const mongoc_apm_command_started_t *event);
109106

@@ -140,10 +137,6 @@ mongoc_apm_command_succeeded_get_server_id (const mongoc_apm_command_succeeded_t
140137
MONGOC_EXPORT (const bson_oid_t *)
141138
mongoc_apm_command_succeeded_get_service_id (const mongoc_apm_command_succeeded_t *event);
142139

143-
BSON_DEPRECATED_FOR (mongoc_apm_command_succeeded_get_server_connection_id_int64)
144-
MONGOC_EXPORT (int32_t)
145-
mongoc_apm_command_succeeded_get_server_connection_id (const mongoc_apm_command_succeeded_t *event);
146-
147140
MONGOC_EXPORT (int64_t)
148141
mongoc_apm_command_succeeded_get_server_connection_id_int64 (const mongoc_apm_command_succeeded_t *event);
149142

@@ -184,9 +177,6 @@ mongoc_apm_command_failed_get_server_id (const mongoc_apm_command_failed_t *even
184177
MONGOC_EXPORT (const bson_oid_t *)
185178
mongoc_apm_command_failed_get_service_id (const mongoc_apm_command_failed_t *event);
186179

187-
BSON_DEPRECATED_FOR (mongoc_apm_command_failed_get_server_connection_id_int64)
188-
MONGOC_EXPORT (int32_t) mongoc_apm_command_failed_get_server_connection_id (const mongoc_apm_command_failed_t *event);
189-
190180
MONGOC_EXPORT (int64_t)
191181
mongoc_apm_command_failed_get_server_connection_id_int64 (const mongoc_apm_command_failed_t *event);
192182

0 commit comments

Comments
 (0)