Portability | portable |
---|---|
Stability | experimental |
Maintainer | Stefan Schmidt (stefanschmidt@web.de) |
Version : 0.1
- type FileId = String
- type FileContent = ByteString
- getContentLength :: FileContent -> Integer
- data FileData = MkFileData {}
- data FileSystem
- data FSStandaloneConf = FSStandaloneConf {}
- defaultFSStandaloneConfig :: FSStandaloneConf
- data FSControllerConf = FSControllerConf {}
- defaultFSControllerConfig :: FSControllerConf
- data FSNodeConf = FSNodeConf {}
- defaultFSNodeConfig :: FSNodeConf
- data FSClientConf = FSClientConf {}
- 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 ()
- createFiles :: [(FileId, FileContent)] -> FileSystem -> IO ()
- appendFile :: FileId -> FileContent -> FileSystem -> IO ()
- deleteFile :: FileId -> FileSystem -> IO ()
- getFileContent :: FileId -> FileSystem -> IO (Maybe FileContent)
- getMultiFileContent :: [FileId] -> FileSystem -> IO [(FileId, FileContent)]
- getFileData :: FileId -> FileSystem -> IO (Maybe FileData)
- isFileLocal :: FileId -> FileSystem -> IO Bool
Datatypes
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
metadata of a file, known by the storage.
MkFileData | |
|
Configuration
data FSStandaloneConf Source
data FSControllerConf Source
data FSNodeConf Source
Creation and Destruction
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.
createFiles :: [(FileId, FileContent)] -> FileSystem -> IO ()Source
Creates a list of files 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
getMultiFileContent :: [FileId] -> FileSystem -> IO [(FileId, 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