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
20fa2587
Commit
20fa2587
authored
Apr 04, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
line endings oddity
parent
633a91bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
ServerSelectionStrategy.cs
...ange.Redis/StackExchange/Redis/ServerSelectionStrategy.cs
+10
-10
No files found.
StackExchange.Redis/StackExchange/Redis/ServerSelectionStrategy.cs
View file @
20fa2587
...
...
@@ -54,12 +54,12 @@ public ServerSelectionStrategy(ConnectionMultiplexer multiplexer)
this
.
multiplexer
=
multiplexer
;
}
public
ServerType
ServerType
{
get
;
set
;
}
=
ServerType
.
Standalone
;
internal
int
TotalSlots
=>
RedisClusterSlotCount
;
public
ServerType
ServerType
{
get
;
set
;
}
=
ServerType
.
Standalone
;
internal
int
TotalSlots
=>
RedisClusterSlotCount
;
/// <summary>
/// Computes the hash-slot that would be used by the given key
/// </summary>
/// </summary>
/// <param name="key">The <see cref="RedisKey"/> to determine a slot ID for.</param>
public
unsafe
int
HashSlot
(
RedisKey
key
)
{
...
...
@@ -131,13 +131,13 @@ public bool TryResend(int hashSlot, Message message, EndPoint endpoint, bool isM
var
command
=
message
.
Command
;
switch
(
Message
.
GetMasterSlaveFlags
(
message
.
Flags
))
{
case
CommandFlags
.
DemandMaster
:
case
CommandFlags
.
DemandMaster
:
resendVia
=
server
.
IsSelectable
(
command
)
?
server
:
null
;
break
;
case
CommandFlags
.
PreferMaster
:
case
CommandFlags
.
PreferMaster
:
resendVia
=
server
.
IsSelectable
(
command
)
?
server
:
FindSlave
(
server
,
command
);
break
;
case
CommandFlags
.
PreferSlave
:
case
CommandFlags
.
PreferSlave
:
resendVia
=
FindSlave
(
server
,
command
)
??
(
server
.
IsSelectable
(
command
)
?
server
:
null
);
break
;
case
CommandFlags
.
DemandSlave
:
...
...
@@ -149,7 +149,7 @@ public bool TryResend(int hashSlot, Message message, EndPoint endpoint, bool isM
multiplexer
.
Trace
(
"Unable to resend to "
+
endpoint
);
}
else
{
{
message
.
PrepareToResend
(
resendVia
,
isMoved
);
retry
=
resendVia
.
TryEnqueue
(
message
);
}
...
...
@@ -182,7 +182,7 @@ internal int CombineSlot(int oldSlot, int newSlot)
if
(
oldSlot
==
NoSlot
)
return
newSlot
;
return
oldSlot
==
newSlot
?
oldSlot
:
MultipleSlots
;
}
internal
int
CombineSlot
(
int
oldSlot
,
RedisKey
key
)
{
if
(
oldSlot
==
MultipleSlots
||
key
.
IsNull
)
return
oldSlot
;
...
...
@@ -191,7 +191,7 @@ internal int CombineSlot(int oldSlot, RedisKey key)
if
(
oldSlot
==
NoSlot
)
return
newSlot
;
return
oldSlot
==
newSlot
?
oldSlot
:
MultipleSlots
;
}
internal
int
CountCoveredSlots
()
{
var
arr
=
map
;
...
...
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