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

Implement LogicalTime

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.3
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Sharding 2017-02-13

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              misha.tyulenev Misha Tyulenev
              Reporter:
              misha.tyulenev Misha Tyulenev
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: