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
b18dce52
Commit
b18dce52
authored
Aug 10, 2018
by
liuqiyun
Committed by
Nick Craver
Aug 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a command sentinels (#899)
* 新加scan,sentinels命令 * add command sentinels
parent
8cc645dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
6 deletions
+40
-6
IServer.cs
...kExchange.Redis/StackExchange/Redis/Interfaces/IServer.cs
+22
-3
RedisLiterals.cs
StackExchange.Redis/StackExchange/Redis/RedisLiterals.cs
+3
-2
RedisServer.cs
StackExchange.Redis/StackExchange/Redis/RedisServer.cs
+15
-1
No files found.
StackExchange.Redis/StackExchange/Redis/Interfaces/IServer.cs
View file @
b18dce52
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
...
...
@@ -646,6 +646,25 @@ 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
);
#
endregion
}
}
StackExchange.Redis/StackExchange/Redis/RedisLiterals.cs
View file @
b18dce52
using
System
;
using
System
;
using
System.Text
;
namespace
StackExchange.Redis
...
...
@@ -66,6 +66,7 @@ public static readonly RedisValue
GETMASTERADDRBYNAME
=
"GET-MASTER-ADDR-BY-NAME"
,
// RESET = "RESET",
FAILOVER
=
"FAILOVER"
,
Sentinels
=
"Sentinels"
,
// Sentinel Literals as of 2.8.4
MONITOR
=
"MONITOR"
,
...
...
StackExchange.Redis/StackExchange/Redis/RedisServer.cs
View file @
b18dce52
...
...
@@ -302,6 +302,7 @@ public IEnumerable<RedisKey> Keys(int database = 0, RedisValue pattern = default
return
ExecuteSync
(
msg
,
ResultProcessor
.
RedisKeyArray
);
}
public
DateTime
LastSave
(
CommandFlags
flags
=
CommandFlags
.
None
)
{
var
msg
=
Message
.
Create
(-
1
,
flags
,
RedisCommand
.
LASTSAVE
);
...
...
@@ -812,6 +813,19 @@ public Task SentinelFailoverAsync(string serviceName, CommandFlags flags = Comma
return
ExecuteAsync
(
msg
,
ResultProcessor
.
SentinelArrayOfArrays
);
}
public
KeyValuePair
<
string
,
string
>[][]
SentinelSentinels
(
string
serviceName
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
var
msg
=
Message
.
Create
(-
1
,
flags
,
RedisCommand
.
SENTINEL
,
RedisLiterals
.
Sentinels
,
(
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
.
Sentinels
,
(
RedisValue
)
serviceName
);
return
ExecuteAsync
(
msg
,
ResultProcessor
.
SentinelArrayOfArrays
);
}
#
endregion
}
}
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