From 00cfb3254185d1e0104d4e593d04971fabe3c521 Mon Sep 17 00:00:00 2001 From: fjy Date: Sun, 26 May 2013 13:41:53 -0600 Subject: [PATCH] also remove curator listeners on cleanup --- .../java/com/metamx/druid/client/ServerInventoryView.java | 4 ++-- .../druid/curator/inventory/CuratorInventoryManager.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/main/java/com/metamx/druid/client/ServerInventoryView.java b/client/src/main/java/com/metamx/druid/client/ServerInventoryView.java index 81ad886c36c..dc1156fe966 100644 --- a/client/src/main/java/com/metamx/druid/client/ServerInventoryView.java +++ b/client/src/main/java/com/metamx/druid/client/ServerInventoryView.java @@ -153,7 +153,7 @@ public class ServerInventoryView implements ServerView, InventoryView if (segment != null) { log.warn( - "Not running callbacks for existing segment[%s] on server[%s]", + "Not adding or running callbacks for existing segment[%s] on server[%s]", inventoryKey, container.getName() ); @@ -185,7 +185,7 @@ public class ServerInventoryView implements ServerView, InventoryView if (segment == null) { log.warn( - "Not running callbacks or cleanup for non-existing segment[%s] on server[%s]", + "Not running cleanup or callbacks for non-existing segment[%s] on server[%s]", inventoryKey, container.getName() ); diff --git a/client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManager.java b/client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManager.java index 81dc4feb119..ab1e31bbc49 100644 --- a/client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManager.java +++ b/client/src/main/java/com/metamx/druid/curator/inventory/CuratorInventoryManager.java @@ -216,7 +216,7 @@ public class CuratorInventoryManager containers.put(containerKey, new ContainerHolder(container, inventoryCache)); - log.info("Starting inventory cache for %s, inventoryPath %s", container, inventoryPath); + log.info("Starting inventory cache for %s, inventoryPath %s", containerKey, inventoryPath); inventoryCache.start(); strategy.newContainer(container); } @@ -233,8 +233,8 @@ public class CuratorInventoryManager // This close() call actually calls shutdownNow() on the executor registered with the Cache object, it // better have its own executor or ignore shutdownNow() calls... - log.info("Closing inventory cache for %s", containerKey); - removed.getCache().clear(); + log.info("Closing inventory cache for %s. Also removing listeners.", containerKey); + removed.getCache().getListenable().clear(); removed.getCache().close(); strategy.deadContainer(removed.getContainer());