@@ -70,7 +70,7 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
70
70
/// <param name="key">Name of the key to return information about.</param>
71
71
/// <returns>Information of the filter.</returns>
72
72
/// <remarks><seealso href="https://redis.io/commands/bf.info"/></remarks>
73
- public BloomInformation ? Info ( RedisKey key )
73
+ public BloomInformation Info ( RedisKey key )
74
74
{
75
75
var info = _db . Execute ( BF . INFO , key ) ;
76
76
return ResponseParser . ToBloomInfo ( info ) ;
@@ -82,7 +82,7 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
82
82
/// <param name="key">Name of the key to return information about.</param>
83
83
/// <returns>Information of the filter.</returns>
84
84
/// <remarks><seealso href="https://redis.io/commands/bf.info"/></remarks>
85
- public async Task < BloomInformation ? > InfoAsync ( RedisKey key )
85
+ public async Task < BloomInformation > InfoAsync ( RedisKey key )
86
86
{
87
87
var info = await _db . ExecuteAsync ( BF . INFO , key ) ;
88
88
return ResponseParser . ToBloomInfo ( info ) ;
@@ -108,8 +108,8 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
108
108
double ? error = null , int ? expansion = null ,
109
109
bool nocreate = false , bool nonscaling = false )
110
110
{
111
- if ( items == null )
112
- throw new ArgumentNullException ( nameof ( items ) ) ;
111
+ if ( items . Length < 1 )
112
+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
113
113
114
114
List < object > args = new List < object > { key } ;
115
115
@@ -119,6 +119,7 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
119
119
args . Add ( capacity ) ;
120
120
}
121
121
122
+
122
123
if ( error != null )
123
124
{
124
125
args . Add ( BloomArgs . ERROR ) ;
@@ -171,8 +172,8 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
171
172
double ? error = null , int ? expansion = null ,
172
173
bool nocreate = false , bool nonscaling = false )
173
174
{
174
- if ( items == null )
175
- throw new ArgumentNullException ( nameof ( items ) ) ;
175
+ if ( items . Length < 1 )
176
+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
176
177
177
178
List < object > args = new List < object > { key } ;
178
179
@@ -221,11 +222,11 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
221
222
/// <param name="key">Name of the key to restore.</param>
222
223
/// <param name="iterator">Iterator value associated with data (returned by SCANDUMP).</param>
223
224
/// <param name="data">Current data chunk (returned by SCANDUMP).</param>
224
- /// <returns>Array with information of the filter. </returns>
225
+ /// <returns><see langword="true"/> if executed correctly, error otherwise/> </returns>
225
226
/// <remarks><seealso href="https://redis.io/commands/bf.loadchunk"/></remarks>
226
227
public bool LoadChunk ( RedisKey key , long iterator , Byte [ ] data )
227
228
{
228
- return ResponseParser . ParseOKtoBoolean ( _db . Execute ( BF . LOADCHUNK , key , iterator , data ) ) ;
229
+ return ResponseParser . OKtoBoolean ( _db . Execute ( BF . LOADCHUNK , key , iterator , data ) ) ;
229
230
}
230
231
231
232
/// <summary>
@@ -234,12 +235,12 @@ public bool LoadChunk(RedisKey key, long iterator, Byte[] data)
234
235
/// <param name="key">Name of the key to restore.</param>
235
236
/// <param name="iterator">Iterator value associated with data (returned by SCANDUMP).</param>
236
237
/// <param name="data">Current data chunk (returned by SCANDUMP).</param>
237
- /// <returns>Array with information of the filter. </returns>
238
+ /// <returns><see langword="true"/> if executed correctly, error otherwise/> </returns>
238
239
/// <remarks><seealso href="https://redis.io/commands/bf.loadchunk"/></remarks>
239
240
public async Task < bool > LoadChunkAsync ( RedisKey key , long iterator , Byte [ ] data )
240
241
{
241
242
var result = await _db . ExecuteAsync ( BF . LOADCHUNK , key , iterator , data ) ;
242
- return ResponseParser . ParseOKtoBoolean ( result ) ;
243
+ return ResponseParser . OKtoBoolean ( result ) ;
243
244
}
244
245
245
246
/// <summary>
@@ -250,10 +251,10 @@ public async Task<bool> LoadChunkAsync(RedisKey key, long iterator, Byte[] data)
250
251
/// <returns>An array of booleans. Each element is either true or false depending on whether the
251
252
/// corresponding input element was newly added to the filter or may have previously existed.</returns>
252
253
/// <remarks><seealso href="https://redis.io/commands/bf.madd"/></remarks>
253
- public bool [ ] MAdd ( RedisKey key , RedisValue [ ] items )
254
+ public bool [ ] MAdd ( RedisKey key , params RedisValue [ ] items )
254
255
{
255
- if ( items == null )
256
- throw new ArgumentNullException ( nameof ( items ) ) ;
256
+ if ( items . Length < 1 )
257
+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
257
258
258
259
List < object > args = new List < object > { key } ;
259
260
@@ -273,10 +274,10 @@ public bool[] MAdd(RedisKey key, RedisValue[] items)
273
274
/// <returns>An array of booleans. Each element is either true or false depending on whether the
274
275
/// corresponding input element was newly added to the filter or may have previously existed.</returns>
275
276
/// <remarks><seealso href="https://redis.io/commands/bf.madd"/></remarks>
276
- public async Task < bool [ ] > MAddAsync ( RedisKey key , RedisValue [ ] items )
277
+ public async Task < bool [ ] > MAddAsync ( RedisKey key , params RedisValue [ ] items )
277
278
{
278
- if ( items == null )
279
- throw new ArgumentNullException ( nameof ( items ) ) ;
279
+ if ( items . Length < 1 )
280
+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
280
281
281
282
List < object > args = new List < object > { key } ;
282
283
@@ -299,8 +300,8 @@ public async Task<bool[]> MAddAsync(RedisKey key, RedisValue[] items)
299
300
/// <remarks><seealso href="https://redis.io/commands/bf.mexists"/></remarks>
300
301
public bool [ ] MExists ( RedisKey key , RedisValue [ ] items )
301
302
{
302
- if ( items == null )
303
- throw new ArgumentNullException ( nameof ( items ) ) ;
303
+ if ( items . Length < 1 )
304
+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
304
305
305
306
List < object > args = new List < object > { key } ;
306
307
@@ -323,8 +324,8 @@ public bool[] MExists(RedisKey key, RedisValue[] items)
323
324
/// <remarks><seealso href="https://redis.io/commands/bf.mexists"/></remarks>
324
325
public async Task < bool [ ] > MExistsAsync ( RedisKey key , RedisValue [ ] items )
325
326
{
326
- if ( items == null )
327
- throw new ArgumentNullException ( nameof ( items ) ) ;
327
+ if ( items . Length < 1 )
328
+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
328
329
329
330
List < object > args = new List < object > { key } ;
330
331
@@ -348,7 +349,7 @@ public async Task<bool[]> MExistsAsync(RedisKey key, RedisValue[] items)
348
349
/// created in size of the last sub-filter multiplied by expansion.</param>
349
350
/// <param name="nonscaling">(Optional) <see langword="true"/> toprevent the filter
350
351
/// from creating additional sub-filters if initial capacity is reached.</param>
351
- /// <returns><see langword="true"/> if executed correctly, <see langword="false"/> otherwise. </returns>
352
+ /// <returns><see langword="true"/> if executed correctly, error otherwise/> </returns>
352
353
/// <remarks><seealso href="https://redis.io/commands/bf.reserve"/></remarks>
353
354
public bool Reserve ( RedisKey key , double errorRate , long capacity ,
354
355
int ? expansion = null , bool nonscaling = false )
@@ -365,7 +366,7 @@ public bool Reserve(RedisKey key, double errorRate, long capacity,
365
366
args . Add ( BloomArgs . NONSCALING ) ;
366
367
}
367
368
368
- return ResponseParser . ParseOKtoBoolean ( _db . Execute ( BF . RESERVE , args ) ) ;
369
+ return ResponseParser . OKtoBoolean ( _db . Execute ( BF . RESERVE , args ) ) ;
369
370
}
370
371
371
372
/// <summary>
@@ -378,7 +379,7 @@ public bool Reserve(RedisKey key, double errorRate, long capacity,
378
379
/// created in size of the last sub-filter multiplied by expansion.</param>
379
380
/// <param name="nonscaling">(Optional) <see langword="true"/> toprevent the filter
380
381
/// from creating additional sub-filters if initial capacity is reached.</param>
381
- /// <returns><see langword="true"/> if executed correctly, <see langword="false"/> otherwise.</returns>
382
+ /// <returns><see langword="true"/> if executed correctly, Error otherwise.</returns>
382
383
/// <remarks><seealso href="https://redis.io/commands/bf.reserve"/></remarks>
383
384
public async Task < bool > ReserveAsync ( RedisKey key , double errorRate , long capacity ,
384
385
int ? expansion = null , bool nonscaling = false )
@@ -396,7 +397,7 @@ public async Task<bool> ReserveAsync(RedisKey key, double errorRate, long capaci
396
397
}
397
398
398
399
var result = await _db . ExecuteAsync ( BF . RESERVE , args ) ;
399
- return ResponseParser . ParseOKtoBoolean ( result ) ;
400
+ return ResponseParser . OKtoBoolean ( result ) ;
400
401
}
401
402
402
403
/// <summary>
@@ -406,7 +407,7 @@ public async Task<bool> ReserveAsync(RedisKey key, double errorRate, long capaci
406
407
/// <param name="iterator">Iterator value; either 0 or the iterator from a previous invocation of this command.</param>
407
408
/// <returns>Tuple of iterator and data.</returns>
408
409
/// <remarks><seealso href="https://redis.io/commands/bf.scandump"/></remarks>
409
- public Tuple < long , Byte [ ] > ? ScanDump ( RedisKey key , long iterator )
410
+ public Tuple < long , Byte [ ] > ScanDump ( RedisKey key , long iterator )
410
411
{
411
412
return ResponseParser . ToScanDumpTuple ( _db . Execute ( BF . SCANDUMP , key , iterator ) ) ;
412
413
}
@@ -418,7 +419,7 @@ public async Task<bool> ReserveAsync(RedisKey key, double errorRate, long capaci
418
419
/// <param name="iterator">Iterator value; either 0 or the iterator from a previous invocation of this command.</param>
419
420
/// <returns>Tuple of iterator and data.</returns>
420
421
/// <remarks><seealso href="https://redis.io/commands/bf.scandump"/></remarks>
421
- public async Task < Tuple < long , Byte [ ] > ? > ScanDumpAsync ( RedisKey key , long iterator )
422
+ public async Task < Tuple < long , Byte [ ] > > ScanDumpAsync ( RedisKey key , long iterator )
422
423
{
423
424
var result = await _db . ExecuteAsync ( BF . SCANDUMP , key , iterator ) ;
424
425
return ResponseParser . ToScanDumpTuple ( result ) ;
0 commit comments