|
1 | | -using StackExchange.Redis; |
| 1 | +using RESPite.Messages; |
| 2 | +using StackExchange.Redis; |
2 | 3 |
|
3 | 4 | namespace RESPite.StackExchange.Redis; |
4 | 5 |
|
5 | 6 | internal partial class RespContextDatabase |
6 | 7 | { |
7 | 8 | // Async HyperLogLog methods |
8 | | - public Task<bool> HyperLogLogAddAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) => |
9 | | - throw new NotImplementedException(); |
| 9 | + public Task<bool> HyperLogLogAddAsync( |
| 10 | + RedisKey key, |
| 11 | + RedisValue value, |
| 12 | + CommandFlags flags = CommandFlags.None) => |
| 13 | + Context(flags).HyperLogLogs().PfAdd(key, value).AsTask(); |
10 | 14 |
|
11 | | - public Task<bool> HyperLogLogAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) => |
12 | | - throw new NotImplementedException(); |
| 15 | + public Task<bool> HyperLogLogAddAsync( |
| 16 | + RedisKey key, |
| 17 | + RedisValue[] values, |
| 18 | + CommandFlags flags = CommandFlags.None) => |
| 19 | + Context(flags).HyperLogLogs().PfAdd(key, values).AsTask(); |
13 | 20 |
|
14 | | - public Task<long> HyperLogLogLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) => |
15 | | - throw new NotImplementedException(); |
| 21 | + public Task<long> HyperLogLogLengthAsync( |
| 22 | + RedisKey key, |
| 23 | + CommandFlags flags = CommandFlags.None) => |
| 24 | + Context(flags).HyperLogLogs().PfCount(key).AsTask(); |
16 | 25 |
|
17 | | - public Task<long> HyperLogLogLengthAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) => |
18 | | - throw new NotImplementedException(); |
| 26 | + public Task<long> HyperLogLogLengthAsync( |
| 27 | + RedisKey[] keys, |
| 28 | + CommandFlags flags = CommandFlags.None) => |
| 29 | + Context(flags).HyperLogLogs().PfCount(keys).AsTask(); |
19 | 30 |
|
20 | 31 | public Task HyperLogLogMergeAsync( |
21 | 32 | RedisKey destination, |
22 | 33 | RedisKey first, |
23 | 34 | RedisKey second, |
24 | 35 | CommandFlags flags = CommandFlags.None) => |
25 | | - throw new NotImplementedException(); |
| 36 | + Context(flags).HyperLogLogs().PfMerge(destination, first, second).AsTask(); |
26 | 37 |
|
27 | 38 | public Task HyperLogLogMergeAsync( |
28 | 39 | RedisKey destination, |
29 | 40 | RedisKey[] sourceKeys, |
30 | 41 | CommandFlags flags = CommandFlags.None) => |
31 | | - throw new NotImplementedException(); |
| 42 | + Context(flags).HyperLogLogs().PfMerge(destination, sourceKeys).AsTask(); |
32 | 43 |
|
33 | 44 | // Synchronous HyperLogLog methods |
34 | | - public bool HyperLogLogAdd(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) => |
35 | | - throw new NotImplementedException(); |
| 45 | + public bool HyperLogLogAdd( |
| 46 | + RedisKey key, |
| 47 | + RedisValue value, |
| 48 | + CommandFlags flags = CommandFlags.None) => |
| 49 | + Context(flags).HyperLogLogs().PfAdd(key, value).Wait(SyncTimeout); |
36 | 50 |
|
37 | | - public bool HyperLogLogAdd(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) => |
38 | | - throw new NotImplementedException(); |
| 51 | + public bool HyperLogLogAdd( |
| 52 | + RedisKey key, |
| 53 | + RedisValue[] values, |
| 54 | + CommandFlags flags = CommandFlags.None) => |
| 55 | + Context(flags).HyperLogLogs().PfAdd(key, values).Wait(SyncTimeout); |
39 | 56 |
|
40 | | - public long HyperLogLogLength(RedisKey key, CommandFlags flags = CommandFlags.None) => |
41 | | - throw new NotImplementedException(); |
| 57 | + public long HyperLogLogLength( |
| 58 | + RedisKey key, |
| 59 | + CommandFlags flags = CommandFlags.None) => |
| 60 | + Context(flags).HyperLogLogs().PfCount(key).Wait(SyncTimeout); |
42 | 61 |
|
43 | | - public long HyperLogLogLength(RedisKey[] keys, CommandFlags flags = CommandFlags.None) => |
44 | | - throw new NotImplementedException(); |
| 62 | + public long HyperLogLogLength( |
| 63 | + RedisKey[] keys, |
| 64 | + CommandFlags flags = CommandFlags.None) => |
| 65 | + Context(flags).HyperLogLogs().PfCount(keys).Wait(SyncTimeout); |
45 | 66 |
|
46 | 67 | public void HyperLogLogMerge( |
47 | 68 | RedisKey destination, |
48 | 69 | RedisKey first, |
49 | 70 | RedisKey second, |
50 | 71 | CommandFlags flags = CommandFlags.None) => |
51 | | - throw new NotImplementedException(); |
| 72 | + Context(flags).HyperLogLogs().PfMerge(destination, first, second).Wait(SyncTimeout); |
52 | 73 |
|
53 | 74 | public void HyperLogLogMerge( |
54 | 75 | RedisKey destination, |
55 | 76 | RedisKey[] sourceKeys, |
56 | 77 | CommandFlags flags = CommandFlags.None) => |
57 | | - throw new NotImplementedException(); |
| 78 | + Context(flags).HyperLogLogs().PfMerge(destination, sourceKeys).Wait(SyncTimeout); |
58 | 79 | } |
0 commit comments