public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implements Discovery, PingContextProvider
Modifier and Type | Class and Description |
---|---|
static class |
ZenDiscovery.RejoinClusterRequest |
Discovery.AckListener, Discovery.FailedToCommitClusterStateException
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DISCOVERY_REJOIN_ACTION_NAME |
static Setting<java.lang.Integer> |
JOIN_RETRY_ATTEMPTS_SETTING |
static Setting<TimeValue> |
JOIN_RETRY_DELAY_SETTING |
static Setting<TimeValue> |
JOIN_TIMEOUT_SETTING |
static Setting<java.lang.Boolean> |
MASTER_ELECTION_IGNORE_NON_MASTER_PINGS_SETTING |
static Setting<TimeValue> |
MASTER_ELECTION_WAIT_FOR_JOINS_TIMEOUT_SETTING |
static Setting<java.lang.Integer> |
MAX_PINGS_FROM_ANOTHER_MASTER_SETTING |
static Setting<TimeValue> |
PING_TIMEOUT_SETTING |
static Setting<java.lang.Boolean> |
SEND_LEAVE_REQUEST_SETTING |
lifecycle
deprecationLogger, logger, settings
Constructor and Description |
---|
ZenDiscovery(Settings settings,
ClusterName clusterName,
ThreadPool threadPool,
TransportService transportService,
ClusterService clusterService,
ClusterSettings clusterSettings,
ZenPingService pingService,
ElectMasterService electMasterService) |
Modifier and Type | Method and Description |
---|---|
protected void |
doClose() |
protected void |
doStart() |
protected void |
doStop() |
DiscoverySettings |
getDiscoverySettings() |
int |
getMinimumMasterNodes() |
boolean |
joiningCluster()
returns true if zen discovery is started and there is a currently a background thread active for (re)joining
the cluster used for testing.
|
DiscoveryNode |
localNode() |
java.lang.String |
nodeDescription() |
boolean |
nodeHasJoinedClusterOnce()
return true if this node has previously joined the cluster at least once.
|
DiscoveryNodes |
nodes()
start of
PingContextProvider implementation |
ClusterState[] |
pendingClusterStates() |
void |
publish(ClusterChangedEvent clusterChangedEvent,
Discovery.AckListener ackListener)
end of
PingContextProvider implementation |
protected ClusterState |
rejoin(ClusterState clusterState,
java.lang.String reason) |
void |
setRoutingService(RoutingService routingService)
Another hack to solve dep injection problem..., note, this will be called before
any start is called.
|
void |
startInitialJoin()
Triggers the first join cycle
|
DiscoveryStats |
stats() |
static void |
validateStateIsFromCurrentMaster(ESLogger logger,
DiscoveryNodes currentNodes,
ClusterState newClusterState)
In the case we follow an elected master the new cluster state needs to have the same elected master
This method checks for this and throws an exception if needed
|
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
logDeprecatedSetting, logRemovedSetting, nodeName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
close
public static final Setting<java.lang.Integer> JOIN_RETRY_ATTEMPTS_SETTING
public static final Setting<java.lang.Integer> MAX_PINGS_FROM_ANOTHER_MASTER_SETTING
public static final Setting<java.lang.Boolean> SEND_LEAVE_REQUEST_SETTING
public static final Setting<TimeValue> MASTER_ELECTION_WAIT_FOR_JOINS_TIMEOUT_SETTING
public static final Setting<java.lang.Boolean> MASTER_ELECTION_IGNORE_NON_MASTER_PINGS_SETTING
public static final java.lang.String DISCOVERY_REJOIN_ACTION_NAME
@Inject public ZenDiscovery(Settings settings, ClusterName clusterName, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, ClusterSettings clusterSettings, ZenPingService pingService, ElectMasterService electMasterService)
public void setRoutingService(RoutingService routingService)
Discovery
setRoutingService
in interface Discovery
protected void doStart()
doStart
in class AbstractLifecycleComponent<Discovery>
public void startInitialJoin()
Discovery
startInitialJoin
in interface Discovery
protected void doStop()
doStop
in class AbstractLifecycleComponent<Discovery>
protected void doClose()
doClose
in class AbstractLifecycleComponent<Discovery>
public DiscoveryNode localNode()
public java.lang.String nodeDescription()
nodeDescription
in interface Discovery
public DiscoveryNodes nodes()
PingContextProvider
implementationnodes
in interface DiscoveryNodesProvider
public boolean nodeHasJoinedClusterOnce()
PingContextProvider
nodeHasJoinedClusterOnce
in interface PingContextProvider
public void publish(ClusterChangedEvent clusterChangedEvent, Discovery.AckListener ackListener)
PingContextProvider
implementationpublic DiscoveryStats stats()
public DiscoverySettings getDiscoverySettings()
getDiscoverySettings
in interface Discovery
public int getMinimumMasterNodes()
getMinimumMasterNodes
in interface Discovery
public boolean joiningCluster()
public ClusterState[] pendingClusterStates()
public static void validateStateIsFromCurrentMaster(ESLogger logger, DiscoveryNodes currentNodes, ClusterState newClusterState)
protected ClusterState rejoin(ClusterState clusterState, java.lang.String reason)