Commit ea41c343 authored by Rich Prohaska's avatar Rich Prohaska

add db get, db delete

git-svn-id: file:///svn/tokudb@293 c7de825b-a66e-492c-adef-691d508d4ae1
parent 204f68ed
...@@ -260,7 +260,8 @@ struct __toku_dbc_internal { ...@@ -260,7 +260,8 @@ struct __toku_dbc_internal {
}; };
int __toku_c_get (DBC *c, DBT *key, DBT *data, u_int32_t flag) { int __toku_c_get (DBC *c, DBT *key, DBT *data, u_int32_t flag) {
return brt_c_get(c->i->c, key, data, flag); int r = brt_c_get(c->i->c, key, data, flag);
return r;
} }
int __toku_c_close (DBC *c) { int __toku_c_close (DBC *c) {
...@@ -270,8 +271,8 @@ int __toku_c_close (DBC *c) { ...@@ -270,8 +271,8 @@ int __toku_c_close (DBC *c) {
} }
int __toku_c_del (DBC *c, u_int32_t flags) { int __toku_c_del (DBC *c, u_int32_t flags) {
barf(); int r = brt_cursor_delete(c->i->c, flags);
return 0; return r;
} }
int __toku_db_cursor (DB *db, DB_TXN *txn, DBC **c, u_int32_t flags) { int __toku_db_cursor (DB *db, DB_TXN *txn, DBC **c, u_int32_t flags) {
...@@ -289,14 +290,15 @@ int __toku_db_cursor (DB *db, DB_TXN *txn, DBC **c, u_int32_t flags) { ...@@ -289,14 +290,15 @@ int __toku_db_cursor (DB *db, DB_TXN *txn, DBC **c, u_int32_t flags) {
return 0; return 0;
} }
int __toku_db_del (DB *db, DB_TXN *txn, DBT *dbt, u_int32_t flags) { int __toku_db_del (DB *db, DB_TXN *txn __attribute__((unused)), DBT *key, u_int32_t flags __attribute((unused))) {
barf(); int r = brt_delete(db->i->brt, key, db);
abort(); return r;
} }
int __toku_db_get (DB *db, DB_TXN *txn, DBT *dbta, DBT *dbtb, u_int32_t flags) { int __toku_db_get (DB *db, DB_TXN *txn __attribute__((unused)), DBT *key, DBT *data, u_int32_t flags) {
barf(); assert(flags == 0);
abort(); int r = brt_lookup(db->i->brt, key, data, db);
return r;
} }
int __toku_db_key_range (DB *db, DB_TXN *txn, DBT *dbt, DB_KEY_RANGE *kr, u_int32_t flags) { int __toku_db_key_range (DB *db, DB_TXN *txn, DBT *dbt, DB_KEY_RANGE *kr, u_int32_t flags) {
...@@ -371,8 +373,8 @@ int __toku_db_open (DB *db, DB_TXN *txn, const char *fname, const char *dbname, ...@@ -371,8 +373,8 @@ int __toku_db_open (DB *db, DB_TXN *txn, const char *fname, const char *dbname,
assert(r==0); assert(r==0);
return 0; return 0;
} }
int __toku_db_put (DB *db, DB_TXN *txn, DBT *dbta, DBT *dbtb, u_int32_t flags) { int __toku_db_put (DB *db, DB_TXN *txn, DBT *key, DBT *data, u_int32_t flags) {
int r = brt_insert(db->i->brt, dbta, dbtb, db); int r = brt_insert(db->i->brt, key, data, db);
//printf("%s:%d %d=__toku_db_put(...)\n", __FILE__, __LINE__, r); //printf("%s:%d %d=__toku_db_put(...)\n", __FILE__, __LINE__, r);
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment