question: public static BlockSnapshotDeleteCompleter createCompleter ( DbClient dbClient , BlockSnapshot snapshot , String task ) { BlockSnapshotDeleteCompleter completer = new BlockSnapshotDeleteCompleter ( snapshot , task ) ; if ( snapshot . getConsistencyGroup ( ) != null ) { List < URI > snapIds = new ArrayList < URI > ( ) ; List < BlockSnapshot > snaps = ControllerUtils . getSnapshotsPartOfReplicationGroup ( snapshot , dbClient ) ; for ( BlockSnapshot snap : snaps ) { snapIds . add ( snap . getId ( ) ) ; } completer . addIds ( snapIds ) ; } return completer ; }
target:  This method is for creating the BlockSnapshotDeleteCompleter. This a bit unique from the other completers because of the way that we need to complete the task. For the case of CG snapshots, there will be multiple BlockSnapshots associated, even though the request to delete the snapshot was against only one of the CG snaps. Here we will make sure that the task completer has references to all the CG snaps, so that they can be referred to in the completer. Main reason is that if a BlockSnapshot is marked inactive, it can no longer be retrieved using AltIndex queries.