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. More... | |
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. More... | |
int | fastbit_build_index (const char *indexLocation, const char *cname, const char *indexOptions) |
Build an index for the named attribute. More... | |
int | fastbit_build_indexes (const char *indexLocation, const char *indexOptions) |
Build indexes for all columns in the named directory. More... | |
FastBitQueryHandle | fastbit_build_query (const char *selectClause, const char *indexLocation, const char *queryConditions) |
Build a new FastBit query. More... | |
void | fastbit_cleanup (void) |
Clean up resources hold by FastBit file manager. More... | |
int | fastbit_columns_in_partition (const char *dir) |
Return the number of columns in the data partition. More... | |
int | fastbit_destroy_query (FastBitQueryHandle query) |
Free all resource associated with the handle. More... | |
int | fastbit_flush_buffer (const char *dir) |
Flush the in-memory data to the named directory. More... | |
const char * | fastbit_get_from_clause (FastBitQueryHandle query) |
Return the table name. More... | |
const char * | fastbit_get_logfile () |
Find out the name of the current log file. More... | |
FILE * | fastbit_get_logfilepointer () |
Return the file pointer to the log file. More... | |
int | fastbit_get_result_columns (FastBitQueryHandle query) |
Count the number of columns selected in the select clause of the query. More... | |
int | fastbit_get_result_row_ids (FastBitQueryHandle, uint32_t *) |
Retrieve the row number of those satisfying the query conditions. More... | |
int | fastbit_get_result_rows (FastBitQueryHandle query) |
Retrieve the number of hits in the query. More... | |
const char * | fastbit_get_select_clause (FastBitQueryHandle query) |
Return the string form of the select clause. More... | |
int | fastbit_get_verbose_level (void) |
Return the current verboseness level. More... | |
int | fastbit_get_version_number () |
Return the software version as an integer. More... | |
const char * | fastbit_get_version_string () |
Return the software version as a string. More... | |
const char * | fastbit_get_where_clause (FastBitQueryHandle query) |
Return the where clause of the query. More... | |
void | fastbit_init (const char *rcfile) |
Initialization function. More... | |
int | fastbit_purge_index (const char *indexLocation, const char *cname) |
Purge the index of the named attribute. More... | |
int | fastbit_purge_indexes (const char *indexLocation) |
Purge all index files. More... | |
double | fastbit_read_clock () |
Read the system's wallclock timer. More... | |
int | fastbit_reorder_partition (const char *dir) |
Reorder all the columns in the partition. More... | |
int | fastbit_rows_in_partition (const char *dir) |
Return the number of rows in the data partition. More... | |
int | fastbit_set_logfile (const char *filename) |
Change the name of the log file. More... | |
int | fastbit_set_verbose_level (int v) |
Change the verboseness of FastBit functions. More... | |
typedef struct FastBitQuery* FastBitQueryHandle |
A handle to be used by C clients.
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::CATEGORY, ibis::DOUBLE, ibis::FLOAT, ibis::INT, ibis::LONG, ibis::SHORT, ibis::TEXT, ibis::UBYTE, ibis::UINT, ibis::ULONG, ibis::UNKNOWN_TYPE, and ibis::USHORT.
int fastbit_build_index | ( | const char * | indexLocation, |
const char * | cname, | ||
const char * | indexOptions | ||
) |
Build an index for the named attribute.
References ibis::part::getColumn(), ibis::column::loadIndex(), ibis::part::nColumns(), ibis::part::nRows(), ibis::column::unloadIndex(), and ibis::part::updateMetaData().
int fastbit_build_indexes | ( | const char * | indexLocation, |
const char * | indexOptions | ||
) |
Build indexes for all columns in the named directory.
References ibis::part::buildIndexes(), ibis::part::nColumns(), and ibis::part::nRows().
FastBitQueryHandle fastbit_build_query | ( | const char * | select, |
const char * | datadir, | ||
const char * | where | ||
) |
Build a new FastBit query.
Build a new FastBit query.
" A blank selectClause is equivalent to "count(*)". The dataLocation is the directory containing the data and indexes. This is a required field. If the where clause is missing, the query is assumed to match all rows following the convention used by SQL.
References fastbit_destroy_query().
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::fileManager::clear(), ibis::util::closeLogFile(), and ibis::fileManager::instance().
int fastbit_columns_in_partition | ( | const char * | dir | ) |
Return the number of columns in the data partition.
References ibis::part::nColumns(), and ibis::part::releaseAccess().
int fastbit_destroy_query | ( | FastBitQueryHandle | query | ) |
Free all resource associated with the handle.
References ibis::DOUBLE, ibis::FLOAT, 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::part::releaseAccess(), ibis::part::updateData(), and ibis::tablex::write().
const char* fastbit_get_from_clause | ( | FastBitQueryHandle | query | ) |
Return the table name.
References ibis::part::name().
const char* fastbit_get_logfile | ( | ) |
Find out the name of the current log file.
References ibis::util::getLogFileName().
FILE* fastbit_get_logfilepointer | ( | ) |
Return the file pointer to the log file.
References ibis::util::getLogFile().
int fastbit_get_result_columns | ( | FastBitQueryHandle | query | ) |
Count the number of columns selected in the select clause of the query.
int fastbit_get_result_row_ids | ( | FastBitQueryHandle | qhandle, |
uint32_t * | ids | ||
) |
Retrieve the row number of those satisfying the query conditions.
Retrieve the row number of those satisfying the query conditions.
The row ids are limited to be uint32_t so that no more than 4 billion rows could be stored in a single data partition.
The caller must have allocated enough space.
References ibis::query::FULL_EVALUATE, and ibis::bitvector::indexSet::nIndices().
int fastbit_get_result_rows | ( | FastBitQueryHandle | query | ) |
Retrieve 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::query::FULL_EVALUATE.
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.
References ibis::util::getVersionNumber().
const char* fastbit_get_version_string | ( | ) |
Return the software version as a string.
References ibis::util::getVersionString().
const char* fastbit_get_where_clause | ( | FastBitQueryHandle | query | ) |
Return the where clause of the query.
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::gParameters(), and ibis::resource::read().
int fastbit_purge_index | ( | const char * | indexLocation, |
const char * | cname | ||
) |
Purge the index of the named attribute.
References ibis::part::getColumn(), ibis::part::nColumns(), ibis::part::nRows(), ibis::column::purgeIndexFile(), and ibis::part::releaseAccess().
int fastbit_purge_indexes | ( | const char * | indexLocation | ) |
Purge all index files.
References ibis::part::purgeIndexFiles(), and ibis::part::releaseAccess().
double fastbit_read_clock | ( | ) |
Read the system's wallclock timer.
It tries to use clock_gettime if it is available, otherwise it falls back to gettimeofday and clock.
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 ibis::part::releaseAccess(), and ibis::part::reorder().
int fastbit_rows_in_partition | ( | const char * | dir | ) |
Return the number of rows in the data partition.
References ibis::part::nRows(), and ibis::part::releaseAccess().
int fastbit_set_logfile | ( | const char * | filename | ) |
Change the name of the log file.
References ibis::util::setLogFileName().
int fastbit_set_verbose_level | ( | int | v | ) |
Change the verboseness of FastBit functions.