@Test public void testWithdraw() throws Throwable { leaderElectorWithdrawTests(3); }
@Override public CompletableFuture<Void> withdraw(String topic) { return client.submit(new Withdraw(topic)).whenComplete((r, e) -> cache.invalidate(topic)); }
AtomixLeaderElector extends AbstractResource<AtomixLeaderElector> implements AsyncLeaderElector { @Override public CompletableFuture<Void> withdraw(String topic) { return client.submit(new Withdraw(topic)).whenComplete((r, e) -> cache.invalidate(topic)); } }
AtomixLeaderElector extends AbstractResource<AtomixLeaderElector> implements AsyncLeaderElector { @Override public CompletableFuture<Void> withdraw(String topic) { return client.submit(new Withdraw(topic)).whenComplete((r, e) -> cache.invalidate(topic)); } AtomixLeaderElector(CopycatClient client, Properties properties); }
AtomixLeaderElector extends AbstractResource<AtomixLeaderElector> implements AsyncLeaderElector { @Override public CompletableFuture<Void> withdraw(String topic) { return client.submit(new Withdraw(topic)).whenComplete((r, e) -> cache.invalidate(topic)); } AtomixLeaderElector(CopycatClient client, Properties properties); @Override CompletableFuture<Void> destroy(); @Override String name(); @Override CompletableFuture<AtomixLeaderElector> open(); CompletableFuture<AtomixLeaderElector> setupCache(); @Override CompletableFuture<Leadership> run(String topic, NodeId nodeId); @Override CompletableFuture<Void> withdraw(String topic); @Override CompletableFuture<Boolean> anoint(String topic, NodeId nodeId); @Override CompletableFuture<Boolean> promote(String topic, NodeId nodeId); @Override CompletableFuture<Void> evict(NodeId nodeId); @Override CompletableFuture<Leadership> getLeadership(String topic); @Override CompletableFuture<Map<String, Leadership>> getLeaderships(); CompletableFuture<Set<String>> getElectedTopics(NodeId nodeId); @Override synchronized CompletableFuture<Void> addChangeListener(Consumer<Change<Leadership>> consumer); @Override synchronized CompletableFuture<Void> removeChangeListener(Consumer<Change<Leadership>> consumer); @Override void addStatusChangeListener(Consumer<Status> listener); @Override void removeStatusChangeListener(Consumer<Status> listener); @Override Collection<Consumer<Status>> statusChangeListeners(); }
AtomixLeaderElector extends AbstractResource<AtomixLeaderElector> implements AsyncLeaderElector { @Override public CompletableFuture<Void> withdraw(String topic) { return client.submit(new Withdraw(topic)).whenComplete((r, e) -> cache.invalidate(topic)); } AtomixLeaderElector(CopycatClient client, Properties properties); @Override CompletableFuture<Void> destroy(); @Override String name(); @Override CompletableFuture<AtomixLeaderElector> open(); CompletableFuture<AtomixLeaderElector> setupCache(); @Override CompletableFuture<Leadership> run(String topic, NodeId nodeId); @Override CompletableFuture<Void> withdraw(String topic); @Override CompletableFuture<Boolean> anoint(String topic, NodeId nodeId); @Override CompletableFuture<Boolean> promote(String topic, NodeId nodeId); @Override CompletableFuture<Void> evict(NodeId nodeId); @Override CompletableFuture<Leadership> getLeadership(String topic); @Override CompletableFuture<Map<String, Leadership>> getLeaderships(); CompletableFuture<Set<String>> getElectedTopics(NodeId nodeId); @Override synchronized CompletableFuture<Void> addChangeListener(Consumer<Change<Leadership>> consumer); @Override synchronized CompletableFuture<Void> removeChangeListener(Consumer<Change<Leadership>> consumer); @Override void addStatusChangeListener(Consumer<Status> listener); @Override void removeStatusChangeListener(Consumer<Status> listener); @Override Collection<Consumer<Status>> statusChangeListeners(); static final String CHANGE_SUBJECT; }