com.gilt.gfc.cache

DerivedAsyncCacheWithAsyncTransformImpl

trait DerivedAsyncCacheWithAsyncTransformImpl[K, V, L, W] extends DerivedAsyncCacheBase[K, V, L, W]

An implementation of the DerivedAsyncCacheBase where all transformations are asynchronous and return a Future[Iterable] of transformed key/value pairs for each key/value pair of the parent/source cache.

K

- key type of the parent cache

V

- value type of the parent cache

L

- key type of this cache

W

- value type of this cache

Linear Supertypes
DerivedAsyncCacheBase[K, V, L, W], DerivedCacheBaseImpl, Loggable, AsyncCacheEventHandler[K, V], AsyncCacheEventNotifierImpl[L, W], AsyncCache[L, W], AsyncCacheEventNotifier[L, W], CacheBase, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DerivedAsyncCacheWithAsyncTransformImpl
  2. DerivedAsyncCacheBase
  3. DerivedCacheBaseImpl
  4. Loggable
  5. AsyncCacheEventHandler
  6. AsyncCacheEventNotifierImpl
  7. AsyncCache
  8. AsyncCacheEventNotifier
  9. CacheBase
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def onCacheMiss(k: L): Future[Option[W]]

    Computes the value for a given key k that is missing from the cache.

    Computes the value for a given key k that is missing from the cache.

    Note: This function will be called during class instantiation if the parent cache has already been started. Implementations should ensure that anything they depend on is already available, for example, as a constructor parameter or through a separate singleton implementation. Don't use values that are defined in the class itself as they would only be available after this base class has been initialized.

    k

    - cache key which value needs to be computed

    returns

    - the value for the given key

    Definition Classes
    DerivedAsyncCacheBase
  2. abstract def parent: AsyncCache[K, V]

    The parent this cache is derived from.

    The parent this cache is derived from.

    Definition Classes
    DerivedAsyncCacheBase → DerivedCacheBaseImpl
  3. abstract def transformSourceObjects(kvs: Iterable[(K, V)]): Future[Iterable[(L, W)]]

    Transforms an iterable collection of key value pairs from the parent cache into a future of a iterable collection of key value pairs for the derived cache.

    Transforms an iterable collection of key value pairs from the parent cache into a future of a iterable collection of key value pairs for the derived cache.

    kvs

    - an iterable collection of key value pairs from the parent cache

    returns

    - future of an iterable collection of key,value pairs for this cache

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. def addToCache(objects: Iterable[(L, W)]): Unit

    Updates the cache with the proivided objects and notifies all registered AsyncCacheEventHandlers for cache miss for each of those objects.

    Updates the cache with the proivided objects and notifies all registered AsyncCacheEventHandlers for cache miss for each of those objects.

    Attributes
    protected
    Definition Classes
    DerivedAsyncCacheBase
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def asMap: Map[L, Future[Option[W]]]

    View this cache as an immutable Map.

    View this cache as an immutable Map. The returned Map is a snapshot of the cache, i.e. any changes to the cache, both incremental and bulk-reloads, are not reflected in the returned Map.

    returns

    Definition Classes
    DerivedAsyncCacheBase → AsyncCache
  9. def checkStarted(): Unit

    Attributes
    protected
    Definition Classes
    DerivedAsyncCacheBase → CacheBase
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def debug(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  12. def debug(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  13. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  15. def error(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  16. def error(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  17. def error(ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  18. def fatal(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  19. def fatal(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  20. def fatal(ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  21. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def flatPeek(key: L): Option[W]

    Peek if the given key is cached, resolved and present or not.

    Peek if the given key is cached, resolved and present or not. If it is, it returns a Some of the value, otherwise None. This works by flattening down the return value of peek. This method does not trigger a remote call if the given key is not cached already.

    key
    returns

    Definition Classes
    DerivedAsyncCacheBase → AsyncCache
  23. def get(key: L): Future[Option[W]]

    Throws exception if the cache is not started, otherwise it will return the cached value for the provided key.

    Throws exception if the cache is not started, otherwise it will return the cached value for the provided key. If the cache doesn't contain the value for the key onCacheMiss will be called, value will be cached and all registered AsyncCacheEventHandlers will be notified.

    Definition Classes
    DerivedAsyncCacheBase → AsyncCache
  24. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  26. def info(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  27. def info(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. def isStarted: Boolean

    Test if the cache has been started.

    Test if the cache has been started.

    Definition Classes
    DerivedCacheBaseImpl → CacheBase
  30. final def jGet(key: L): ListenableFuture[Optional[W]]

    Definition Classes
    AsyncCache
  31. def maybeBlockForResult[A](f: Future[A]): Unit

    Block for the result if the parent has a SYNC init strategy.

    Block for the result if the parent has a SYNC init strategy. A bit of a hack, since we don't have API access to the parent's config.

    Attributes
    protected
    Definition Classes
    DerivedAsyncCacheBase
  32. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  35. def notifyCacheMissFor(key: L, value: W): Unit

    Notifies all registered AsyncCacheEventHandler's for a cache miss for the provided key.

    Notifies all registered AsyncCacheEventHandler's for a cache miss for the provided key.

    key

    - cache key

    value

    - cache value

    Definition Classes
    AsyncCacheEventNotifierImpl
  36. def notifyCacheReloadFor(cache: Iterable[(L, W)]): Unit

    Notifies all registered AsyncCacheEventHandler's that provided cache was reloaded.

    Notifies all registered AsyncCacheEventHandler's that provided cache was reloaded.

    cache

    - cache that was reloaded

    Definition Classes
    AsyncCacheEventNotifierImpl
  37. def onCacheMissLoad(key: K, value: V): Unit

    Defines callback for cache miss.

    Defines callback for cache miss.

    key

    - key for which we have a cache miss

    value

    - value for which we have a cache miss

    Definition Classes
    DerivedAsyncCacheWithAsyncTransformImplAsyncCacheEventHandler
  38. def onCacheReload(fromCache: Iterable[(K, V)]): Unit

    Defines callback for cache reload.

    Defines callback for cache reload.

    fromCache

    - the cache that was reloaded

    Definition Classes
    DerivedAsyncCacheWithAsyncTransformImplAsyncCacheEventHandler
  39. def peek(key: L): Option[Future[Option[W]]]

    Peek if the given key is already cached or not.

    Peek if the given key is already cached or not. If it is, it returns a Some of cached Future, otherwise None. This method does not trigger a remote call if the given key is not cached already.

    key
    returns

    Definition Classes
    DerivedAsyncCacheBase → AsyncCache
  40. def register(): DerivedAsyncCacheWithAsyncTransformImpl.this.type

    Loads the content of this cache from its parent, if the parent is started.

    Loads the content of this cache from its parent, if the parent is started. Register itself for parent cache change notifications.

    This method should be called only once, when the cache is ready to receive notifications. Subsequent calls to this method are of no effect.

    returns

    this cache ready to receive notifications from its parent

    Definition Classes
    DerivedAsyncCacheBase
  41. def registerHandler(handler: AsyncCacheEventHandler[L, W]): Unit

    Register an AsyncCacheEventHandler to be notified for cache events.

    Register an AsyncCacheEventHandler to be notified for cache events.

    handler

    - the handler to be notified for cache events

    Definition Classes
    AsyncCacheEventNotifierImplAsyncCacheEventNotifier
  42. def replaceCache(objects: Iterable[(L, W)]): Unit

    Replaces the cache with the proivided objects and notifies all registered AsyncCacheEventHandlers for cache reload.

    Replaces the cache with the proivided objects and notifies all registered AsyncCacheEventHandlers for cache reload.

    Attributes
    protected
    Definition Classes
    DerivedAsyncCacheBase
  43. def shutdown(): Unit

    Stop the cache from loading.

    Stop the cache from loading.

    Definition Classes
    DerivedCacheBaseImpl → CacheBase
  44. def start(): DerivedAsyncCacheWithAsyncTransformImpl.this.type

    Starts the loading of the cache.

    Starts the loading of the cache.

    Definition Classes
    DerivedCacheBaseImpl → CacheBase
  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  46. def toString(): String

    Definition Classes
    AnyRef → Any
  47. def trace(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  48. def trace(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  49. def transformSourceObject(k: K, v: V): Future[Iterable[(L, W)]]

    Transforms a key value pair from the parent cache into a future of a iterable collection of key value pairs for the derived cache.

    Transforms a key value pair from the parent cache into a future of a iterable collection of key value pairs for the derived cache.

    k

    - key from the parent cache

    v

    - the value for this key from the parent cache

    returns

    - future of an iterable collection of derived key,value pairs

  50. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. def warn(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  54. def warn(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable

Inherited from DerivedAsyncCacheBase[K, V, L, W]

Inherited from DerivedCacheBaseImpl

Inherited from Loggable

Inherited from AsyncCacheEventHandler[K, V]

Inherited from AsyncCacheEventNotifierImpl[L, W]

Inherited from AsyncCache[L, W]

Inherited from AsyncCacheEventNotifier[L, W]

Inherited from CacheBase

Inherited from AnyRef

Inherited from Any

Ungrouped