Interface CacheWriter<K,V>

All Superinterfaces:
org.infinispan.commons.api.Lifecycle
All Known Subinterfaces:
AdvancedCacheExpirationWriter<K,V>, AdvancedCacheWriter<K,V>, AdvancedLoadWriteStore<K,V>, ExternalStore<K,V>, FlagAffectedStore<K,V>, SegmentedAdvancedLoadWriteStore<K,V>, TransactionalCacheWriter<K,V>
All Known Implementing Classes:
AbstractSegmentedAdvancedLoadWriteStore, ComposedSegmentedLoadWriteStore, DelegatingCacheWriter

@ThreadSafe @Deprecated(forRemoval=true) public interface CacheWriter<K,V> extends org.infinispan.commons.api.Lifecycle
Deprecated, for removal: This API element is subject to removal in a future version.
since 11.0 replaced by NonBlockingStore
Allows persisting data to an external storage, as opposed to the CacheLoader.
Since:
6.0
Author:
Mircea Markus
  • Method Summary

    Modifier and Type
    Method
    Description
    bulkUpdate(org.reactivestreams.Publisher<MarshallableEntry<? extends K,? extends V>> publisher)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Persist all provided entries to the store in chunks, with the size of each chunk determined by the store implementation.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    default void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove all provided keys from the store in a single batch operation.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Used to initialize a cache loader.
    default boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    write(MarshallableEntry<? extends K,? extends V> entry)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Persists the entry to the storage.

    Methods inherited from interface org.infinispan.commons.api.Lifecycle

    start, stop
  • Method Details

    • init

      void init(InitializationContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Used to initialize a cache loader. Typically invoked by the PersistenceManager when setting up cache loaders.
      Throws:
      PersistenceException - in case of an error, e.g. communicating with the external storage
    • write

      void write(MarshallableEntry<? extends K,? extends V> entry)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Persists the entry to the storage.
      Throws:
      PersistenceException - in case of an error, e.g. communicating with the external storage
      See Also:
    • delete

      boolean delete(Object key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      true if the entry existed in the persistent store and it was deleted.
      Throws:
      PersistenceException - in case of an error, e.g. communicating with the external storage
    • bulkUpdate

      default CompletionStage<Void> bulkUpdate(org.reactivestreams.Publisher<MarshallableEntry<? extends K,? extends V>> publisher)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Persist all provided entries to the store in chunks, with the size of each chunk determined by the store implementation. If chunking is not supported by the underlying store, then entries are written to the store individually via write(MarshallableEntry).
      Parameters:
      publisher - a Publisher of MarshallableEntry instances
      Throws:
      NullPointerException - if the publisher is null.
    • deleteBatch

      default void deleteBatch(Iterable<Object> keys)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Remove all provided keys from the store in a single batch operation. If this is not supported by the underlying store, then keys are removed from the store individually via delete(Object).
      Parameters:
      keys - an Iterable of entry Keys to be removed from the store.
      Throws:
      NullPointerException - if keys is null.
    • isAvailable

      default boolean isAvailable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      true if the writer can be connected to, otherwise false