BF.LOADCHUNK
BF.LOADCHUNK key iterator data
- Group
- Bloom filter
- Complexity
- O(n), n being the bytes of the chunk
- Arity
- -1 (at least 1 words, counting the command name)
- Flags
- none
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
BF.LOADCHUNK rebuilds a Bloom filter from a dump made with
BF.SCANDUMP. Send the chunks back in the order you
received them, each with the iterator that BF.SCANDUMP returned alongside it.
The first chunk (iterator 1) creates the filter at key, replacing any
Bloom filter already there. The later chunks fill in its bits. The restored
filter answers exactly as the original did.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Chunk loaded | Simple string OK |
Simple string OK |
Error replies:
ERR received bad datafor a chunk that does not belong to the filter being loaded.ERR not foundfor a data chunk sent before the first chunk.ERR Second argument must be numericfor a non-integer iterator.WRONGTYPEif the key holds a value that is not a Bloom filter.
Examples
Section titled “Examples”A typical restore, in client code:
iter = 0chunks = []loop: iter, data = BF.SCANDUMP src iter if iter == 0: break chunks.append((iter, data))for (iter, data) in chunks: BF.LOADCHUNK dst iter dataErrors from redis-cli:
127.0.0.1:6379> BF.LOADCHUNK restored 1 garbage(error) ERR received bad data127.0.0.1:6379> BF.LOADCHUNK restored 145 garbage(error) ERR not foundCompatibility
Section titled “Compatibility”Same command flow as BF.LOADCHUNK in RedisBloom. Chunks must come from a
HotKV BF.SCANDUMP.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.