Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3506

correct the SessionTrackerImpl#initializeNextSession's javaDoc about how to generate the sessionId

    XMLWordPrintableJSON

    Details

      Description

       

      /**
       * Generates an initial sessionId. High order byte is serverId, next 5
       * 5 bytes are from timestamp, and low order 2 bytes are 0s.
       */
      public static long initializeNextSession(long id) {
          long nextSid;
          nextSid = (Time.currentElapsedTime() << 24) >>> 8;
          nextSid =  nextSid | (id <<56);
          if (nextSid == EphemeralType.CONTAINER_EPHEMERAL_OWNER) {
              ++nextSid;  // this is an unlikely edge case, but check it just in case
          }
          return nextSid;
      }
      

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                maoling maoling
                Reporter:
                maoling maoling
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m