private void deleteOwnedRefreshes(Materialization materialization, SchemaConfig schemaConfig) { Iterable<Refresh> refreshes = materializationStore.getRefreshesExclusivelyOwnedBy(materialization); if (Iterables.isEmpty(refreshes)) { logger.debug("deleted materialization {} has no associated refresh"); return; } for (Refresh r : refreshes) { try { //TODO once DX-10850 is fixed we should no longer need to split the refresh path into separate components final List<String> tableSchemaPath = ImmutableList.<String>builder() .add(ReflectionServiceImpl.ACCELERATOR_STORAGEPLUGIN_NAME) .addAll(PathUtils.toPathComponents(r.getPath())) .build(); logger.debug("deleting refresh {}", tableSchemaPath); super.dropTable(tableSchemaPath, schemaConfig); } catch (Exception e) { logger.warn("Couldn't delete refresh {}", r.getId().getId(), e); } finally { materializationStore.delete(r.getId()); } } }