public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implements Discovery, PingContextProvider
Modifier and Type | Class and Description |
---|---|
static class |
ZenDiscovery.RejoinClusterRequest |
Discovery.AckListener
Modifier and Type | Field and Description |
---|---|
static String |
DISCOVERY_REJOIN_ACTION_NAME |
static String |
SETTING_JOIN_RETRY_ATTEMPTS |
static String |
SETTING_JOIN_RETRY_DELAY |
static String |
SETTING_JOIN_TIMEOUT |
static String |
SETTING_MASTER_ELECTION_FILTER_CLIENT |
static String |
SETTING_MASTER_ELECTION_FILTER_DATA |
static String |
SETTING_MASTER_ELECTION_WAIT_FOR_JOINS_TIMEOUT |
static String |
SETTING_MAX_PINGS_FROM_ANOTHER_MASTER |
static String |
SETTING_PING_TIMEOUT |
static String |
SETTING_SEND_LEAVE_REQUEST |
lifecycle
deprecationLogger, logger, settings
Constructor and Description |
---|
ZenDiscovery(Settings settings,
ClusterName clusterName,
ThreadPool threadPool,
TransportService transportService,
ClusterService clusterService,
NodeSettingsService nodeSettingsService,
ZenPingService pingService,
ElectMasterService electMasterService,
DiscoverySettings discoverySettings) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(InitialStateDiscoveryListener listener) |
protected void |
doClose() |
protected void |
doStart() |
protected void |
doStop() |
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() |
String |
nodeDescription() |
boolean |
nodeHasJoinedClusterOnce()
return true if this node has previously joined the cluster at least once.
|
DiscoveryNodes |
nodes()
start of
PingContextProvider implementation |
NodeService |
nodeService() |
void |
publish(ClusterChangedEvent clusterChangedEvent,
Discovery.AckListener ackListener)
end of
PingContextProvider implementation |
protected ClusterState |
rejoin(ClusterState clusterState,
String reason) |
void |
removeListener(InitialStateDiscoveryListener listener) |
void |
setNodeService(NodeService nodeService)
Here as a hack to solve dep injection problem...
|
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
|
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 String SETTING_PING_TIMEOUT
public static final String SETTING_JOIN_TIMEOUT
public static final String SETTING_JOIN_RETRY_ATTEMPTS
public static final String SETTING_JOIN_RETRY_DELAY
public static final String SETTING_MAX_PINGS_FROM_ANOTHER_MASTER
public static final String SETTING_SEND_LEAVE_REQUEST
public static final String SETTING_MASTER_ELECTION_FILTER_CLIENT
public static final String SETTING_MASTER_ELECTION_WAIT_FOR_JOINS_TIMEOUT
public static final String SETTING_MASTER_ELECTION_FILTER_DATA
public static final String DISCOVERY_REJOIN_ACTION_NAME
@Inject public ZenDiscovery(Settings settings, ClusterName clusterName, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, NodeSettingsService nodeSettingsService, ZenPingService pingService, ElectMasterService electMasterService, DiscoverySettings discoverySettings)
public void setNodeService(@Nullable NodeService nodeService)
Discovery
setNodeService
in interface Discovery
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 void addListener(InitialStateDiscoveryListener listener)
addListener
in interface Discovery
public void removeListener(InitialStateDiscoveryListener listener)
removeListener
in interface Discovery
public String nodeDescription()
nodeDescription
in interface Discovery
public DiscoveryNodes nodes()
PingContextProvider
implementationnodes
in interface DiscoveryNodesProvider
public NodeService nodeService()
nodeService
in interface DiscoveryNodesProvider
public boolean nodeHasJoinedClusterOnce()
PingContextProvider
nodeHasJoinedClusterOnce
in interface PingContextProvider
public void publish(ClusterChangedEvent clusterChangedEvent, Discovery.AckListener ackListener)
PingContextProvider
implementationpublic boolean joiningCluster()
protected ClusterState rejoin(ClusterState clusterState, String reason)
Copyright © 2009–2016. All rights reserved.