From 39658901bd9e2e1834ada93ac3e2317ad35dbb43 Mon Sep 17 00:00:00 2001 From: Alexander Polovtcev Date: Mon, 17 Jan 2022 19:32:43 +0300 Subject: [PATCH] Remove ClusterImpl#isShutdown method (#373) --- .../src/main/java/io/scalecube/cluster/Cluster.java | 7 ------- .../src/main/java/io/scalecube/cluster/ClusterImpl.java | 5 ----- .../src/test/java/io/scalecube/cluster/ClusterTest.java | 1 - 3 files changed, 13 deletions(-) diff --git a/cluster-api/src/main/java/io/scalecube/cluster/Cluster.java b/cluster-api/src/main/java/io/scalecube/cluster/Cluster.java index 9f891167..b0f15582 100644 --- a/cluster-api/src/main/java/io/scalecube/cluster/Cluster.java +++ b/cluster-api/src/main/java/io/scalecube/cluster/Cluster.java @@ -141,11 +141,4 @@ public interface Cluster { * @return promise which is completed once graceful shutdown is finished. */ Mono onShutdown(); - - /** - * Check if cluster instance has been shut down. - * - * @return returns true if cluster instance has been shut down; false otherwise. - */ - boolean isShutdown(); } diff --git a/cluster/src/main/java/io/scalecube/cluster/ClusterImpl.java b/cluster/src/main/java/io/scalecube/cluster/ClusterImpl.java index 4d17315e..6e65a42e 100644 --- a/cluster/src/main/java/io/scalecube/cluster/ClusterImpl.java +++ b/cluster/src/main/java/io/scalecube/cluster/ClusterImpl.java @@ -558,11 +558,6 @@ public Mono onShutdown() { return onShutdown.asMono(); } - @Override - public boolean isShutdown() { - return onShutdown.asMono().toFuture().isDone(); - } - private static class SenderAwareTransport implements Transport { private final Transport transport; diff --git a/cluster/src/test/java/io/scalecube/cluster/ClusterTest.java b/cluster/src/test/java/io/scalecube/cluster/ClusterTest.java index 1bffe359..21c3969e 100644 --- a/cluster/src/test/java/io/scalecube/cluster/ClusterTest.java +++ b/cluster/src/test/java/io/scalecube/cluster/ClusterTest.java @@ -471,7 +471,6 @@ public void onMembershipEvent(MembershipEvent event) { node2.shutdown(); node2.onShutdown().block(TIMEOUT); - assertTrue(node2.isShutdown()); assertTrue(leavingLatch.await(TIMEOUT.getSeconds(), TimeUnit.SECONDS)); assertTrue(removedLatch.await(TIMEOUT.getSeconds(), TimeUnit.SECONDS));