Main Page | Modules | Data Structures | File List | Data Fields

File System Interface
[State Object Library]


Typedefs

typedef sos_fs_t sos_fs_t
typedef sos_fs_txn_t sos_fs_txn_t

Functions

 sos_fs_create (apr_pool_t *pool, sul_cfg_block_t *cfg)
 sos_fs_open (sos_fs_t *fs, apr_size_t cns_override, apr_pool_t *pool)
 sos_fs_open_config (sos_fs_t *fs, apr_size_t cns_override, const char *ip, const char *dbname, const char *user, const char *password)
 sos_fs_close (sos_fs_t *fs)
 sos_fs_clear (sos_fs_t *fs)
 sos_fs_hup (sos_fs_t *fs)
 sos_fs_txn_create (sos_fs_txn_t **txn, sos_fs_t *fs, apr_pool_t *pool)
 sos_fs_txn_begin (sos_fs_txn_t *txn, apr_pool_t *pool)
 sos_fs_txn_rollback (sos_fs_txn_t *txn, apr_pool_t *pool)
 sos_fs_txn_end (sos_fs_txn_t *txn, apr_pool_t *pool)
 sos_fs_txn_destroy (sos_fs_txn_t *txn, apr_pool_t *pool)
 sos_fs_create_connection (sos_fs_t *fs, const char *ip, const char *dbname, const char *user, const char *password)
 sos_fs_dbc (sos_fs_t *fs, apr_pool_t *pool)
 sos_fs_txn_return (sos_fs_txn_t *txn)
 sos_fs_txn_dbc (sos_fs_txn_t *txn)

Typedef Documentation

typedef struct sos_fs_t sos_fs_t
 

A pointer to a specific file system. File Systems are where we store all of the data required during runtime. It is also where all of the state and runtime information is stored. File Systems can have any implementation as long as they all use this same interface.

typedef struct sos_fs_txn_t sos_fs_txn_t
 

When we would like to do a bunch of stuff in a transaction we create one and then proceed to do all of our dirty work inside.


Function Documentation

sos_fs_clear sos_fs_t fs  ) 
 

Clears a file system. We do this after forks?

Parameters:
fs A file system pointer.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_close sos_fs_t fs  ) 
 

Closes a file system.

Parameters:
fs A file system pointer.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_create apr_pool_t *  pool,
sul_cfg_block_t cfg
 

Creates a new instance of a File System. This merely allocates memory and initializes the state.

Parameters:
pool Memory pool to allocate overhead from.
cfg 
Returns:
A new file system pointer.

sos_fs_create_connection sos_fs_t fs,
const char *  ip,
const char *  dbname,
const char *  user,
const char *  password
 

Creates all of the internal database connections for the File System. There is a finite number of connections available, so threads needing one when they are all consumed will block until one is returned to the file system. applications should customize the number of connections created to their specific needs.

Parameters:
fs A file system pointer.
ip 
dbname 
user 
password 
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_dbc sos_fs_t fs,
apr_pool_t *  pool
 

Gets a new database connection from the File System.

Parameters:
fs File System.
pool Memory pool to allocate overhead from.
Returns:
A database connection.

sos_fs_hup sos_fs_t fs  ) 
 

Hangs up on a file system, causing everything to be reinitialized. This is invoked whenever the user HUP's the daemon and so the file system should clear any caches and such.

Parameters:
fs A file system pointer.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_open sos_fs_t fs,
apr_size_t  cns_override,
apr_pool_t *  pool
 

Opens a file system.

Parameters:
fs A file system pointer.
cns_override 
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_open_config sos_fs_t fs,
apr_size_t  cns_override,
const char *  ip,
const char *  dbname,
const char *  user,
const char *  password
 

Parameters:
fs 
cns_override 
ip 
dbname 
user 
password 
Returns:

sos_fs_txn_begin sos_fs_txn_t txn,
apr_pool_t *  pool
 

Begins a new Transaction. This function can be call recursively, only one transaction will be created though, corresponding with the two outer calls to sos_fs_txn_begin and sos_fs_txn_end.

Parameters:
txn A database transaction.
pool Memory pool to allocate overhead from.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_txn_create sos_fs_txn_t **  txn,
sos_fs_t fs,
apr_pool_t *  pool
 

Creates a new file system transaction. All activity in the file system occurs inside of a transaction, this ensures atomicity and also provides a nice wrapping of the concept of database connections. Database transactions need not be thread safe. The returned transaction is tied to the lifetime of the memory pool Memory pool to allocate overhead from. is tied up until then.

Note: Never allocate transactions from the global pool Memory pool to allocate overhead from. never quit because the connection will never be released before the database system is shutdown.

Parameters:
txn A database transaction.
fs A file system pointer.
pool Memory pool to allocate overhead from.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_txn_dbc sos_fs_txn_t txn  ) 
 

Returns the databse connection associated with a specific file system transaction.

Parameters:
txn A database transaction.
Returns:
A database connection.

sos_fs_txn_destroy sos_fs_txn_t txn,
apr_pool_t *  pool
 

Destroys a transaction.

Parameters:
txn A database transaction.
pool Memory pool to allocate overhead from.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_txn_end sos_fs_txn_t txn,
apr_pool_t *  pool
 

Commits the changes in the active Transaction. Must be called by the user after a call to sos_fs_txn_begin if the changes are to be commited.

Parameters:
txn A database transaction.
pool Memory pool to allocate overhead from.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_txn_return sos_fs_txn_t txn  ) 
 

Returns a transaction to its parent file system.

Parameters:
txn A database transaction.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sos_fs_txn_rollback sos_fs_txn_t txn,
apr_pool_t *  pool
 

Ends any active Transaction and rolls back the changes. If a transaction is being cleaned up by a memory pool Memory pool to allocate overhead from. there is an outstanding transaction then the system will automatically call sos_fs_txn_rollback as it is assume to be in a state of error.

Parameters:
txn A database transaction.
pool Memory pool to allocate overhead from.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.


Generated on Wed Apr 28 09:38:37 2004 for State by doxygen 1.3.5