public static RetentionSet removeStreamCutBefore ( RetentionSet set , StreamCutReferenceRecord record ) { Preconditions . checkNotNull ( record ) ; // remove all stream cuts with recordingTime before supplied cut int beforeIndex = getGreatestLowerBound ( set , record . getRecordingTime ( ) , StreamCutReferenceRecord :: getRecordingTime ) ; if ( beforeIndex < 0 ) { return set ; } if ( beforeIndex + 1 == set . retentionRecords . size ( ) ) { return new RetentionSet ( ImmutableList . of ( ) ) ; } return new RetentionSet ( set . retentionRecords . subList ( beforeIndex + 1 , set . retentionRecords . size ( ) ) ) ; }
Creates a new retention set object by removing all records on or before given record .