Modules | |
Column-access functiones. | |
This set of functions provide column-wise accesses to query results. | |
Row-wise access functiones. | |
This set of functions provide row-wise accesses to query results. | |
Typedefs | |
typedef struct FastBitQuery * | FastBitQueryHandle |
A handle to be used by C clients. | |
Functions | |
int | fastbit_add_values (const char *colname, const char *coltype, void *vals, uint32_t nelem, uint32_t start) |
Add nelem values of the specified column (colname ) to the in-memory buffer. | |
int | fastbit_build_index (const char *indexLocation, const char *cname, const char *indexOptions) |
Build an index for the named attribute. | |
int | fastbit_build_indexes (const char *indexLocation, const char *indexOptions) |
Build indexes for all columns in the named directory. | |
FastBitQueryHandle | fastbit_build_query (const char *selectClause, const char *indexLocation, const char *queryConditions) |
Build a new FastBit query. | |
void | fastbit_cleanup (void) |
Clean up resources hold by FastBit file manager. | |
int | fastbit_columns_in_partition (const char *dir) |
Return the number of columns in the data partition. | |
int | fastbit_destroy_query (FastBitQueryHandle query) |
Free all resource associated with the handle. | |
int | fastbit_flush_buffer (const char *dir) |
Flush the in-memory data to the named directory. | |
const char * | fastbit_get_from_clause (FastBitQueryHandle query) |
Return the table name. | |
const char * | fastbit_get_logfile () |
Find out the name of the current log file. | |
FILE * | fastbit_get_logfilepointer () |
Return the file pointer to the log file. | |
int | fastbit_get_result_columns (FastBitQueryHandle query) |
Count the number of columns selected in the select clause of the query. | |
int | fastbit_get_result_rows (FastBitQueryHandle query) |
Return the number of hits in the query. | |
const char * | fastbit_get_select_clause (FastBitQueryHandle query) |
Return the string form of the select clause. | |
int | fastbit_get_verbose_level (void) |
Return the current verboseness level. | |
int | fastbit_get_version_number () |
Return the software version as an integer. | |
const char * | fastbit_get_version_string () |
Return the software version as a string. | |
const char * | fastbit_get_where_clause (FastBitQueryHandle query) |
Return the where clause of the query. | |
void | fastbit_init (const char *rcfile) |
Initialization function. | |
int | fastbit_purge_index (const char *indexLocation, const char *cname) |
Purge the index of the named attribute. | |
int | fastbit_purge_indexes (const char *indexLocation) |
Purge all index files. | |
int | fastbit_reorder_partition (const char *dir) |
Reorder all the columns in the partition. | |
int | fastbit_rows_in_partition (const char *dir) |
Return the number of rows in the data partition. | |
int | fastbit_set_logfile (const char *filename) |
Change the name of the log file. | |
int | fastbit_set_verbose_level (int v) |
Change the verboseness of FastBit functions. |
int fastbit_add_values | ( | const char * | colname, |
const char * | coltype, | ||
void * | vals, | ||
uint32_t | nelem, | ||
uint32_t | start | ||
) |
Add nelem
values of the specified column (colname
) to the in-memory buffer.
Add nelem
values of the specified column (colname
) to the in-memory buffer.
nelem
values, though only the first nelem
values are used by this function.vals
to be added to the in-memory buffer.References ibis::tablex::addColumn(), ibis::tablex::append(), ibis::BYTE, ibis::CATEGORY, ibis::DOUBLE, ibis::util::envLock, ibis::FLOAT, ibis::gVerbose, ibis::INT, ibis::LONG, ibis::SHORT, ibis::TEXT, ibis::UBYTE, ibis::UINT, ibis::ULONG, ibis::UNKNOWN_TYPE, and ibis::USHORT.
FastBitQueryHandle fastbit_build_query | ( | const char * | selectClause, |
const char * | indexLocation, | ||
const char * | queryConditions | ||
) |
Build a new FastBit query.
This is logically equivalent to the SQL statement "SELECT selectClause FROM indexLocation WHERE queryConditions." A blank selectClause is equivalent to "count(*)".
References fastbit_destroy_query(), fastbit_init(), and ibis::gVerbose.
void fastbit_cleanup | ( | void | ) |
Clean up resources hold by FastBit file manager.
Clean up resources hold by FastBit file manager.
It is expected to be te last function to be called by the user. Since there is no centralized list of query objects, the user is responsible for freeing the resources held by each query object.
References ibis::util::envLock, ibis::gVerbose, and ibis::fileManager::instance().
int fastbit_destroy_query | ( | FastBitQueryHandle | query | ) |
Free all resource associated with the handle.
References ibis::BYTE, ibis::DOUBLE, ibis::FLOAT, ibis::gVerbose, ibis::INT, ibis::LONG, ibis::OID, ibis::SHORT, ibis::TEXT, ibis::UBYTE, ibis::UINT, ibis::ULONG, and ibis::USHORT.
Referenced by fastbit_build_query().
int fastbit_flush_buffer | ( | const char * | dir | ) |
Flush the in-memory data to the named directory.
Flush the in-memory data to the named directory.
In addition, if the new records contain columns that are not already in the directory, then the new columns are automatically added with existing records assumed to contain NULL values. This set of functions are intended for a user to append some number of rows in one operation. It is clear that writing one row as a time is slow because of the overhead involved in writing the files. On the other hand, since the new rows are stored in memory, it can not store too many rows.
References ibis::util::envLock, ibis::gVerbose, ibis::part::updateData(), and ibis::tablex::write().
const char* fastbit_get_logfile | ( | ) |
Find out the name of the current log file.
int fastbit_get_result_columns | ( | FastBitQueryHandle | query | ) |
Count the number of columns selected in the select clause of the query.
int fastbit_get_result_rows | ( | FastBitQueryHandle | query | ) |
Return the number of hits in the query.
It is also the number of rows in the result set. The arrays returned by fastbit_get_qualified_floats shall have this many elements.
References ibis::gVerbose.
void fastbit_init | ( | const char * | rcfile | ) |
Initialization function.
Initialization function.
May pass in a nil pointer as rcfile if one is expected to use use the default configuartion files listed in the documentation of ibis::resources::read. One may call this function multiple times to read multiple configuration files to modify the parameters.
References ibis::util::envLock, ibis::gParameters(), ibis::gVerbose, and ibis::resource::read().
Referenced by fastbit_build_index(), fastbit_build_indexes(), fastbit_build_query(), fastbit_columns_in_partition(), fastbit_purge_index(), fastbit_purge_indexes(), fastbit_reorder_partition(), and fastbit_rows_in_partition().
int fastbit_reorder_partition | ( | const char * | dir | ) |
Reorder all the columns in the partition.
Reordering the rows can lead to better index compression and query performance.
References fastbit_init(), ibis::gVerbose, and ibis::part::reorder().
int fastbit_set_logfile | ( | const char * | filename | ) |
Change the name of the log file.
References ibis::gVerbose.
int fastbit_set_verbose_level | ( | int | v | ) |
Change the verboseness of FastBit functions.
References ibis::gVerbose.
![]() |