"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "voter/src/main/java/org/terracotta/voter/ActiveVoter.java" between
terracotta-core-5.7.0.tar.gz and terracotta-core-5.7.1.tar.gz

About: Terracotta - Clustering technology for Java ("Network Attached Memory", "Distributed Cache"). Source code of the server (5.x) core components.

ActiveVoter.java  (terracotta-core-5.7.0):ActiveVoter.java  (terracotta-core-5.7.1)
skipping to change at line 206 skipping to change at line 206
} }
} }
} }
private Runnable heartbeat(ExecutorService executorService, ClientVoterManager voterManager, Optional<Properties> connectionProps, AtomicReference<ClientVoter Manager> voteOwner) { private Runnable heartbeat(ExecutorService executorService, ClientVoterManager voterManager, Optional<Properties> connectionProps, AtomicReference<ClientVoter Manager> voteOwner) {
return () -> { return () -> {
try { try {
ClientVoterManager owner = voteOwner.get(); ClientVoterManager owner = voteOwner.get();
while (owner != null && !executorService.isShutdown()) { while (owner != null && !executorService.isShutdown()) {
try { try {
// Need to break out if the voterManager pointing to node is detache
d from the cluster
if (!existingTopology.contains(voterManager.getTargetHostPort())) {
break;
}
voterManager.connect(connectionProps); voterManager.connect(connectionProps);
long lastVotedElection = 0; long lastVotedElection = 0;
// if the current vote owner is the active, allowed to reconnect // if the current vote owner is the active, allowed to reconnect
long registration = voterManager.registerVoter(id); long registration = voterManager.registerVoter(id);
LOGGER.debug("Registration {} for {}", registration, voterManager); LOGGER.debug("Registration {} for {}", registration, voterManager);
if (registration > 0) { if (registration > 0) {
if (voterManager == owner) { if (voterManager == owner) {
// the vote was re-registered on the active, this is not allowed, vo ting cycle // the vote was re-registered on the active, this is not allowed, vo ting cycle
// must start over // must start over
if (voteOwner.compareAndSet(owner, null)) { if (voteOwner.compareAndSet(owner, null)) {
 End of changes. 1 change blocks. 
0 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)