Class SnitchContext
- java.lang.Object
-
- org.apache.solr.common.cloud.rule.SnitchContext
-
- All Implemented Interfaces:
RemoteCallback
public abstract class SnitchContext extends Object implements RemoteCallback
This is the context provided to the snitches to interact with the system. This is a per-node-per-snitch instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SnitchContext.SnitchInfo
-
Field Summary
Fields Modifier and Type Field Description Exception
exception
SnitchContext.SnitchInfo
snitchInfo
-
Constructor Summary
Constructors Constructor Description SnitchContext(SnitchContext.SnitchInfo perSnitch, String node, Map<String,Object> session)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getErrMsg()
String
getNode()
Map<String,Object>
getNodeValues(String node, Collection<String> tags)
Map<String,Object>
getTags()
abstract Map<?,?>
getZkJson(String path)
void
invokeRemote(String node, ModifiableSolrParams params, String klas, RemoteCallback callback)
Deprecated.void
remoteCallback(SnitchContext ctx, Map<String,Object> returnedVal)
Object
retrieve(String s)
void
store(String s, Object val)
-
-
-
Field Detail
-
snitchInfo
public final SnitchContext.SnitchInfo snitchInfo
-
exception
public Exception exception
-
-
Constructor Detail
-
SnitchContext
public SnitchContext(SnitchContext.SnitchInfo perSnitch, String node, Map<String,Object> session)
-
-
Method Detail
-
getZkJson
public abstract Map<?,?> getZkJson(String path) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
getNode
public String getNode()
-
invokeRemote
@Deprecated public void invokeRemote(String node, ModifiableSolrParams params, String klas, RemoteCallback callback)
Deprecated.make a call to solrnode/admin/cores with the given params and give a callback. This is designed to be asynchronous because the system would want to batch the calls made to any given node- Parameters:
node
- The node for which this call is madeparams
- The params to be passed to the Snitch counterpartklas
- The name of the class to be invoked in the remote nodecallback
- The callback to be called when the response is obtained from remote node. If this is passed as null the entire response map will be added as tags
-
remoteCallback
public void remoteCallback(SnitchContext ctx, Map<String,Object> returnedVal)
- Specified by:
remoteCallback
in interfaceRemoteCallback
-
getErrMsg
public String getErrMsg()
-
-