Class OverseerCollectionMessageHandler
- java.lang.Object
-
- org.apache.solr.cloud.api.collections.OverseerCollectionMessageHandler
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,OverseerMessageHandler
,SolrCloseable
public class OverseerCollectionMessageHandler extends Object implements OverseerMessageHandler, SolrCloseable
AOverseerMessageHandler
that handles Collections API related overseer messages.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
OverseerCollectionMessageHandler.Cmd
class
OverseerCollectionMessageHandler.ShardRequestTracker
-
Nested classes/interfaces inherited from interface org.apache.solr.cloud.OverseerMessageHandler
OverseerMessageHandler.Lock
-
-
Field Summary
Fields Modifier and Type Field Description static String
COLL_PROP_PREFIX
static Map<String,Object>
COLLECTION_PROPS_AND_DEFAULTS
static String
CREATE_NODE_SET
static String
CREATE_NODE_SET_EMPTY
static String
CREATE_NODE_SET_SHUFFLE
static boolean
CREATE_NODE_SET_SHUFFLE_DEFAULT
static String
FAILURE_FIELD
static String
NUM_SLICES
static String
ONLY_ACTIVE_NODES
static String
ONLY_IF_DOWN
protected static Random
RANDOM
static String
REQUESTID
static String
ROUTER
static String
SHARD_UNIQUE
static String
SHARDS_PROP
static String
SUCCESS_FIELD
-
Constructor Summary
Constructors Constructor Description OverseerCollectionMessageHandler(ZkStateReader zkStateReader, String myId, HttpShardHandlerFactory shardHandlerFactory, String adminPath, Stats stats, Overseer overseer, OverseerNodePrioritizer overseerPrioritizer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OverseerCollectionMessageHandler.ShardRequestTracker
asyncRequestTracker(String asyncId)
void
close()
static void
createConfNode(DistribStateManager stateManager, String configName, String coll, boolean isLegacyCloud)
This doesn't validate the config (path) itself and is just responsible for creating the confNode.String
getName()
String
getTaskKey(ZkNodeProps message)
String
getTimerName(String operation)
boolean
isClosed()
OverseerMessageHandler.Lock
lockTask(ZkNodeProps message, OverseerTaskProcessor.TaskBatch taskBatch)
Try to provide an exclusive lock for this particular task return null if locking is not possible.OverseerSolrResponse
processMessage(ZkNodeProps message, String operation)
OverseerCollectionMessageHandler.ShardRequestTracker
syncRequestTracker()
-
-
-
Field Detail
-
NUM_SLICES
public static final String NUM_SLICES
- See Also:
- Constant Field Values
-
CREATE_NODE_SET_SHUFFLE_DEFAULT
public static final boolean CREATE_NODE_SET_SHUFFLE_DEFAULT
- See Also:
- Constant Field Values
-
CREATE_NODE_SET_SHUFFLE
public static final String CREATE_NODE_SET_SHUFFLE
- See Also:
- Constant Field Values
-
CREATE_NODE_SET_EMPTY
public static final String CREATE_NODE_SET_EMPTY
- See Also:
- Constant Field Values
-
CREATE_NODE_SET
public static final String CREATE_NODE_SET
- See Also:
- Constant Field Values
-
ROUTER
public static final String ROUTER
- See Also:
- Constant Field Values
-
SHARDS_PROP
public static final String SHARDS_PROP
- See Also:
- Constant Field Values
-
REQUESTID
public static final String REQUESTID
- See Also:
- Constant Field Values
-
COLL_PROP_PREFIX
public static final String COLL_PROP_PREFIX
- See Also:
- Constant Field Values
-
ONLY_IF_DOWN
public static final String ONLY_IF_DOWN
- See Also:
- Constant Field Values
-
SHARD_UNIQUE
public static final String SHARD_UNIQUE
- See Also:
- Constant Field Values
-
ONLY_ACTIVE_NODES
public static final String ONLY_ACTIVE_NODES
- See Also:
- Constant Field Values
-
FAILURE_FIELD
public static final String FAILURE_FIELD
- See Also:
- Constant Field Values
-
SUCCESS_FIELD
public static final String SUCCESS_FIELD
- See Also:
- Constant Field Values
-
RANDOM
protected static final Random RANDOM
-
-
Constructor Detail
-
OverseerCollectionMessageHandler
public OverseerCollectionMessageHandler(ZkStateReader zkStateReader, String myId, HttpShardHandlerFactory shardHandlerFactory, String adminPath, Stats stats, Overseer overseer, OverseerNodePrioritizer overseerPrioritizer)
-
-
Method Detail
-
processMessage
public OverseerSolrResponse processMessage(ZkNodeProps message, String operation)
- Specified by:
processMessage
in interfaceOverseerMessageHandler
- Parameters:
message
- the message to processoperation
- the operation to process- Returns:
- response
-
createConfNode
public static void createConfNode(DistribStateManager stateManager, String configName, String coll, boolean isLegacyCloud) throws IOException, AlreadyExistsException, BadVersionException, org.apache.zookeeper.KeeperException, InterruptedException
This doesn't validate the config (path) itself and is just responsible for creating the confNode. That check should be done before the config node is created.- Throws:
IOException
AlreadyExistsException
BadVersionException
org.apache.zookeeper.KeeperException
InterruptedException
-
getName
public String getName()
- Specified by:
getName
in interfaceOverseerMessageHandler
- Returns:
- the name of the OverseerMessageHandler
-
getTimerName
public String getTimerName(String operation)
- Specified by:
getTimerName
in interfaceOverseerMessageHandler
- Parameters:
operation
- the operation to be timed- Returns:
- the name of the timer to use for the operation
-
getTaskKey
public String getTaskKey(ZkNodeProps message)
- Specified by:
getTaskKey
in interfaceOverseerMessageHandler
- Parameters:
message
- the message being processed- Returns:
- the taskKey for the message for handling task exclusivity
-
lockTask
public OverseerMessageHandler.Lock lockTask(ZkNodeProps message, OverseerTaskProcessor.TaskBatch taskBatch)
Description copied from interface:OverseerMessageHandler
Try to provide an exclusive lock for this particular task return null if locking is not possible. If locking is not necessary- Specified by:
lockTask
in interfaceOverseerMessageHandler
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interfaceSolrCloseable
-
syncRequestTracker
public OverseerCollectionMessageHandler.ShardRequestTracker syncRequestTracker()
-
asyncRequestTracker
public OverseerCollectionMessageHandler.ShardRequestTracker asyncRequestTracker(String asyncId)
-
-