Liking cljdoc? Tell your friends :D

eva.v2.storage.core


*decrypt-byte-string*clj

(*decrypt-byte-string* v)

Inputs: [v :- ByteString] Returns: ByteString

Dynamic function used to decrypt the individual block vals. Default implementation is a no-op; rebind this function to provide actual decryption logic.

Inputs: [v :- ByteString]
Returns: ByteString

Dynamic function used to decrypt the individual block vals. Default implementation
is a no-op; rebind this function to provide actual decryption logic.
sourceraw docstring

*encrypt-byte-string*clj

(*encrypt-byte-string* v)

Inputs: [v :- ByteString] Returns: ByteString

Dynamic function used to encrypt the individual block vals. Default implementation is a no-op; rebind this function to provide actual encryption logic.

Inputs: [v :- ByteString]
Returns: ByteString

Dynamic function used to encrypt the individual block vals. Default implementation
is a no-op; rebind this function to provide actual encryption logic.
sourceraw docstring

*max-block-size*clj

By default Blocks have a maximum size of 64 KB

By default Blocks have a maximum size of 64 KB
sourceraw docstring

BlockStoragecljprotocol

Storage is block-addressable: i.e., a block is the smallest unit that Storage is aware of. This methods are for Storage implementors and should NEVER be called directly!

Storage is block-addressable: i.e., a block is the smallest unit that Storage is aware of.
This methods are for Storage implementors and should NEVER be called directly!

storage-compare-and-set-blockclj

(storage-compare-and-set-block s expected-block replacement-block)

compare-and-set expected-block for replacement block. Returns true/false to indicate success.

compare-and-set expected-block for replacement block. Returns true/false to indicate success.

storage-create-blockclj

(storage-create-block s block)

create-block writes block IFF NO OTHER BLOCK HAS BEEN WRITTEN WITH THAT ID. Returns true/false.

create-block writes block IFF NO OTHER BLOCK HAS BEEN WRITTEN WITH THAT ID. Returns true/false.

storage-delete-blocksclj

(storage-delete-blocks s namespace ids)

deletes blocks from BlockStore, returns a sequence of ids of deleted blocks

deletes blocks from BlockStore, returns a sequence of ids of deleted blocks

storage-read-blocksclj

(storage-read-blocks s read-mode namespace ids)

reads blocks from BlockStore, returns a sequence of blocks.

reads blocks from BlockStore, returns a sequence of blocks.

storage-write-blocksclj

(storage-write-blocks s write-mode blocks)

writes blocks to BlockStore, returns a sequence of maps {:keys [namespace id]} of written blocks

writes blocks to BlockStore, returns a sequence of maps {:keys [namespace id]} of written blocks
sourceraw docstring

cas-meterclj

source

cas-timerclj

source

compare-and-set-blockclj

(compare-and-set-block storage expected-block replacement-block)

Replaces a block in storage. Operation is atomic. Returns true if swap is successful.

Compares expected-block to current block in storage. If equal, replacement-block overwrites the current block. If not equal, no change occurrs.

Replaces a block in storage. Operation is atomic. Returns true if swap is successful.

Compares expected-block to current block in storage. If equal, replacement-block
 overwrites the current block. If not equal, no change occurrs.
sourceraw docstring

compound-block?clj

(compound-block? block)
source

create-blockclj

(create-block storage block)

Atomically writes a block to storage IF IT DOES NOT EXIST ALREADY. Returns true if the write is successful. If the block already exists, it is NOT overwritten, and create-block will return false.

Atomically writes a block to storage IF IT DOES NOT EXIST ALREADY. Returns true if
the write is successful. If the block already exists, it is NOT overwritten, and
create-block will return false.
sourceraw docstring

decrypt-blockclj

(decrypt-block decrypt b)

Inputs: [decrypt :- IFn b :- Block] Returns: Block

Inputs: [decrypt :- IFn b :- Block]
Returns: Block
sourceraw docstring

delete-blockclj

(delete-block storage namespace id)

Inputs: [storage :- (s/protocol BlockStorage) namespace :- ID id :- ID] Returns: (s/maybe {:namespace ID, :id ID})

Inputs: [storage :- (s/protocol BlockStorage) namespace :- ID id :- ID]
Returns: (s/maybe {:namespace ID, :id ID})
sourceraw docstring

delete-blocksclj

(delete-blocks storage namespace ids)

Deletes the specified blocks from storage. Returns the ids of successfully deleted blocks.

Delete is idempotent; deleting and ID that does not exist will return success.

Deletes the specified blocks from storage.
Returns the ids of successfully deleted blocks.

Delete is idempotent; deleting and ID that does not exist will return success.
sourceraw docstring

encrypt-blockclj

(encrypt-block encrypt b)

Inputs: [encrypt :- IFn b :- Block] Returns: Block

Inputs: [encrypt :- IFn b :- Block]
Returns: Block
sourceraw docstring

Loadablecljprotocol

Blocks can be partially loaded from storage. This protocol allows testing and loading of partially loaded Blocks.

Blocks can be partially loaded from storage. This protocol allows testing and loading of
partially loaded Blocks.

load-fromclj

(load-from x block-store)

return copy of item that has been loaded from the block-store

return copy of item that has been loaded from the block-store

loaded?clj

(loaded? x)

returns true if item has been loaded

returns true if item has been loaded
sourceraw docstring

ptrclj

(ptr block)
(ptr namespace id)

Inputs: ([block :- (s/protocol StorageBlock)] [namespace :- ID id :- ID]) Returns: Ptr

Inputs: ([block :- (s/protocol StorageBlock)] [namespace :- ID id :- ID])
Returns: Ptr
sourceraw docstring

read-blockclj

(read-block storage read-mode namespace id)

Inputs: [storage :- (s/protocol BlockStorage) read-mode :- ReadMode namespace :- ID id :- ID] Returns: (s/maybe Block)

Inputs: [storage :- (s/protocol BlockStorage) read-mode :- ReadMode namespace :- ID id :- ID]
Returns: (s/maybe Block)
sourceraw docstring

read-blocksclj

(read-blocks storage read-mode namespace ids)
(read-blocks storage
             read-mode
             namespace
             ids
             {:as opts :keys [decrypt] :or {decrypt *decrypt-byte-string*}})

Reads blocks in the given namespace from storage.

read-mode: specify ':read-full' to read the entire block (attrs + val); specify ':read-attrs' to only load the block attrs

opts keys: specify :decrypt with a function that will be applied to each read block. Function will be passed a block and is expected to decrypt the block's :val and return the decrypted block. If ommited, will default to the dynamic function 'decrypt-block-val'

Reads blocks in the given namespace from storage.

read-mode: specify ':read-full' to read the entire block (attrs + val);
           specify ':read-attrs' to only load the block attrs

opts keys: specify :decrypt with a function that will be applied to each
           read block. Function will be passed a block and is expected to decrypt
           the block's :val and return the decrypted block.
           If ommited, will default to the dynamic function '*decrypt-block-val*'
sourceraw docstring

read-blocks-histclj

source

read-blocks-onlyclj

(read-blocks-only storage read-mode namespace ids)

Inputs: [storage :- (s/protocol BlockStorage) read-mode :- ReadMode namespace :- ID ids :- [ID]] Returns: [Block]

See read-blocks. This works the same but does NOT decrypt.

Inputs: [storage :- (s/protocol BlockStorage) read-mode :- ReadMode namespace :- ID ids :- [ID]]
Returns: [Block]

See read-blocks. This works the same but does NOT decrypt.
sourceraw docstring

read-blocks-timerclj

source

ReadModeclj

Read Modes control whether the entire Block is loaded from storage, or only the Block's attributes.

Read Modes control whether the entire Block is loaded from storage, or
only the Block's attributes.
sourceraw docstring

simple-block?clj

(simple-block? block)
source

StorageBlockcljprotocol

Getters/setters for a Block. Because it has more type restrictions than a normal record, this provides a convenient way to document/enforce these.

Getters/setters for a Block. Because it has more type restrictions than
a normal record, this provides a convenient way to document/enforce these.

attributesclj

(attributes _)
(attributes _ attribute)
(attributes _ attribute val)

Get all attributes, a single attribute, or set a single attribute in this Block's attribute map.

Get all attributes, a single attribute, or set a single attribute in this Block's attribute map.

storage-idclj

(storage-id _)
(storage-id _ id)

Get or set the id (String) of this block.

Get or set the id (String) of this block.

storage-namespaceclj

(storage-namespace _)
(storage-namespace _ ns)

Get or set the namespace (String) of this block.

Get or set the namespace (String) of this block.

valueclj

(value _)
(value _ v-or-f)

Get or set or update the value (ByteString) of this Block.

Get or set or update the value (ByteString) of this Block.
sourceraw docstring

strict-map->Blockclj

(strict-map->Block m28166 & [drop-extra-keys?__5380__auto__])

Factory function for class Block, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->

Factory function for class Block, taking a map of keywords to field values.  All keys are required, and no extra keys are allowed.  Even faster than map->
sourceraw docstring

strict-map->Ptrclj

(strict-map->Ptr m28070 & [drop-extra-keys?__5380__auto__])

Factory function for class Ptr, taking a map of keywords to field values. All keys are required, and no extra keys are allowed. Even faster than map->

Factory function for class Ptr, taking a map of keywords to field values.  All keys are required, and no extra keys are allowed.  Even faster than map->
sourceraw docstring

write-blockclj

(write-block storage write-mode block)

Inputs: [storage :- (s/protocol BlockStorage) write-mode :- WriteMode block :- Block] Returns: (s/maybe {:namespace ID, :id ID})

Inputs: [storage :- (s/protocol BlockStorage) write-mode :- WriteMode block :- Block]
Returns: (s/maybe {:namespace ID, :id ID})
sourceraw docstring

write-blocksclj

(write-blocks storage write-mode blocks)
(write-blocks storage
              write-mode
              blocks
              {:keys [encrypt] :or {encrypt *encrypt-byte-string*}})

Writes block into storage. Existing blocks will be overwritten in-place. Returns a sequence of the block-ids that were successfully written.

write-mode: specify ':write-full' to write the entire block (attrs + val) specify ':write-attrs to write only the block attrs, leaving the existing val unchanged

opts keys: specify :encrypt with a function that will be applied to each block before writing. Function will be passed a block and is expected to encrypt the blocks's :val and return the encrypted block. If ommitted will default to the dynamic function 'encrypt-block-val'.

Writes block into storage. Existing blocks will be overwritten in-place.
Returns a sequence of the block-ids that were successfully written.

write-mode: specify ':write-full' to write the entire block (attrs + val)
            specify ':write-attrs to write only the block attrs, leaving the existing val unchanged

opts keys: specify :encrypt with a function that will be applied to each block before writing.
           Function will be passed a block and is expected to encrypt the blocks's :val and
           return the encrypted block. If ommitted will default to the dynamic function '*encrypt-block-val*'.
sourceraw docstring

write-blocks-histclj

source

write-blocks-onlyclj

(write-blocks-only storage write-mode blocks)

Inputs: [storage :- (s/protocol BlockStorage) write-mode :- WriteMode blocks :- [Block]] Returns: [{:namespace ID, :id ID}]

See write-blocks. This works the same but does NOT encrypt.

Inputs: [storage :- (s/protocol BlockStorage) write-mode :- WriteMode blocks :- [Block]]
Returns: [{:namespace ID, :id ID}]

See write-blocks. This works the same but does NOT encrypt.
sourceraw docstring

write-blocks-timerclj

source

WriteModeclj

Write Modes control whether the entire Block is written to storage, or only the Block's attributes.

Write Modes control whether the entire Block is written to storage, or
only the Block's attributes.
sourceraw docstring

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

× close