Data Structures | Files | Enumerations | Functions | Variables

Fast plain-text write-only DB driver.
[Database Abstraction Layer]

Collaboration diagram for Fast plain-text write-only DB driver.:

Data Structures

Files

Enumerations

Functions

Variables


Enumeration Type Documentation

Enumerator:
FLAT_OPENED 

Handle opened successfully.

Definition at line 46 of file flat_con.h.


Function Documentation

int flat_cmd ( db_cmd_t cmd  ) 

This function allocates and initializes memory for a new flat_cmd data structure. The data structure is then attached to the generic db_cmd structure in cmd parameter.

Parameters:
cmd A generic db_cmd structure to which the newly created flat_cmd structure will be attached.
static void flat_cmd_free ( db_cmd_t cmd,
struct flat_cmd payload 
) [static]

This function frees all memory used by flat_cmd structure.

Parameters:
cmd A pointer to generic db_cmd command being freed.
payload A pointer to flat_cmd structure to be freed.

Definition at line 48 of file flat_cmd.c.

References flat_cmd::gen.

int flat_con ( db_con_t *  con  ) 

This function creates a new flat_con structure and attachs the structure to the generic db_con structure in the parameter.

Parameters:
con A generic db_con structure to be extended with flatstore payload
Return values:
0 on success
A negative number on error
static void flat_con_free ( db_con_t *  con,
struct flat_con payload 
) [static]

This function function frees all memory that is in use by a flat_con structure.

Parameters:
con A generic db_con connection structure.
payload Flatstore specific payload to be freed.

Definition at line 53 of file flat_con.c.

int flat_put ( db_res_t *  res,
db_cmd_t cmd 
)

This is the main execution function in this driver. It is executed whenever a SER module calls db_exec and the target database of the commands is flatstore.

Parameters:
res A pointer to (optional) result structure if the command returns a result.
Return values:
0 if executed successfully
A negative number if the database server failed to execute command
A positive number if there was an error on client side (SER)
int flat_uri ( db_uri_t *  uri  ) 

This function builds a new flat_uri structure from the body of the generic URI given to it in parameter.

Parameters:
uri A generic db_uri structure.
Return values:
0 on success
A negative number on error.
static void rotate ( rpc_t *  rpc,
void *  c 
) [static]

This function can be called through the management interface in SER and it will register a new file rotation request. This function only registers the request, it will be carried out next time SER attempts to write new data into the file.

Definition at line 44 of file flat_rpc.c.

References flat_rotate.


Variable Documentation

The character in this variable will be used to delimit fields.

Definition at line 77 of file flatstore_mod.c.

str flat_delimiter = STR_STATIC_INIT("|")

The character in this variable will be used to delimit fields.

Definition at line 77 of file flatstore_mod.c.

str flat_escape = STR_STATIC_INIT("\\")

The character in this variable will be used to escape specia characters, such as row and field delimiters, if they appear in the data being written in the files.

Definition at line 85 of file flatstore_mod.c.

The character in this variable will be used to escape specia characters, such as row and field delimiters, if they appear in the data being written in the files.

Definition at line 85 of file flatstore_mod.c.

Definition at line 65 of file flatstore_mod.c.

int flat_flush = 1

Definition at line 65 of file flatstore_mod.c.

This variable contains the time of the last rotation of files.

Definition at line 104 of file flatstore_mod.c.

This variable contains the time of the last rotation of files.

Definition at line 104 of file flatstore_mod.c.

str flat_pid = STR_NULL

The flatstore module generates one file per SER process to ensure that every SER process has its own file and no locking/synchronization is necessary. This variable contains a unique id of the SER process which will be added to the file name.

Definition at line 61 of file flatstore_mod.c.

The flatstore module generates one file per SER process to ensure that every SER process has its own file and no locking/synchronization is necessary. This variable contains a unique id of the SER process which will be added to the file name.

Definition at line 61 of file flatstore_mod.c.

The character in this variable will be used to delimit rows.

Definition at line 71 of file flatstore_mod.c.

str flat_record_delimiter = STR_STATIC_INIT("\n")

The character in this variable will be used to delimit rows.

Definition at line 71 of file flatstore_mod.c.

time_t* flat_rotate

This variable holds the timestamp of the last file rotation request received through the management interface.

Definition at line 98 of file flatstore_mod.c.

Referenced by rotate().

time_t* flat_rotate

This variable holds the timestamp of the last file rotation request received through the management interface.

Definition at line 98 of file flatstore_mod.c.

Referenced by rotate().

This is the suffix of newly created files.

Definition at line 91 of file flatstore_mod.c.

str flat_suffix = STR_STATIC_INIT(".log")

This is the suffix of newly created files.

Definition at line 91 of file flatstore_mod.c.