Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types involved in the implementation of the backend for a Tahoe-LAFS storage server.
Synopsis
- type ApplicationVersion = ByteString
- data Version1Parameters = Version1Parameters {}
- data Version = Version {}
- type Size = Integer
- type Offset = Integer
- type QueryRange = Maybe ByteRanges
- type StorageIndex = String
- type ShareData = ByteString
- newtype ShareNumber = ShareNumber Integer
- newtype CBORSet a = CBORSet {
- getCBORSet :: Set a
- newtype CorruptionDetails = CorruptionDetails {}
- newtype UploadSecret = UploadSecret ByteString
- newtype WriteEnablerSecret = WriteEnablerSecret ByteString
- data ReadTestWriteVectors = ReadTestWriteVectors {}
- data TestWriteVectors = TestWriteVectors {
- test :: [TestVector]
- write :: [WriteVector]
- newLength :: Maybe Integer
- data TestVector = TestVector {}
- data WriteVector = WriteVector {}
- data ReadVector = ReadVector {}
- data ReadTestWriteResult = ReadTestWriteResult {
- success :: Bool
- readData :: ReadResult
- type ReadResult = Map ShareNumber [ShareData]
- readv :: Offset -> Size -> ReadTestWriteVectors
- writev :: ShareNumber -> Offset -> ShareData -> ReadTestWriteVectors
- testv :: ShareNumber -> Offset -> ShareData -> ReadTestWriteVectors
- data AllocateBuckets = AllocateBuckets {
- shareNumbers :: [ShareNumber]
- allocatedSize :: Size
- data AllocationResult = AllocationResult {
- alreadyHave :: [ShareNumber]
- allocated :: [ShareNumber]
- data LeaseSecret
- data TestOperator
- newtype Base64 = Base64 {}
- data WriteImmutableError
- data WriteMutableError
- class Backend b where
- version :: b -> IO Version
- renewLease :: b -> StorageIndex -> [LeaseSecret] -> IO ()
- createImmutableStorageIndex :: b -> StorageIndex -> Maybe [LeaseSecret] -> AllocateBuckets -> IO AllocationResult
- writeImmutableShare :: b -> StorageIndex -> ShareNumber -> Maybe [LeaseSecret] -> ShareData -> Maybe ByteRanges -> IO ()
- abortImmutableUpload :: b -> StorageIndex -> ShareNumber -> Maybe [LeaseSecret] -> IO ()
- adviseCorruptImmutableShare :: b -> StorageIndex -> ShareNumber -> CorruptionDetails -> IO ()
- getImmutableShareNumbers :: b -> StorageIndex -> IO (CBORSet ShareNumber)
- readImmutableShare :: b -> StorageIndex -> ShareNumber -> QueryRange -> IO ShareData
- readvAndTestvAndWritev :: b -> StorageIndex -> WriteEnablerSecret -> ReadTestWriteVectors -> IO ReadTestWriteResult
- readMutableShare :: b -> StorageIndex -> ShareNumber -> QueryRange -> IO ShareData
- getMutableShareNumbers :: b -> StorageIndex -> IO (CBORSet ShareNumber)
- adviseCorruptMutableShare :: b -> StorageIndex -> ShareNumber -> CorruptionDetails -> IO ()
Documentation
type ApplicationVersion = ByteString Source #
A human-readable description of the backend software in use.
data Version1Parameters Source #
Give certain operational details about this storage server.
Instances
Carry a version string and operational parameters.
Instances
Eq Version Source # | |
Show Version Source # | |
Generic Version Source # | |
type Rep Version Source # | |
Defined in Tahoe.Storage.Backend type Rep Version = D1 ('MetaData "Version" "Tahoe.Storage.Backend" "tahoe-great-black-swamp-types-0.5.0.0-inplace" 'False) (C1 ('MetaCons "Version" 'PrefixI 'True) (S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version1Parameters) :*: S1 ('MetaSel ('Just "applicationVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ApplicationVersion))) |
type Offset = Integer Source #
A position in some data identified by a number of bytes into that data from the beginning.
type QueryRange = Maybe ByteRanges Source #
Some ranges of data, possibly. Nothing conventionally refers to the entire data.
type StorageIndex = String Source #
An opaque identifier for a single storage area. Multiple storage objects may exist at one storage index if they have different share numbers. TODO: This should probably be ByteString instead.
type ShareData = ByteString Source #
Some data.
newtype ShareNumber Source #
The identifier of a distinct storage object, unique within the context of a particular storage index. In practice, values are in the range [0..255] (endpoints included).
Instances
A new type for which we can define our own CBOR serialisation rules. The cborg library provides a Serialise instance for Set which is not compatible with the representation required by Tahoe-LAFS.
CBORSet | |
|
newtype CorruptionDetails Source #
Describe a client-detected incidence of data corruption.
Instances
Eq CorruptionDetails Source # | |
Defined in Tahoe.Storage.Backend (==) :: CorruptionDetails -> CorruptionDetails -> Bool # (/=) :: CorruptionDetails -> CorruptionDetails -> Bool # | |
Show CorruptionDetails Source # | |
Defined in Tahoe.Storage.Backend showsPrec :: Int -> CorruptionDetails -> ShowS # show :: CorruptionDetails -> String # showList :: [CorruptionDetails] -> ShowS # | |
Generic CorruptionDetails Source # | |
Defined in Tahoe.Storage.Backend type Rep CorruptionDetails :: Type -> Type # from :: CorruptionDetails -> Rep CorruptionDetails x # to :: Rep CorruptionDetails x -> CorruptionDetails # | |
type Rep CorruptionDetails Source # | |
Defined in Tahoe.Storage.Backend type Rep CorruptionDetails = D1 ('MetaData "CorruptionDetails" "Tahoe.Storage.Backend" "tahoe-great-black-swamp-types-0.5.0.0-inplace" 'True) (C1 ('MetaCons "CorruptionDetails" 'PrefixI 'True) (S1 ('MetaSel ('Just "reason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) |
newtype UploadSecret Source #
A secret shared between a client and this storage server for the purpose of authorizing certain operations related to immutable uploads.
Instances
Eq UploadSecret Source # | |
Defined in Tahoe.Storage.Backend (==) :: UploadSecret -> UploadSecret -> Bool # (/=) :: UploadSecret -> UploadSecret -> Bool # |
newtype WriteEnablerSecret Source #
A secret shared between an SSK write capability holder and this storage server for the purpose of authorizing write operations on a mutable object.
Instances
Eq WriteEnablerSecret Source # | |
Defined in Tahoe.Storage.Backend (==) :: WriteEnablerSecret -> WriteEnablerSecret -> Bool # (/=) :: WriteEnablerSecret -> WriteEnablerSecret -> Bool # |
data ReadTestWriteVectors Source #
Describe tests, reads, and writes to perform on a mutable object.
Instances
data TestWriteVectors Source #
Describe tests and writes to perform on a mutable object.
TestWriteVectors | |
|
Instances
data TestVector Source #
Describe a single test to perform on a mutable object.
TestVector | |
|
Instances
data WriteVector Source #
Describe a single write to perform on a mutable object.
Instances
data ReadVector Source #
Describe one read to perform on an immutable object.
Instances
Eq ReadVector Source # | |
Defined in Tahoe.Storage.Backend (==) :: ReadVector -> ReadVector -> Bool # (/=) :: ReadVector -> ReadVector -> Bool # | |
Show ReadVector Source # | |
Defined in Tahoe.Storage.Backend showsPrec :: Int -> ReadVector -> ShowS # show :: ReadVector -> String # showList :: [ReadVector] -> ShowS # | |
Generic ReadVector Source # | |
Defined in Tahoe.Storage.Backend type Rep ReadVector :: Type -> Type # from :: ReadVector -> Rep ReadVector x # to :: Rep ReadVector x -> ReadVector # | |
type Rep ReadVector Source # | |
Defined in Tahoe.Storage.Backend type Rep ReadVector = D1 ('MetaData "ReadVector" "Tahoe.Storage.Backend" "tahoe-great-black-swamp-types-0.5.0.0-inplace" 'False) (C1 ('MetaCons "ReadVector" 'PrefixI 'True) (S1 ('MetaSel ('Just "offset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Offset) :*: S1 ('MetaSel ('Just "readSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Size))) |
data ReadTestWriteResult Source #
The result of a request to read andor write some data fromto some shares.
Instances
type ReadResult = Map ShareNumber [ShareData] Source #
The result of a request to read some data from some shares.
readv :: Offset -> Size -> ReadTestWriteVectors Source #
Create a ReadTestWriteVectors which performs one read at the given offset of the given size.
writev :: ShareNumber -> Offset -> ShareData -> ReadTestWriteVectors Source #
Create a ReadTestWriteVectors which performs one write on the given share number at the given offset.
testv :: ShareNumber -> Offset -> ShareData -> ReadTestWriteVectors Source #
Create a ReadTestWriteVectors which performs one test on the given share number using the given specimen.
data AllocateBuckets Source #
Describe some allocations for immutable objects requested by a client.
Instances
data AllocationResult Source #
Describe the server's willingness to allocate space for some immutable objects.
Instances
data LeaseSecret Source #
One of several kinds of shared secrets for authorizing a client to perform various operations.
data TestOperator Source #
Instances
A ByteString wrapper which can have its own serialization semantics.
data WriteImmutableError Source #
Exceptional cases which might be encounted by various backend for operations related to immutable shares.
MissingUploadSecret | Used to reject an immutable allocate or upload with no upload secret. |
IncorrectUploadSecret | Used to reject an immutable upload with an incorrect upload secret. |
ShareSizeMismatch | Used to reject an immutable allocate of a size that does not match existing shares with the same storage index. |
MaximumShareSizeExceeded | Used to reject an immutable allocate of a size greater than the maximum allowed by the server. |
ImmutableShareAlreadyWritten | Used to reject an immutable write to a share that is already completely written. |
ShareNotAllocated | Used to reject an immutable write to a share which has not been allocated. |
ConflictingWrite | Used to reject an immutable write that overlaps with data that has already been written. |
Instances
Eq WriteImmutableError Source # | |
Defined in Tahoe.Storage.Backend (==) :: WriteImmutableError -> WriteImmutableError -> Bool # (/=) :: WriteImmutableError -> WriteImmutableError -> Bool # | |
Ord WriteImmutableError Source # | |
Defined in Tahoe.Storage.Backend compare :: WriteImmutableError -> WriteImmutableError -> Ordering # (<) :: WriteImmutableError -> WriteImmutableError -> Bool # (<=) :: WriteImmutableError -> WriteImmutableError -> Bool # (>) :: WriteImmutableError -> WriteImmutableError -> Bool # (>=) :: WriteImmutableError -> WriteImmutableError -> Bool # max :: WriteImmutableError -> WriteImmutableError -> WriteImmutableError # min :: WriteImmutableError -> WriteImmutableError -> WriteImmutableError # | |
Show WriteImmutableError Source # | |
Defined in Tahoe.Storage.Backend showsPrec :: Int -> WriteImmutableError -> ShowS # show :: WriteImmutableError -> String # showList :: [WriteImmutableError] -> ShowS # | |
Exception WriteImmutableError Source # | |
Defined in Tahoe.Storage.Backend |
data WriteMutableError Source #
Exceptional cases which might be encounted by various backend for operations related to mutable shares.
MissingWriteEnablerSecret | Used to reject a mutable write with no write enabler secret. |
IncorrectWriteEnablerSecret | Used to reject a mutable write with an incorrect write enabler secret. |
Instances
Eq WriteMutableError Source # | |
Defined in Tahoe.Storage.Backend (==) :: WriteMutableError -> WriteMutableError -> Bool # (/=) :: WriteMutableError -> WriteMutableError -> Bool # | |
Ord WriteMutableError Source # | |
Defined in Tahoe.Storage.Backend compare :: WriteMutableError -> WriteMutableError -> Ordering # (<) :: WriteMutableError -> WriteMutableError -> Bool # (<=) :: WriteMutableError -> WriteMutableError -> Bool # (>) :: WriteMutableError -> WriteMutableError -> Bool # (>=) :: WriteMutableError -> WriteMutableError -> Bool # max :: WriteMutableError -> WriteMutableError -> WriteMutableError # min :: WriteMutableError -> WriteMutableError -> WriteMutableError # | |
Show WriteMutableError Source # | |
Defined in Tahoe.Storage.Backend showsPrec :: Int -> WriteMutableError -> ShowS # show :: WriteMutableError -> String # showList :: [WriteMutableError] -> ShowS # | |
Exception WriteMutableError Source # | |
Defined in Tahoe.Storage.Backend |
class Backend b where Source #
version :: b -> IO Version Source #
renewLease :: b -> StorageIndex -> [LeaseSecret] -> IO () Source #
Update the lease expiration time on the shares associated with the given storage index.
createImmutableStorageIndex :: b -> StorageIndex -> Maybe [LeaseSecret] -> AllocateBuckets -> IO AllocationResult Source #
writeImmutableShare :: b -> StorageIndex -> ShareNumber -> Maybe [LeaseSecret] -> ShareData -> Maybe ByteRanges -> IO () Source #
abortImmutableUpload :: b -> StorageIndex -> ShareNumber -> Maybe [LeaseSecret] -> IO () Source #
adviseCorruptImmutableShare :: b -> StorageIndex -> ShareNumber -> CorruptionDetails -> IO () Source #
getImmutableShareNumbers :: b -> StorageIndex -> IO (CBORSet ShareNumber) Source #
readImmutableShare :: b -> StorageIndex -> ShareNumber -> QueryRange -> IO ShareData Source #
readvAndTestvAndWritev Source #
:: b | |
-> StorageIndex | The storage index at which to operate. |
-> WriteEnablerSecret | A shared secret which the backend can use to authorize the writes. |
-> ReadTestWriteVectors | The reads, tests, and writes to perform. |
-> IO ReadTestWriteResult |
Read some ranges of all shares held and/or, if test conditions are met, overwrite some ranges of some shares.
readMutableShare :: b -> StorageIndex -> ShareNumber -> QueryRange -> IO ShareData Source #
getMutableShareNumbers :: b -> StorageIndex -> IO (CBORSet ShareNumber) Source #
adviseCorruptMutableShare :: b -> StorageIndex -> ShareNumber -> CorruptionDetails -> IO () Source #