packages feed

haskey 0.2.0.0 → 0.2.0.1

raw patch · 3 files changed

+15/−6 lines, 3 filesdep ~haskey-btreePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: haskey-btree

API changes (from Hackage documentation)

- Database.Haskey.Alloc.Concurrent: ConcurrentMeta :: TxId -> S TypeData PageId -> S TypeIndex PageId -> root -> S TypeData FreeTree -> S TypeIndex FreeTree -> OverflowTree -> S TypeData [FreePage] -> S TypeIndex [FreePage] -> ConcurrentMeta root
+ Database.Haskey.Alloc.Concurrent: ConcurrentMeta :: TxId -> S 'TypeData PageId -> S 'TypeIndex PageId -> root -> S 'TypeData FreeTree -> S 'TypeIndex FreeTree -> OverflowTree -> S 'TypeData [FreePage] -> S 'TypeIndex [FreePage] -> ConcurrentMeta root
- Database.Haskey.Alloc.Concurrent: [concurrentMetaDataCachedFreePages] :: ConcurrentMeta root -> S TypeData [FreePage]
+ Database.Haskey.Alloc.Concurrent: [concurrentMetaDataCachedFreePages] :: ConcurrentMeta root -> S 'TypeData [FreePage]
- Database.Haskey.Alloc.Concurrent: [concurrentMetaDataFreeTree] :: ConcurrentMeta root -> S TypeData FreeTree
+ Database.Haskey.Alloc.Concurrent: [concurrentMetaDataFreeTree] :: ConcurrentMeta root -> S 'TypeData FreeTree
- Database.Haskey.Alloc.Concurrent: [concurrentMetaDataNumPages] :: ConcurrentMeta root -> S TypeData PageId
+ Database.Haskey.Alloc.Concurrent: [concurrentMetaDataNumPages] :: ConcurrentMeta root -> S 'TypeData PageId
- Database.Haskey.Alloc.Concurrent: [concurrentMetaIndexCachedFreePages] :: ConcurrentMeta root -> S TypeIndex [FreePage]
+ Database.Haskey.Alloc.Concurrent: [concurrentMetaIndexCachedFreePages] :: ConcurrentMeta root -> S 'TypeIndex [FreePage]
- Database.Haskey.Alloc.Concurrent: [concurrentMetaIndexFreeTree] :: ConcurrentMeta root -> S TypeIndex FreeTree
+ Database.Haskey.Alloc.Concurrent: [concurrentMetaIndexFreeTree] :: ConcurrentMeta root -> S 'TypeIndex FreeTree
- Database.Haskey.Alloc.Concurrent: [concurrentMetaIndexNumPages] :: ConcurrentMeta root -> S TypeIndex PageId
+ Database.Haskey.Alloc.Concurrent: [concurrentMetaIndexNumPages] :: ConcurrentMeta root -> S 'TypeIndex PageId
- Database.Haskey.Alloc.Concurrent.Environment: WriterEnv :: !hnds -> !TxId -> Map TxId Integer -> FileState TypeIndex -> FileState TypeData -> !Bool -> !(Set DirtyOverflow) -> !Word32 -> ![OldOverflow] -> WriterEnv hnds
+ Database.Haskey.Alloc.Concurrent.Environment: WriterEnv :: !hnds -> !TxId -> Map TxId Integer -> FileState 'TypeIndex -> FileState 'TypeData -> !Bool -> !(Set DirtyOverflow) -> !Word32 -> ![OldOverflow] -> WriterEnv hnds
- Database.Haskey.Alloc.Concurrent.Environment: [DataState] :: a -> S TypeData a
+ Database.Haskey.Alloc.Concurrent.Environment: [DataState] :: a -> S 'TypeData a
- Database.Haskey.Alloc.Concurrent.Environment: [IndexState] :: a -> S TypeIndex a
+ Database.Haskey.Alloc.Concurrent.Environment: [IndexState] :: a -> S 'TypeIndex a
- Database.Haskey.Alloc.Concurrent.Environment: [writerDataFileState] :: WriterEnv hnds -> FileState TypeData
+ Database.Haskey.Alloc.Concurrent.Environment: [writerDataFileState] :: WriterEnv hnds -> FileState 'TypeData
- Database.Haskey.Alloc.Concurrent.Environment: [writerIndexFileState] :: WriterEnv hnds -> FileState TypeIndex
+ Database.Haskey.Alloc.Concurrent.Environment: [writerIndexFileState] :: WriterEnv hnds -> FileState 'TypeIndex
- Database.Haskey.Alloc.Concurrent.Environment: newWriter :: hnd -> TxId -> Map TxId Integer -> S TypeData PageId -> S TypeIndex PageId -> S TypeData [FreePage] -> S TypeIndex [FreePage] -> S TypeData FreeTree -> S TypeIndex FreeTree -> WriterEnv hnd
+ Database.Haskey.Alloc.Concurrent.Environment: newWriter :: hnd -> TxId -> Map TxId Integer -> S 'TypeData PageId -> S 'TypeIndex PageId -> S 'TypeData [FreePage] -> S 'TypeIndex [FreePage] -> S 'TypeData FreeTree -> S 'TypeIndex FreeTree -> WriterEnv hnd
- Database.Haskey.Alloc.Concurrent.Meta: ConcurrentMeta :: TxId -> S TypeData PageId -> S TypeIndex PageId -> root -> S TypeData FreeTree -> S TypeIndex FreeTree -> OverflowTree -> S TypeData [FreePage] -> S TypeIndex [FreePage] -> ConcurrentMeta root
+ Database.Haskey.Alloc.Concurrent.Meta: ConcurrentMeta :: TxId -> S 'TypeData PageId -> S 'TypeIndex PageId -> root -> S 'TypeData FreeTree -> S 'TypeIndex FreeTree -> OverflowTree -> S 'TypeData [FreePage] -> S 'TypeIndex [FreePage] -> ConcurrentMeta root
- Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaDataCachedFreePages] :: ConcurrentMeta root -> S TypeData [FreePage]
+ Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaDataCachedFreePages] :: ConcurrentMeta root -> S 'TypeData [FreePage]
- Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaDataFreeTree] :: ConcurrentMeta root -> S TypeData FreeTree
+ Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaDataFreeTree] :: ConcurrentMeta root -> S 'TypeData FreeTree
- Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaDataNumPages] :: ConcurrentMeta root -> S TypeData PageId
+ Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaDataNumPages] :: ConcurrentMeta root -> S 'TypeData PageId
- Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaIndexCachedFreePages] :: ConcurrentMeta root -> S TypeIndex [FreePage]
+ Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaIndexCachedFreePages] :: ConcurrentMeta root -> S 'TypeIndex [FreePage]
- Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaIndexFreeTree] :: ConcurrentMeta root -> S TypeIndex FreeTree
+ Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaIndexFreeTree] :: ConcurrentMeta root -> S 'TypeIndex FreeTree
- Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaIndexNumPages] :: ConcurrentMeta root -> S TypeIndex PageId
+ Database.Haskey.Alloc.Concurrent.Meta: [concurrentMetaIndexNumPages] :: ConcurrentMeta root -> S 'TypeIndex PageId
- Database.Haskey.Store.Class: calculateMaxKeySize :: PageSize -> (Node Z ZeroEncoded ZeroEncoded -> PageSize) -> Word64
+ Database.Haskey.Store.Class: calculateMaxKeySize :: PageSize -> (Node 'Z ZeroEncoded ZeroEncoded -> PageSize) -> Word64
- Database.Haskey.Store.Class: calculateMaxValueSize :: PageSize -> Word64 -> (Node Z ZeroEncoded ZeroEncoded -> PageSize) -> Word64
+ Database.Haskey.Store.Class: calculateMaxValueSize :: PageSize -> Word64 -> (Node 'Z ZeroEncoded ZeroEncoded -> PageSize) -> Word64
- Database.Haskey.Store.Class: class (Applicative m, Monad m) => StoreM hnd m | m -> hnd where maxKeySize = do { f <- nodePageSize; fmax <- maxPageSize; return $ calculateMaxKeySize fmax (f zeroHeight) } maxValueSize = do { f <- nodePageSize; key <- maxKeySize; fmax <- maxPageSize; return $ calculateMaxValueSize fmax key (f zeroHeight) }
+ Database.Haskey.Store.Class: class (Applicative m, Monad m) => StoreM hnd m | m -> hnd
- Database.Haskey.Store.Class: getOverflow :: (StoreM hnd m, Value val) => hnd -> Proxy val -> m val
+ Database.Haskey.Store.Class: getOverflow :: (StoreM hnd m, (Value val)) => hnd -> Proxy val -> m val
- Database.Haskey.Store.Class: putOverflow :: (StoreM hnd m, Value val) => hnd -> val -> m ()
+ Database.Haskey.Store.Class: putOverflow :: (StoreM hnd m, (Value val)) => hnd -> val -> m ()
- Database.Haskey.Store.File: [ConcurrentMetaPage] :: Root root => ConcurrentMeta root -> Page TypeConcurrentMeta
+ Database.Haskey.Store.File: [ConcurrentMetaPage] :: Root root => ConcurrentMeta root -> Page 'TypeConcurrentMeta
- Database.Haskey.Store.File: [EmptyPage] :: Page TypeEmpty
+ Database.Haskey.Store.File: [EmptyPage] :: Page 'TypeEmpty
- Database.Haskey.Store.File: [IndexNodePage] :: (Key k, Value v) => Height (S h) -> Node (S h) k v -> Page TypeIndexNode
+ Database.Haskey.Store.File: [IndexNodePage] :: (Key k, Value v) => Height ( 'S h) -> Node ( 'S h) k v -> Page 'TypeIndexNode
- Database.Haskey.Store.File: [LeafNodePage] :: (Key k, Value v) => Height Z -> Node Z k v -> Page TypeLeafNode
+ Database.Haskey.Store.File: [LeafNodePage] :: (Key k, Value v) => Height 'Z -> Node 'Z k v -> Page 'TypeLeafNode
- Database.Haskey.Store.File: [OverflowPage] :: (Value v) => v -> Page TypeOverflow
+ Database.Haskey.Store.File: [OverflowPage] :: (Value v) => v -> Page 'TypeOverflow
- Database.Haskey.Store.InMemory: [ConcurrentMetaPage] :: Root root => ConcurrentMeta root -> Page TypeConcurrentMeta
+ Database.Haskey.Store.InMemory: [ConcurrentMetaPage] :: Root root => ConcurrentMeta root -> Page 'TypeConcurrentMeta
- Database.Haskey.Store.InMemory: [EmptyPage] :: Page TypeEmpty
+ Database.Haskey.Store.InMemory: [EmptyPage] :: Page 'TypeEmpty
- Database.Haskey.Store.InMemory: [IndexNodePage] :: (Key k, Value v) => Height (S h) -> Node (S h) k v -> Page TypeIndexNode
+ Database.Haskey.Store.InMemory: [IndexNodePage] :: (Key k, Value v) => Height ( 'S h) -> Node ( 'S h) k v -> Page 'TypeIndexNode
- Database.Haskey.Store.InMemory: [LeafNodePage] :: (Key k, Value v) => Height Z -> Node Z k v -> Page TypeLeafNode
+ Database.Haskey.Store.InMemory: [LeafNodePage] :: (Key k, Value v) => Height 'Z -> Node 'Z k v -> Page 'TypeLeafNode
- Database.Haskey.Store.InMemory: [OverflowPage] :: (Value v) => v -> Page TypeOverflow
+ Database.Haskey.Store.InMemory: [OverflowPage] :: (Value v) => v -> Page 'TypeOverflow
- Database.Haskey.Store.Page: [ConcurrentMetaPage] :: Root root => ConcurrentMeta root -> Page TypeConcurrentMeta
+ Database.Haskey.Store.Page: [ConcurrentMetaPage] :: Root root => ConcurrentMeta root -> Page 'TypeConcurrentMeta
- Database.Haskey.Store.Page: [EmptyPage] :: Page TypeEmpty
+ Database.Haskey.Store.Page: [EmptyPage] :: Page 'TypeEmpty
- Database.Haskey.Store.Page: [IndexNodePage] :: (Key k, Value v) => Height (S h) -> Node (S h) k v -> Page TypeIndexNode
+ Database.Haskey.Store.Page: [IndexNodePage] :: (Key k, Value v) => Height ( 'S h) -> Node ( 'S h) k v -> Page 'TypeIndexNode
- Database.Haskey.Store.Page: [LeafNodePage] :: (Key k, Value v) => Height Z -> Node Z k v -> Page TypeLeafNode
+ Database.Haskey.Store.Page: [LeafNodePage] :: (Key k, Value v) => Height 'Z -> Node 'Z k v -> Page 'TypeLeafNode
- Database.Haskey.Store.Page: [OverflowPage] :: (Value v) => v -> Page TypeOverflow
+ Database.Haskey.Store.Page: [OverflowPage] :: (Value v) => v -> Page 'TypeOverflow
- Database.Haskey.Store.Page: [STypeConcurrentMeta] :: SPageType TypeConcurrentMeta
+ Database.Haskey.Store.Page: [STypeConcurrentMeta] :: SPageType 'TypeConcurrentMeta
- Database.Haskey.Store.Page: [STypeEmpty] :: SPageType TypeEmpty
+ Database.Haskey.Store.Page: [STypeEmpty] :: SPageType 'TypeEmpty
- Database.Haskey.Store.Page: [STypeIndexNode] :: SPageType TypeIndexNode
+ Database.Haskey.Store.Page: [STypeIndexNode] :: SPageType 'TypeIndexNode
- Database.Haskey.Store.Page: [STypeLeafNode] :: SPageType TypeLeafNode
+ Database.Haskey.Store.Page: [STypeLeafNode] :: SPageType 'TypeLeafNode
- Database.Haskey.Store.Page: [STypeOverflow] :: SPageType TypeOverflow
+ Database.Haskey.Store.Page: [STypeOverflow] :: SPageType 'TypeOverflow
- Database.Haskey.Store.Page: concurrentMetaPage :: Root root => Proxy root -> SGet TypeConcurrentMeta
+ Database.Haskey.Store.Page: concurrentMetaPage :: Root root => Proxy root -> SGet 'TypeConcurrentMeta
- Database.Haskey.Store.Page: emptyPage :: SGet TypeEmpty
+ Database.Haskey.Store.Page: emptyPage :: SGet 'TypeEmpty
- Database.Haskey.Store.Page: indexNodePage :: (Key k, Value v) => Height (S n) -> Proxy k -> Proxy v -> SGet TypeIndexNode
+ Database.Haskey.Store.Page: indexNodePage :: (Key k, Value v) => Height ( 'S n) -> Proxy k -> Proxy v -> SGet 'TypeIndexNode
- Database.Haskey.Store.Page: leafNodePage :: (Key k, Value v) => Height Z -> Proxy k -> Proxy v -> SGet TypeLeafNode
+ Database.Haskey.Store.Page: leafNodePage :: (Key k, Value v) => Height 'Z -> Proxy k -> Proxy v -> SGet 'TypeLeafNode
- Database.Haskey.Store.Page: overflowPage :: (Value v) => Proxy v -> SGet TypeOverflow
+ Database.Haskey.Store.Page: overflowPage :: (Value v) => Proxy v -> SGet 'TypeOverflow

Files

haskey.cabal view
@@ -1,5 +1,5 @@ name:                haskey-version:             0.2.0.0+version:             0.2.0.1 synopsis:            A transactional, ACID compliant, embeddable key-value store. description:     Haskey is a transactional, ACID compliant, embeddable, scalable key-value@@ -65,7 +65,7 @@     exceptions              >=0.8.3 && <0.9,     filepath                >=1.4  && <2,     focus                   >=0.1.2 && <0.2,-    haskey-btree            >=0.2 && <1,+    haskey-btree            >=0.2.0.1 && <1,     list-t                  >=0.2  && <2,     lz4                     >=0.2  && <1,     mtl                     >=2.1  && <3,
src/Database/Haskey/Alloc/Concurrent/Monad.hs view
@@ -139,7 +139,9 @@      freeOverflow oid = overflowType oid >>= \case         Right i -> removeOldOverflow i-        Left (DirtyOverflow i) -> do+        Left (DirtyOverflow i) -> deleteOverflowData i++    deleteOverflowData i = do             root <- concurrentHandlesOverflowDir . writerHnds <$> get             lift $ removeHandle (getOverflowHandle root i) 
src/Database/Haskey/Alloc/Concurrent/Overflow.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-}@@ -14,6 +15,7 @@ import Data.Maybe (fromMaybe, listToMaybe) import Data.Word (Word8) import qualified Data.List.NonEmpty as NE+import qualified Data.Map as M  import Numeric (showHex, readHex) @@ -91,16 +93,21 @@         freeAllNodes h nid         deleteTree tx tree   where-    freeAllNodes :: (AllocM m, Key key, Value val)+    freeAllNodes :: (AllocM m)                  => Height h-                 -> NodeId h key val+                 -> NodeId h OverflowId ()                  -> m ()     freeAllNodes h nid = readNode h nid >>= \case-        Leaf _ -> freeNode h nid+        l@(Leaf _) -> freeOverflowInLeaf l >> freeNode h nid         Idx idx -> do             let subHgt = decrHeight h             traverse_ (freeAllNodes subHgt) idx             freeNode h nid++    freeOverflowInLeaf :: (AllocM m)+                       => Node 'Z OverflowId ()+                       -> m ()+    freeOverflowInLeaf (Leaf items) = mapM_ deleteOverflowData $ M.keys items  --------------------------------------------------------------------------------