Class HazelcastCluster
java.lang.Object
com.norconex.crawler.core.cluster.impl.hazelcast.HazelcastCluster
- All Implemented Interfaces:
Cluster,Closeable,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbindSession(CrawlerSession session) Binds the given crawl session to this cluster node.protected booleanvoidclose()protected com.hazelcast.core.HazelcastInstancecreateHazelcastInstance(com.hazelcast.config.Config hzConfig) booleanReturns the crawl session bound to this cluster node, ornullif the session has not been bound yet.intReturns the number of nodes in the cluster.Returns the names of all nodes in the cluster.Returns the names of the nodes still working on the crawl: those that may still finish the documents they took for processing.inthashCode()voidbooleanWhether this cluster can have more than one node.booleanvoidvoidStarts monitoring for stop signals.voidstop()Requests to stop the cluster.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.norconex.crawler.core.cluster.Cluster
init, stopLocally
-
Constructor Details
-
HazelcastCluster
-
-
Method Details
-
getCrawlerId
-
getLocalNode
- Specified by:
getLocalNodein interfaceCluster
-
getCacheManager
- Specified by:
getCacheManagerin interfaceCluster
-
getPipelineManager
- Specified by:
getPipelineManagerin interfaceCluster
-
getCrawlSession
Description copied from interface:ClusterReturns the crawl session bound to this cluster node, ornullif the session has not been bound yet.- Specified by:
getCrawlSessionin interfaceCluster- Returns:
- the crawl session
-
bindSession
Description copied from interface:ClusterBinds the given crawl session to this cluster node. Called once during session initialization.- Specified by:
bindSessionin interfaceCluster- Parameters:
session- the crawl session
-
init
-
createHazelcastInstance
protected com.hazelcast.core.HazelcastInstance createHazelcastInstance(com.hazelcast.config.Config hzConfig) -
startStopMonitoring
public void startStopMonitoring()Description copied from interface:ClusterStarts monitoring for stop signals. Should only be called by commands that need to respond to stop requests (e.g., CrawlerCommand).- Specified by:
startStopMonitoringin interfaceCluster
-
addCoordinatorChangeListener
-
removeCoordinatorChangeListener
-
stop
public void stop()Description copied from interface:ClusterRequests to stop the cluster. Does not wait. -
close
public void close() -
getNodeCount
public int getNodeCount()Description copied from interface:ClusterReturns the number of nodes in the cluster.- Specified by:
getNodeCountin interfaceCluster- Returns:
- node count
-
getNodeNames
Description copied from interface:ClusterReturns the names of all nodes in the cluster.- Specified by:
getNodeNamesin interfaceCluster- Returns:
- node names
-
getWorkingNodeNames
Returns the names of the nodes still working on the crawl: those that may still finish the documents they took for processing. A node that left the cluster is not one of them. Implementations that track more than membership also leave out a node that stopped sending news of itself, or that is done with the step the crawl is running. Documents taken by a node not listed may be given to another one.A member of the cluster is working unless its latest worker heartbeat for this crawl run is older than the node expiry timeout (the rule the pipeline coordinator uses to mark a node expired), or reports it done (in a terminal status) with the step its pipeline is running. A member with no heartbeat yet for this run is working: it has just joined.
- Specified by:
getWorkingNodeNamesin interfaceCluster- Returns:
- the working node names, empty if they cannot be told
-
isStandalone
public boolean isStandalone() -
isClustered
public boolean isClustered()Description copied from interface:ClusterWhether this cluster can have more than one node. When it cannot, no other node may ever take over what this one is processing.- Specified by:
isClusteredin interfaceCluster- Returns:
trueif clustered
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getWorkDir
-
getConfiguration
-