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
b56e707a
Commit
b56e707a
authored
Mar 23, 2020
by
mgravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix naming of SentinelGetSentinelAddressesAsync
parent
a01cd041
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
7 deletions
+22
-7
ConnectionMultiplexer.cs
src/StackExchange.Redis/ConnectionMultiplexer.cs
+1
-1
IServer.cs
src/StackExchange.Redis/Interfaces/IServer.cs
+10
-1
RedisServer.cs
src/StackExchange.Redis/RedisServer.cs
+8
-2
Sentinel.cs
tests/StackExchange.Redis.Tests/Sentinel.cs
+3
-3
No files found.
src/StackExchange.Redis/ConnectionMultiplexer.cs
View file @
b56e707a
...
@@ -2423,7 +2423,7 @@ internal void UpdateSentinelAddressList(string serviceName, int timeoutmillis =
...
@@ -2423,7 +2423,7 @@ internal void UpdateSentinelAddressList(string serviceName, int timeoutmillis =
{
{
Task
<
EndPoint
[
]>
[]
sentinels
=
GetServerSnapshot
().
ToArray
()
Task
<
EndPoint
[
]>
[]
sentinels
=
GetServerSnapshot
().
ToArray
()
.
Where
(
s
=>
s
.
ServerType
==
ServerType
.
Sentinel
)
.
Where
(
s
=>
s
.
ServerType
==
ServerType
.
Sentinel
)
.
Select
(
s
=>
GetServer
(
s
.
EndPoint
).
SentinelGetSentinelAddresses
(
serviceName
))
.
Select
(
s
=>
GetServer
(
s
.
EndPoint
).
SentinelGetSentinelAddresses
Async
(
serviceName
))
.
ToArray
();
.
ToArray
();
Task
<
Task
<
EndPoint
[
]>
>
firstCompleteRequest
=
WaitFirstNonNullIgnoreErrorsAsync
(
sentinels
);
Task
<
Task
<
EndPoint
[
]>
>
firstCompleteRequest
=
WaitFirstNonNullIgnoreErrorsAsync
(
sentinels
);
...
...
src/StackExchange.Redis/Interfaces/IServer.cs
View file @
b56e707a
...
@@ -759,7 +759,16 @@ public partial interface IServer : IRedis
...
@@ -759,7 +759,16 @@ public partial interface IServer : IRedis
/// <param name="serviveName">the sentinel service name</param>
/// <param name="serviveName">the sentinel service name</param>
/// <param name="flags"></param>
/// <param name="flags"></param>
/// <returns>a list of the sentinel ips and ports</returns>
/// <returns>a list of the sentinel ips and ports</returns>
Task
<
EndPoint
[
]>
SentinelGetSentinelAddresses
(
string
serviveName
,
CommandFlags
flags
=
CommandFlags
.
None
);
EndPoint
[]
SentinelGetSentinelAddresses
(
string
serviveName
,
CommandFlags
flags
=
CommandFlags
.
None
);
/// <summary>
/// Returns the ip and port numbers of all known Sentinels
/// for the given service name.
/// </summary>
/// <param name="serviveName">the sentinel service name</param>
/// <param name="flags"></param>
/// <returns>a list of the sentinel ips and ports</returns>
Task
<
EndPoint
[
]>
SentinelGetSentinelAddressesAsync
(
string
serviveName
,
CommandFlags
flags
=
CommandFlags
.
None
);
/// <summary>
/// <summary>
/// Show the state and info of the specified master.
/// Show the state and info of the specified master.
...
...
src/StackExchange.Redis/RedisServer.cs
View file @
b56e707a
...
@@ -807,7 +807,13 @@ public Task<EndPoint> SentinelGetMasterAddressByNameAsync(string serviceName, Co
...
@@ -807,7 +807,13 @@ public Task<EndPoint> SentinelGetMasterAddressByNameAsync(string serviceName, Co
return
ExecuteAsync
(
msg
,
ResultProcessor
.
SentinelMasterEndpoint
);
return
ExecuteAsync
(
msg
,
ResultProcessor
.
SentinelMasterEndpoint
);
}
}
public
Task
<
EndPoint
[
]>
SentinelGetSentinelAddresses
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
)
public
EndPoint
[]
SentinelGetSentinelAddresses
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
var
msg
=
Message
.
Create
(-
1
,
flags
,
RedisCommand
.
SENTINEL
,
RedisLiterals
.
SENTINELS
,
(
RedisValue
)
serviceName
);
return
ExecuteSync
(
msg
,
ResultProcessor
.
SentinelAddressesEndPoints
);
}
public
Task
<
EndPoint
[
]>
SentinelGetSentinelAddressesAsync
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
{
var
msg
=
Message
.
Create
(-
1
,
flags
,
RedisCommand
.
SENTINEL
,
RedisLiterals
.
SENTINELS
,
(
RedisValue
)
serviceName
);
var
msg
=
Message
.
Create
(-
1
,
flags
,
RedisCommand
.
SENTINEL
,
RedisLiterals
.
SENTINELS
,
(
RedisValue
)
serviceName
);
return
ExecuteAsync
(
msg
,
ResultProcessor
.
SentinelAddressesEndPoints
);
return
ExecuteAsync
(
msg
,
ResultProcessor
.
SentinelAddressesEndPoints
);
...
...
tests/StackExchange.Redis.Tests/Sentinel.cs
View file @
b56e707a
...
@@ -562,15 +562,15 @@ public async Task GetSentinelMasterConnectionWriteReadFailover()
...
@@ -562,15 +562,15 @@ public async Task GetSentinelMasterConnectionWriteReadFailover()
[
Fact
]
[
Fact
]
public
async
Task
SentinelGetSentinelAddressesTest
()
public
async
Task
SentinelGetSentinelAddressesTest
()
{
{
var
addresses
=
await
SentinelServerA
.
SentinelGetSentinelAddresses
(
ServiceName
).
ForAwait
();
var
addresses
=
await
SentinelServerA
.
SentinelGetSentinelAddresses
Async
(
ServiceName
).
ForAwait
();
Assert
.
Contains
(
SentinelServerB
.
EndPoint
,
addresses
);
Assert
.
Contains
(
SentinelServerB
.
EndPoint
,
addresses
);
Assert
.
Contains
(
SentinelServerC
.
EndPoint
,
addresses
);
Assert
.
Contains
(
SentinelServerC
.
EndPoint
,
addresses
);
addresses
=
await
SentinelServerB
.
SentinelGetSentinelAddresses
(
ServiceName
).
ForAwait
();
addresses
=
await
SentinelServerB
.
SentinelGetSentinelAddresses
Async
(
ServiceName
).
ForAwait
();
Assert
.
Contains
(
SentinelServerA
.
EndPoint
,
addresses
);
Assert
.
Contains
(
SentinelServerA
.
EndPoint
,
addresses
);
Assert
.
Contains
(
SentinelServerC
.
EndPoint
,
addresses
);
Assert
.
Contains
(
SentinelServerC
.
EndPoint
,
addresses
);
addresses
=
await
SentinelServerC
.
SentinelGetSentinelAddresses
(
ServiceName
).
ForAwait
();
addresses
=
await
SentinelServerC
.
SentinelGetSentinelAddresses
Async
(
ServiceName
).
ForAwait
();
Assert
.
Contains
(
SentinelServerA
.
EndPoint
,
addresses
);
Assert
.
Contains
(
SentinelServerA
.
EndPoint
,
addresses
);
Assert
.
Contains
(
SentinelServerB
.
EndPoint
,
addresses
);
Assert
.
Contains
(
SentinelServerB
.
EndPoint
,
addresses
);
}
}
...
...
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