Liking cljdoc? Tell your friends :D

asami.durable.block.file.block-file

A mapped file implementation of the Block abstraction

A mapped file implementation of the Block abstraction
raw docstring

block-forclj

(block-for {:keys [nr-blocks block-size stride mapped-byte-buffers]
            :as block-file}
           block-id)

Returns the byte buffer that references the given block.

Returns the byte buffer that references the given block.
sourceraw docstring

BlockFileclj

source

cache-sizeclj

source

clear!clj

(clear! {:keys [block-size stride mapped-byte-buffers file raf fc]
         :as block-file})
source

copy-blockclj

(copy-block {:keys [mapped-byte-buffers block-size stride] :as block-file}
            {:keys [byte-offset ro] :as block}
            new-block-id)

Allocates a new block with a copy of the original block.

Allocates a new block with a copy of the original block.
sourceraw docstring

create-managed-block-fileclj

(create-managed-block-file filename block-size)
source

force-fileclj

(force-file {:keys [mapped-byte-buffers] :as block-file})

Ensures all cached data is written to disk. This returns synchronously after all data is written.

Ensures all cached data is written to disk. This returns synchronously after all data is written.
sourceraw docstring

get-nr-blocksclj

(get-nr-blocks {:keys [nr-blocks]})

Returns the number of blocks

Returns the number of blocks
sourceraw docstring

LN2clj

source

log2clj

(log2 x)
source

ManagedBlockFileclj

source

map-file!clj

(map-file! {:keys [nr-mapped-regions stride mapped-byte-buffers] :as block-file}
           regions)

Expands a block-file to one that is mapped to the required number of regions. Returns a new block-file with the required mappings.

Expands a block-file to one that is mapped to the required number of regions.
Returns a new block-file with the required mappings.
sourceraw docstring

next-size-incrementclj

(next-size-increment {:keys [nr-blocks block-size stride] :as block-file})

Determine the next number of blocks that the file should move up to. The size increment of the file increases as the size of the file increases

Determine the next number of blocks that the file should move up to.
The size increment of the file increases as the size of the file increases
sourceraw docstring

nullclj

source

open-block-fileclj

(open-block-file file block-size)

Opens a file for storing blocks. Returns a structure with the block file and the RandomAccessFile that the block file uses. The file will need to be closed when block files based on this initial block file are no longer needed.

Opens a file for storing blocks. Returns a structure with the block file
and the RandomAccessFile that the block file uses. The file will need to be
closed when block files based on this initial block file are no longer needed.
sourceraw docstring

pow2clj

(pow2 x)

Raise 2 to the power of x, with a floor value of 1.

Raise 2 to the power of x, with a floor value of 1.
sourceraw docstring

power-incrementclj

Defines how many bits behind the region magnitude to increment the number of regions by. 4 bits behind means that it starts at incrementing by 1, until size 32. Then 2 until 64. Then 4 until 128, and so on.

Defines how many bits behind the region magnitude to increment the number of regions by.
4 bits behind means that it starts at incrementing by 1, until size 32. Then 2 until 64.
Then 4 until 128, and so on.
sourceraw docstring

region-sizeclj

source

retriesclj

source

set-nr-blocks!clj

(set-nr-blocks! {:keys [nr-blocks block-size nr-mapped-regions stride]
                 :as block-file}
                new-nr)

Updates the number of blocks mapped in a block file. Returns the new block-file.

Updates the number of blocks mapped in a block file. Returns the new block-file.
sourceraw docstring

unmapclj

(unmap {:keys [mapped-byte-buffers block-size nr-blocks raf] :as block-file})

Throw away mappings. This is dangerous, as it invalidates all instances. Only to be used when closing the file for good.

Throw away mappings. This is dangerous, as it invalidates all instances.
Only to be used when closing the file for good.
sourceraw docstring

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

× close