[CDRIVER-2502] Rewrite mongoc_cursor_t Created: 13/Feb/18  Updated: 28/Oct/23  Resolved: 19/Apr/18

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.10.0

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-2510 Drop MongoDB 2.6 Closed
depends on CDRIVER-2572 Only enable counters for shared memory Closed
Epic Link: Post-3.6 cleanup

 Description   

The C Driver has a base cursor implementation, mongoc_cursor_t, and four "subclasses". As the wire protocol has evolved, the cursor logic has become a mess. Recent updates to the cursor code were unreasonably costly, and planned future work on cursors is extremely risky. Rewrite the cursor classes to clean up debt and prepare us for future work.



 Comments   
Comment by Githook User [ 18/Apr/18 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'name': 'Kevin Albertson', 'username': 'kevinAlbs'}

Message: CDRIVER-2502 rewrite mongoc_cursor_t

  • organize different cursor impls:
    + find cursor, which changes into a find-opquery or find-cmd cursor
    + command cursor for agg + listCollections + listIndexes
    + deprecated command cursor for deprecated command methods
  • make mongoc-cursor-legacy.c for cursor functions relating to
    OP_QUERY find, OP_REPLY streaming and OP_GETMORE
  • remove unused fields from cursor_t, remove implementation specific
    fields, remove is_find
  • cursor state is now tracked in one enum value as a state machine
  • translating flags into options is now a separate function that
    the caller must call before creating a new cursor
    Branch: master
    https://github.com/mongodb/mongo-c-driver/commit/28c3a5ad0f05b1a63c2023c3d59735aa015e945f
Generated at Wed Feb 07 21:15:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.