Holumbus-Storage-0.1.0: a distributed storage system

Portabilityportable
Stabilityexperimental
MaintainerStefan Schmidt (stefanschmidt@web.de)

Holumbus.FileSystem.FileSystem

Contents

Description

Version : 0.1

Synopsis

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

data FileData Source

metadata of a file, known by the storage.

Constructors

MkFileData 

Fields

fd_FileId :: FileId

filename

fd_Size :: Integer

filesize

fd_CreationDate :: UTCTime

creation date

fd_LastModifiedDate :: UTCTime

last modified date

fd_Hashvalue :: Integer

hash value

Configuration

Creation and Destruction

closeFileSystem :: FileSystem -> IO ()Source

Closes the filesystem.

Operations

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