public interface JpaClusterRepository extends JpaBaseRepository<ClusterEntity>, CriteriaResolutionRepository
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FIND_TERMINATED_CLUSTERS_SQL
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 |
|---|---|
java.lang.Long |
deleteByIdIn(java.util.Set<java.lang.Long> ids)
Delete all clusters whose ids are contained in the given set of ids.
|
java.util.Set<java.lang.Number> |
findTerminatedUnusedClusters()
Find the ids of all clusters that are in a terminated state and aren't attached to any jobs.
|
existsByUniqueId, findByUniqueId, findByUniqueIddeleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlushfindAllcount, delete, deleteAll, deleteAll, deleteById, existsById, findById, savecount, exists, findAll, findOnecount, findAll, findAll, findAll, findOneresolveClustersAndCommandsstatic 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