org.apache.solr.common.cloud.rule

## 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 and Description
    --- | ---
    `static class` | `SnitchContext.SnitchInfo`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Exception` | `exception`
    `SnitchContext.SnitchInfo` | `snitchInfo`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SnitchContext(SnitchContext.SnitchInfo perSnitch, String node, Map<String,Object> session)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getErrMsg()`
    `String` | `getNode()`
    `SnitchContext.SnitchInfo` | `getSnitchInfo()`
    `Map<String,Object>` | `getTags()`
    `abstract Map` | `getZkJson(String path)`
    `abstract void` | `invokeRemote(String node, ModifiableSolrParams params, String klas, RemoteCallback callback)` make a call to solrnode/admin/cores with the given params and give a callback.
    `void` | `remoteCallback(SnitchContext ctx, Map<String,Object> returnedVal)`
    `Object` | `retrieve(String s)`
    `void` | `store(String s, Object val)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

    - #### getSnitchInfo

          public SnitchContext.SnitchInfo getSnitchInfo()

    - #### getTags

          public Map<String,Object> getTags()

    - #### store

          public void store(String s,
                            Object val)

    - #### retrieve

          public Object retrieve(String s)

    - #### getZkJson

          public abstract Map getZkJson(String path)

    - #### getNode

          public String getNode()

    - #### invokeRemote

          public abstract void invokeRemote(String node,
                                            ModifiableSolrParams params,
                                            String klas,
                                            RemoteCallback callback)

      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 made
        `params` - The params to be passed to the Snitch counterpart
        `klas` - The name of the class to be invoked in the remote node
        `callback` - 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 interface `RemoteCallback`

    - #### getErrMsg

          public String getErrMsg()

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.