1K      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J SafeK+Open the specified file in read-write mode.L<Write **at most** the specified amount of bytes to a handle.M=Read **at most** the specified amount of bytes from a handle.PReturn the amount of bytes actually read, or throw an IO error (including EOF).N&Synchronize the file contents to disk.OSeek to an absolute position.P%Set the filesize to a certain length.Q2Get the filesize. This **edits the file pointer**.R Close a file.SObtain a lock on a file.Use T to release the prefix lock.U2Read the lock and break it if the process is dead.V4Read the lock and return the process id if possible.W\Is this a permission error? If so we don't have permission to remove the lock file, abort.XHWe have determined the locking process is gone, try to remove the lock.YvAn exception when we tried to break a lock, if it says the lock file has already disappeared we are still good to go.ZTry to create lock by opening the file with the O_EXCL flag and writing our PID into it. Verify by reading the pid back out and matching, maybe some other process slipped in before we were done and broke our lock.[:An exception saying the data is locked by another process.\<An exception saying we don't have permission to create lock.]SAn exception saying another process broke our lock before we finished creating it.TBRelinquish the lock by removing it and then verifying the removal.^_`abKLMNOPQRSUVWcdXYZ[\]T ^`bKLMNOPQRST^_`abKLMNOPQRSUVWcdXYZ[\]TNone*efgefgefgSafe0hException raised when i is improperly used.iA reentrant lock.jCreate a new reentrant lock.k!Acquire a reentrant lock, blocks.lRelease a reentrant lock.m:Execute an action with the lock, bracketed, exception-safehnijklmohnijklmhnijklmoSafepppSafeqqqNonerstrstrstNone,09;<=?RData type which encodes the integer using a variable amount of NULL or ONE bytes.;A storage back-end that can store and fetch physical pages./Open a database handle for reading and writing.EObtain a lock on the given handle, so no other process can access it.GRelease the lock on the given handle, so other processes can access it.:Flush the contents of a handle to disk (or other storage). Close a database handle. *Remove a handle from the storage back-end. A function that calculates the hypothetical size of a node, if it were to be written to a page (regardless of the maximum page size). /The maximum page size the allocator can handle. Get the maximum key size0The default implementation will repeatedly call A. You might want to cache this value in your own implementation.Get the maximum value size0The default implementation will repeatedly call A. You might want to cache this value in your own implementation.YRead a page and return the actual node and the transaction id when the node was written. Write a node to a physical page."Read a value from an overflow page!Write a value to an overflow page7List overflow pages in the specific overflow directory.The result should include **AT LEAST** the handles in the specified directory, but it may contain more handles, even handles that do not belong to an overflow page.Calculate the maximum key size.oReturn the size for which at least 4 key-value pairs with keys and values of that size can fit in a leaf node.!Calculate the maximum value size.Return the size for which at least 4 key-value pairs of the specified maximum key size and values of the returned size can fit in a leaf node. that size can fit in a leaf node.NSearch an arbitrary number, less than a limit, greater than a starting value. Maximum pages size0Function that calculates the page size of a nodeMaximum key sizeMaximum page sizeMaximum key size0Function that calculates the page size of a nodeMaximum value size     None  None@A committed or aborted transaction, with a return value of type a."0Commit the new tree and return a computed value.#5Commit the new tree, without return a computed value.$2Abort the transaction and return a computed value.%:Abort the transaction, without returning a computed value. !"#$% !"#$% !"#$% !"#$%None%&[&0the subtree structure of the free page database.Just a collection of free us.'2The main tree structure of the free page database.(The main free page database tree maps a v to a &.(!Replace the subtree of a certain v.) Delete the subtree of a certain v.The v> will not be present anymore in the free tree after this call.*Insert a subtree for a certain v.&'()*&'()*'&()*&'()*None%&,/09:;DIOT\+Wrapper around wE indicating that it is an overflow page from a previous transaction.-Wrapper around w indicating that it is dirty./Wrapper around uC indicating that it is dirty, i.e. written to in this transaction.1Wrapper around u= indicating it is free and can be reused in any transaction.3Wrapper around uM indicating it is newly free'd and cannot be reused in the same transaction.:#State of the file with index nodes.;'State of the file with data/leaf nodes.<<Whether or not querying free pages from the free is enabled.=3Newly allocated overflow pages in this transaction.>JCounts how many overflow pages were already allocated in this transaction.?fOld overflow pages that were removed in this transaction and should be deleted when no longer in use.BYPages free'd in this transaction, not ready for reuse until the transaction is commited.CJThe original number of pages in the file, before the transaction started.D/The new uncommited number of pages in the file.All pages in the range C to D? (excluding) are freshly allocated in the ongoing transaction.E%Pages written to in this transaction.F=The root of the free tree, might change during a transaction.GXAll pages that are immediately ready for reuse in this and any subsequent transactions.KcWrapper around a type to indicate it belongs to a file with either data/leaf nodes or index nodes.RCreate a new writer.S/Try to free a page, given a set of dirty pages.If the page was dirty, a 1- page is added to the environment, if not a 3" page is added to the environment.Btw, give me lenses...UGet a /, page, by first proving it is in fact dirty.V"Touch a fresh page, make it dirty.We really need lenses...W-Touch a fresh overflow page, making it dirty.X"Get the type of the overflow page.YFree an old overflow page.2+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\/+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY2NOPKLM\[ZQHIJ@ABCDEFG56789:;<=>?R3412/0STUV-.+,WXY+,-./012345 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\None%&:OT[nEAuxiliry type to ensure the transaction ID of free pages are checked.pGet a free page.wFirst try to get one from the in-memory dirty pages. Then try to get one from the in-memory free page cache stored in GC. If that one is empty, actually query one from the free database.qGet a cached free page.8Get a free page from the free database cache stored in G.rTry to get a list of free pages from the free page database, return the first free one for immediate use, and store the rest in the environment.=Immediately remove the queried free pages from the free tree.sULookup a list of free pages from the free page database, guaranteed to be old enough.t8Lookup a list of free pages from the free page database.uDCheck the transaction ID of the free pages, if it's to old, return x.nopqrstunopqrstupqrstnounopqrstuNonevFSave the free pages from the dirty page list and the free page cache.wDSave the newly free pages of the current transaction, as stored by B.vwvwvwvwNone%&:[x5The subtree structure of the freed overflow page treey7The main tree structure of the freed overflow page tree?Save a set of overflow ids that were free'd in the transaction.CDelete the set of overflow ids that were free'd in the transaction. xyz{|}~ xyz{|}~ z{|}~yx xyz{|}~None,/05:<=DA class representing the storage requirements of the page allocator.JA store supporting the page allocator should be an instance of this class.0Write the meta-data structure to a certain page.=Try to read the meta-data structure from a handle, or return x, if the handle doesn't contain a meta page. Meta data of the page allocator.The root7 type parameter should be a user-defined collection of y roots, instantiating the  type class."To store store a single tree, use ConcurrentMeta (Tree k v).DData type used to point to the most recent version of the meta data.%User-defined data root stored inside .)This can be a user-defined collection of y roots.  None %&9:;IOT[\/Monad in which page allocations can take place.The monad has access to a K back-end which manages can store and retreive the corresponding metadata.All necessary database handles.Construct a set of  from a root directory.Run the actions in an . monad, given a reader or writer environment.Evaluate the actions in an . monad, given a reader or writer environment.  None!":OT[An active concurrent database.#This can be shared amongst threads.Lock the database.WThis needs to be called manually, if you want exclusive access, before calling either  or Use  using the z* pattern to properly unlock the database.Unlock the database.Open all concurrent handles.7Open a new concurrent database, with the given handles.6Open the an existing database, with the given handles."Close the handles of the database.DCreate a new concurrent database with handles and metadata provided.Get the current meta data.BWrite the new metadata, and switch the pointer to the current one.+Execute a write transaction, with a result.DExecute a write transaction, without cleaning up old overflow pages..Execute a write transaction, without a result. Execute a read-only transaction.bRun a write action that takes the current meta-data and returns new meta-data to be commited, or x- if the write transaction should be aborted.<Cleanup after an exception occurs, or after a program crash.The v- of the aborted transaction should be passed.?Remove all overflow pages that were written in the transaction.CIf the transaction is aborted, all written pages should be deleted..Update the meta-data from a writer environmentBSave the newly free'd overflow pages, for deletion on the next tx./Save the free'd pages to the free page databaseHandle the cached free pages.9Save the cached free pages to the metadata for later use.Update the database size.None/ !"#$%( None %&,0:ADT[/Exception thrown when decoding of a page fails.A decoder with its type."A decoded page, of a certain type t of kind .The type of a page.Get the type of a .GEncode a page to a lazy byte string, but with the checksum set to zero.IEncode a page to a lazy byte string, and prepend the calculated checksum.=Prepend the xxHash 64-bit checksum of a bytestring to itself.EEncode a page to a lazy byte string, without prepending the checksum.)Size of a node, if it were to be encoded.'Decode a page, and verify the checksum.;Decode a page with a specific decoder, or return the error.Monadic wrapper around The encoder of a .Decoder for an empty page.Decoder for a leaf node page.Decoder for a leaf node page.Decoder for an overflow page.(&( None%&,09:;<=AIT[ CException thrown when a value from an overflow page cannot be cast. As used in .>Exception thrown when a node cannot be cast to the right type. As used in .:Exception thrown when a page that is too large is written. As used in .<Exception thrown when a file is accessed that doesn't exist.File store configuration.3The default configuration can be obtained by using  DA configuration with a specific page size can be obtained by using . 9Monad in which on-disk storage operations can take place.Two important instances are $ making it a storage back-end, and M making it a storage back-end compatible with the concurrent page allocator.{6A collection of files, each associated with a certain fp handle.Each file is a Handle opened in . and contains a collection of physical pages. 0Encode a page padding it to the maxim page size.Return x4 of the page is too large to fit into one page size. The default configurationThis is an unwrapped ! with a page size of 4096 bytes.1Create a configuration with a specific page size.5The maximum key and value sizes are calculated using  and .If the page size is too small, x is returned."Run the storage operations in the  * monad, given a collection of open files.   |}{ ~ Action Configuration             |}{ ~  None%&-09:;<=AIT[$CException thrown when a value from an overflow page cannot be cast. As used in .&>Exception thrown when a node cannot be cast to the right type. As used in .(<Exception thrown when a page that is accessed doesn't exist.*<Exception thrown when a file is accessed that doesn't exist.,Memory store configuration.3The default configuration can be obtained by using 4.DA configuration with a specific page size can be obtained by using 5.18Monad in which binary storage operations can take place.Two important instances are % making it a storage back-end, and N making it a storage back-end compatible with the concurrent page allocator.2A collection of File"s, each associated with a certain fp handle.+This is shareable amongst multiple threads.3(A file containing a collection of pages.Access the files.Access the files.Modify the files.4The default configuration.This is an unwrapped 5 with a page size of 4096.51Create a configuration with a specific page size.5The maximum key and value sizes are calculated using  and .If the page size is too small, x is returned.6"Run the storage operations in the 1 monad, given a collection of Files.7;Construct a store with an empty database with name of type hnd.!$%&'()*+,-./0123456 Action to run ConfigurationData789:;<=$%&'()*+,-./0123456732,-./045167*+()&'$%$%&'()*+,-./0123456789:;<= !"#$%&'()*+,-./0123456789:;<=>?@ABBCCDDEEFFGGHIJKLMNOPQQRSTUVWXXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}}~                                                                   ! " # $ % &     ' '   ( ( ) * + , - . / 0 1 2   3  4 5 6 7 8 9 : ; < = > # ? % &@ABCDEFGHIJKLMNOPQRSSTTUVWXYZ[\]^_`[abcdefghighjghklmngopqrs t  u v w x y , z { |}%haskey-0.2.0.0-1EosJKVTIA32JYw7HhPTkMDatabase.Haskey.Store.Class!Database.Haskey.Alloc.Transaction/Database.Haskey.Alloc.Concurrent.FreePages.Tree,Database.Haskey.Alloc.Concurrent.Environment0Database.Haskey.Alloc.Concurrent.FreePages.Query/Database.Haskey.Alloc.Concurrent.FreePages.Save)Database.Haskey.Alloc.Concurrent.Overflow%Database.Haskey.Alloc.Concurrent.Meta&Database.Haskey.Alloc.Concurrent.Monad)Database.Haskey.Alloc.Concurrent.DatabaseDatabase.Haskey.Store.PageDatabase.Haskey.Store.FileDatabase.Haskey.Store.InMemoryFileIODatabase.Haskey.Utils.STM.MapDatabase.Haskey.Utils.RLock!Database.Haskey.Utils.Monad.CatchDatabase.Haskey.Utils.MonadDatabase.Haskey.Utils.IODatabase.Haskey.Store Database.Haskey.Alloc.Concurrent System.IO ReadWriteMode ZeroEncodedgetZeroEncodedgetZeroEncodedValueStoreM openHandle lockHandle releaseHandle flushHandle closeHandle removeHandle nodePageSize maxPageSize maxKeySize maxValueSize getNodePage putNodePage getOverflow putOverflow listOverflowscalculateMaxKeySizecalculateMaxValueSizearbitrarySearch$fValueZeroEncoded$fKeyZeroEncoded$fBinaryZeroEncoded$fStoreMhndReaderT$fStoreMhndStateT$fEqZeroEncoded$fOrdZeroEncoded$fShowZeroEncoded TransactionCommitAbortcommitcommit_abortabort_ FreeSubtreeFreeTreereplaceSubtree deleteSubtree insertSubtree OldOverflow DirtyOverflowDirtyFreePage NewlyFreed WriterEnv writerHnds writerTxId writerReaderswriterIndexFileStatewriterDataFileStatewriterQueryFreeTreeOnwriterDirtyOverflowswriterOverflowCounterwriterRemovedOverflows FileStatefileStateNewlyFreedPagesfileStateOriginalNumPagesfileStateNewNumPagesfileStateDirtyPagesfileStateFreeTreefileStateCachedFreePages ReaderEnv readerHndsS DataState IndexState StateTypeTypeData TypeIndex getSValue newWriterfreePageupdateFileStatedirty touchPage touchOverflow overflowTyperemoveOldOverflow $fFunctorS $fBinaryS $fBinaryS0$fEqNewlyFreed$fOrdNewlyFreed$fShowNewlyFreed$fBinaryFreePage $fEqFreePage $fOrdFreePage$fShowFreePage $fEqDirty $fOrdDirty $fShowDirty$fEqDirtyOverflow$fOrdDirtyOverflow$fShowDirtyOverflow$fEqOldOverflow$fOrdOldOverflow$fShowOldOverflow$fShowS Unchecked getFreePageIdgetCachedFreePageIdqueryNewFreePageIdslookupValidFreePageIdslookupFreePageIdscheckFreePages saveFreePagessaveNewlyFreedPagesOverflowSubtree OverflowTreegetNewOverflowIdgetOverflowHandlegetOverflowDirreadOverflowIdshowHex'readHex'insertOverflowIdsdeleteOverflowIdsdeleteOutdatedOverflowIdsConcurrentMetaStoreMputConcurrentMetareadConcurrentMetaConcurrentMetaconcurrentMetaRevisionconcurrentMetaDataNumPagesconcurrentMetaIndexNumPagesconcurrentMetaRootconcurrentMetaDataFreeTreeconcurrentMetaIndexFreeTreeconcurrentMetaOverflowTree!concurrentMetaDataCachedFreePages"concurrentMetaIndexCachedFreePagesCurrentMetaPageMeta1Meta2Root$fBinaryConcurrentMeta $fRootTree$fGenericConcurrentMeta$fShowConcurrentMeta ConcurrentTfromConcurrentTConcurrentHandlesconcurrentHandlesRootconcurrentHandlesDataconcurrentHandlesIndexconcurrentHandlesMetadata1concurrentHandlesMetadata2concurrentHandlesOverflowDirconcurrentHandlesrunConcurrentTevalConcurrentT readOverflow' getWriterHnd getReaderHnd$fAllocReaderMConcurrentT$fAllocReaderMConcurrentT0$fAllocMConcurrentT$fMonadTransConcurrentT$fShowConcurrentHandles$fFunctorConcurrentT$fApplicativeConcurrentT$fMonadConcurrentT$fMonadIOConcurrentT$fMonadThrowConcurrentT$fMonadCatchConcurrentT$fMonadMaskConcurrentT$fMonadStateConcurrentT ConcurrentDbconcurrentDbHandlesconcurrentDbWriterLockconcurrentDbCurrentMetaconcurrentDbMeta1concurrentDbMeta2concurrentDbReaderslockConcurrentDbunlockConcurrentDbopenConcurrentHandlescreateConcurrentDbopenConcurrentDbcloseConcurrentHandlesnewConcurrentDbgetCurrentMetasetCurrentMetatransact transactNow transact_transactReadOnly actAndCommitcleanupAfterExceptionremoveNewlyAllocatedOverflows updateMetasaveOverflowIdssaveFreePages'handleCachedFreePages DecodeErrorSGetPage EmptyPageConcurrentMetaPage OverflowPage LeafNodePage IndexNodePage SPageType STypeEmptySTypeConcurrentMeta STypeOverflow STypeLeafNodeSTypeIndexNodePageType TypeEmptyTypeConcurrentMeta TypeOverflow TypeLeafNode TypeIndexNodepageTypeencodeZeroChecksumencodeprependChecksumencodeNoChecksumencodedPageSizedecodedecodeNoChecksumdecodeMputPage emptyPage leafNodePage indexNodePage overflowPageconcurrentMetaPage checksumSeed$fExceptionDecodeError$fBinaryPageType $fEqPageType$fShowPageType$fShowDecodeErrorWrongOverflowValueErrorWrongNodeTypeErrorPageOverflowErrorFileNotFoundErrorFileStoreConfigfileStoreConfigPageSizefileStoreConfigMaxKeySizefileStoreConfigMaxValueSize FileStoreT encodeAndPaddefFileStoreConfigfileStoreConfigWithPageSize runFileStoreT"$fExceptionWrongOverflowValueError$fExceptionWrongNodeTypeError$fExceptionPageOverflowError$fExceptionFileNotFoundError $fConcurrentMetaStoreMFileStoreT$fStoreM[]FileStoreT$fShowFileStoreConfig$fApplicativeFileStoreT$fFunctorFileStoreT$fMonadFileStoreT$fMonadIOFileStoreT$fMonadThrowFileStoreT$fMonadCatchFileStoreT$fMonadMaskFileStoreT$fMonadReaderFileStoreT$fMonadStateFileStoreT$fShowFileNotFoundError$fShowPageOverflowError$fShowWrongNodeTypeError$fShowWrongOverflowValueErrorPageNotFoundErrorMemoryStoreConfigmemoryStoreConfigPageSizememoryStoreConfigMaxKeySizememoryStoreConfigMaxValueSize MemoryStoreT MemoryFiles MemoryFiledefMemoryStoreConfigmemoryStoreConfigWithPageSizerunMemoryStoreTnewEmptyMemoryStore$fExceptionPageNotFoundError"$fConcurrentMetaStoreMMemoryStoreT$fStoreMfpMemoryStoreT$fShowMemoryStoreConfig$fApplicativeMemoryStoreT$fFunctorMemoryStoreT$fMonadMemoryStoreT$fMonadIOMemoryStoreT$fMonadThrowMemoryStoreT$fMonadCatchMemoryStoreT$fMonadMaskMemoryStoreT$fMonadReaderMemoryStoreT$fShowPageNotFoundError openReadWritewritereadflushseek setFileSize getFileSizecloseobtainPrefixLockreleasePrefixLock checkLockreadLockcheckReadFileError breakLockcheckBreakErrortakeLocklockedBycantLock stolenLockFHandle PrefixLockprefixLockFromPrefixmaybeBreakLockdoesProcessExist lookupMin lookupMinKeyalter RLockErrorRLocknewRLock acquireRLock releaseRLock withRLock$fExceptionRLockErrorjustErrMifMreadByteStringwriteByteStringwriteLazyByteString+haskey-btree-0.2.0.0-6qPv3dDs3lNF4AoCjCHQYtData.BTree.Primitives.IdsPageIdTxId OverflowIdbaseGHC.BaseNothingData.BTree.Impure.StructuresTree'exceptions-0.8.3-74UMKX8an841ULC0nHtYN7Control.Monad.CatchbracketFilesfromFileStoreT lookupHandlegetgetsmodify'fromMemoryStoreT lookupFile lookupPage