private TableName snapshotExists ( String snapshotName , List < SnapshotDescription > snapshotDescriptions ) { if ( snapshotDescriptions != null ) { Optional < SnapshotDescription > descriptor = snapshotDescriptions . stream ( ) . filter ( desc -> desc . getName ( ) . equals ( snapshotName ) ) . findFirst ( ) ; return descriptor . isPresent ( ) ? descriptor . get ( ) . getTableName ( ) : null ; } return null ; }
To check Snapshot exists or not .