@Test public void typicalCreatePartitionScheduleForHousekeeping() { HousekeepingMetadata metadata = createHousekeepingMetadataPartition(); HousekeepingMetadata tableMetadata = createHousekeepingMetadataTable(); when(housekeepingMetadataRepository.findRecordForCleanupByDbTableAndPartitionName(DATABASE_NAME, TABLE_NAME, PARTITION_NAME)).thenReturn(Optional.empty()); when(housekeepingMetadataRepository.findRecordForCleanupByDbTableAndPartitionName(DATABASE_NAME, TABLE_NAME, null)).thenReturn(Optional.of(tableMetadata)); expiredHousekeepingMetadataSchedulerService.scheduleForHousekeeping(metadata); verify(housekeepingMetadataRepository).save(metadata); }
@Override @TimedTaggable("metadata-scheduled") public void scheduleForHousekeeping(HousekeepingEntity housekeepingEntity) { HousekeepingMetadata housekeepingMetadata = createOrUpdateHousekeepingMetadata( (HousekeepingMetadata) housekeepingEntity); try { housekeepingMetadataRepository.save(housekeepingMetadata); log.info(format("Successfully scheduled %s", housekeepingMetadata)); } catch (Exception e) { throw new BeekeeperException(format("Unable to schedule %s", housekeepingMetadata), e); } }
ExpiredHousekeepingMetadataSchedulerService implements SchedulerService { @Override @TimedTaggable("metadata-scheduled") public void scheduleForHousekeeping(HousekeepingEntity housekeepingEntity) { HousekeepingMetadata housekeepingMetadata = createOrUpdateHousekeepingMetadata( (HousekeepingMetadata) housekeepingEntity); try { housekeepingMetadataRepository.save(housekeepingMetadata); log.info(format("Successfully scheduled %s", housekeepingMetadata)); } catch (Exception e) { throw new BeekeeperException(format("Unable to schedule %s", housekeepingMetadata), e); } } }
ExpiredHousekeepingMetadataSchedulerService implements SchedulerService { @Override @TimedTaggable("metadata-scheduled") public void scheduleForHousekeeping(HousekeepingEntity housekeepingEntity) { HousekeepingMetadata housekeepingMetadata = createOrUpdateHousekeepingMetadata( (HousekeepingMetadata) housekeepingEntity); try { housekeepingMetadataRepository.save(housekeepingMetadata); log.info(format("Successfully scheduled %s", housekeepingMetadata)); } catch (Exception e) { throw new BeekeeperException(format("Unable to schedule %s", housekeepingMetadata), e); } } @Autowired  ExpiredHousekeepingMetadataSchedulerService(HousekeepingMetadataRepository housekeepingMetadataRepository); }
ExpiredHousekeepingMetadataSchedulerService implements SchedulerService { @Override @TimedTaggable("metadata-scheduled") public void scheduleForHousekeeping(HousekeepingEntity housekeepingEntity) { HousekeepingMetadata housekeepingMetadata = createOrUpdateHousekeepingMetadata( (HousekeepingMetadata) housekeepingEntity); try { housekeepingMetadataRepository.save(housekeepingMetadata); log.info(format("Successfully scheduled %s", housekeepingMetadata)); } catch (Exception e) { throw new BeekeeperException(format("Unable to schedule %s", housekeepingMetadata), e); } } @Autowired  ExpiredHousekeepingMetadataSchedulerService(HousekeepingMetadataRepository housekeepingMetadataRepository); @Override LifecycleEventType getLifecycleEventType(); @Override @TimedTaggable("metadata-scheduled") void scheduleForHousekeeping(HousekeepingEntity housekeepingEntity); }
ExpiredHousekeepingMetadataSchedulerService implements SchedulerService { @Override @TimedTaggable("metadata-scheduled") public void scheduleForHousekeeping(HousekeepingEntity housekeepingEntity) { HousekeepingMetadata housekeepingMetadata = createOrUpdateHousekeepingMetadata( (HousekeepingMetadata) housekeepingEntity); try { housekeepingMetadataRepository.save(housekeepingMetadata); log.info(format("Successfully scheduled %s", housekeepingMetadata)); } catch (Exception e) { throw new BeekeeperException(format("Unable to schedule %s", housekeepingMetadata), e); } } @Autowired  ExpiredHousekeepingMetadataSchedulerService(HousekeepingMetadataRepository housekeepingMetadataRepository); @Override LifecycleEventType getLifecycleEventType(); @Override @TimedTaggable("metadata-scheduled") void scheduleForHousekeeping(HousekeepingEntity housekeepingEntity);  }