Safe Haskell | None |
---|---|
Language | Haskell2010 |
- getFreePageId :: (Functor m, AllocM m, MonadIO m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe SomeFreePage)
- getFreedDirtyPageId :: (Functor m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe DirtyFree)
- getCachedFreePageId :: (Functor m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe OldFree)
- queryNewFreePageIds :: (AllocM m, MonadIO m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe OldFree)
- lookupValidFreePageIds :: (MonadIO m, AllocReaderM m, MonadState (WriterEnv hnd) m) => FreeTree -> m (Maybe (TxId, NonEmpty PageId))
- lookupFreePageIds :: (Functor m, AllocReaderM m, MonadState (WriterEnv hnd) m) => FreeTree -> m (Maybe (Unchecked (TxId, NonEmpty PageId)))
- newtype Unchecked a = Unchecked a
- checkFreePages :: (Functor m, MonadIO m, MonadState (WriterEnv hnd) m) => Unchecked (TxId, NonEmpty PageId) -> m (Maybe (TxId, NonEmpty PageId))
Documentation
getFreePageId :: (Functor m, AllocM m, MonadIO m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe SomeFreePage) Source #
Get a free page.
First try to get one from the in-memory dirty pages. Then try to get one
from the in-memory free page cache stored in writerReusablePages
. If that
one is empty, actually query one from the free database.
getFreedDirtyPageId :: (Functor m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe DirtyFree) Source #
Get a free'd dirty page.
Get a free'd dirty page, that is immediately suitable for reuse in the current transaction.
getCachedFreePageId :: (Functor m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe OldFree) Source #
Get a cached free page.
Get a free page from the free database cache stored in writerReusablePages
.
queryNewFreePageIds :: (AllocM m, MonadIO m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe OldFree) Source #
Try 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.
This function will delete the lastly used entry from the free database, query a new one, and then update the free page cache in the state.
This function only works when writerReusablePagesOn
is True
.
This function expects writerReusablePages
to be empty.
lookupValidFreePageIds :: (MonadIO m, AllocReaderM m, MonadState (WriterEnv hnd) m) => FreeTree -> m (Maybe (TxId, NonEmpty PageId)) Source #
Lookup a list of free pages from the free page database, guaranteed to be old enough.
lookupFreePageIds :: (Functor m, AllocReaderM m, MonadState (WriterEnv hnd) m) => FreeTree -> m (Maybe (Unchecked (TxId, NonEmpty PageId))) Source #
Lookup a list of free pages from the free page database.
Auxiliry type to ensure the transaction ID of free pages are checked.