-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* redis cluster monitoring * redis master slave monitoring --------- Co-authored-by: Mikołaj Bul <m.bul@avsystem.com> Co-authored-by: pzareba <p.zareba@avsystem.com>
- Loading branch information
1 parent
54c276e
commit 6c254f4
Showing
9 changed files
with
123 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
redis/src/main/scala/com/avsystem/commons/redis/monitoring/ClusterStateObserver.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.avsystem.commons | ||
package redis.monitoring | ||
|
||
import com.avsystem.commons.redis.RedisClusterClient | ||
|
||
/** | ||
* Intended for monitoring [[RedisClusterClient]]'s connections. | ||
* Should be non-blocking and handle internal exceptions by itself. | ||
*/ | ||
trait ClusterStateObserver extends ConnectionStateObserver { | ||
def onClusterRefresh(): Unit | ||
def onClusterRefreshFailure(): Unit | ||
def onClusterInitialized(): Unit | ||
def onClusterInitFailure(): Unit | ||
} |
19 changes: 19 additions & 0 deletions
19
redis/src/main/scala/com/avsystem/commons/redis/monitoring/ConnectionStateObserver.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.avsystem.commons | ||
package redis.monitoring | ||
|
||
import com.avsystem.commons.misc.{AbstractValueEnum, AbstractValueEnumCompanion, EnumCtx} | ||
import com.avsystem.commons.redis.NodeAddress | ||
|
||
/** | ||
* Intended for monitoring the state of a single Redis connection. | ||
* Should be non-blocking and handle internal exceptions by itself. | ||
*/ | ||
trait ConnectionStateObserver { | ||
def onConnectionStateChange(addr: NodeAddress, state: ConnectionState): Unit | ||
} | ||
|
||
final class ConnectionState(implicit enumCtx: EnumCtx) extends AbstractValueEnum | ||
|
||
object ConnectionState extends AbstractValueEnumCompanion[ConnectionState] { | ||
final val Created, Connecting, Connected, Closed, Removed: ConnectionState = new ConnectionState | ||
} |
13 changes: 13 additions & 0 deletions
13
redis/src/main/scala/com/avsystem/commons/redis/monitoring/SentinelStateObserver.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.avsystem.commons | ||
package redis.monitoring | ||
|
||
import com.avsystem.commons.redis.NodeAddress | ||
import com.avsystem.commons.redis.RedisMasterSlaveClient | ||
|
||
/** | ||
* Intended for monitoring [[RedisMasterSlaveClient]]'s state and connections. | ||
* Should be non-blocking and handle internal exceptions by itself. | ||
*/ | ||
trait SentinelStateObserver extends ConnectionStateObserver { | ||
def onMasterChange(master: NodeAddress): Unit | ||
} |