public void setRetention ( long duration , TimeUnit timeUnit ) { this . _duration = Math . max ( 1 , duration ) ; this . _timeUnit = timeUnit ; long millis = TimeUnit . MILLISECONDS == timeUnit ? _duration : TimeUnit . MILLISECONDS . convert ( _duration , timeUnit ) ; _timeMillis = Math . max ( millis , MIN_DURATION_MILLIS ) ; }
Sets the retention duration period of this policy .