This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GossipDigestAck2 { | |
final Map<InetAddressAndPort, EndpointState> epStateMap; | |
GossipDigestAck2(Map<InetAddressAndPort, EndpointState> epStateMap){ | |
this.epStateMap = epStateMap; | |
} | |
Map<InetAddressAndPort, EndpointState> getEndpointStateMap(){ | |
return epStateMap; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GossipDigestAck { | |
final List<GossipDigest> gDigestList; | |
final Map<InetAddressAndPort, EndpointState> epStateMap; | |
GossipDigestAck(List<GossipDigest> gDigestList, Map<InetAddressAndPort, EndpointState> epStateMap{ | |
this.gDigestList = gDigestList; | |
this.epStateMap = epStateMap; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GossipDigestSynVerbHandler extends GossipVerbHandler<GossipDigestSyn> { | |
public static final GossipDigestSynVerbHandler instance = new GossipDigestSynVerbHandler(); | |
public void doVerb(Message<GossipDigestSyn> message) { | |
InetAddressAndPort from = message.from(); | |
GossipDigestSyn gDigestMessage = message.payload; | |
List<GossipDigest> gDigestList = gDigestMessage.getGossipDigests(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GossipDigestSyn { | |
final String clusterId; | |
final String partioner; | |
final List<GossipDigest> gDigests; | |
public GossipDigestSyn(String clusterId, String partioner, List<GossipDigest> gDigests{ | |
this.clusterId = clusterId; | |
this.partioner = partioner; | |
this.gDigests = gDigests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GossipDigest implements Comparable<GossipDigest> { | |
final InetAddressAndPort endpoint; | |
final int generation; // generation stays the same when server is running and grows every time the node is started | |
final int maxVersion; // maximum version number is the biggest version number in EndPointState for this endpoint | |
GossipDigest(InetAddressAndPort ep, int gen, int version){ | |
endpoint = ep; | |
generation = gen; | |
maxVersion = version; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.Serializable; | |
import java.net.InetAddress; | |
import java.net.UnknownHostException; | |
public final class InetAddressAndPort implements Serializable { | |
private static final long serialVersionUID = 0; | |
static volatile int defaultPort = 7000; | |
private final InetAddress address; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum ApplicationState { | |
STATUS, | |
LOAD, | |
SCHEMA, | |
DC, | |
RACK, | |
RELEASE_VERSION, | |
REMOVAL_COORDINATOR, | |
SEVERITY, | |
NET_VERSION, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Collections; | |
import java.util.EnumMap; | |
import java.util.Map; | |
import java.util.Set; | |
import java.util.concurrent.atomic.AtomicReference; | |
public class EndpointState { | |
private volatile HeartBeatState hbState; | |
private final AtomicReference<Map<ApplicationState, VersionedValue>> applicationState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum AppState { | |
STATUS, | |
LOAD, | |
SCHEMA, | |
DC, | |
RACK, | |
RELEASE_VERSION, | |
REMOVAL_COORDINATOR, | |
SEVERITY, | |
NET_VERSION, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VersionGenerator { | |
private static final AtomicInteger version = new AtomicInteger(0); | |
public static int getNextVersion() { | |
return version.incrementAndGet(); | |
} | |
} | |
public class HeartBeatState implements Serializable { | |
private volatile int generation; | |
private volatile int version; |
NewerOlder