Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27743

Implement LogicalTime

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.3
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding 2017-02-13

      The LogicalTime class contains the time and defines the operations allowed with this time.

      class LogicalTime {
        public:
            LogicalTime();
            LogicalTime(Timestamp);
            
            LogicalTime(const LogicalTime&) = default;
            LogicalTime(LogicalTime&&) = default;
        
            LogicalTime& operator=(const LogicalTime&) = default;
            LogicalTime& operator=(LogicalTime&&) = default;
      
            Timestamp asTimestamp() const;
       
            // increments the clock
            void addTicks(unsigned ticks); 
            std::string toString() const;
      
        private:
           uint64_t _time{0};
        };
      

      Add unit tests to validate the API

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: