diff --git a/server/src/main/java/com/hedera/block/server/mediator/LiveStreamMediatorImpl.java b/server/src/main/java/com/hedera/block/server/mediator/LiveStreamMediatorImpl.java index 9eedbdcd5..057968037 100644 --- a/server/src/main/java/com/hedera/block/server/mediator/LiveStreamMediatorImpl.java +++ b/server/src/main/java/com/hedera/block/server/mediator/LiveStreamMediatorImpl.java @@ -64,8 +64,6 @@ public void subscribe(final LiveStreamObserver liveStreamObserver) { if (subscribers.remove(liveStreamObserver)) { LOGGER.log(System.Logger.Level.DEBUG, "Successfully removed observer from subscription list"); - } else { - LOGGER.log(System.Logger.Level.ERROR, "Failed to remove observer from subscription list"); } } @@ -80,15 +78,6 @@ public boolean isSubscribed(final LiveStreamObserver { */ boolean isSubscribed(final LiveStreamObserver observer); - /** - * Unsubscribes all LiveStreamObservers from the producer - */ - void unsubscribeAll(); - /** * Passes the newly arrived block to all subscribers * diff --git a/server/src/main/java/com/hedera/block/server/producer/ProducerBlockStreamObserver.java b/server/src/main/java/com/hedera/block/server/producer/ProducerBlockStreamObserver.java index 9d07645eb..5691cc24e 100644 --- a/server/src/main/java/com/hedera/block/server/producer/ProducerBlockStreamObserver.java +++ b/server/src/main/java/com/hedera/block/server/producer/ProducerBlockStreamObserver.java @@ -55,8 +55,11 @@ public ProducerBlockStreamObserver(final StreamMediator blockCache; - @Test - public void testUnsubscribeAll() { - - final StreamMediator streamMediator = - new LiveStreamMediatorImpl(new WriteThroughCacheHandler(blockStorage, blockCache)); - - // Set up the subscribers - streamMediator.subscribe(liveStreamObserver1); - streamMediator.subscribe(liveStreamObserver2); - streamMediator.subscribe(liveStreamObserver3); - - assertTrue(streamMediator.isSubscribed(liveStreamObserver1), "Expected the mediator to have liveStreamObserver1 subscribed"); - assertTrue(streamMediator.isSubscribed(liveStreamObserver2), "Expected the mediator to have liveStreamObserver2 subscribed"); - assertTrue(streamMediator.isSubscribed(liveStreamObserver3), "Expected the mediator to have liveStreamObserver3 subscribed"); - - streamMediator.unsubscribeAll(); - - assertFalse(streamMediator.isSubscribed(liveStreamObserver1), "Expected the mediator to have unsubscribed liveStreamObserver1"); - assertFalse(streamMediator.isSubscribed(liveStreamObserver2), "Expected the mediator to have unsubscribed liveStreamObserver2"); - assertFalse(streamMediator.isSubscribed(liveStreamObserver3), "Expected the mediator to have unsubscribed liveStreamObserver3"); - } - @Test public void testUnsubscribeEach() {