The virtualfile Module

Created on 24.08.2011

class cloudfusion.pyfusebox.virtualfile.VirtualFile(path)

Bases: object

INITIAL_TEXT = '\nSome virtual Text.\n'
get_dir()
Returns:the pyth of the directory of this virtual file
get_name()
get_path()
get_subdir(real_directory)
Returns:the parent directory of this virtualfile’s path which is a subdirectory of real_directory
get_text()
getattr()
read(size, offset)
truncate()
write(buf, offset)

The configurable_pyfusebox Module

Created on 23.08.2011

This FUSE module initializes the store at runtime when the user accesses the virtual file /.config/.###config### and writes the appropriate parameters to the file.

class cloudfusion.pyfusebox.configurable_pyfusebox.ConfigurablePyFuseBox(root)

Bases: cloudfusion.pyfusebox.pyfusebox.PyFuseBox

Offers a virtual configuration file, to configure Cloudfusion at runtime. To better separate the data from the configuration directory, data can be accessed in the top level directory data, and the configuration file can be accessed in the top level directory config.

DATA_FOLDER_PATH = '/data'
VIRTUAL_CONFIG_FILE = '/config/config'
_getattr_for_folder_with_full_access()
create(path, mode)
disable_logging()
enable_logging()
flush(path, fh)
getattr(path, fh=None)
mkdir(path, mode)
read(path, size, offset, fh)
readdir(path, fh)
release(path, fh)
remove_data_folder_prefix(path)
rename(old, new)
rmdir(path)
statfs(path)
truncate(path, length, fh=None)
write(path, buf, offset, fh)

The pyfusebox Module

class cloudfusion.pyfusebox.pyfusebox.PyFuseBox(path, store)

Bases: cloudfusion.fuse.Operations

This is the application entry point for file system requests, for instance to handle read and write requests to files within the mount directory. PyFuseBox delegates these requests to an implementation of the interface cloudfusion.store.Store. For instance to cloudfusion.store.dropbox.dropbox_store.DropboxStore, which would then retrieve the accessed file from Dropbox, or store the modified file to Dropbox.

Create an instance of cloudfusion.pyfusebox.PyFuseBox. :param path: the path to the mount point :param store: an instance of the implementation of the interface cloudfusion.store.Store or None for later configuration

_release(path, fh)
create(path, mode)
flush(path, fh)
getattr(path, fh=None)
mkdir(path, mode)
open(path, flags)
read(path, size, offset, fh)
readdir(path, fh)
release(path, fh)
rename(old, new)
rmdir(path)
slow_down_if_cache_full(filesize)

Reduce write speed to 10kB/s if cache has reached its hard limit

statfs(path)

This implementation should be looked at by a linux guru, since I have little experience concerning filesystems.

truncate(path, length, fh=None)
write(path, buf, offset, fh)
cloudfusion.pyfusebox.pyfusebox.zstat()

The transparent_configurable_pyfusebox Module

Created on Oct 7, 2013

@author: joe

class cloudfusion.pyfusebox.transparent_configurable_pyfusebox.TransparentConfigurablePyFuseBox(root)

Bases: cloudfusion.pyfusebox.configurable_pyfusebox.ConfigurablePyFuseBox

Offers a virtual statistics directory stats, to monitor Cloudfusion at runtime. The three files are stats, notuploaded, and errors. stats shows runtime statistics like throughput, cache hits, or cache size. notuploaded shows a list of files that is not yet synchronized with the provider. errors shows a list of recent errors.

DATA_FOLDER_PATH = '/data'
STATS_DIR = '/stats'
VIRTUAL_DIRTY_FILELIST_FILE = '/stats/notuploaded'
VIRTUAL_ERRORS_FILE = '/stats/errors'
VIRTUAL_STATISTICS_FILE = '/stats/stats'
XATTR_IS_DIRTY = 'XATTR_IS_DIRTY'
_get_exception_stats()
_initialize_store()
_log_exception(exception)
_update_vtf(path)
getattr(path, fh=None)
getxattr(path, name, position=0)
listxattr(path)
read(path, size, offset, fh)
readdir(path, fh)
release(path, fh)
truncate(path, length, fh=None)
write(path, buf, offset, fh)

The virtualconfigfile Module

Created on 24.08.2011

class cloudfusion.pyfusebox.virtualconfigfile.VirtualConfigFile(path, pyfusebox)

Bases: cloudfusion.pyfusebox.virtualfile.VirtualFile

Responsible for the (re)configuration of cloudfusion.pyfusebox.ConfigurablePyFuseBox, everytime it contents is written to it.

INITIAL_TEXT = '\n#explanation of config parameter 1\n#explanation of config parameter 2\n#explanation of config parameter 3\n\n'
_VirtualConfigFile__get_new_store(service, auth)

To add a new implementation of cloudfusion.store.Store, add an elif branch in the if statement. The parameter service is the value of the variable name specified in the configuration file in the [store] section. The parameter auth is a dictionary with every variable specified in the configuration file in the [auth] section, such as password and user. :param service: The name of the service to be used. I.e. Sugarsync, Dropbox, or Google Storage. :param auth: Dictionary of the variable specified in the configuration file’s [auth] section.

_initialize_store()

Parametrize the store implementation with the settings in the configuration file Also, it is determined which wrappers should envelope the store for caching, or to provide a monitoring layer.

_reconfigure_store()
_unify_auth(auth)

Add id and secret.

auto_register()
get_service_auth_data()
get_store_config_data()
write(buf, offset)

Table Of Contents

Previous topic

The db_handler Module

Next topic

Subpackages

This Page