@Test public void secondDiscoverSuccessRecoveryNeeded() { decider.setResults(results); decider.startDiscovery(asList(address1, address2)); decider.discovered(address1, discovery(COMMITTED)); decider.discovered(address2, discovery(PREPARED)); decider.endDiscovery(); decider.startSecondDiscovery(); decider.discoverRepeated(address1); decider.discoverRepeated(address2); decider.endSecondDiscovery(); assertTrue(decider.isDiscoverSuccessful()); assertFalse(decider.isWholeClusterAccepting()); }
@Override public void discovered(InetSocketAddress server, DiscoverResponse<T> discovery) { super.discovered(server, discovery); UUID latestChangeUuid = getLatestChangeUuid(discovery); latestChangeUuids.add(latestChangeUuid); ChangeRequestState changeState = getLatestChangeState(discovery); if (changeState != null) { switch (changeState) { case COMMITTED: committed.incrementAndGet(); break; case ROLLED_BACK: rolledBack.incrementAndGet(); break; case PREPARED: prepared.incrementAndGet(); break; default: throw new AssertionError(changeState); } } }
RecoveryProcessDecider extends BaseNomadDecider<T> { @Override public void discovered(InetSocketAddress server, DiscoverResponse<T> discovery) { super.discovered(server, discovery); UUID latestChangeUuid = getLatestChangeUuid(discovery); latestChangeUuids.add(latestChangeUuid); ChangeRequestState changeState = getLatestChangeState(discovery); if (changeState != null) { switch (changeState) { case COMMITTED: committed.incrementAndGet(); break; case ROLLED_BACK: rolledBack.incrementAndGet(); break; case PREPARED: prepared.incrementAndGet(); break; default: throw new AssertionError(changeState); } } } }
RecoveryProcessDecider extends BaseNomadDecider<T> { @Override public void discovered(InetSocketAddress server, DiscoverResponse<T> discovery) { super.discovered(server, discovery); UUID latestChangeUuid = getLatestChangeUuid(discovery); latestChangeUuids.add(latestChangeUuid); ChangeRequestState changeState = getLatestChangeState(discovery); if (changeState != null) { switch (changeState) { case COMMITTED: committed.incrementAndGet(); break; case ROLLED_BACK: rolledBack.incrementAndGet(); break; case PREPARED: prepared.incrementAndGet(); break; default: throw new AssertionError(changeState); } } } RecoveryProcessDecider(int expectedNodeCount, ChangeRequestState forcedState); }
RecoveryProcessDecider extends BaseNomadDecider<T> { @Override public void discovered(InetSocketAddress server, DiscoverResponse<T> discovery) { super.discovered(server, discovery); UUID latestChangeUuid = getLatestChangeUuid(discovery); latestChangeUuids.add(latestChangeUuid); ChangeRequestState changeState = getLatestChangeState(discovery); if (changeState != null) { switch (changeState) { case COMMITTED: committed.incrementAndGet(); break; case ROLLED_BACK: rolledBack.incrementAndGet(); break; case PREPARED: prepared.incrementAndGet(); break; default: throw new AssertionError(changeState); } } } RecoveryProcessDecider(int expectedNodeCount, ChangeRequestState forcedState); @Override boolean shouldDoCommit(); @Override boolean shouldDoRollback(); @Override void discovered(InetSocketAddress server, DiscoverResponse<T> discovery); }
RecoveryProcessDecider extends BaseNomadDecider<T> { @Override public void discovered(InetSocketAddress server, DiscoverResponse<T> discovery) { super.discovered(server, discovery); UUID latestChangeUuid = getLatestChangeUuid(discovery); latestChangeUuids.add(latestChangeUuid); ChangeRequestState changeState = getLatestChangeState(discovery); if (changeState != null) { switch (changeState) { case COMMITTED: committed.incrementAndGet(); break; case ROLLED_BACK: rolledBack.incrementAndGet(); break; case PREPARED: prepared.incrementAndGet(); break; default: throw new AssertionError(changeState); } } } RecoveryProcessDecider(int expectedNodeCount, ChangeRequestState forcedState); @Override boolean shouldDoCommit(); @Override boolean shouldDoRollback(); @Override void discovered(InetSocketAddress server, DiscoverResponse<T> discovery);  }