Class RedisStoreProvider

java.lang.Object
me.ahoo.cosid.store.redis.RedisStoreProvider
All Implemented Interfaces:
me.ahoo.cosid.store.StoreProvider

public final class RedisStoreProvider extends Object implements me.ahoo.cosid.store.StoreProvider
Opens RedisStores, type redis (06-stores.md ยง2.2); registered with ServiceLoader.

StoreConfig.client() may hold:

  • a RedisScripts: used as it is, WAIT included (the Spring Data adapter);
  • a RedisClient or RedisClusterClient: the store opens a connection of its own on it and closes that connection, not the client;
  • a StatefulRedisConnection<String, String> or StatefulRedisClusterConnection<String, String>: used for the scripts, and never closed. Since WAIT must not block a shared connection, this needs wait resolving to 0;
  • nothing: the store creates a client from options.uri and closes it.

Options: uri (a Redis URI, without a client), cluster (true for a Redis Cluster uri), wait (auto, the default: WAIT 1 after each write when the server has replicas; off; or the replica count) and sweepBatch (expired leases one acquire sweeps, default 16). StoreConfig.timeout() bounds each command and WAIT.

The uniqueness of the ids rests on acknowledged writes never being lost: see RedisStore.

  • Field Details

  • Constructor Details

    • RedisStoreProvider

      public RedisStoreProvider()
  • Method Details

    • type

      public String type()
      Specified by:
      type in interface me.ahoo.cosid.store.StoreProvider
    • options

      public Set<String> options()
      Specified by:
      options in interface me.ahoo.cosid.store.StoreProvider
    • open

      public me.ahoo.cosid.store.Store open(me.ahoo.cosid.store.StoreConfig config)
      Specified by:
      open in interface me.ahoo.cosid.store.StoreProvider