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
7382262a
Commit
7382262a
authored
Mar 12, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: KeyspaceIsolation
parent
67d53bd8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
DatabaseWrapper.cs
.../StackExchange/Redis/KeyspaceIsolation/DatabaseWrapper.cs
+9
-3
WrapperBase.cs
...edis/StackExchange/Redis/KeyspaceIsolation/WrapperBase.cs
+8
-4
No files found.
StackExchange.Redis/StackExchange/Redis/KeyspaceIsolation/DatabaseWrapper.cs
View file @
7382262a
...
...
@@ -36,6 +36,7 @@ public long GeoAdd(RedisKey key, GeoEntry[] values, CommandFlags flags = Command
{
return
Inner
.
GeoAdd
(
ToInner
(
key
),
values
,
flags
);
}
public
bool
GeoAdd
(
RedisKey
key
,
GeoEntry
value
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
GeoAdd
(
ToInner
(
key
),
value
,
flags
);
...
...
@@ -75,6 +76,7 @@ public GeoRadiusResult[] GeoRadius(RedisKey key, RedisValue member, double radiu
{
return
Inner
.
GeoRadius
(
ToInner
(
key
),
member
,
radius
,
unit
,
count
,
order
,
options
,
flags
);
}
public
GeoRadiusResult
[]
GeoRadius
(
RedisKey
key
,
double
longitude
,
double
latitude
,
double
radius
,
GeoUnit
unit
=
GeoUnit
.
Meters
,
int
count
=
-
1
,
Order
?
order
=
null
,
GeoRadiusOptions
options
=
GeoRadiusOptions
.
Default
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
GeoRadius
(
ToInner
(
key
),
longitude
,
latitude
,
radius
,
unit
,
count
,
order
,
options
,
flags
);
...
...
@@ -474,10 +476,12 @@ public RedisValue[] Sort(RedisKey key, long skip = 0, long take = -1, Order orde
{
return
Inner
.
Sort
(
ToInner
(
key
),
skip
,
take
,
order
,
sortType
,
SortByToInner
(
by
),
SortGetToInner
(
get
),
flags
);
}
public
long
SortedSetAdd
(
RedisKey
key
,
SortedSetEntry
[]
values
,
CommandFlags
flags
)
{
return
Inner
.
SortedSetAdd
(
ToInner
(
key
),
values
,
flags
);
}
public
long
SortedSetAdd
(
RedisKey
key
,
SortedSetEntry
[]
values
,
When
when
=
When
.
Always
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
SortedSetAdd
(
ToInner
(
key
),
values
,
when
,
flags
);
...
...
@@ -487,6 +491,7 @@ public bool SortedSetAdd(RedisKey key, RedisValue member, double score, CommandF
{
return
Inner
.
SortedSetAdd
(
ToInner
(
key
),
member
,
score
,
flags
);
}
public
bool
SortedSetAdd
(
RedisKey
key
,
RedisValue
member
,
double
score
,
When
when
=
When
.
Always
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
SortedSetAdd
(
ToInner
(
key
),
member
,
score
,
when
,
flags
);
...
...
@@ -687,11 +692,11 @@ public TimeSpan Ping(CommandFlags flags = CommandFlags.None)
return
Inner
.
Ping
(
flags
);
}
IEnumerable
<
HashEntry
>
IDatabase
.
HashScan
(
RedisKey
key
,
RedisValue
pattern
,
int
pageSize
,
CommandFlags
flags
)
{
return
HashScan
(
key
,
pattern
,
pageSize
,
RedisBase
.
CursorUtils
.
Origin
,
0
,
flags
);
}
public
IEnumerable
<
HashEntry
>
HashScan
(
RedisKey
key
,
RedisValue
pattern
=
default
(
RedisValue
),
int
pageSize
=
RedisBase
.
CursorUtils
.
DefaultPageSize
,
long
cursor
=
RedisBase
.
CursorUtils
.
Origin
,
int
pageOffset
=
0
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
HashScan
(
ToInner
(
key
),
pattern
,
pageSize
,
cursor
,
pageOffset
,
flags
);
...
...
@@ -701,6 +706,7 @@ IEnumerable<RedisValue> IDatabase.SetScan(RedisKey key, RedisValue pattern, int
{
return
SetScan
(
key
,
pattern
,
pageSize
,
RedisBase
.
CursorUtils
.
Origin
,
0
,
flags
);
}
public
IEnumerable
<
RedisValue
>
SetScan
(
RedisKey
key
,
RedisValue
pattern
=
default
(
RedisValue
),
int
pageSize
=
RedisBase
.
CursorUtils
.
DefaultPageSize
,
long
cursor
=
RedisBase
.
CursorUtils
.
Origin
,
int
pageOffset
=
0
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
SetScan
(
ToInner
(
key
),
pattern
,
pageSize
,
cursor
,
pageOffset
,
flags
);
...
...
@@ -710,12 +716,12 @@ IEnumerable<SortedSetEntry> IDatabase.SortedSetScan(RedisKey key, RedisValue pat
{
return
SortedSetScan
(
key
,
pattern
,
pageSize
,
RedisBase
.
CursorUtils
.
Origin
,
0
,
flags
);
}
public
IEnumerable
<
SortedSetEntry
>
SortedSetScan
(
RedisKey
key
,
RedisValue
pattern
=
default
(
RedisValue
),
int
pageSize
=
RedisBase
.
CursorUtils
.
DefaultPageSize
,
long
cursor
=
RedisBase
.
CursorUtils
.
Origin
,
int
pageOffset
=
0
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
SortedSetScan
(
ToInner
(
key
),
pattern
,
pageSize
,
cursor
,
pageOffset
,
flags
);
}
#if DEBUG
public
string
ClientGetName
(
CommandFlags
flags
=
CommandFlags
.
None
)
{
...
...
StackExchange.Redis/StackExchange/Redis/KeyspaceIsolation/WrapperBase.cs
View file @
7382262a
...
...
@@ -46,7 +46,6 @@ public Task<string[]> GeoHashAsync(RedisKey key, RedisValue[] members, CommandFl
public
Task
<
string
>
GeoHashAsync
(
RedisKey
key
,
RedisValue
member
,
CommandFlags
flags
=
CommandFlags
.
None
)
=>
Inner
.
GeoHashAsync
(
ToInner
(
key
),
member
,
flags
);
public
Task
<
GeoPosition
?[
]>
GeoPositionAsync
(
RedisKey
key
,
RedisValue
[]
members
,
CommandFlags
flags
=
CommandFlags
.
None
)
=>
Inner
.
GeoPositionAsync
(
ToInner
(
key
),
members
,
flags
);
...
...
@@ -59,7 +58,6 @@ public Task<GeoRadiusResult[]> GeoRadiusAsync(RedisKey key, RedisValue member, d
public
Task
<
GeoRadiusResult
[
]>
GeoRadiusAsync
(
RedisKey
key
,
double
longitude
,
double
latitude
,
double
radius
,
GeoUnit
unit
=
GeoUnit
.
Meters
,
int
count
=
-
1
,
Order
?
order
=
null
,
GeoRadiusOptions
options
=
GeoRadiusOptions
.
Default
,
CommandFlags
flags
=
CommandFlags
.
None
)
=>
Inner
.
GeoRadiusAsync
(
ToInner
(
key
),
longitude
,
latitude
,
radius
,
unit
,
count
,
order
,
options
,
flags
);
public
Task
<
double
>
HashDecrementAsync
(
RedisKey
key
,
RedisValue
hashField
,
double
value
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
HashDecrementAsync
(
ToInner
(
key
),
hashField
,
value
,
flags
);
...
...
@@ -344,8 +342,10 @@ public Task<long> PublishAsync(RedisChannel channel, RedisValue message, Command
{
return
Inner
.
PublishAsync
(
ToInner
(
channel
),
message
,
flags
);
}
public
Task
<
RedisResult
>
ExecuteAsync
(
string
command
,
params
object
[]
args
)
=>
Inner
.
ExecuteAsync
(
command
,
ToInner
(
args
),
CommandFlags
.
None
);
public
Task
<
RedisResult
>
ExecuteAsync
(
string
command
,
ICollection
<
object
>
args
,
CommandFlags
flags
=
CommandFlags
.
None
)
=>
Inner
.
ExecuteAsync
(
command
,
ToInner
(
args
),
flags
);
...
...
@@ -460,6 +460,7 @@ public Task<long> SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, Comma
{
return
Inner
.
SortedSetAddAsync
(
ToInner
(
key
),
values
,
flags
);
}
public
Task
<
long
>
SortedSetAddAsync
(
RedisKey
key
,
SortedSetEntry
[]
values
,
When
when
=
When
.
Always
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
SortedSetAddAsync
(
ToInner
(
key
),
values
,
when
,
flags
);
...
...
@@ -469,6 +470,7 @@ public Task<bool> SortedSetAddAsync(RedisKey key, RedisValue member, double scor
{
return
Inner
.
SortedSetAddAsync
(
ToInner
(
key
),
member
,
score
,
flags
);
}
public
Task
<
bool
>
SortedSetAddAsync
(
RedisKey
key
,
RedisValue
member
,
double
score
,
When
when
=
When
.
Always
,
CommandFlags
flags
=
CommandFlags
.
None
)
{
return
Inner
.
SortedSetAddAsync
(
ToInner
(
key
),
member
,
score
,
when
,
flags
);
...
...
@@ -712,9 +714,10 @@ protected RedisKey ToInnerOrDefault(RedisKey outer)
return
ToInner
(
outer
);
}
}
protected
ICollection
<
object
>
ToInner
(
ICollection
<
object
>
args
)
{
if
(
args
!=
null
&&
args
.
Any
(
x
=>
x
is
RedisKey
||
x
is
RedisChannel
)
)
if
(
args
?.
Any
(
x
=>
x
is
RedisKey
||
x
is
RedisChannel
)
==
true
)
{
var
withPrefix
=
new
object
[
args
.
Count
];
int
i
=
0
;
...
...
@@ -739,6 +742,7 @@ protected ICollection<object> ToInner(ICollection<object> args)
}
return
args
;
}
protected
RedisKey
[]
ToInner
(
RedisKey
[]
outer
)
{
if
(
outer
==
null
||
outer
.
Length
==
0
)
...
...
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