diff --git a/hermes-common/src/main/java/pl/allegro/tech/hermes/infrastructure/zookeeper/ZookeeperBasedRepository.java b/hermes-common/src/main/java/pl/allegro/tech/hermes/infrastructure/zookeeper/ZookeeperBasedRepository.java index 2578467bfe..241fcb0260 100644 --- a/hermes-common/src/main/java/pl/allegro/tech/hermes/infrastructure/zookeeper/ZookeeperBasedRepository.java +++ b/hermes-common/src/main/java/pl/allegro/tech/hermes/infrastructure/zookeeper/ZookeeperBasedRepository.java @@ -196,11 +196,6 @@ protected void touch(String path) throws Exception { zookeeper.setData().forPath(path, oldData); } - protected void removeIfExists(String path) throws Exception { - ensureConnected(); - zookeeper.delete().quietly().guaranteed().deletingChildrenIfNeeded().forPath(path); - } - protected void remove(String path) throws Exception { ensureConnected(); zookeeper.delete().guaranteed().deletingChildrenIfNeeded().forPath(path); diff --git a/hermes-common/src/main/java/pl/allegro/tech/hermes/infrastructure/zookeeper/ZookeeperTopicRepository.java b/hermes-common/src/main/java/pl/allegro/tech/hermes/infrastructure/zookeeper/ZookeeperTopicRepository.java index b04122f1ff..51cd7bc4eb 100644 --- a/hermes-common/src/main/java/pl/allegro/tech/hermes/infrastructure/zookeeper/ZookeeperTopicRepository.java +++ b/hermes-common/src/main/java/pl/allegro/tech/hermes/infrastructure/zookeeper/ZookeeperTopicRepository.java @@ -124,12 +124,11 @@ public void removeTopic(TopicName topicName) { try { deleteInTransaction(pathsForRemoval); - } catch (Exception ex) { - throw new InternalProcessingException(ex); + } catch (Exception e) { + throw new InternalProcessingException(e); } } - @Override public void updateTopic(Topic topic) { ensureTopicExists(topic.getName()); @@ -147,7 +146,6 @@ public void touchTopic(TopicName topicName) { ensureTopicExists(topicName); logger.info("Touching topic: " + topicName.qualifiedName()); - removeTopicChildren(topicName); try { touch(paths.topicPath(topicName)); } catch (Exception ex) { @@ -155,20 +153,6 @@ public void touchTopic(TopicName topicName) { } } - private void removeTopicChildren(TopicName topicName) { - try { - removeIfExists(paths.topicPreviewPath(topicName)); - } catch (Exception e) { - throw new InternalProcessingException(e); - } - - try { - removeIfExists(paths.topicMetricsPath(topicName)); - } catch (Exception e) { - throw new InternalProcessingException(e); - } - } - @Override public Topic getTopicDetails(TopicName topicName) { return getTopicDetails(topicName, false).get();