[SERVER-66543] Remove unused vector_clock_trivial.cpp file Created: 18/May/22  Updated: 09/Jun/22  Resolved: 02/Jun/22

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

Type: Task Priority: Major - P3
Reporter: Sergi Mateo Bellido Assignee: Enrico Golfieri
Resolution: Won't Fix Votes: 0
Labels: neweng, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Sharding EMEA 2022-06-13
Participants:

 Description   

It looks like vector_clock_trivial.cpp is not used anymore.



 Comments   
Comment by Enrico Golfieri [ 02/Jun/22 ]

vector_clock_trivial.cpp is not unused. 

Every VectorClock register an instance at static time into a Decoration (which contains a static registry).

The Decoration is held by the parent class VectorClock which registers any VectorClock type as a VectorClock*. 

 

Since static objects are instantiated before calling the main, by just including a specific vector clock as a dependency target will trigger a registration of that vector clock inside the decoration, and then be accessed as a VectorClock* 

 

VectorClockTrivial performs the registration here

 

A vector_clock_trivial target is defined here and several test targets include this target as a dependency like here

 

Therefore, a VectorClock* pointing to a instance of VectorClockTrivial is expected for every test that include that dependency once 

VectorClock* vc = VectorClock::get(…) 

Is called.

Generated at Thu Feb 08 06:05:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.