Interface Cluster

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
HazelcastCluster, MemoryCluster, MVStoreCluster

public interface Cluster extends Closeable
  • Method Details

    • getNodeCount

      int getNodeCount()
      Returns the number of nodes in the cluster.
      Returns:
      node count
    • getNodeNames

      List<String> getNodeNames()
      Returns the names of all nodes in the cluster.
      Returns:
      node names
    • getWorkingNodeNames

      default Set<String> 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.
      Returns:
      the working node names, empty if they cannot be told
    • isClustered

      default boolean isClustered()
      Whether this cluster can have more than one node. When it cannot, no other node may ever take over what this one is processing.
      Returns:
      true if clustered
    • getLocalNode

      ClusterNode getLocalNode()
    • getCacheManager

      CacheManager getCacheManager()
    • getPipelineManager

      PipelineManager getPipelineManager()
    • getCrawlSession

      CrawlerSession getCrawlSession()
      Returns the crawl session bound to this cluster node, or null if the session has not been bound yet.
      Returns:
      the crawl session
    • bindSession

      void bindSession(CrawlerSession session)
      Binds the given crawl session to this cluster node. Called once during session initialization.
      Parameters:
      session - the crawl session
    • init

      void init(Path crawlerWorkDir, boolean isClustered, Map<String,Class<?>> cacheTypes)
    • init

      default void init(Path crawlerWorkDir, boolean isClustered)
      Convenience overload for tests and simple scenarios that do not need to pre-register cache value types.
      Parameters:
      crawlerWorkDir - working directory
      isClustered - whether running in clustered mode
    • startStopMonitoring

      void startStopMonitoring()
      Starts monitoring for stop signals. Should only be called by commands that need to respond to stop requests (e.g., CrawlerCommand).
    • stop

      void stop()
      Requests to stop the cluster. Does not wait.
    • stopLocally

      default void stopLocally()
      Stops the crawl pipelines running on this node, firing CrawlerEvent.CRAWLER_STOP_REQUEST_BEGIN before and CrawlerEvent.CRAWLER_STOP_REQUEST_END after. Every cluster implementation must stop a node through this method, whatever the way the stop reached the node, so listeners are told on every node and in every cluster mode.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable