redis_cluster
Redis cluster module.
- exception spicerack.redis_cluster.RedisClusterError[source]
Bases:
SpicerackError
Custom exception class for errors in the RedisCluster class.
- class spicerack.redis_cluster.RedisCluster(cluster: str, config_dir: pathlib.Path, *, dry_run: bool = True) None [source]
Bases:
object
Class to manage a Redis Cluster.
Initialize the instance.
- Parameters:
cluster (
str
) -- the name of the cluster to connect to.config_dir (
pathlib.Path
) -- path to the directory containing the configuration files for the Redis clusters.dry_run (
bool
, default:True
) -- whether this is a DRY-RUN.
- class spicerack.redis_cluster.RedisInstance(**kwargs: Any) None [source]
Bases:
object
Class to manage a Redis instance, a simple wrapper around redis.StrictRedis.
Initialize the instance.
- Parameters:
**kwargs (
typing.Any
) -- arbitrary keyword arguments, to be passed to the redis.StrictRedis constructor.
- start_replica(master: spicerack.redis_cluster.RedisInstance) None [source]
Start the replica from the given master instance.
- Parameters:
master (
spicerack.redis_cluster.RedisInstance
) -- the master instance.- Return type: