Holumbus-Storage-0.0.1: a distributed storage systemSource codeContentsIndex
Holumbus.FileSystem.FileSystem
Portabilityportable
Stabilityexperimental
MaintainerStefan Schmidt (stefanschmidt@web.de)
Contents
Datatypes
Configuration
Creation and Destruction
Operations
Description
Version : 0.1
Synopsis
type FileId = String
type FileContent = ByteString
getContentLength :: FileContent -> Integer
data FileData = MkFileData {
fd_FileId :: FileId
fd_Size :: Integer
fd_CreationDate :: UTCTime
fd_LastModifiedDate :: UTCTime
fd_Hashvalue :: Integer
}
data FileSystem
data FSStandaloneConf = FSStandaloneConf {
fstc_StreamName :: StreamName
fstc_StoragePath :: FilePath
fstc_StorageFile :: FilePath
}
defaultFSStandaloneConfig :: FSStandaloneConf
data FSControllerConf = FSControllerConf {
fcoc_StreamName :: StreamName
fcoc_PortNumber :: Maybe PortNumber
}
defaultFSControllerConfig :: FSControllerConf
data FSNodeConf = FSNodeConf {
fnoc_StreamName :: StreamName
fnoc_SocketId :: Maybe SocketId
fnoc_StoragePath :: FilePath
fnoc_StorageFile :: FilePath
}
defaultFSNodeConfig :: FSNodeConf
data FSClientConf = FSClientConf {
fclc_StreamName :: StreamName
fclc_SocketId :: Maybe SocketId
}
defaultFSClientConfig :: FSClientConf
mkStandaloneFileSystem :: FSStandaloneConf -> IO FileSystem
mkFileSystemController :: FSControllerConf -> IO FileSystem
mkFileSystemNode :: FSNodeConf -> IO FileSystem
mkFileSystemClient :: FSClientConf -> IO FileSystem
closeFileSystem :: FileSystem -> IO ()
getMySiteId :: FileSystem -> IO SiteId
getFileSites :: FileId -> FileSystem -> IO (Set SiteId)
getNearestNodePortWithFile :: FileId -> FileSystem -> IO (Maybe NodePort)
getNearestNodePortForFile :: FileId -> Integer -> FileSystem -> IO (Maybe NodePort)
containsFile :: FileId -> FileSystem -> IO Bool
createFile :: FileId -> FileContent -> FileSystem -> IO ()
appendFile :: FileId -> FileContent -> FileSystem -> IO ()
deleteFile :: FileId -> FileSystem -> IO ()
getFileContent :: FileId -> FileSystem -> IO (Maybe FileContent)
getFileData :: FileId -> FileSystem -> IO (Maybe FileData)
isFileLocal :: FileId -> FileSystem -> IO Bool
Datatypes
type FileId = StringSource
The file-identifier, should be unique in the whole system and be an instance of the classes show, eq, ord and binary
type FileContent = ByteStringSource
getContentLength :: FileContent -> IntegerSource
data FileData Source
metadata of a file, known by the storage.
Constructors
MkFileData
fd_FileId :: FileIdfilename
fd_Size :: Integerfilesize
fd_CreationDate :: UTCTimecreation date
fd_LastModifiedDate :: UTCTimelast modified date
fd_Hashvalue :: Integerhash value
show/hide Instances
data FileSystem Source
show/hide Instances
Configuration
data FSStandaloneConf Source
Constructors
FSStandaloneConf
fstc_StreamName :: StreamName
fstc_StoragePath :: FilePath
fstc_StorageFile :: FilePath
defaultFSStandaloneConfig :: FSStandaloneConfSource
data FSControllerConf Source
Constructors
FSControllerConf
fcoc_StreamName :: StreamName
fcoc_PortNumber :: Maybe PortNumber
defaultFSControllerConfig :: FSControllerConfSource
data FSNodeConf Source
Constructors
FSNodeConf
fnoc_StreamName :: StreamName
fnoc_SocketId :: Maybe SocketId
fnoc_StoragePath :: FilePath
fnoc_StorageFile :: FilePath
defaultFSNodeConfig :: FSNodeConfSource
data FSClientConf Source
Constructors
FSClientConf
fclc_StreamName :: StreamName
fclc_SocketId :: Maybe SocketId
defaultFSClientConfig :: FSClientConfSource
Creation and Destruction
mkStandaloneFileSystem :: FSStandaloneConf -> IO FileSystemSource
mkFileSystemController :: FSControllerConf -> IO FileSystemSource
mkFileSystemNode :: FSNodeConf -> IO FileSystemSource
mkFileSystemClient :: FSClientConf -> IO FileSystemSource
closeFileSystem :: FileSystem -> IO ()Source
Closes the filesystem.
Operations
getMySiteId :: FileSystem -> IO SiteIdSource
getFileSites :: FileId -> FileSystem -> IO (Set SiteId)Source
Get a set of all sites the file exists.
getNearestNodePortWithFile :: FileId -> FileSystem -> IO (Maybe NodePort)Source
gets the nearest NodePort with our fileId
getNearestNodePortForFile :: FileId -> Integer -> FileSystem -> IO (Maybe NodePort)Source
gets the nearest NodePort on which we can create our fileId. we need the content-size to get a node with enough space.
containsFile :: FileId -> FileSystem -> IO BoolSource
Checks if a file is in the filesystem
createFile :: FileId -> FileContent -> FileSystem -> IO ()Source
Creates a file in the filesystem.
appendFile :: FileId -> FileContent -> FileSystem -> IO ()Source
Appends a file in the fileSystem.
deleteFile :: FileId -> FileSystem -> IO ()Source
Deletes a file from the filesystem.
getFileContent :: FileId -> FileSystem -> IO (Maybe FileContent)Source
Gets the file content from the nearest site whitch holds the file
getFileData :: FileId -> FileSystem -> IO (Maybe FileData)Source
Gets the file data from the nearest site whitch holds the file
isFileLocal :: FileId -> FileSystem -> IO BoolSource
Tests, if the local storage (if one exists) holds the file
Produced by Haddock version 2.4.2