code: public static long computeSegmentId(int segmentNumber, int epoch) {
          Preconditions.checkArgument(segmentNumber >= 0);
          Preconditions.checkArgument(epoch >= 0);
          return (long) epoch << 32 | (segmentNumber & 0xFFFFFFFFL);
      }
docs: Method to compute 64 bit segment id which takes segment number and epoch and composes it as
  `msb = epoch` `lsb = segmentNumber`.
  Primary id identifies the segment container mapping and primary + secondary uniquely identifies a segment
  within a stream.
  
  @param segmentNumber segment number.
  @param epoch epoch in which segment was created.
  @return segment id which is composed using segment number and epoch.