org.allenai.common.cache

JsonQueryCache

Related Doc: package cache

class JsonQueryCache[V] extends Logging

Class holding a Redis cache of query results. This is meant to store any value T where T : spray.json.JsonFormat (any T with a json serialization as per spray json), keyed on string query. Multiple cache instances (instances pointing to different Redis caches) need to be configured to have different JedisPools.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JsonQueryCache
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JsonQueryCache(redisHostName: String, redisHostPort: Int, clientPrefix: String)(implicit arg0: JsonFormat[V])

    Constructs a QueryCache[V], building a JedisPool from the parameters given.

    Constructs a QueryCache[V], building a JedisPool from the parameters given.

    redisHostName

    the hostName of the redis server to connect to

    redisHostPort

    the port of the redis server to connect to

    clientPrefix

    an identifier for the client using this caching mechanism, which will become part of the cache key (prepended to the actual query)

  2. new JsonQueryCache(pool: JedisPool, clientPrefix: String)(implicit arg0: JsonFormat[V])

    pool

    the JedisPool that the client should use to serve requests

    clientPrefix

    an identifier for the client using this caching mechanism, which will become part of the cache key (prepended to the actual query)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def del(query: String): Unit

    Deletes a key->value pair from the cache.

    Deletes a key->value pair from the cache.

    query

    key for value you want to delete (not including client prefix)

  7. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def get(query: String): Option[V]

    Retrieves the value for a passed key.

    Retrieves the value for a passed key.

    query

    key for stored value (not including client prefix)

    returns

    Option containing value, None if not found or timed out (async)

  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. val internalLogger: Logger

    Definition Classes
    Logging
  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. def keyForQuery(query: String): String

    returns

    the cache key for the query, with client prefix prepended

    Attributes
    protected
  16. object logger

    Definition Classes
    Logging
  17. object loggerConfig

    Simple logback configuration.

    Simple logback configuration. Hopefully this will be discoverable by just typing loggerConfig.[TAB]

    Examples: loggerConfig.Logger("org.apache.spark").setLevel(Level.WARN) loggerConfig.Logger().addAppender( loggerConfig.newPatternLayoutEncoder("%-5level [%thread]: %message%n"), loggerConfig.newConsoleAppender )

    Definition Classes
    Logging
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. def put(query: String, response: V): Unit

    Puts a key->value pair in the cache.

    Puts a key->value pair in the cache.

    query

    key for value (not including client prefix)

    response

    Value you want stored in cache

  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped