Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Database.LSMTree.Internal.Paths
Synopsis
- newtype SessionRoot = SessionRoot {}
- lockFile :: SessionRoot -> FsPath
- newtype ActiveDir = ActiveDir {}
- activeDir :: SessionRoot -> ActiveDir
- runPath :: ActiveDir -> RunNumber -> RunFsPaths
- data SnapshotName
- toSnapshotName :: String -> SnapshotName
- isValidSnapshotName :: String -> Bool
- data InvalidSnapshotNameError = ErrSnapshotNameInvalid !String
- snapshotsDir :: SessionRoot -> FsPath
- newtype NamedSnapshotDir = NamedSnapshotDir {}
- namedSnapshotDir :: SessionRoot -> SnapshotName -> NamedSnapshotDir
- newtype SnapshotMetaDataFile = SnapshotMetaDataFile FsPath
- snapshotMetaDataFile :: NamedSnapshotDir -> SnapshotMetaDataFile
- newtype SnapshotMetaDataChecksumFile = SnapshotMetaDataChecksumFile FsPath
- snapshotMetaDataChecksumFile :: NamedSnapshotDir -> SnapshotMetaDataChecksumFile
- tableBlobPath :: SessionRoot -> Unique -> FsPath
- data RunFsPaths = RunFsPaths {}
- pathsForRunFiles :: RunFsPaths -> ForRunFiles FsPath
- runKOpsPath :: RunFsPaths -> FsPath
- runBlobPath :: RunFsPaths -> FsPath
- runFilterPath :: RunFsPaths -> FsPath
- runIndexPath :: RunFsPaths -> FsPath
- runChecksumsPath :: RunFsPaths -> FsPath
- checksumFileNamesForRunFiles :: ForRunFiles ChecksumsFileName
- toChecksumsFile :: ForRunFiles CRC32C -> ChecksumsFile
- fromChecksumsFile :: ChecksumsFile -> Either String (ForRunFiles CRC32C)
- toChecksumsFileForWriteBufferFiles :: (ForKOps CRC32C, ForBlob CRC32C) -> ChecksumsFile
- fromChecksumsFileForWriteBufferFiles :: ChecksumsFile -> Either String (ForKOps CRC32C, ForBlob CRC32C)
- newtype ForKOps a = ForKOps {
- unForKOps :: a
- newtype ForBlob a = ForBlob {
- unForBlob :: a
- newtype ForFilter a = ForFilter {
- unForFilter :: a
- newtype ForIndex a = ForIndex {
- unForIndex :: a
- data ForRunFiles a = ForRunFiles {
- forRunKOps :: !(ForKOps a)
- forRunBlob :: !(ForBlob a)
- forRunFilter :: !(ForFilter a)
- forRunIndex :: !(ForIndex a)
- forRunKOpsRaw :: ForRunFiles a -> a
- forRunBlobRaw :: ForRunFiles a -> a
- forRunFilterRaw :: ForRunFiles a -> a
- forRunIndexRaw :: ForRunFiles a -> a
- newtype WriteBufferFsPaths where
- WrapRunFsPaths RunFsPaths
- pattern WriteBufferFsPaths :: FsPath -> RunNumber -> WriteBufferFsPaths
- writeBufferKOpsPath :: WriteBufferFsPaths -> FsPath
- writeBufferBlobPath :: WriteBufferFsPaths -> FsPath
- writeBufferChecksumsPath :: WriteBufferFsPaths -> FsPath
- writeBufferFilePathWithExt :: WriteBufferFsPaths -> String -> FsPath
Documentation
newtype SessionRoot Source #
Constructors
SessionRoot | |
Fields |
Instances
Eq SessionRoot Source # | |
Defined in Database.LSMTree.Internal.Paths |
lockFile :: SessionRoot -> FsPath Source #
activeDir :: SessionRoot -> ActiveDir Source #
data SnapshotName Source #
Instances
IsString SnapshotName Source # | The given string must satsify |
Defined in Database.LSMTree.Internal.Paths Methods fromString :: String -> SnapshotName # | |
Show SnapshotName Source # | |
Defined in Database.LSMTree.Internal.Paths Methods showsPrec :: Int -> SnapshotName -> ShowS # show :: SnapshotName -> String # showList :: [SnapshotName] -> ShowS # | |
Eq SnapshotName Source # | |
Defined in Database.LSMTree.Internal.Paths | |
Ord SnapshotName Source # | |
Defined in Database.LSMTree.Internal.Paths Methods compare :: SnapshotName -> SnapshotName -> Ordering # (<) :: SnapshotName -> SnapshotName -> Bool # (<=) :: SnapshotName -> SnapshotName -> Bool # (>) :: SnapshotName -> SnapshotName -> Bool # (>=) :: SnapshotName -> SnapshotName -> Bool # max :: SnapshotName -> SnapshotName -> SnapshotName # min :: SnapshotName -> SnapshotName -> SnapshotName # |
toSnapshotName :: String -> SnapshotName Source #
Create snapshot name.
The given string must satsify isValidSnapshotName
.
Throws the following exceptions:
InvalidSnapshotNameError
- If the given string is not a valid snapshot name.
isValidSnapshotName :: String -> Bool Source #
Check if a String
would be a valid snapshot name.
Snapshot names consist of lowercase characters, digits, dashes -
,
and underscores _
, and must be between 1 and 64 characters long.
>>> isValidSnapshotName "main"
True
>>>
isValidSnapshotName "temporary-123-test_"
True
>>>
isValidSnapshotName "UPPER"
False>>>
isValidSnapshotName "dir/dot.exe"
False>>>
isValidSnapshotName ".."
False>>>
isValidSnapshotName "\\"
False>>>
isValidSnapshotName ""
False>>>
isValidSnapshotName (replicate 100 'a')
False
Snapshot names must be valid directory on both POSIX and Windows. This rules out the following reserved file and directory names on Windows:
>>>
isValidSnapshotName "con"
False>>>
isValidSnapshotName "prn"
False>>>
isValidSnapshotName "aux"
False>>>
isValidSnapshotName "nul"
False>>>
isValidSnapshotName "com1" -- "com2", "com3", etc.
False>>>
isValidSnapshotName "lpt1" -- "lpt2", "lpt3", etc.
False
See, e.g., the VBA docs for the "Bad file name or number" error.
data InvalidSnapshotNameError Source #
Constructors
ErrSnapshotNameInvalid !String |
Instances
Exception InvalidSnapshotNameError Source # | |
Defined in Database.LSMTree.Internal.Paths | |
Show InvalidSnapshotNameError Source # | |
Defined in Database.LSMTree.Internal.Paths Methods showsPrec :: Int -> InvalidSnapshotNameError -> ShowS # show :: InvalidSnapshotNameError -> String # showList :: [InvalidSnapshotNameError] -> ShowS # |
snapshotsDir :: SessionRoot -> FsPath Source #
newtype NamedSnapshotDir Source #
The directory for a specific, named snapshot.
Not to be confused with the snapshots directory, which holds all named snapshot directories.
Constructors
NamedSnapshotDir | |
Fields |
newtype SnapshotMetaDataFile Source #
Constructors
SnapshotMetaDataFile FsPath |
newtype SnapshotMetaDataChecksumFile Source #
Constructors
SnapshotMetaDataChecksumFile FsPath |
Table paths
tableBlobPath :: SessionRoot -> Unique -> FsPath Source #
The file name for a table's write buffer blob file
Run paths
data RunFsPaths Source #
The (relative) file path locations of all the files used by the run:
The following files exist for a run:
${n}.keyops
: the sorted run of key/operation pairs${n}.blobs
: the blob values associated with the key/operations${n}.filter
: a Bloom filter of all the keys in the run${n}.index
: an index from keys to disk page numbers${n}.checksums
: a file listing the crc32c checksums of the other files
The representation doesn't store the full, name, just the number n
. Use
the accessor functions to get the actual names.
Constructors
RunFsPaths | |
Instances
Show RunFsPaths Source # | |
Defined in Database.LSMTree.Internal.Paths Methods showsPrec :: Int -> RunFsPaths -> ShowS # show :: RunFsPaths -> String # showList :: [RunFsPaths] -> ShowS # | |
NFData RunFsPaths Source # | |
Defined in Database.LSMTree.Internal.Paths Methods rnf :: RunFsPaths -> () # |
pathsForRunFiles :: RunFsPaths -> ForRunFiles FsPath Source #
Paths to all files associated with this run, except runChecksumsPath
.
runKOpsPath :: RunFsPaths -> FsPath Source #
runBlobPath :: RunFsPaths -> FsPath Source #
runFilterPath :: RunFsPaths -> FsPath Source #
runIndexPath :: RunFsPaths -> FsPath Source #
runChecksumsPath :: RunFsPaths -> FsPath Source #
Checksums for Run files
Checksums for WriteBuffer files
fromChecksumsFileForWriteBufferFiles :: ChecksumsFile -> Either String (ForKOps CRC32C, ForBlob CRC32C) Source #
ForRunFiles abstraction
Instances
Foldable ForKOps Source # | |
Defined in Database.LSMTree.Internal.Paths Methods fold :: Monoid m => ForKOps m -> m # foldMap :: Monoid m => (a -> m) -> ForKOps a -> m # foldMap' :: Monoid m => (a -> m) -> ForKOps a -> m # foldr :: (a -> b -> b) -> b -> ForKOps a -> b # foldr' :: (a -> b -> b) -> b -> ForKOps a -> b # foldl :: (b -> a -> b) -> b -> ForKOps a -> b # foldl' :: (b -> a -> b) -> b -> ForKOps a -> b # foldr1 :: (a -> a -> a) -> ForKOps a -> a # foldl1 :: (a -> a -> a) -> ForKOps a -> a # elem :: Eq a => a -> ForKOps a -> Bool # maximum :: Ord a => ForKOps a -> a # minimum :: Ord a => ForKOps a -> a # | |
Traversable ForKOps Source # | |
Functor ForKOps Source # | |
Show a => Show (ForKOps a) Source # | |
Instances
Foldable ForBlob Source # | |
Defined in Database.LSMTree.Internal.Paths Methods fold :: Monoid m => ForBlob m -> m # foldMap :: Monoid m => (a -> m) -> ForBlob a -> m # foldMap' :: Monoid m => (a -> m) -> ForBlob a -> m # foldr :: (a -> b -> b) -> b -> ForBlob a -> b # foldr' :: (a -> b -> b) -> b -> ForBlob a -> b # foldl :: (b -> a -> b) -> b -> ForBlob a -> b # foldl' :: (b -> a -> b) -> b -> ForBlob a -> b # foldr1 :: (a -> a -> a) -> ForBlob a -> a # foldl1 :: (a -> a -> a) -> ForBlob a -> a # elem :: Eq a => a -> ForBlob a -> Bool # maximum :: Ord a => ForBlob a -> a # minimum :: Ord a => ForBlob a -> a # | |
Traversable ForBlob Source # | |
Functor ForBlob Source # | |
Show a => Show (ForBlob a) Source # | |
Constructors
ForFilter | |
Fields
|
Instances
Foldable ForFilter Source # | |
Defined in Database.LSMTree.Internal.Paths Methods fold :: Monoid m => ForFilter m -> m # foldMap :: Monoid m => (a -> m) -> ForFilter a -> m # foldMap' :: Monoid m => (a -> m) -> ForFilter a -> m # foldr :: (a -> b -> b) -> b -> ForFilter a -> b # foldr' :: (a -> b -> b) -> b -> ForFilter a -> b # foldl :: (b -> a -> b) -> b -> ForFilter a -> b # foldl' :: (b -> a -> b) -> b -> ForFilter a -> b # foldr1 :: (a -> a -> a) -> ForFilter a -> a # foldl1 :: (a -> a -> a) -> ForFilter a -> a # toList :: ForFilter a -> [a] # length :: ForFilter a -> Int # elem :: Eq a => a -> ForFilter a -> Bool # maximum :: Ord a => ForFilter a -> a # minimum :: Ord a => ForFilter a -> a # | |
Traversable ForFilter Source # | |
Defined in Database.LSMTree.Internal.Paths | |
Functor ForFilter Source # | |
Show a => Show (ForFilter a) Source # | |
Constructors
ForIndex | |
Fields
|
Instances
Foldable ForIndex Source # | |
Defined in Database.LSMTree.Internal.Paths Methods fold :: Monoid m => ForIndex m -> m # foldMap :: Monoid m => (a -> m) -> ForIndex a -> m # foldMap' :: Monoid m => (a -> m) -> ForIndex a -> m # foldr :: (a -> b -> b) -> b -> ForIndex a -> b # foldr' :: (a -> b -> b) -> b -> ForIndex a -> b # foldl :: (b -> a -> b) -> b -> ForIndex a -> b # foldl' :: (b -> a -> b) -> b -> ForIndex a -> b # foldr1 :: (a -> a -> a) -> ForIndex a -> a # foldl1 :: (a -> a -> a) -> ForIndex a -> a # elem :: Eq a => a -> ForIndex a -> Bool # maximum :: Ord a => ForIndex a -> a # minimum :: Ord a => ForIndex a -> a # | |
Traversable ForIndex Source # | |
Defined in Database.LSMTree.Internal.Paths | |
Functor ForIndex Source # | |
Show a => Show (ForIndex a) Source # | |
data ForRunFiles a Source #
Stores someting for each run file (except the checksums file), allowing to easily do something for all of them without mixing them up.
Constructors
ForRunFiles | |
Fields
|
Instances
forRunKOpsRaw :: ForRunFiles a -> a Source #
forRunBlobRaw :: ForRunFiles a -> a Source #
forRunFilterRaw :: ForRunFiles a -> a Source #
forRunIndexRaw :: ForRunFiles a -> a Source #
WriteBuffer paths
newtype WriteBufferFsPaths Source #
Constructors
WrapRunFsPaths RunFsPaths |
Bundled Patterns
pattern WriteBufferFsPaths :: FsPath -> RunNumber -> WriteBufferFsPaths |