Skip to content

Commit e571fb8

Browse files
committed
Updating command responses and making table in markdown not HTML
Signed-off-by: zackcam <[email protected]>
1 parent 613ed72 commit e571fb8

File tree

5 files changed

+21
-57
lines changed

5 files changed

+21
-57
lines changed

commands/bf.add.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To create a bloom filter with non-default properties, use the `BF.INSERT` or `BF
88

99
```
1010
127.0.0.1:6379> BF.ADD key val
11-
1
11+
(integer) 1
1212
127.0.0.1:6379> BF.ADD key val
13-
0
13+
(integer) 0
1414
```

commands/bf.card.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Returns the cardinality of a bloom filter which is the number of items that have
44

55
```
66
127.0.0.1:6379> BF.ADD key val
7-
1
7+
(integer) 1
88
127.0.0.1:6379> BF.CARD key
9-
1
9+
(integer) 1
1010
127.0.0.1:6379> BF.CARD nonexistentkey
11-
0
12-
```
11+
(integer) 0
12+
```

commands/bf.exists.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ A bloom filter has two possible responses when you check if an item exists:
1010

1111
```
1212
127.0.0.1:6379> BF.ADD key val
13-
1
13+
(integer) 1
1414
127.0.0.1:6379> BF.EXISTS key val
15-
1
15+
(integer) 1
1616
127.0.0.1:6379> BF.EXISTS key nonexistent
17-
0
17+
(integer) 0
1818
```

commands/bf.info.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ When no optional fields are specified, all available fields for the given filter
1818

1919
```
2020
127.0.0.1:6379> BF.ADD key val
21-
1
21+
(integer) 1
2222
127.0.0.1:6379> BF.INFO key
2323
1) Capacity
2424
2) (integer) 100
@@ -37,5 +37,5 @@ When no optional fields are specified, all available fields for the given filter
3737
15) Max scaled capacity
3838
16) (integer) 26214300
3939
127.0.0.1:6379> BF.INFO key CAPACITY
40-
100
40+
(integer) 100
4141
```

topics/bloomfilters.md

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -98,50 +98,14 @@ The following two properties can be specified in the `BF.INSERT` command:
9898

9999
These are the default bloom properties along with the commands and configs which allow customizing.
100100

101-
<table width="100%" border="1" style="border-collapse: collapse; border: 1px solid black" cellpadding="8">
102-
<tr>
103-
<th width="20%">Property</th>
104-
<th width="20%">Default Value</th>
105-
<th width="30%">Command Name</th>
106-
<th width="30%">Configuration name</th>
107-
</tr>
108-
<tr>
109-
<td>Capacity</td>
110-
<td>100</td>
111-
<td>BF.INSERT, BF.RESERVE</td>
112-
<td>BF.BLOOM-CAPACITY</td>
113-
</tr>
114-
<tr>
115-
<td>False Positive Rate</td>
116-
<td>0.01</td>
117-
<td>BF.INSERT, BF.RESERVE</td>
118-
<td>BF.BLOOM-FP-RATE</td>
119-
</tr>
120-
<tr>
121-
<td>Scaling / Non Scaling</td>
122-
<td>Scaling</td>
123-
<td>BF.INSERT, BF.RESERVE</td>
124-
<td>BF.BLOOM-EXPANSION</td>
125-
</tr>
126-
<tr>
127-
<td>Expansion Rate</td>
128-
<td>2</td>
129-
<td>BF.INSERT, BF.RESERVE</td>
130-
<td>BF.BLOOM-EXPANSION</td>
131-
</tr>
132-
<tr>
133-
<td>Tightening Ratio</td>
134-
<td>0.5</td>
135-
<td>BF.INSERT</td>
136-
<td>BF.BLOOM-TIGHTENING-RATIO</td>
137-
</tr>
138-
<tr>
139-
<td>Seed</td>
140-
<td>Random Seed</td>
141-
<td>BF.INSERT</td>
142-
<td>BF.BLOOM-USE-RANDOM-SEED</td>
143-
</tr>
144-
</table>
101+
| Property | Default Value | Command Name | Configuration name |
102+
|----------|--------------|--------------|-------------------|
103+
| Capacity | 100 | BF.INSERT, BF.RESERVE | BF.BLOOM-CAPACITY |
104+
| False Positive Rate | 0.01 | BF.INSERT, BF.RESERVE | BF.BLOOM-FP-RATE |
105+
| Scaling / Non Scaling | Scaling | BF.INSERT, BF.RESERVE | BF.BLOOM-EXPANSION |
106+
| Expansion Rate | 2 | BF.INSERT, BF.RESERVE | BF.BLOOM-EXPANSION |
107+
| Tightening Ratio | 0.5 | BF.INSERT | BF.BLOOM-TIGHTENING-RATIO |
108+
| Seed | Random Seed | BF.INSERT | BF.BLOOM-USE-RANDOM-SEED |
145109

146110

147111
Since bloom filters have a default expansion of 2, this means any default creation as a result of `BF.ADD`, `BF.MADD`, `BF.INSERT` will be a scalable bloom filter. Users can create a non scaling bloom filter using `BF.RESERVE <filter-name> <error-rate> <capacity> NONSCALING` or by specifying `NONSCALING` in `BF.INSERT`. Additionally, the other default properties of a bloom filter creation can be seen in the table above and BF.INFO command response below. These default properties can be configured through configs on the bloom module.
@@ -229,7 +193,7 @@ bf_bloom_defrag_misses:0
229193

230194
* `bf_bloom_defrag_misses`: Total number of defrag misses that have occurred on bloom filters.
231195

232-
## Limits
196+
## Handling Large Bloom Filters
233197

234198
There are two limits a bloom filter faces.
235199

@@ -242,7 +206,7 @@ There are two limits a bloom filter faces.
242206
When a bloom filter scales out, a new sub filter is added. The limit on the number of sub filters depends on the false positive rate and tightening ratio. Each sub filter has a stricter false positive, and this is controlled by the tightening ratio. If a command attempting a scale out results in the sub filter reaching a false positive of 0, the command is rejected.
243207

244208

245-
We have implemented `VALIDATESCALETO` as an optional arg of `BF.INSERT` to help determine whether the bloom filter can scale out to the reach the specified capacity without hitting either limits mentioned above. It will reject the command otherwise.
209+
You can use `VALIDATESCALETO` as an optional arg of `BF.INSERT` to help determine whether the bloom filter can scale out to the reach the specified capacity without hitting either limits mentioned above. It will reject the command otherwise.
246210

247211
As seen below, when trying to create a bloom filter with a capacity that cannot be achieved through scale outs (given the memory limits), the command is rejected. However, if the capacity can be achieved through scale out (even with the limits), then the creation of the bloom filter will succeed.
248212

0 commit comments

Comments
 (0)