|Modifier and Type||Field and Description|
The SQL to find all clusters in a TERMINATED state that aren't attached to any jobs still in the database.
|Modifier and Type||Method and Description|
Delete all clusters whose ids are contained in the given set of ids.
Find the ids of all clusters that are in a terminated state and aren't attached to any jobs.
existsByUniqueId, findByUniqueId, findByUniqueId
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush
count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
count, exists, findAll, findOne
count, findAll, findAll, findAll, findOne
static final java.lang.String FIND_TERMINATED_CLUSTERS_SQL
@Query(value="SELECT id FROM clusters WHERE id NOT IN (SELECT DISTINCT(cluster_id) FROM jobs WHERE cluster_id IS NOT NULL) AND status = \'TERMINATED\' FOR UPDATE;", nativeQuery=true) java.util.Set<java.lang.Number> findTerminatedUnusedClusters()
@Modifying java.lang.Long deleteByIdIn(java.util.Set<java.lang.Long> ids)
ids- The ids of the clusters to delete