[SERVER-30401] Simplify UpdateLeafNode::apply interface Created: 28/Jul/17  Updated: 30/Oct/23  Resolved: 18/Aug/17

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 3.5.12

Type: Improvement Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2017-08-21, Query 2017-09-11
Participants:

 Description   

There are too many things one has to remember when implementing a new UpdateLeafNode. Consider simplifying the interface by making UpdateLeafNode::apply a nonvirtual method, which calls several virtual methods, to be implemented by the leaves. For example, we can separate the actual update, logging, checking for affected indexes, validation for storage, and checking immutable paths.



 Comments   
Comment by Githook User [ 18/Aug/17 ]

Author:

{'username': 'jseyster', 'email': 'justin.seyster@mongodb.com', 'name': 'Justin Seyster'}

Message: SERVER-30401 Simplify UpdateLeafNode::apply interface

We need some simplifiction here because UpdateLeafNode::apply is
responsible for so many things (a list of which is in
modifier_node.h). This change puts most of those things into one
function, so that the various modifier implementations can write a few
small overrides to customize their functionality, rather than
reimplementing all of apply() in each case.

This approach extends the PathCreatingNode approach we took previously
for all the modifiers. The one exception is RenameNode, which we
implement by composing SetNode and UnsetNode.
Branch: master
https://github.com/mongodb/mongo/commit/aef10829fc71cb41c54df5838e9e7e74d41d122b

Generated at Thu Feb 08 04:23:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.