A facade for accessing some FastBit functions from java. More...
Classes | |
class | QueryHandle |
An auxiliary class to hold handles to query objects. More... | |
Public Member Functions | |
native int | add_bytes (String colname, byte[] arr) |
Add values to a values to a byte-valued column. More... | |
native int | add_doubles (String colname, double[] arr) |
Add the name column containing double values. More... | |
native int | add_floats (String colname, float[] arr) |
Add values to a values to a float-valued column. More... | |
native int | add_ints (String colname, int[] arr) |
Add values to a values to a int-valued column. More... | |
native int | add_longs (String colname, long[] arr) |
Add values to a values to a long-valued column. More... | |
native int | add_shorts (String colname, short[] arr) |
Add values to a values to a short-valued column. More... | |
native int | build_index (String dir, String col, String opt) |
Build an index for the named column. More... | |
native int | build_indexes (String dir, String opt) |
Build indexes for all columns in the specified directory. More... | |
native QueryHandle | build_query (String select, String datadir, String where) |
Build a new query object. More... | |
native int | destroy_query (QueryHandle handle) |
Destroy a query object. More... | |
FastBit (String rcfile) | |
Constructor. More... | |
native String | get_logfile () |
Retrieve the name of the log file. | |
native int | get_message_level () |
Return the current message level used by FastBit. | |
native byte[] | get_qualified_bytes (QueryHandle handle, String col) |
Retrieve the values of the named column from the rows satisfying the query conditions. More... | |
native double[] | get_qualified_doubles (QueryHandle handle, String col) |
Retrieve values as doubles. More... | |
native float[] | get_qualified_floats (QueryHandle handle, String col) |
Retrieve values as floats. More... | |
native int[] | get_qualified_ints (QueryHandle handle, String col) |
Retrieve values as ints. More... | |
native long[] | get_qualified_longs (QueryHandle handle, String col) |
Retrieve values as longs. More... | |
native short[] | get_qualified_shorts (QueryHandle handle, String col) |
Retrieve values as shorts. More... | |
native int[] | get_result_row_ids (QueryHandle handle) |
Retrieve the ids of rows satisfying the query conditions. More... | |
native int | get_result_size (QueryHandle handle) |
Return the number of records/rows satisfying the query conditions. More... | |
native int | number_of_columns (String dir) |
Compute the number of columns in the specified directory. More... | |
native int | number_of_rows (String dir) |
Compute the number of rows in the specified directory. More... | |
native int | purge_index (String dir, String col) |
Remove the index files associated with the specified column. | |
native int | purge_indexes (String dir) |
Remove all existing index files. More... | |
native int | set_logfile (String filename) |
Change the name of the log file. | |
native int | set_message_level (int level) |
Change the message level to the specified value. More... | |
native int | write_buffer (String dir) |
Write the buffer to the named directory. More... | |
Protected Member Functions | |
native void | cleanup () |
Cleanup resources hold by FastBit services. More... | |
void | finalize () |
Perform the final clean up job. | |
native void | init (String rcfile) |
Function to initialize required data structure on C++ side. More... | |
A facade for accessing some FastBit functions from java.
This class exports some functions from ibis::part
and ibis::query
classes to java. A very small example is available in java/milky.java.
|
inline |
Constructor.
The argument to the constructor can be an empty string.
References gov.lbl.fastbit.FastBit.init().
native int gov.lbl.fastbit.FastBit.add_bytes | ( | String | colname, |
byte[] | arr | ||
) |
Add values to a values to a byte-valued column.
native int gov.lbl.fastbit.FastBit.add_doubles | ( | String | colname, |
double[] | arr | ||
) |
Add the name column containing double values.
Note that if the target directory contains values already, the type specified here must match exactly.
native int gov.lbl.fastbit.FastBit.add_floats | ( | String | colname, |
float[] | arr | ||
) |
Add values to a values to a float-valued column.
native int gov.lbl.fastbit.FastBit.add_ints | ( | String | colname, |
int[] | arr | ||
) |
Add values to a values to a int-valued column.
native int gov.lbl.fastbit.FastBit.add_longs | ( | String | colname, |
long[] | arr | ||
) |
Add values to a values to a long-valued column.
native int gov.lbl.fastbit.FastBit.add_shorts | ( | String | colname, |
short[] | arr | ||
) |
Add values to a values to a short-valued column.
native int gov.lbl.fastbit.FastBit.build_index | ( | String | dir, |
String | col, | ||
String | opt | ||
) |
Build an index for the named column.
native int gov.lbl.fastbit.FastBit.build_indexes | ( | String | dir, |
String | opt | ||
) |
Build indexes for all columns in the specified directory.
native QueryHandle gov.lbl.fastbit.FastBit.build_query | ( | String | select, |
String | datadir, | ||
String | where | ||
) |
Build a new query object.
The three arguments mirros the three clauses of a simple SQL select statement.
|
protected |
Cleanup resources hold by FastBit services.
Referenced by gov.lbl.fastbit.FastBit.finalize().
native int gov.lbl.fastbit.FastBit.destroy_query | ( | QueryHandle | handle | ) |
Destroy a query object.
Reclaims all resources associated with the query object.
native byte [] gov.lbl.fastbit.FastBit.get_qualified_bytes | ( | QueryHandle | handle, |
String | col | ||
) |
Retrieve the values of the named column from the rows satisfying the query conditions.
If the column has appeared in the select clause in build_query
, then the values are guarateed to not contain any null values. If there is no null values to consider, then there is no need to specify anything in the select clause when building the query.
native double [] gov.lbl.fastbit.FastBit.get_qualified_doubles | ( | QueryHandle | handle, |
String | col | ||
) |
Retrieve values as doubles.
native float [] gov.lbl.fastbit.FastBit.get_qualified_floats | ( | QueryHandle | handle, |
String | col | ||
) |
Retrieve values as floats.
native int [] gov.lbl.fastbit.FastBit.get_qualified_ints | ( | QueryHandle | handle, |
String | col | ||
) |
Retrieve values as ints.
native long [] gov.lbl.fastbit.FastBit.get_qualified_longs | ( | QueryHandle | handle, |
String | col | ||
) |
Retrieve values as longs.
native short [] gov.lbl.fastbit.FastBit.get_qualified_shorts | ( | QueryHandle | handle, |
String | col | ||
) |
Retrieve values as shorts.
native int [] gov.lbl.fastbit.FastBit.get_result_row_ids | ( | QueryHandle | handle | ) |
Retrieve the ids of rows satisfying the query conditions.
native int gov.lbl.fastbit.FastBit.get_result_size | ( | QueryHandle | handle | ) |
Return the number of records/rows satisfying the query conditions.
|
protected |
Function to initialize required data structure on C++ side.
Referenced by gov.lbl.fastbit.FastBit.FastBit().
native int gov.lbl.fastbit.FastBit.number_of_columns | ( | String | dir | ) |
Compute the number of columns in the specified directory.
native int gov.lbl.fastbit.FastBit.number_of_rows | ( | String | dir | ) |
Compute the number of rows in the specified directory.
native int gov.lbl.fastbit.FastBit.purge_indexes | ( | String | dir | ) |
Remove all existing index files.
native int gov.lbl.fastbit.FastBit.set_message_level | ( | int | level | ) |
Change the message level to the specified value.
The default value is 0. As the message level increases, more message will be printed. Returns the current message level before the change is to take place.
native int gov.lbl.fastbit.FastBit.write_buffer | ( | String | dir | ) |
Write the buffer to the named directory.
It also flushes the current buffer. All functions calls to various add functions are assumed to be adding to a single FastBit data partition. This set of functions are intended for adding rows to a data partition. Considerable overhead is involved in creating the files when the function write_buffer is invoked, therefore it is not recommended for writing a single row. Additionally, since all data values are stored in a memory buffer, one can not write a large number of records in one shot.