Skip to content

Commit c97e0c6

Browse files
Adding Bloom command JSON files (#47)
* Adding bloom command json files. These files contain base information about bloom comamnds which will be used by the valkey website Signed-off-by: zackcam <[email protected]> * Update summaries for bloom commands to be more descriptive Taking feedback and applying suggested changes to the summaries of bloom commands Co-authored-by: KarthikSubbarao <[email protected]> Signed-off-by: zackcam <[email protected]> * Apply suggestions from code review Signed-off-by: KarthikSubbarao <[email protected]> * Update .gitignore Signed-off-by: KarthikSubbarao <[email protected]> --------- Signed-off-by: zackcam <[email protected]> Signed-off-by: KarthikSubbarao <[email protected]> Co-authored-by: KarthikSubbarao <[email protected]>
1 parent d6b8763 commit c97e0c6

File tree

10 files changed

+328
-1
lines changed

10 files changed

+328
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ tests/.build
44
__pycache__
55
test-data
66
.attach_pid*
7-
tests/valkeytests*
7+
tests/valkeytests*

src/commands/bf.add.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"BF.ADD": {
3+
"summary": "Add a single item to a bloom filter. The bloom filter is created if it doesn't exist",
4+
"complexity": "O(N), where N is the number of hash functions used by the bloom filter.",
5+
"group": "bloom",
6+
"module_since": "1.0.0",
7+
"arity": 3,
8+
"acl_categories": [
9+
"FAST",
10+
"WRITE",
11+
"BLOOM"
12+
],
13+
"arguments": [
14+
{
15+
"name": "key",
16+
"type": "key",
17+
"key_spec_index": 0
18+
},
19+
{
20+
"name": "value",
21+
"type": "string"
22+
}
23+
]
24+
}
25+
}

src/commands/bf.card.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"BF.CARD": {
3+
"summary": "Returns the cardinality of a bloom filter",
4+
"complexity": "O(1)",
5+
"group": "bloom",
6+
"module_since": "1.0.0",
7+
"arity": 2,
8+
"acl_categories": [
9+
"READ",
10+
"FAST",
11+
"BLOOM"
12+
],
13+
"arguments": [
14+
{
15+
"name": "key",
16+
"type": "key",
17+
"key_spec_index": 0
18+
}
19+
]
20+
}
21+
}

src/commands/bf.exists.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"BF.EXISTS": {
3+
"summary": "Determines if the bloom filter contains the specified item",
4+
"complexity": "O(N), where N is the number of hash functions used by the bloom filter.",
5+
"group": "bloom",
6+
"module_since": "1.0.0",
7+
"arity": 3,
8+
"acl_categories": [
9+
"READ",
10+
"FAST",
11+
"BLOOM"
12+
],
13+
"arguments": [
14+
{
15+
"name": "key",
16+
"type": "key",
17+
"key_spec_index": 0
18+
},
19+
{
20+
"name": "value",
21+
"type": "string"
22+
}
23+
]
24+
}
25+
}

src/commands/bf.info.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"BF.INFO": {
3+
"summary": "Returns usage information and properties of a specific bloom filter",
4+
"complexity": "O(1)",
5+
"group": "bloom",
6+
"module_since": "1.0.0",
7+
"arity": -2,
8+
"acl_categories": [
9+
"READ",
10+
"FAST",
11+
"BLOOM"
12+
],
13+
"arguments": [
14+
{
15+
"name": "key",
16+
"type": "key",
17+
"key_spec_index": 0
18+
},
19+
{
20+
"name": "sortby",
21+
"type": "oneof",
22+
"optional": true,
23+
"arguments": [
24+
{
25+
"name": "capacity",
26+
"type": "pure-token",
27+
"token": "CAPACITY"
28+
},
29+
{
30+
"name": "size",
31+
"type": "pure-token",
32+
"token": "SIZE"
33+
},
34+
{
35+
"name": "filters",
36+
"type": "pure-token",
37+
"token": "FILTERS"
38+
},
39+
{
40+
"name": "expansion",
41+
"type": "pure-token",
42+
"token": "EXPANSION"
43+
},
44+
{
45+
"name": "error",
46+
"type": "pure-token",
47+
"token": "ERROR"
48+
},
49+
{
50+
"name": "tightening",
51+
"type": "pure-token",
52+
"token": "TIGHTENTING"
53+
},
54+
{
55+
"name": "maxscaledcapacity",
56+
"type": "pure-token",
57+
"token": "MAXSCALEDCAPACITY"
58+
}
59+
]
60+
}
61+
]
62+
}
63+
}

src/commands/bf.insert.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"BF.INSERT": {
3+
"summary": "Creates a bloom filter with 0 or more items or adds items to an existing bloom filter",
4+
"complexity": "O(N * K), where N is the number of hash functions used by the bloom filter and K is the number of items being added",
5+
"group": "bloom",
6+
"module_since": "1.0.0",
7+
"arity": -2,
8+
"acl_categories": [
9+
"WRITE",
10+
"FAST",
11+
"BLOOM"
12+
],
13+
"arguments": [
14+
{
15+
"name": "key",
16+
"type": "key",
17+
"key_spec_index": 0
18+
},
19+
{
20+
"token": "CAPACITY",
21+
"name": "capacity",
22+
"type": "integer",
23+
"optional": true
24+
},
25+
{
26+
"token": "ERROR",
27+
"name": "error",
28+
"type": "float",
29+
"optional": true
30+
},
31+
{
32+
"token": "EXPANSION",
33+
"name": "expansion",
34+
"type": "integer",
35+
"optional": true
36+
},
37+
{
38+
"token": "SEED",
39+
"name": "seed",
40+
"type": "string",
41+
"optional": true
42+
},
43+
{
44+
"token": "TIGHTENING",
45+
"name": "tightening",
46+
"type": "float",
47+
"optional": true
48+
},
49+
{
50+
"token": "VALIDATESCALETO",
51+
"name": "validatescaleto",
52+
"type": "integer",
53+
"optional": true
54+
},
55+
{
56+
"token": "NONSCALING",
57+
"name": "nonscaling",
58+
"type": "pure-token",
59+
"optional": true
60+
},
61+
{
62+
"token": "NOCREATE",
63+
"name": "nocreate",
64+
"type": "pure-token",
65+
"optional": true
66+
},
67+
{
68+
"token": "ITEMS",
69+
"name": "value",
70+
"type": "string",
71+
"multiple": true,
72+
"optional": true
73+
}
74+
]
75+
}
76+
}

src/commands/bf.load.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"BF.LOAD": {
3+
"summary": "Restores a bloom filter in a single operation. The command is only generated during AOF Rewrite of bloom filters",
4+
"complexity": "O(N), where N is the capacity",
5+
"group": "bloom",
6+
"module_since": "1.0.0",
7+
"arity": 3,
8+
"acl_categories": [
9+
"WRITE",
10+
"BLOOM"
11+
],
12+
"arguments": [
13+
{
14+
"name": "key",
15+
"type": "key",
16+
"key_spec_index": 0
17+
},
18+
{
19+
"name": "dump",
20+
"type": "string"
21+
}
22+
]
23+
}
24+
}

src/commands/bf.madd.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"BF.MADD": {
3+
"summary": "Adds one or more items to a bloom filter. The bloom filter is created if it doesn't exist",
4+
"complexity": "O(N * K), where N is the number of hash functions used by the bloom filter and K is the number of items being added",
5+
"group": "bloom",
6+
"module_since": "1.0.0",
7+
"arity": 3,
8+
"acl_categories": [
9+
"FAST",
10+
"WRITE",
11+
"BLOOM"
12+
],
13+
"arguments": [
14+
{
15+
"name": "key",
16+
"type": "key",
17+
"key_spec_index": 0
18+
},
19+
{
20+
"name": "value",
21+
"type": "string",
22+
"multiple": true
23+
}
24+
]
25+
}
26+
}

src/commands/bf.mexists.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"BF.MEXISTS": {
3+
"summary": "Determines if the bloom filter contains one or more items",
4+
"complexity": "O(K * N), where N is the number of hash functions used by the bloom filter and K is the number of items",
5+
"group": "bloom",
6+
"module_since": "1.0.0",
7+
"arity": 3,
8+
"acl_categories": [
9+
"READ",
10+
"FAST",
11+
"BLOOM"
12+
],
13+
"arguments": [
14+
{
15+
"name": "key",
16+
"type": "key",
17+
"key_spec_index": 0
18+
},
19+
{
20+
"name": "value",
21+
"type": "string",
22+
"multiple": true
23+
}
24+
]
25+
}
26+
}

src/commands/bf.reserve.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"BF.RESERVE": {
3+
"summary": "Creates an empty bloom filter with the specified properties",
4+
"complexity": "O(1)",
5+
"group": "bloom",
6+
"module_since": "1.0.0",
7+
"arity": -4,
8+
"acl_categories": [
9+
"FAST",
10+
"WRITE",
11+
"BLOOM"
12+
],
13+
"arguments": [
14+
{
15+
"name": "key",
16+
"type": "key",
17+
"key_spec_index": 0
18+
},
19+
{
20+
"name": "error_rate",
21+
"type": "float"
22+
},
23+
{
24+
"name": "capacity",
25+
"type": "integer"
26+
},
27+
{
28+
"token": "EXPANSION",
29+
"name": "expansion",
30+
"type": "integer",
31+
"optional": true
32+
},
33+
{
34+
"token": "NONSCALING",
35+
"name": "nonscaling",
36+
"type": "pure-token",
37+
"optional": true
38+
}
39+
]
40+
}
41+
}

0 commit comments

Comments
 (0)