Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
7ec50486
Commit
7ec50486
authored
Aug 10, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup .SentinelSentinels() + test
parent
b18dce52
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
20 deletions
+31
-20
Sentinel.cs
StackExchange.Redis.Tests/Sentinel.cs
+14
-0
IServer.cs
...kExchange.Redis/StackExchange/Redis/Interfaces/IServer.cs
+14
-17
RedisLiterals.cs
StackExchange.Redis/StackExchange/Redis/RedisLiterals.cs
+1
-1
RedisServer.cs
StackExchange.Redis/StackExchange/Redis/RedisServer.cs
+2
-2
No files found.
StackExchange.Redis.Tests/Sentinel.cs
View file @
7ec50486
...
...
@@ -73,6 +73,20 @@ public void SentinelMasterTest()
}
}
[
Fact
]
public
void
SentinelSentinelsTest
()
{
var
sentinels
=
Server
.
SentinelSentinels
(
"mymaster"
);
Assert
.
True
(
sentinels
[
0
].
ToDictionary
().
ContainsKey
(
"name"
));
foreach
(
var
config
in
sentinels
)
{
foreach
(
var
kvp
in
config
)
{
Output
.
WriteLine
(
"{0}:{1}"
,
kvp
.
Key
,
kvp
.
Value
);
}
}
}
[
Fact
]
public
void
SentinelMastersTest
()
{
...
...
StackExchange.Redis/StackExchange/Redis/Interfaces/IServer.cs
View file @
7ec50486
...
...
@@ -646,24 +646,21 @@ public partial interface IServer : IRedis
/// <remarks>https://redis.io/topics/sentinel</remarks>
Task
SentinelFailoverAsync
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
);
/// <summary>
/// show a list of sentinels info about a redis master
/// </summary>
/// <param name="serviceName">The sentinel service name.</param>
/// <param name="flags">The command flags to use.</param>
/// <returns>an array of sentinel info KeyValuePair arrays</returns>
/// <remarks>https://redis.io/topics/sentinel</remarks>
KeyValuePair
<
string
,
string
>[][]
SentinelSentinels
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
);
/// <summary>
/// show a list of sentinels info about a redis master
/// </summary>
/// <param name="serviceName">The sentinel service name.</param>
/// <param name="flags">The command flags to use.</param>
/// <returns>an array of sentinel info KeyValuePair arrays</returns>
/// <remarks>https://redis.io/topics/sentinel</remarks>
Task
<
KeyValuePair
<
string
,
string
>[][
]>
SentinelSentinelsAsync
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
);
/// <summary>
/// Show a list of sentinels for a master, and their state.
/// </summary>
/// <param name="serviceName">The sentinel service name.</param>
/// <param name="flags">The command flags to use.</param>
/// <remarks>https://redis.io/topics/sentinel</remarks>
KeyValuePair
<
string
,
string
>[][]
SentinelSentinels
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
);
/// <summary>
/// Show a list of sentinels for a master, and their state.
/// </summary>
/// <param name="serviceName">The sentinel service name.</param>
/// <param name="flags">The command flags to use.</param>
/// <remarks>https://redis.io/topics/sentinel</remarks>
Task
<
KeyValuePair
<
string
,
string
>[][
]>
SentinelSentinelsAsync
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
);
#
endregion
}
...
...
StackExchange.Redis/StackExchange/Redis/RedisLiterals.cs
View file @
7ec50486
...
...
@@ -66,7 +66,7 @@ public static readonly RedisValue
GETMASTERADDRBYNAME
=
"GET-MASTER-ADDR-BY-NAME"
,
// RESET = "RESET",
FAILOVER
=
"FAILOVER"
,
S
entinels
=
"Sentinels
"
,
S
ENTINELS
=
"SENTINELS
"
,
// Sentinel Literals as of 2.8.4
MONITOR
=
"MONITOR"
,
...
...
StackExchange.Redis/StackExchange/Redis/RedisServer.cs
View file @
7ec50486
...
...
@@ -816,13 +816,13 @@ public Task SentinelFailoverAsync(string serviceName, CommandFlags flags = Comma
public
KeyValuePair
<
string
,
string
>[][]
SentinelSentinels
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
var
msg
=
Message
.
Create
(-
1
,
flags
,
RedisCommand
.
SENTINEL
,
RedisLiterals
.
S
entinels
,
(
RedisValue
)
serviceName
);
var
msg
=
Message
.
Create
(-
1
,
flags
,
RedisCommand
.
SENTINEL
,
RedisLiterals
.
S
ENTINELS
,
(
RedisValue
)
serviceName
);
return
ExecuteSync
(
msg
,
ResultProcessor
.
SentinelArrayOfArrays
);
}
public
Task
<
KeyValuePair
<
string
,
string
>[][
]>
SentinelSentinelsAsync
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
var
msg
=
Message
.
Create
(-
1
,
flags
,
RedisCommand
.
SENTINEL
,
RedisLiterals
.
S
entinels
,
(
RedisValue
)
serviceName
);
var
msg
=
Message
.
Create
(-
1
,
flags
,
RedisCommand
.
SENTINEL
,
RedisLiterals
.
S
ENTINELS
,
(
RedisValue
)
serviceName
);
return
ExecuteAsync
(
msg
,
ResultProcessor
.
SentinelArrayOfArrays
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment