Commit 7382262a authored by Nick Craver's avatar Nick Craver

Cleanup: KeyspaceIsolation

parent 67d53bd8
......@@ -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)
{
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment