Class OverseerCollectionMessageHandler

java.lang.Object
org.apache.solr.cloud.api.collections.OverseerCollectionMessageHandler
All Implemented Interfaces:
Closeable, AutoCloseable, OverseerMessageHandler, org.apache.solr.common.SolrCloseable

public class OverseerCollectionMessageHandler extends Object implements OverseerMessageHandler, org.apache.solr.common.SolrCloseable
A OverseerMessageHandler that handles Collections API related overseer messages.

A lot of the content that was in this class got moved to CollectionHandlingUtils and CollApiCmds.

The equivalent of this class for distributed Collection API command execution is DistributedCollectionConfigSetCommandRunner.

  • Constructor Details

  • Method Details

    • processMessage

      public OverseerSolrResponse processMessage(org.apache.solr.common.cloud.ZkNodeProps message, String operation)
      Specified by:
      processMessage in interface OverseerMessageHandler
      Parameters:
      message - the message to process
      operation - the operation to process
      Returns:
      response
    • getName

      public String getName()
      Specified by:
      getName in interface OverseerMessageHandler
      Returns:
      the name of the OverseerMessageHandler
    • getTimerName

      public String getTimerName(String operation)
      Specified by:
      getTimerName in interface OverseerMessageHandler
      Parameters:
      operation - the operation to be timed
      Returns:
      the name of the timer to use for the operation
    • getTaskKey

      public String getTaskKey(org.apache.solr.common.cloud.ZkNodeProps message)
      Specified by:
      getTaskKey in interface OverseerMessageHandler
      Parameters:
      message - the message being processed
      Returns:
      the taskKey for the message for handling task exclusivity
    • lockTask

      public OverseerMessageHandler.Lock lockTask(org.apache.solr.common.cloud.ZkNodeProps message, long batchSessionId)
      Grabs an exclusive lock for this particular task.
      Specified by:
      lockTask in interface OverseerMessageHandler
      Returns:
      null if locking is not possible. When locking is not possible, it will remain impossible for the passed value of batchSessionId. This is to guarantee tasks are executed in queue order (and a later task is not run earlier than its turn just because it happens that a lock got released).
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface org.apache.solr.common.SolrCloseable