Liking cljdoc? Tell your friends :D

blocks.summary

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.
raw docstring

bucket->rangeclj

(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.
sourceraw docstring

initclj

(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 ids
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 ids
sourceraw docstring

mergeclj

(merge a b)

Merge two storage summaries together.

Merge two storage summaries together.
sourceraw docstring

probably-contains?clj

(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.
sourceraw docstring

size->bucketclj

(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)`.
sourceraw docstring

updateclj

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close