[SERVER-26449] ExportedServerParameter with lambdas for get/set Created: 04/Oct/16  Updated: 06/Dec/17  Resolved: 28/Jun/17

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.5.10

Type: Improvement Priority: Major - P3
Reporter: Mira Carey Assignee: Sara Golemon
Resolution: Done Votes: 0
Labels: neweng, platforms-interns-2017
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-29750 Introduce get() method to ServerParam... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2017-07-10
Participants:

 Description   

ExportedServerParameter provides a valuable tool for reducing copy/paste code for general c++ variables, but is a little limited in scope.

Providing a version which took lambdas for get and set would allow for substantially more coverage and further reduce the number of unique ServerParameter inheritors.



 Comments   
Comment by Sara Golemon [ 28/Jun/17 ]

Changes implementation of ExportedServerParameter, but attempts to keep full BC with prior functionality.

Comment by Githook User [ 28/Jun/17 ]

Author:

{u'username': u'sgolemon', u'name': u'Sara Golemon', u'email': u'sara.golemon@mongodb.com'}

Message: SERVER-26449 BoundServerParameter

Implement BoundServerParameter class which accepts
getter/setter callbacks to be invoked on append()/setFromString().

Moved ExportedServerParameter to be a child of BoundServerParameter.
This noticably simplifies the implementation.

Implement LockedServerParameter class as child of
BoundServerParameter which provides storage and unique_lock<mutex>
guarded accessors.
Branch: master
https://github.com/mongodb/mongo/commit/c7d54af3418b8dfaa498a3a94edf8fab4adff965

Comment by Andy Schwerin [ 04/Oct/16 ]

Good idea. One challenge with ExportedServerParamter is that it provides pretty much no concurrency control. I think the model might be busted, because you hand a pointer to, say, a raw integer to ESP, and if it's runtime-settable, you don't specify how sets of the integer get synchronized.

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