@Override public void deleteByGallery(String resourceGroupName, String galleryName, String galleryImageName) { this.deleteByGalleryAsync(resourceGroupName, galleryName, galleryImageName).await(); } }
@Override public void updateInstances(String... instanceIds) { this.updateInstancesAsync(instanceIds).await(); } }
@Override public void deleteById(String id, String eTagValue) { deleteByIdAsync(id, eTagValue).await(); } }
@Override public void deleteById(String id, String eTagValue) { deleteByIdAsync(id, eTagValue).await(); } }
@Override public void purgeContent(Set<String> contentPaths) { if (contentPaths != null) { this.purgeContentAsync(contentPaths).await(); } }
@Override public void deleteByName(String name) { deleteByNameAsync(name).await(); }
@Override public void powerOff() { this.powerOffAsync().await(); }
@Override public void deallocate() { this.deallocateAsync().await(); }
@Override public void restart() { this.restartAsync().await(); }
@Override public void delete() { deleteAsync().await(); }
@Override public void purgeContent(Set<String> contentPaths) { if (contentPaths != null) { this.purgeContentAsync(contentPaths).await(); } }
@Override public void purgeEndpointContent(String endpointName, Set<String> contentPaths) { this.purgeEndpointContentAsync(endpointName, contentPaths).await(); }
@Override public void updateInstances(String... instanceIds) { this.updateInstancesAsync(instanceIds).await(); } }
@Override public void deleteByGallery(String resourceGroupName, String galleryName, String galleryImageName) { this.deleteByGalleryAsync(resourceGroupName, galleryName, galleryImageName).await(); } }
@Override public final void deleteByResourceGroup(String groupName, String name) { deleteByResourceGroupAsync(groupName, name).await(); }
@Override public void moveResources(String sourceResourceGroupName, ResourceGroup targetResourceGroup, List<String> resources) { this.moveResourcesAsync(sourceResourceGroupName, targetResourceGroup, resources).await(); }
/** * Intended to be used at the startup of the MetricsServiceImpl to ensure we have enough tables for processing */ public void verifyAndCreateTempTables() { ZonedDateTime currentBlock = ZonedDateTime.ofInstant(Instant.ofEpochMilli(DateTimeService.now.get().getMillis()), UTC) .with(DateTimeService.startOfPreviousEvenHour()); ZonedDateTime lastStartupBlock = currentBlock.plus(6, ChronoUnit.HOURS); verifyAndCreateTempTables(currentBlock, lastStartupBlock).await(); }
/** * Intended to be used at the startup of the MetricsServiceImpl to ensure we have enough tables for processing */ public void verifyAndCreateTempTables() { ZonedDateTime currentBlock = ZonedDateTime.ofInstant(Instant.ofEpochMilli(DateTimeService.now.get().getMillis()), UTC) .with(DateTimeService.startOfPreviousEvenHour()); ZonedDateTime lastStartupBlock = currentBlock.plus(6, ChronoUnit.HOURS); verifyAndCreateTempTables(currentBlock, lastStartupBlock).await(); }
public void truncateTables(String keyspace) { //TODO: The filtering below for static data tables is prone to error. Find a better way to avoid //truncating those tables. session.execute("select table_name from system_schema.tables where keyspace_name = '" + keyspace + "'") .flatMap(Observable::from) .filter(row -> !row.getString(0).equals("cassalog") && !row.getString(0).equals("sys_config")) .flatMap(row -> session.execute("truncate " + row.getString(0))) .toCompletable() .await(10, TimeUnit.SECONDS); }
private void unscheduleDeleteExpiredMetrics() { String jobName = "DELETE_EXPIRED_METRICS"; String configId = "org.hawkular.metrics.jobs.DELETE_EXPIRED_METRICS"; // We load the configuration first so that delete is done only if it exists in order to avoid generating // tombstones. Completable deleteConfig = configurationService.load(configId) .map(config -> configurationService.delete(configId)) .toCompletable(); // unscheduleJobByTypeAndName will not generate unnecessary tombstones as it does reads before writes Completable unscheduleJob = scheduler.unscheduleJobByTypeAndName(jobName, jobName); Completable.merge(deleteConfig, unscheduleJob).await(); }