public static long computeSegmentId ( int segmentNumber , int epoch ) { Preconditions . checkArgument ( segmentNumber >= 0 ) ; Preconditions . checkArgument ( epoch >= 0 ) ; return ( long ) epoch << 32 | ( segmentNumber & 0xFFFFFFFF L ) ; }
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 .