dfinity-radix-tree-0.0.0: A Merkleized key–value data store.

Copyright2018 DFINITY Stiftung
LicenseGPL-3
MaintainerEnzo Haussecker <enzo@dfinity.org>
StabilityStable
Safe HaskellNone
LanguageHaskell2010

Network.DFINITY.RadixTree

Contents

Description

A Merkleized key–value data store.

Synopsis

Types

data RadixError Source #

Instances

Eq RadixError Source # 
Data RadixError Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RadixError -> c RadixError #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RadixError #

toConstr :: RadixError -> Constr #

dataTypeOf :: RadixError -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c RadixError) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RadixError) #

gmapT :: (forall b. Data b => b -> b) -> RadixError -> RadixError #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RadixError -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RadixError -> r #

gmapQ :: (forall d. Data d => d -> u) -> RadixError -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RadixError -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RadixError -> m RadixError #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RadixError -> m RadixError #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RadixError -> m RadixError #

Show RadixError Source # 
Exception RadixError Source # 

Create

createRadixTree Source #

Arguments

:: MonadResource m 
=> Int

Bloom filter size in bits.

-> Int

LRU cache size in items.

-> FilePath

LevelDB database.

-> Maybe RadixRoot

Last valid state root.

-> m RadixTree 

Create a radix tree.

subtreeRadixTree Source #

Arguments

:: MonadIO m 
=> RadixRoot

State root.

-> RadixTree

Radix tree.

-> m RadixTree 

Create a radix subtree from a radix tree.

Insert

insertRadixTree Source #

Arguments

:: MonadIO m 
=> ByteString

Key.

-> ByteString

Value.

-> RadixTree

Radix tree.

-> m RadixTree 

Insert a key and value into a radix tree.

Delete

deleteRadixTree Source #

Arguments

:: MonadIO m 
=> ByteString

Key.

-> RadixTree

Radix tree.

-> m RadixTree 

Delete a value from a radix tree.

Merkleize

merkleizeRadixTree Source #

Arguments

:: MonadIO m 
=> RadixTree

Radix tree.

-> m (RadixRoot, RadixTree) 

Merkleize a radix tree. This will flush the buffer to disk.

Query

lookupMerkleizedRadixTree Source #

Arguments

:: MonadIO m 
=> ByteString

Key.

-> RadixTree

Radix tree.

-> m (Maybe (ByteString, RadixTree)) 

Lookup a value in a Merkleized radix tree.

lookupNonMerkleizedRadixTree Source #

Arguments

:: MonadIO m 
=> ByteString

Key.

-> RadixTree

Radix tree.

-> m (Maybe (ByteString, RadixTree)) 

Lookup a value in a non-Merkleized radix tree.

Test

isEmptyRadixTree Source #

Arguments

:: RadixTree

Radix tree.

-> Bool 

Check if a radix tree is empty.

isValidRadixRoot Source #

Arguments

:: MonadIO m 
=> RadixRoot

State root.

-> RadixTree

Radix tree.

-> m Bool 

Check if a state root is valid.

Stream

sourceMerkleizedRadixTree Source #

Arguments

:: MonadResource m 
=> [Bool]

Bit patten.

-> Int

LRU cache size in items.

-> BoundedChan RadixRoot

Terminal state root producer.

-> RadixTree

Radix tree.

-> Source m ByteString 

Create a conduit from a Merkleized radix tree.

Debug

printMerkleizedRadixTree Source #

Arguments

:: MonadIO m 
=> RadixTree

Radix tree.

-> m () 

Print a Merkleized radix tree.

printNonMerkleizedRadixTree Source #

Arguments

:: MonadIO m 
=> RadixTree

Radix tree.

-> m () 

Print a non-Merkleized radix tree.