Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.

RedisCluster -> Mutable/Immutable - #13

Open
jhiggins-bam wants to merge 1 commit into
Ma27:masterfrom
jhiggins-bam:feature-mutable-cluster
Open

RedisCluster -> Mutable/Immutable#13
jhiggins-bam wants to merge 1 commit into
Ma27:masterfrom
jhiggins-bam:feature-mutable-cluster

Conversation

@jhiggins-bam

Copy link
Copy Markdown

Hello!

This change addresses such issues as etaty#177 .

Essentially it is for supporting Redis clusters (in "cluster mode").

The previous versions of rediscala support cluster mode, but the RedisCluster class only accepts an immutable list of servers, and as such the list of nodes cannot change, however this does not allow the user to utilize Redis cluster features such as scaling out shards, adding or removing replication nodes, etc.

This changes RedisCluster to an abstract class. From there, I added ImmutableRedisCluster which is an implementation of RedisCluster that maintains the same functionality as in previous versions, and MutableRedisCluster, which is an abstract class that will refresh the list of nodes every n seconds, where the method of refreshing the list of nodes depends on the implementation.

I have also added an implementation of MutableRedisCluster, ClusterCommandRedisCluster, which uses the CLUSTER NODES command to refresh the list of nodes. This class accepts a configUrl as input which is based on the AWS Elasticache flavor of Redis clusters, but more generically the configUrl is a CNAME record from which the initial nodes can be discovered.

This is a breaking change! Suggestions on how to make this a non-breaking change are welcomed (other suggestions are welcomed, too).

@Ma27

Ma27 commented Sep 25, 2018

Copy link
Copy Markdown
Owner

Hi!
First of all, thanks a lot for your effort!
Unfortunately I'll be a bit busy the next days, so please be a bit patient with my review :)

/cc @kardapoltsev @herzrasen this might be interesing for you as well

redisServerConnections.keys.toSeq
}

def addServer(server: RedisServer) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Procedure syntax is deprecated


protected val timeoutMillis: Option[Long] = timeout.map(_.toMillis)

if(timeout.isDefined) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like foreach

Comment thread version.sbt
@@ -1 +1 @@
version := "1.8.4"
version := "2.0.0" No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it shouldn't be a part of PR

@Ma27

Ma27 commented Jan 7, 2019

Copy link
Copy Markdown
Owner

first of all sorry, due to several time limitations I neglected this repository far too much. I'm not sure when exactly, but I hope that I can find some time to do a review here at one of the next weekends.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants