SOS: Scalable Object Store  4.0.0
 All Classes Functions Variables Typedefs Enumerations Enumerator Groups Pages
Container Functions

Functions

int sos_container_new (const char *path, int o_mode)
 Create a Container. More...
 
sos_t sos_container_open (const char *path, sos_perm_t o_perm)
 Open a Container. More...
 
int sos_container_move (const char *path_arg, const char *new_path)
 Move a container. More...
 
int sos_container_delete (sos_t c)
 Delete storage associated with a Container. More...
 
int sos_container_stat (sos_t sos, struct stat *sb)
 Return information about a container. More...
 
void sos_container_close (sos_t c, sos_commit_t flags)
 Close a Container. More...
 
int sos_container_commit (sos_t c, sos_commit_t flags)
 Flush outstanding changes to persistent storage. More...
 
void sos_container_info (sos_t sos, FILE *fp)
 Print container information. More...
 
int sos_container_lock_info (const char *path, FILE *fp)
 Print container lock information. More...
 
int sos_container_lock_cleanup (const char *path)
 Release locks held by dead processes. More...
 
void sos_inuse_obj_info (sos_t sos, FILE *fp)
 
void sos_free_obj_info (sos_t sos, FILE *fp)
 
int sos_container_config_set (const char *path, const char *option, const char *value)
 Set a container configuration option. More...
 
char * sos_container_config_get (const char *path, const char *option)
 
sos_config_iter_t sos_config_iter_new (const char *path)
 
void sos_config_iter_free (sos_config_iter_t iter)
 
sos_config_t sos_config_first (sos_config_iter_t iter)
 
sos_config_t sos_config_next (sos_config_iter_t iter)
 
void sos_config_print (const char *path, FILE *fp)
 

Detailed Description

Function Documentation

void sos_container_close ( sos_t  sos,
sos_commit_t  flags 
)

Close a Container.

This function commits changes to stable storage and releases all in-memory resources associated with the container.

If SOS_COMMIT_SYNC is specified in the flags parameter, the function will wait until the changes are commited before returning.

Parameters
sosThe SOS container handle
flagsThe commit flags
int sos_container_commit ( sos_t  sos,
sos_commit_t  flags 
)

Flush outstanding changes to persistent storage.

This function commits the index changes to stable storage. If SOS_COMMIT_SYNC is specified in the flags parameter, the function will wait until the changes are commited to stable stroage before returning.

Parameters
sosThe SOS container handle
flagsThe commit flags
int sos_container_config_set ( const char *  path,
const char *  opt_name,
const char *  opt_value 
)

Set a container configuration option.

Container configuration options are used to manage the storage management features of SOS

SOS_POS_KEEP_TIME Determines how long iterator positions are kept before being destroyed. The time is specified in seconds.

Sets the value of a SOS container option. Options include:

int sos_container_delete ( sos_t  c)

Delete storage associated with a Container.

Removes all resources associated with the Container. The sos_t handle must be provided (requiring an open) because it is necessary to know the associated Indices in order to be able to know the names of the associated files. sos_destroy() will also close sos, as the files should be closed before begin removed.

Parameters
cThe container handle
Return values
0The container was deleted
EPERMThe user has insufficient privilege
EINUSEThe container is in-use by other clients
void sos_container_info ( sos_t  sos,
FILE *  fp 
)

Print container information.

Prints information about the container to the specified FILE pointer.

Parameters
sosThe container handle
fpThe FILE pointer
int sos_container_lock_cleanup ( const char *  path)

Release locks held by dead processes.

It is possible for a process to die while holding container locks. This renders the container inaccessible. This function will release locks held by dead processes.

Parameters
sosThe container handle
int sos_container_lock_info ( const char *  path,
FILE *  fp 
)

Print container lock information.

Prints information about the locks held on the container to a FILE pointer.

Parameters
sosThe container handle
fpThe FILE pointer
int sos_container_move ( const char *  path_arg,
const char *  new_path 
)

Move a container.

Changes the path data that the container keeps internally for partitions.

Parameters
pathPathname to the Container. See sos_container_new()
new_pathPathname where the containter was copied.
int sos_container_new ( const char *  path,
int  o_mode 
)

Create a Container.

Creates a SOS container. The o_flags and o_mode parameters accept the same values and have the same meaning as the corresponding parameters to the open() system call.

Containers are logically maintained in a Unix filesystem namespace. The specified path must be unique for the Container and all sub-directories in the path up to, but not including the basename() must exist.

Parameters
pathPathname for the Container.
o_modeThe file mode for the Container.
Return values
0The container was successfully created.
EINVALA parameter was invalid
EPERMThe user has insufficient permission
EEXISTA container already exists at the specified path
sos_t sos_container_open ( const char *  path_arg,
sos_perm_t  o_perm 
)

Open a Container.

Open a SOS container. If successfull, the c parameter will contain a valid sos_t handle on exit.

Parameters
pathPathname for the Container. See sos_container_new()
o_permThe requested read/write permissions
Return values
!NULLThe sos_t handle for the container.
NULLAn error occured, consult errno for the reason.
int sos_container_stat ( sos_t  sos,
struct stat *  sb 
)

Return information about a container.

Fills a Unix struct stat buffer with information about a container's meta data.

Parameters
sosThe container handle
sbThe struct stat buffer
Return values
0Success
!0A Unix error code