@ Override public void cleanSnapshots ( ) { File [ ] files = getFilesByType ( HollowProducer . Blob . Type . SNAPSHOT . prefix ) ; if ( files == null || files . length <= numOfSnapshotsToKeep ) { return ; } sortByLastModified ( files ) ; for ( int i = numOfSnapshotsToKeep ; i < files . length ; i ++ ) { File file = files [ i ] ; boolean deleted = file . delete ( ) ; if ( ! deleted ) { log . warning ( "Could not delete snapshot " + file . getPath ( ) ) ; } } }
Cleans snapshot to keep the last n snapshots . Defaults to 5 .