Esempio n. 1
0
JNIEXPORT jint JNICALL Java_gov_lbl_fastbit_FastBit_build_1index
(JNIEnv * env, jobject jo, jstring jdir, jstring jcol, jstring jopt) {
    jint            ierr;
    jboolean        iscopy;
    const char     *cdir;
    const char     *ccol;
    const char     *copt;
    if (jdir == NULL || jcol == NULL) {
	ierr = -1;
	return ierr;
    }

    cdir = (*env)->GetStringUTFChars(env, jdir, &iscopy);
    ccol = (*env)->GetStringUTFChars(env, jcol, &iscopy);
    if (jopt != NULL)
	copt = (*env)->GetStringUTFChars(env, jopt, &iscopy);
    else
	copt = NULL;

    ierr = fastbit_build_index(cdir, ccol, copt);

    if (NULL != copt) {
	(*env)->GetStringUTFChars(env, jopt, &iscopy);
    }
    (*env)->ReleaseStringUTFChars(env, jcol, ccol);
    (*env)->ReleaseStringUTFChars(env, jdir, cdir);
    return ierr;
} /* Java_gov_lbl_fastbit_FastBit_build_1index */
Esempio n. 2
0
void fb_table::build_indexes()
{
	for (size_t i = 0; i < ncolumns; i++) {
		if (columns[i].build_index) {
			fastbit_build_index(dir, columns[i].name, NULL);
		}
	}
}