package gw.solr.consistency uses org.json.simple.JSONObject /** * Interface that provides a mapping from the URN for a Solr document * to the key that is used for the consistency cache to match related * Solr document updates and deletes. * * Pass an implementation of this interface to the consistency tracker * builder that provides the appropriate mapping (such as stripping or * modifying a digest key). Defaults to using the URN for the key, * which will be correct for most cases. */ @ReadOnly interface IKeyGenerator { /** * Create the consistency cache key to be used for this URN. For a * given key, only the most recent update to that key will be cached * for consistency checking purposes. * * IMPORTANT : Implementations of this class must be thread safe! * * @param docObj a json representation of the document for which the * key is being created * @param urnTag the label used for the unique resource id of this document. * This can be different for deletes vs updates * @return the key to use for the consistency cache */ function createKey( docObj : JSONObject, urnTag : String ) : String }