question: private void handlePersistence ( DbClient dbClient , boolean flush ) { if ( null != unManagedCGsInsert ) { if ( flush || ( unManagedCGsInsert . size ( ) > BATCH_SIZE ) ) { partitionManager . insertInBatches ( unManagedCGsInsert , BATCH_SIZE , dbClient , UNMANAGED_PROTECTION_SET ) ; unManagedCGsInsert . clear ( ) ; } } if ( null != unManagedCGsUpdate ) { if ( flush || ( unManagedCGsUpdate . size ( ) > BATCH_SIZE ) ) { partitionManager . updateAndReIndexInBatches ( unManagedCGsUpdate , BATCH_SIZE , dbClient , UNMANAGED_PROTECTION_SET ) ; unManagedCGsUpdate . clear ( ) ; } } if ( null != unManagedVolumesToUpdateByWwn ) { if ( flush || ( unManagedVolumesToUpdateByWwn . size ( ) > BATCH_SIZE ) ) { partitionManager . updateAndReIndexInBatches ( new ArrayList < UnManagedVolume > ( unManagedVolumesToUpdateByWwn . values ( ) ) , BATCH_SIZE , dbClient , UNMANAGED_VOLUME ) ; unManagedVolumesToUpdateByWwn . clear ( ) ; } } if ( null != unManagedVolumesToDelete ) { if ( flush || ( unManagedVolumesToDelete . size ( ) > BATCH_SIZE ) ) { dbClient . markForDeletion ( unManagedVolumesToDelete ) ; unManagedVolumesToDelete . clear ( ) ; } } }
target:  Handle updating the database with UnManagedProtectionSets, and also clearing out any orphaned ingested UnManagedVolumes. Unless the flush argument is true, only when the set to be persisted reaches the value of BATCH_SIZE will the database be updated.