Created
October 31, 2014 01:47
-
-
Save mschoch/7a5fb25d8ce2b485ffde to your computer and use it in GitHub Desktop.
ForestDB test program with no fdb_commit()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
#include "libforestdb/forestdb.h" | |
int main(int argc, char**argv) { | |
fdb_handle *db; | |
fdb_status status; | |
fdb_config config; | |
config = fdb_get_default_config(); | |
status = fdb_open(&db, "/tmp/db", &config); | |
assert(status == FDB_RESULT_SUCCESS); | |
printf("opened database\n"); | |
int i; | |
for (i = 0; i < 100000000; i++) { | |
char key[10]; | |
snprintf(key, 9, "%d", i); | |
int keylen = strlen(key); | |
status = fdb_set_kv(db, key, keylen, "BOGUSDATA", 9); | |
assert(status == FDB_RESULT_SUCCESS); | |
if((i+1)%1000000 == 0) { | |
printf("written %d keys\n", i+1); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment