-
Notifications
You must be signed in to change notification settings - Fork 47
Creating CommandBuilders #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
56ef34a
Creating ExecuteInTransaction function
shacharPash f1ebf4e
test cpmmit
shacharPash d6060d7
Add SerializedCommands & BloomSerializer
shacharPash 92439ee
Creating ExecuteInTransaction function
shacharPash a93c134
test cpmmit
shacharPash 1c6d286
Add SerializedCommands & BloomSerializer
shacharPash dedd93f
Fix SerializedCommand
shacharPash 55bc897
Merge branch 'SupportTransactions' of github.com:redis/NRedisStack in…
shacharPash a6d2ec4
Add CmsCommandBuilder
shacharPash b524ada
Naming
shacharPash 6929c05
Add CuckooCommndBuilder
shacharPash fdf6a89
Add TdigestCommndBuilder
shacharPash ca97a3f
Add TopKCommandBuilder
shacharPash c55a528
Add JsonCommandBuilder
shacharPash f2cc6a3
Add SearchCommandBuilder
shacharPash ba2d420
Fix Tests
shacharPash 2855bcc
Add TimeSeriesCommandBuilder
shacharPash 38c8bc8
Remove Unessesary using
shacharPash bac799c
Update Branch
shacharPash 6b4100e
Connecting GraphCommands to the documentation of the interface
shacharPash 9cc41d2
Add GraphCommandBuilder
shacharPash 8899813
Update Version to 0.4.0
shacharPash ed7c24c
Writing README
shacharPash d5a9dec
update words to ignor
shacharPash 52205e5
update words to ignore
shacharPash dfa282d
update words to ignore2
shacharPash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
using NRedisStack.Literals; | ||
using NRedisStack.RedisStackCommands; | ||
using StackExchange.Redis; | ||
namespace NRedisStack | ||
{ | ||
|
||
public static class BloomCommandBuilder | ||
{ | ||
public static SerializedCommand Add(RedisKey key, RedisValue item) | ||
{ | ||
return new SerializedCommand(BF.ADD, key, item); | ||
} | ||
|
||
public static SerializedCommand Exists(RedisKey key, RedisValue item) | ||
{ | ||
return new SerializedCommand(BF.EXISTS, key, item); | ||
} | ||
|
||
public static SerializedCommand Info(RedisKey key) | ||
{ | ||
return new SerializedCommand(BF.INFO, key); | ||
} | ||
|
||
public static SerializedCommand Insert(RedisKey key, RedisValue[] items, int? capacity = null, | ||
double? error = null, int? expansion = null, | ||
bool nocreate = false, bool nonscaling = false) | ||
{ | ||
if (items.Length < 1) | ||
throw new ArgumentOutOfRangeException(nameof(items)); | ||
|
||
var args = BloomAux.BuildInsertArgs(key, items, capacity, error, expansion, nocreate, nonscaling); | ||
|
||
return new SerializedCommand(BF.INSERT, args); | ||
} | ||
|
||
public static SerializedCommand LoadChunk(RedisKey key, long iterator, Byte[] data) | ||
{ | ||
return new SerializedCommand(BF.LOADCHUNK, key, iterator, data); | ||
} | ||
|
||
public static SerializedCommand MAdd(RedisKey key, params RedisValue[] items) | ||
{ | ||
if (items.Length < 1) | ||
throw new ArgumentOutOfRangeException(nameof(items)); | ||
|
||
List<object> args = new List<object> { key }; | ||
|
||
foreach (var item in items) | ||
{ | ||
args.Add(item); | ||
} | ||
|
||
return new SerializedCommand(BF.MADD, args); | ||
} | ||
|
||
public static SerializedCommand MExists(RedisKey key, RedisValue[] items) | ||
{ | ||
if (items.Length < 1) | ||
throw new ArgumentOutOfRangeException(nameof(items)); | ||
|
||
List<object> args = new List<object> { key }; | ||
|
||
foreach (var item in items) | ||
{ | ||
args.Add(item); | ||
} | ||
|
||
return new SerializedCommand(BF.MEXISTS, args); | ||
|
||
} | ||
|
||
public static SerializedCommand Reserve(RedisKey key, double errorRate, long capacity, | ||
int? expansion = null, bool nonscaling = false) | ||
{ | ||
List<object> args = new List<object> { key, errorRate, capacity }; | ||
|
||
if (expansion != null) | ||
{ | ||
args.Add(expansion); | ||
} | ||
|
||
if (nonscaling) | ||
{ | ||
args.Add(BloomArgs.NONSCALING); | ||
} | ||
|
||
return new SerializedCommand(BF.RESERVE, args); | ||
} | ||
|
||
public static SerializedCommand ScanDump(RedisKey key, long iterator) | ||
{ | ||
return new SerializedCommand(BF.SCANDUMP, key, iterator); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO comment the class too. Let's explain to users why this exists, why it's an issue.