Package org.qubership.atp.dataset.db.jpa
Class JaversSnapshotService
java.lang.Object
org.qubership.atp.dataset.db.jpa.JaversSnapshotService
-
Constructor Summary
ConstructorsConstructorDescriptionJaversSnapshotService(JpaJvSnapshotRepository snapshotRepository, JpaJvGlobalIdRepository globalIdRepository, JpaJvCommitRepository commitRepository, JpaJvCommitPropertyRepository commitPropertyRepository) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteOldAndUpdateAsInitial(Long globalId, List<JvSnapshotEntity> snapshots) Delete old snapshots, commit properties and commits.voidDelete terminated snapshots, globalIds, commits and commit properties.findGlobalIdAndCount(Long lastRevisionCount) Get globalId and number of old objects.findOldSnapshots(Long globalId, Long count) Get old snapshots by globalId and count.Get the oldest snapshot and update snapshot type with INITIAL value.
-
Constructor Details
-
JaversSnapshotService
@Autowired public JaversSnapshotService(JpaJvSnapshotRepository snapshotRepository, JpaJvGlobalIdRepository globalIdRepository, JpaJvCommitRepository commitRepository, JpaJvCommitPropertyRepository commitPropertyRepository) Constructor.- Parameters:
snapshotRepository- snapshotRepositoryglobalIdRepository- globalIdRepositorycommitRepository- commitRepositorycommitPropertyRepository- commitPropertyRepository
-
-
Method Details
-
findGlobalIdAndCount
Get globalId and number of old objects.- Parameters:
lastRevisionCount- number of the last revisions.- Returns:
ListofJaversCountResponse
-
findOldSnapshots
Get old snapshots by globalId and count.- Parameters:
globalId- globalIdcount- count- Returns:
ListofJvSnapshotEntity
-
findTheOldestSnapshotByGlobalIdAndUpdateTypeAsInitial
Get the oldest snapshot and update snapshot type with INITIAL value.- Parameters:
globalId- globalId- Returns:
JvSnapshotEntityentity;
-
deleteOldAndUpdateAsInitial
@Transactional(rollbackFor=java.lang.Exception.class) public void deleteOldAndUpdateAsInitial(Long globalId, List<JvSnapshotEntity> snapshots) Delete old snapshots, commit properties and commits. And update the oldest snapshot as initial.- Parameters:
globalId- globalIdsnapshots- old snapshots
-
deleteTerminatedSnapshots
Delete terminated snapshots, globalIds, commits and commit properties.
-