SOS: Scalable Object Store
4.0.0
|
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) |
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.
sos | The SOS container handle |
flags | The 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.
sos | The SOS container handle |
flags | The 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.
c | The container handle |
0 | The container was deleted |
EPERM | The user has insufficient privilege |
EINUSE | The 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.
sos | The container handle |
fp | The 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.
sos | The 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.
sos | The container handle |
fp | The 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.
path | Pathname to the Container. See sos_container_new() |
new_path | Pathname 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.
path | Pathname for the Container. |
o_mode | The file mode for the Container. |
0 | The container was successfully created. |
EINVAL | A parameter was invalid |
EPERM | The user has insufficient permission |
EEXIST | A 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.
path | Pathname for the Container. See sos_container_new() |
o_perm | The requested read/write permissions |
!NULL | The sos_t handle for the container. |
NULL | An 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.
sos | The container handle |
sb | The struct stat buffer |
0 | Success |
!0 | A Unix error code |