A 'summary' represents a collection of blocks, including certain statistics and an imprecise membership test in the form of a bloom filter. These are useful for returning from certain operations to represent the set of blocks acted upon.
A 'summary' represents a collection of blocks, including certain statistics and an imprecise membership test in the form of a bloom filter. These are useful for returning from certain operations to represent the set of blocks acted upon.
(bucket->range n)
Returns a vector with the boundaries which a given size bucket covers.
Returns a vector with the boundaries which a given size bucket covers.
(init)
(init expected-population false-positive-rate)
Return a new, empty summary. An optional expected population and error frequency may be passed in for more control. The following fields are present in a summary:
:count
is the total number of blocks added to the summary:size
is the total size of blocks added to the summary, in bytes:sizes
gives a map from bucket exponent to a count of the blocks in that
bucket (see size->bucket
and bucket->range
):membership
a bloom filter holding the statistical membership set of
block idsReturn a new, empty summary. An optional expected population and error frequency may be passed in for more control. The following fields are present in a summary: - `:count` is the total number of blocks added to the summary - `:size` is the total size of blocks added to the summary, in bytes - `:sizes` gives a map from bucket exponent to a count of the blocks in that bucket (see `size->bucket` and `bucket->range`) - `:membership` a bloom filter holding the statistical membership set of block ids
(merge a b)
Merge two storage summaries together.
Merge two storage summaries together.
(probably-contains? summary id)
Uses a summary map to check whether the the store (probably) contains the given block identifier. False positives may be possible, but false negatives are not.
Uses a summary map to check whether the the store (probably) contains the given block identifier. False positives may be possible, but false negatives are not.
(size->bucket size)
Assigns a block size to an exponential histogram bucket. Given a size s
,
returns n
such that 2^n <= s < 2^(n+1)
.
Assigns a block size to an exponential histogram bucket. Given a size `s`, returns `n` such that `2^n <= s < 2^(n+1)`.
(update summary block)
Update the storage summary with the stats from the given block.
Update the storage summary with the stats from the given block.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close