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
17a6ced7
Commit
17a6ced7
authored
Mar 11, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup analyzer warnings, exceptions, and param mismatches
parent
9180b523
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
178 additions
and
179 deletions
+178
-179
Config.cs
StackExchange.Redis.Tests/Config.cs
+2
-1
ClusterConfiguration.cs
...xchange.Redis/StackExchange/Redis/ClusterConfiguration.cs
+5
-5
DebuggingAids.cs
StackExchange.Redis/StackExchange/Redis/DebuggingAids.cs
+2
-2
Exceptions.cs
StackExchange.Redis/StackExchange/Redis/Exceptions.cs
+135
-0
GeoEntry.cs
StackExchange.Redis/StackExchange/Redis/GeoEntry.cs
+4
-4
HashEntry.cs
StackExchange.Redis/StackExchange/Redis/HashEntry.cs
+2
-2
DatabaseWrapper.cs
.../StackExchange/Redis/KeyspaceIsolation/DatabaseWrapper.cs
+6
-6
Message.cs
StackExchange.Redis/StackExchange/Redis/Message.cs
+0
-137
PhysicalConnection.cs
...kExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
+2
-2
RedisDatabase.cs
StackExchange.Redis/StackExchange/Redis/RedisDatabase.cs
+6
-6
RedisServer.cs
StackExchange.Redis/StackExchange/Redis/RedisServer.cs
+6
-6
ScriptParameterMapper.cs
...change.Redis/StackExchange/Redis/ScriptParameterMapper.cs
+1
-1
SortedSetEntry.cs
StackExchange.Redis/StackExchange/Redis/SortedSetEntry.cs
+6
-6
StringSplits.cs
StackExchange.Redis/StackExchange/Redis/StringSplits.cs
+1
-1
No files found.
StackExchange.Redis.Tests/Config.cs
View file @
17a6ced7
...
...
@@ -254,7 +254,8 @@ public void GetInfo()
var
info2
=
server
.
Info
(
"cpu"
);
Assert
.
Single
(
info2
);
var
cpu
=
info2
.
Single
();
Assert
.
True
(
cpu
.
Count
()
>
2
);
var
cpuCount
=
cpu
.
Count
();
Assert
.
True
(
cpuCount
>
2
);
Assert
.
Equal
(
"CPU"
,
cpu
.
Key
);
Assert
.
Contains
(
cpu
,
x
=>
x
.
Key
==
"used_cpu_sys"
);
Assert
.
Contains
(
cpu
,
x
=>
x
.
Key
==
"used_cpu_user"
);
...
...
StackExchange.Redis/StackExchange/Redis/ClusterConfiguration.cs
View file @
17a6ced7
...
...
@@ -112,9 +112,9 @@ public override bool Equals(object obj)
/// <summary>
/// Indicates whether two ranges are equal
/// </summary>
public
bool
Equals
(
SlotRange
range
)
public
bool
Equals
(
SlotRange
other
)
{
return
range
.
from
==
this
.
from
&&
range
.
to
==
this
.
to
;
return
other
.
from
==
this
.
from
&&
other
.
to
==
this
.
to
;
}
/// <summary>
...
...
@@ -456,11 +456,11 @@ public override bool Equals(object obj)
/// <summary>
/// Indicates whether two ClusterNode instances are equivalent
/// </summary>
public
bool
Equals
(
ClusterNode
node
)
public
bool
Equals
(
ClusterNode
other
)
{
if
(
node
==
null
)
return
false
;
if
(
other
==
null
)
return
false
;
return
this
.
ToString
()
==
node
.
ToString
();
// lazy, but effective - plus only computes once
return
this
.
ToString
()
==
other
.
ToString
();
// lazy, but effective - plus only computes once
}
/// <summary>
...
...
StackExchange.Redis/StackExchange/Redis/DebuggingAids.cs
View file @
17a6ced7
...
...
@@ -285,8 +285,8 @@ public enum CompletionType
/// </summary>
Async
=
2
}
#if FEATURE_PERFCOUNTER
#if FEATURE_PERFCOUNTER
internal
static
class
PerfCounterHelper
{
private
static
readonly
object
staticLock
=
new
object
();
...
...
@@ -334,7 +334,7 @@ public static bool TryGetSystemCPU(out float value)
}
#endif
#if FEATURE_THREADPOOL
internal
class
CompletionTypeHelper
internal
static
class
CompletionTypeHelper
{
public
static
void
RunWithCompletionType
(
Func
<
AsyncCallback
,
IAsyncResult
>
beginAsync
,
AsyncCallback
callback
,
CompletionType
completionType
)
{
...
...
StackExchange.Redis/StackExchange/Redis/Exceptions.cs
0 → 100644
View file @
17a6ced7
using
System
;
#if FEATURE_SERIALIZATION
using
System.Runtime.Serialization
;
#endif
#pragma warning disable RCS1194 // Implement exception constructors.
namespace
StackExchange.Redis
{
#if FEATURE_SERIALIZATION
[
Serializable
]
public
sealed
partial
class
RedisCommandException
:
Exception
{
private
RedisCommandException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
}
}
[
Serializable
]
public
sealed
partial
class
RedisTimeoutException
:
TimeoutException
{
private
RedisTimeoutException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
Commandstatus
=
(
CommandStatus
)
info
.
GetValue
(
"commandStatus"
,
typeof
(
CommandStatus
));
}
/// <summary>
/// Serialization implementation; not intended for general usage
/// </summary>
public
override
void
GetObjectData
(
SerializationInfo
info
,
StreamingContext
context
)
{
base
.
GetObjectData
(
info
,
context
);
info
.
AddValue
(
"commandStatus"
,
Commandstatus
);
}
}
[
Serializable
]
public
sealed
partial
class
RedisConnectionException
:
RedisException
{
private
RedisConnectionException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
FailureType
=
(
ConnectionFailureType
)
info
.
GetInt32
(
"failureType"
);
CommandStatus
=
(
CommandStatus
)
info
.
GetValue
(
"commandStatus"
,
typeof
(
CommandStatus
));
}
/// <summary>
/// Serialization implementation; not intended for general usage
/// </summary>
public
override
void
GetObjectData
(
SerializationInfo
info
,
StreamingContext
context
)
{
base
.
GetObjectData
(
info
,
context
);
info
.
AddValue
(
"failureType"
,
(
int
)
FailureType
);
info
.
AddValue
(
"commandStatus"
,
CommandStatus
);
}
}
[
Serializable
]
public
partial
class
RedisException
:
Exception
{
/// <summary>
/// Deserialization constructor; not intended for general usage
/// </summary>
protected
RedisException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
}
}
[
Serializable
]
public
sealed
partial
class
RedisServerException
:
RedisException
{
private
RedisServerException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
}
}
#endif
/// <summary>
/// Indicates that a command was illegal and was not sent to the server
/// </summary>
public
sealed
partial
class
RedisCommandException
:
Exception
{
internal
RedisCommandException
(
string
message
)
:
base
(
message
)
{
}
internal
RedisCommandException
(
string
message
,
Exception
innerException
)
:
base
(
message
,
innerException
)
{
}
}
/// <summary>
/// Indicates the time allotted for a command or operation has expired.
/// </summary>
public
sealed
partial
class
RedisTimeoutException
:
TimeoutException
{
internal
RedisTimeoutException
(
string
message
,
CommandStatus
commandStatus
)
:
base
(
message
)
{
Commandstatus
=
commandStatus
;
}
/// <summary>
/// status of the command while communicating with Redis
/// </summary>
public
CommandStatus
Commandstatus
{
get
;
}
}
/// <summary>
/// Indicates a connection fault when communicating with redis
/// </summary>
public
sealed
partial
class
RedisConnectionException
:
RedisException
{
internal
RedisConnectionException
(
ConnectionFailureType
failureType
,
string
message
)
:
this
(
failureType
,
message
,
null
,
CommandStatus
.
Unknown
)
{}
internal
RedisConnectionException
(
ConnectionFailureType
failureType
,
string
message
,
Exception
innerException
)
:
this
(
failureType
,
message
,
innerException
,
CommandStatus
.
Unknown
)
{}
internal
RedisConnectionException
(
ConnectionFailureType
failureType
,
string
message
,
Exception
innerException
,
CommandStatus
commandStatus
)
:
base
(
message
,
innerException
)
{
FailureType
=
failureType
;
CommandStatus
=
commandStatus
;
}
/// <summary>
/// The type of connection failure
/// </summary>
public
ConnectionFailureType
FailureType
{
get
;
}
/// <summary>
/// status of the command while communicating with Redis
/// </summary>
public
CommandStatus
CommandStatus
{
get
;
}
}
/// <summary>
/// Indicates an issue communicating with redis
/// </summary>
public
partial
class
RedisException
:
Exception
{
internal
RedisException
(
string
message
)
:
base
(
message
)
{
}
internal
RedisException
(
string
message
,
Exception
innerException
)
:
base
(
message
,
innerException
)
{
}
}
/// <summary>
/// Indicates an exception raised by a redis server
/// </summary>
public
sealed
partial
class
RedisServerException
:
RedisException
{
internal
RedisServerException
(
string
message
)
:
base
(
message
)
{
}
}
}
StackExchange.Redis/StackExchange/Redis/GeoEntry.cs
View file @
17a6ced7
...
...
@@ -139,9 +139,9 @@ public override bool Equals(object obj)
/// <summary>
/// Compares two values for equality
/// </summary>
public
bool
Equals
(
GeoPosition
value
)
public
bool
Equals
(
GeoPosition
other
)
{
return
this
==
value
;
return
this
==
other
;
}
/// <summary>
/// Compares two values for equality
...
...
@@ -220,9 +220,9 @@ public override bool Equals(object obj)
/// <summary>
/// Compares two values for equality
/// </summary>
public
bool
Equals
(
GeoEntry
value
)
public
bool
Equals
(
GeoEntry
other
)
{
return
this
==
value
;
return
this
==
other
;
}
/// <summary>
/// Compares two values for equality
...
...
StackExchange.Redis/StackExchange/Redis/HashEntry.cs
View file @
17a6ced7
...
...
@@ -76,9 +76,9 @@ public override bool Equals(object obj)
/// <summary>
/// Compares two values for equality
/// </summary>
public
bool
Equals
(
HashEntry
value
)
public
bool
Equals
(
HashEntry
other
)
{
return
name
==
value
.
name
&&
this
.
value
==
value
.
value
;
return
name
==
other
.
name
&&
this
.
value
==
other
.
value
;
}
/// <summary>
/// Compares two values for equality
...
...
StackExchange.Redis/StackExchange/Redis/KeyspaceIsolation/DatabaseWrapper.cs
View file @
17a6ced7
...
...
@@ -32,13 +32,13 @@ public bool GeoAdd(RedisKey key, double longitude, double latitude, RedisValue m
return
Inner
.
GeoAdd
(
ToInner
(
key
),
longitude
,
latitude
,
member
,
flags
);
}
public
long
GeoAdd
(
RedisKey
key
,
GeoEntry
[]
geoEntri
es
,
CommandFlags
flags
=
CommandFlags
.
None
)
public
long
GeoAdd
(
RedisKey
key
,
GeoEntry
[]
valu
es
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
GeoAdd
(
ToInner
(
key
),
geoEntri
es
,
flags
);
return
Inner
.
GeoAdd
(
ToInner
(
key
),
valu
es
,
flags
);
}
public
bool
GeoAdd
(
RedisKey
key
,
GeoEntry
geoEntry
,
CommandFlags
flags
=
CommandFlags
.
None
)
public
bool
GeoAdd
(
RedisKey
key
,
GeoEntry
value
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
GeoAdd
(
ToInner
(
key
),
geoEntry
,
flags
);
return
Inner
.
GeoAdd
(
ToInner
(
key
),
value
,
flags
);
}
public
bool
GeoRemove
(
RedisKey
key
,
RedisValue
member
,
CommandFlags
flags
=
CommandFlags
.
None
)
...
...
@@ -46,9 +46,9 @@ public bool GeoRemove(RedisKey key, RedisValue member, CommandFlags flags = Comm
return
Inner
.
GeoRemove
(
ToInner
(
key
),
member
,
flags
);
}
public
double
?
GeoDistance
(
RedisKey
key
,
RedisValue
value0
,
RedisValue
value1
,
GeoUnit
unit
=
GeoUnit
.
Meters
,
CommandFlags
flags
=
CommandFlags
.
None
)
public
double
?
GeoDistance
(
RedisKey
key
,
RedisValue
member1
,
RedisValue
member2
,
GeoUnit
unit
=
GeoUnit
.
Meters
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
GeoDistance
(
ToInner
(
key
),
value0
,
value1
,
unit
,
flags
);
return
Inner
.
GeoDistance
(
ToInner
(
key
),
member1
,
member2
,
unit
,
flags
);
}
public
string
[]
GeoHash
(
RedisKey
key
,
RedisValue
[]
members
,
CommandFlags
flags
=
CommandFlags
.
None
)
...
...
StackExchange.Redis/StackExchange/Redis/Message.cs
View file @
17a6ced7
...
...
@@ -2,149 +2,12 @@
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
#if FEATURE_SERIALIZATION
using
System.Runtime.Serialization
;
#endif
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
StackExchange.Redis
{
/// <summary>
/// Indicates that a command was illegal and was not sent to the server
/// </summary>
#if FEATURE_SERIALIZATION
[
Serializable
]
#endif
public
sealed
class
RedisCommandException
:
Exception
{
#if FEATURE_SERIALIZATION
private
RedisCommandException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
}
#endif
internal
RedisCommandException
(
string
message
)
:
base
(
message
)
{
}
internal
RedisCommandException
(
string
message
,
Exception
innerException
)
:
base
(
message
,
innerException
)
{
}
}
/// <summary>
/// Indicates the time allotted for a command or operation has expired.
/// </summary>
#if FEATURE_SERIALIZATION
[
Serializable
]
#endif
public
sealed
class
RedisTimeoutException
:
TimeoutException
{
#if FEATURE_SERIALIZATION
private
RedisTimeoutException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
Commandstatus
=
(
CommandStatus
)
info
.
GetValue
(
"commandStatus"
,
typeof
(
CommandStatus
));
}
/// <summary>
/// Serialization implementation; not intended for general usage
/// </summary>
public
override
void
GetObjectData
(
SerializationInfo
info
,
StreamingContext
context
)
{
base
.
GetObjectData
(
info
,
context
);
info
.
AddValue
(
"commandStatus"
,
Commandstatus
);
}
#endif
internal
RedisTimeoutException
(
string
message
,
CommandStatus
commandStatus
)
:
base
(
message
)
{
Commandstatus
=
commandStatus
;
}
/// <summary>
/// status of the command while communicating with Redis
/// </summary>
public
CommandStatus
Commandstatus
{
get
;
}
}
/// <summary>
/// Indicates a connection fault when communicating with redis
/// </summary>
#if FEATURE_SERIALIZATION
[
Serializable
]
#endif
public
sealed
class
RedisConnectionException
:
RedisException
{
#if FEATURE_SERIALIZATION
private
RedisConnectionException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
FailureType
=
(
ConnectionFailureType
)
info
.
GetInt32
(
"failureType"
);
CommandStatus
=
(
CommandStatus
)
info
.
GetValue
(
"commandStatus"
,
typeof
(
CommandStatus
));
}
/// <summary>
/// Serialization implementation; not intended for general usage
/// </summary>
public
override
void
GetObjectData
(
SerializationInfo
info
,
StreamingContext
context
)
{
base
.
GetObjectData
(
info
,
context
);
info
.
AddValue
(
"failureType"
,
(
int
)
FailureType
);
info
.
AddValue
(
"commandStatus"
,
CommandStatus
);
}
#endif
internal
RedisConnectionException
(
ConnectionFailureType
failureType
,
string
message
)
:
this
(
failureType
,
message
,
null
,
CommandStatus
.
Unknown
)
{
}
internal
RedisConnectionException
(
ConnectionFailureType
failureType
,
string
message
,
Exception
innerException
)
:
this
(
failureType
,
message
,
innerException
,
CommandStatus
.
Unknown
)
{
}
internal
RedisConnectionException
(
ConnectionFailureType
failureType
,
string
message
,
Exception
innerException
,
CommandStatus
commandStatus
)
:
base
(
message
,
innerException
)
{
FailureType
=
failureType
;
CommandStatus
=
commandStatus
;
}
/// <summary>
/// The type of connection failure
/// </summary>
public
ConnectionFailureType
FailureType
{
get
;
}
/// <summary>
/// status of the command while communicating with Redis
/// </summary>
public
CommandStatus
CommandStatus
{
get
;
}
}
/// <summary>
/// Indicates an issue communicating with redis
/// </summary>
#if FEATURE_SERIALIZATION
[
Serializable
]
#endif
public
class
RedisException
:
Exception
{
/// <summary>
/// Deserialization constructor; not intended for general usage
/// </summary>
#if FEATURE_SERIALIZATION
protected
RedisException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
}
#endif
internal
RedisException
(
string
message
)
:
base
(
message
)
{
}
internal
RedisException
(
string
message
,
Exception
innerException
)
:
base
(
message
,
innerException
)
{
}
}
/// <summary>
/// Indicates an exception raised by a redis server
/// </summary>
#if FEATURE_SERIALIZATION
[
Serializable
]
#endif
public
sealed
class
RedisServerException
:
RedisException
{
#if FEATURE_SERIALIZATION
private
RedisServerException
(
SerializationInfo
info
,
StreamingContext
ctx
)
:
base
(
info
,
ctx
)
{
}
#endif
internal
RedisServerException
(
string
message
)
:
base
(
message
)
{
}
}
sealed
class
LoggingMessage
:
Message
{
public
readonly
TextWriter
log
;
...
...
StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
View file @
17a6ced7
...
...
@@ -1151,7 +1151,7 @@ RawResult TryParseResult(byte[] buffer, ref int offset, ref int count)
partial
void
DebugEmulateStaleConnection
(
ref
int
firstUnansweredWrite
);
public
void
CheckForStaleConnection
(
ref
SocketManager
.
ManagerState
managerS
tate
)
public
void
CheckForStaleConnection
(
ref
SocketManager
.
ManagerState
s
tate
)
{
int
firstUnansweredWrite
=
VolatileWrapper
.
Read
(
ref
firstUnansweredWriteTickCount
);
...
...
@@ -1161,7 +1161,7 @@ public void CheckForStaleConnection(ref SocketManager.ManagerState managerState)
if
(
firstUnansweredWrite
!=
0
&&
(
now
-
firstUnansweredWrite
)
>
this
.
Multiplexer
.
RawConfig
.
ResponseTimeout
)
{
this
.
RecordConnectionFailed
(
ConnectionFailureType
.
SocketFailure
,
ref
managerS
tate
,
origin
:
"CheckForStaleConnection"
);
this
.
RecordConnectionFailed
(
ConnectionFailureType
.
SocketFailure
,
ref
s
tate
,
origin
:
"CheckForStaleConnection"
);
}
}
}
...
...
StackExchange.Redis/StackExchange/Redis/RedisDatabase.cs
View file @
17a6ced7
...
...
@@ -93,9 +93,9 @@ public Task<bool> GeoRemoveAsync(RedisKey key, RedisValue member, CommandFlags f
return
SortedSetRemoveAsync
(
key
,
member
,
flags
);
}
public
double
?
GeoDistance
(
RedisKey
key
,
RedisValue
value0
,
RedisValue
value1
,
GeoUnit
unit
=
GeoUnit
.
Meters
,
CommandFlags
flags
=
CommandFlags
.
None
)
public
double
?
GeoDistance
(
RedisKey
key
,
RedisValue
member1
,
RedisValue
member2
,
GeoUnit
unit
=
GeoUnit
.
Meters
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
var
msg
=
Message
.
Create
(
Database
,
flags
,
RedisCommand
.
GEODIST
,
key
,
value0
,
value1
,
StackExchange
.
Redis
.
GeoPosition
.
GetRedisUnit
(
unit
));
var
msg
=
Message
.
Create
(
Database
,
flags
,
RedisCommand
.
GEODIST
,
key
,
member1
,
member2
,
StackExchange
.
Redis
.
GeoPosition
.
GetRedisUnit
(
unit
));
return
ExecuteSync
(
msg
,
ResultProcessor
.
NullableDouble
);
}
public
Task
<
double
?>
GeoDistanceAsync
(
RedisKey
key
,
RedisValue
value0
,
RedisValue
value1
,
GeoUnit
unit
=
GeoUnit
.
Meters
,
CommandFlags
flags
=
CommandFlags
.
None
)
...
...
@@ -1609,9 +1609,9 @@ public Task<long> StringBitOperationAsync(Bitwise operation, RedisKey destinatio
return
ExecuteAsync
(
msg
,
ResultProcessor
.
Int64
);
}
public
long
StringBitPosition
(
RedisKey
key
,
bool
value
,
long
start
=
0
,
long
end
=
-
1
,
CommandFlags
flags
=
CommandFlags
.
None
)
public
long
StringBitPosition
(
RedisKey
key
,
bool
bit
,
long
start
=
0
,
long
end
=
-
1
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
var
msg
=
Message
.
Create
(
Database
,
flags
,
RedisCommand
.
BITPOS
,
key
,
value
,
start
,
end
);
var
msg
=
Message
.
Create
(
Database
,
flags
,
RedisCommand
.
BITPOS
,
key
,
bit
,
start
,
end
);
return
ExecuteSync
(
msg
,
ResultProcessor
.
Int64
);
}
...
...
@@ -1783,9 +1783,9 @@ public Task<bool> StringSetAsync(KeyValuePair<RedisKey, RedisValue>[] values, Wh
return
ExecuteAsync
(
msg
,
ResultProcessor
.
Boolean
);
}
public
bool
StringSetBit
(
RedisKey
key
,
long
offset
,
bool
value
,
CommandFlags
flags
=
CommandFlags
.
None
)
public
bool
StringSetBit
(
RedisKey
key
,
long
offset
,
bool
bit
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
var
msg
=
Message
.
Create
(
Database
,
flags
,
RedisCommand
.
SETBIT
,
key
,
offset
,
value
);
var
msg
=
Message
.
Create
(
Database
,
flags
,
RedisCommand
.
SETBIT
,
key
,
offset
,
bit
);
return
ExecuteSync
(
msg
,
ResultProcessor
.
Boolean
);
}
...
...
StackExchange.Redis/StackExchange/Redis/RedisServer.cs
View file @
17a6ced7
...
...
@@ -577,14 +577,14 @@ internal override RedisFeatures GetFeatures(int db, RedisKey key, CommandFlags f
return
new
RedisFeatures
(
server
.
Version
);
}
public
void
SlaveOf
(
EndPoint
endpoint
,
CommandFlags
flags
=
CommandFlags
.
None
)
public
void
SlaveOf
(
EndPoint
master
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
if
(
endpoint
==
server
.
EndPoint
)
if
(
master
==
server
.
EndPoint
)
{
throw
new
ArgumentException
(
"Cannot slave to self"
);
}
// prepare the actual slaveof message (not sent yet)
var
slaveofMsg
=
CreateSlaveOfMessage
(
endpoint
,
flags
);
var
slaveofMsg
=
CreateSlaveOfMessage
(
master
,
flags
);
var
configuration
=
this
.
multiplexer
.
RawConfig
;
...
...
@@ -610,10 +610,10 @@ public void SlaveOf(EndPoint endpoint, CommandFlags flags = CommandFlags.None)
}
}
public
Task
SlaveOfAsync
(
EndPoint
endpoint
,
CommandFlags
flags
=
CommandFlags
.
None
)
public
Task
SlaveOfAsync
(
EndPoint
master
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
var
msg
=
CreateSlaveOfMessage
(
endpoint
,
flags
);
if
(
endpoint
==
server
.
EndPoint
)
var
msg
=
CreateSlaveOfMessage
(
master
,
flags
);
if
(
master
==
server
.
EndPoint
)
{
throw
new
ArgumentException
(
"Cannot slave to self"
);
}
...
...
StackExchange.Redis/StackExchange/Redis/ScriptParameterMapper.cs
View file @
17a6ced7
...
...
@@ -8,7 +8,7 @@
namespace
StackExchange.Redis
{
class
ScriptParameterMapper
internal
static
class
ScriptParameterMapper
{
public
struct
ScriptParameters
{
...
...
StackExchange.Redis/StackExchange/Redis/SortedSetEntry.cs
View file @
17a6ced7
...
...
@@ -88,25 +88,25 @@ public override bool Equals(object obj)
/// <summary>
/// Compares two values for equality
/// </summary>
public
bool
Equals
(
SortedSetEntry
value
)
public
bool
Equals
(
SortedSetEntry
other
)
{
return
score
==
value
.
score
&&
element
==
value
.
element
;
return
score
==
other
.
score
&&
element
==
other
.
element
;
}
/// <summary>
/// Compares two values by score
/// </summary>
public
int
CompareTo
(
SortedSetEntry
value
)
public
int
CompareTo
(
SortedSetEntry
other
)
{
return
score
.
CompareTo
(
value
.
score
);
return
score
.
CompareTo
(
other
.
score
);
}
/// <summary>
/// Compares two values by score
/// </summary>
public
int
CompareTo
(
object
value
)
public
int
CompareTo
(
object
obj
)
{
return
value
is
SortedSetEntry
?
CompareTo
((
SortedSetEntry
)
value
)
:
-
1
;
return
obj
is
SortedSetEntry
?
CompareTo
((
SortedSetEntry
)
obj
)
:
-
1
;
}
/// <summary>
...
...
StackExchange.Redis/StackExchange/Redis/StringSplits.cs
View file @
17a6ced7
namespace
StackExchange.Redis
{
class
StringSplits
internal
static
class
StringSplits
{
public
static
readonly
char
[]
Space
=
{
' '
},
...
...
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