void preProcessAsSourceSegment ( MergeSegmentOperation operation ) throws StreamSegmentNotSealedException , StreamSegmentMergedException , StreamSegmentTruncatedException { Exceptions . checkArgument ( this . id == operation . getSourceSegmentId ( ) , "operation" , "Invalid Operation Source Segment Id." ) ; if ( this . merged ) { throw new StreamSegmentMergedException ( this . name ) ; } if ( ! this . sealed ) { throw new StreamSegmentNotSealedException ( this . name ) ; } if ( this . startOffset > 0 ) { throw new StreamSegmentTruncatedException ( this . name , "Segment cannot be merged because it is truncated." , null ) ; } if ( ! this . recoveryMode ) { operation . setLength ( this . length ) ; } }
Pre - processes the given operation as a Source Segment .