Safe Haskell | None |
---|---|
Language | Haskell2010 |
- getFreePageId :: (Functor m, AllocM m, MonadIO m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe PageId)
- getCachedFreePageId :: (Functor m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe PageId)
- queryNewFreePageIds :: (AllocM m, MonadIO m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe PageId)
- 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 PageId) 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 fileStateCachedFreePages
. If
that one is empty, actually query one from the free database.
getCachedFreePageId :: (Functor m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe PageId) Source #
Get a cached free page.
Get a free page from the free database cache stored in
fileStateCachedFreePages
.
queryNewFreePageIds :: (AllocM m, MonadIO m, MonadState (WriterEnv hnd) m) => S stateType () -> m (Maybe PageId) 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.
Immediately remove the queried free pages from the free tree.
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.