Commit 53ef01da authored by Rich Prohaska's avatar Rich Prohaska

define the db->truncate function. addresses #968

git-svn-id: file:///svn/tokudb@4824 c7de825b-a66e-492c-adef-691d508d4ae1
parent 466fcd51
......@@ -196,7 +196,8 @@ struct __toku_db {
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=312 size=4, 64=bit offset=528 size=8 */
int (*remove) (DB *, const char *, const char *, u_int32_t); /* 32-bit offset=316 size=4, 64=bit offset=536 size=8 */
int (*rename) (DB *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=320 size=4, 64=bit offset=544 size=8 */
void* __toku_dummy6[5];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=324 size=4, 64=bit offset=552 size=8 */
void* __toku_dummy6[4];
int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=344 size=4, 64=bit offset=592 size=8 */
void* __toku_dummy7[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=356 size=4, 64=bit offset=616 size=8 */
......
......@@ -210,7 +210,8 @@ struct __toku_db {
int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t); /* 32-bit offset=372 size=4, 64=bit offset=648 size=8 */
int (*remove) (DB *, const char *, const char *, u_int32_t); /* 32-bit offset=376 size=4, 64=bit offset=656 size=8 */
int (*rename) (DB *, const char *, const char *, const char *, u_int32_t); /* 32-bit offset=380 size=4, 64=bit offset=664 size=8 */
void* __toku_dummy8[4];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=384 size=4, 64=bit offset=672 size=8 */
void* __toku_dummy8[3];
int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *)); /* 32-bit offset=400 size=4, 64=bit offset=704 size=8 */
void* __toku_dummy9[2];
void (*set_errfile) (DB *, FILE*); /* 32-bit offset=412 size=4, 64=bit offset=728 size=8 */
......
......@@ -224,29 +224,31 @@ struct __toku_db {
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=508 size=4, 64=bit offset=920 size=8 */
void* __toku_dummy13[6];
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=536 size=4, 64=bit offset=976 size=8 */
void* __toku_dummy14[4];
void* __toku_dummy14[2];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=548 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy15[1];
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=556 size=4, 64=bit offset=1016 size=8 */
void* __toku_dummy15[5]; /* Padding at the end */
char __toku_dummy16[16]; /* Padding at the end */
void* __toku_dummy16[5]; /* Padding at the end */
char __toku_dummy17[16]; /* Padding at the end */
};
struct __toku_db_txn_active {
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
void* __toku_dummy0[1];
char __toku_dummy1[12];
DB_LSN lsn; /* 32-bit offset=20 size=8, 64=bit offset=24 size=8 */
void* __toku_dummy0[2];
char __toku_dummy1[4];
DB_LSN lsn; /* 32-bit offset=16 size=8, 64=bit offset=24 size=8 */
char __toku_dummy2[184]; /* Padding at the end */
};
struct __toku_db_txn {
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
struct __toku_db_txn_internal *i;
void* __toku_dummy0[16];
char __toku_dummy1[16];
void *api_internal; /* 32-bit offset=88 size=4, 64=bit offset=160 size=8 */
void* __toku_dummy0[17];
char __toku_dummy1[8];
void *api_internal; /* 32-bit offset=84 size=4, 64=bit offset=160 size=8 */
void* __toku_dummy2[2];
int (*abort) (DB_TXN *); /* 32-bit offset=100 size=4, 64=bit offset=184 size=8 */
int (*commit) (DB_TXN*, u_int32_t); /* 32-bit offset=104 size=4, 64=bit offset=192 size=8 */
int (*abort) (DB_TXN *); /* 32-bit offset=96 size=4, 64=bit offset=184 size=8 */
int (*commit) (DB_TXN*, u_int32_t); /* 32-bit offset=100 size=4, 64=bit offset=192 size=8 */
void* __toku_dummy3[2];
u_int32_t (*id) (DB_TXN *); /* 32-bit offset=116 size=4, 64=bit offset=216 size=8 */
u_int32_t (*id) (DB_TXN *); /* 32-bit offset=112 size=4, 64=bit offset=216 size=8 */
void* __toku_dummy4[5]; /* Padding at the end */
};
struct __toku_db_txn_stat {
......
......@@ -223,10 +223,12 @@ struct __toku_db {
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=520 size=4, 64=bit offset=944 size=8 */
void* __toku_dummy13[6];
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=548 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy14[4];
void* __toku_dummy14[2];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=560 size=4, 64=bit offset=1024 size=8 */
void* __toku_dummy15[1];
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=568 size=4, 64=bit offset=1040 size=8 */
void* __toku_dummy15[5]; /* Padding at the end */
char __toku_dummy16[16]; /* Padding at the end */
void* __toku_dummy16[5]; /* Padding at the end */
char __toku_dummy17[16]; /* Padding at the end */
};
struct __toku_db_txn_active {
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
......
......@@ -227,10 +227,12 @@ struct __toku_db {
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=544 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy14[7];
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=576 size=4, 64=bit offset=1064 size=8 */
void* __toku_dummy15[4];
void* __toku_dummy15[2];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=588 size=4, 64=bit offset=1088 size=8 */
void* __toku_dummy16[1];
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=596 size=4, 64=bit offset=1104 size=8 */
void* __toku_dummy16[5]; /* Padding at the end */
char __toku_dummy17[16]; /* Padding at the end */
void* __toku_dummy17[5]; /* Padding at the end */
char __toku_dummy18[16]; /* Padding at the end */
};
struct __toku_db_txn_active {
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
......
......@@ -149,6 +149,7 @@ void sample_db_offsets (void) {
STRUCT_SETUP(DB, set_flags, "int (*%s) (DB *, u_int32_t)");
STRUCT_SETUP(DB, set_pagesize, "int (*%s) (DB *, u_int32_t)");
STRUCT_SETUP(DB, stat, "int (*%s) (DB *, void *, u_int32_t)");
STRUCT_SETUP(DB, truncate, "int (*%s) (DB *, DB_TXN *, u_int32_t *, u_int32_t)");
STRUCT_SETUP(DB, verify, "int (*%s) (DB *, const char *, const char *, FILE *, u_int32_t)");
sort_and_dump_fields("db", sizeof(DB));
}
......
......@@ -59,6 +59,7 @@ struct fieldinfo db_fields32[] = {
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 312, 4},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 316, 4},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 320, 4},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 324, 4},
{"int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *))", 344, 4},
{"void (*set_errfile) (DB *, FILE*)", 356, 4},
{"int (*set_flags) (DB *, u_int32_t)", 368, 4},
......
......@@ -65,6 +65,7 @@ struct fieldinfo db_fields32[] = {
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 372, 4},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 376, 4},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 380, 4},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 384, 4},
{"int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *))", 400, 4},
{"void (*set_errfile) (DB *, FILE*)", 412, 4},
{"int (*set_flags) (DB *, u_int32_t)", 424, 4},
......
......@@ -71,21 +71,22 @@ struct fieldinfo db_fields32[] = {
{"int (*set_flags) (DB *, u_int32_t)", 480, 4},
{"int (*set_pagesize) (DB *, u_int32_t)", 508, 4},
{"int (*stat) (DB *, void *, u_int32_t)", 536, 4},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 548, 4},
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 556, 4},
{0, 596, 596} /* size of whole struct */
};
struct fieldinfo db_txn_active_fields32[] = {
{"u_int32_t txnid", 0, 4},
{"DB_LSN lsn", 20, 8},
{0, 212, 212} /* size of whole struct */
{"DB_LSN lsn", 16, 8},
{0, 208, 208} /* size of whole struct */
};
struct fieldinfo db_txn_fields32[] = {
{"DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/", 0, 4},
{"void *api_internal", 88, 4},
{"int (*abort) (DB_TXN *)", 100, 4},
{"int (*commit) (DB_TXN*, u_int32_t)", 104, 4},
{"u_int32_t (*id) (DB_TXN *)", 116, 4},
{0, 140, 140} /* size of whole struct */
{"void *api_internal", 84, 4},
{"int (*abort) (DB_TXN *)", 96, 4},
{"int (*commit) (DB_TXN*, u_int32_t)", 100, 4},
{"u_int32_t (*id) (DB_TXN *)", 112, 4},
{0, 136, 136} /* size of whole struct */
};
struct fieldinfo db_txn_stat_fields32[] = {
{"u_int32_t st_nactive", 32, 4},
......
......@@ -70,6 +70,7 @@ struct fieldinfo db_fields32[] = {
{"int (*set_flags) (DB *, u_int32_t)", 492, 4},
{"int (*set_pagesize) (DB *, u_int32_t)", 520, 4},
{"int (*stat) (DB *, void *, u_int32_t)", 548, 4},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 560, 4},
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 568, 4},
{0, 608, 608} /* size of whole struct */
};
......
......@@ -70,6 +70,7 @@ struct fieldinfo db_fields32[] = {
{"int (*set_flags) (DB *, u_int32_t)", 512, 4},
{"int (*set_pagesize) (DB *, u_int32_t)", 544, 4},
{"int (*stat) (DB *, void *, u_int32_t)", 576, 4},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 588, 4},
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 596, 4},
{0, 636, 636} /* size of whole struct */
};
......
......@@ -59,6 +59,7 @@ struct fieldinfo db_fields64[] = {
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 528, 8},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 536, 8},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 544, 8},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 552, 8},
{"int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *))", 592, 8},
{"void (*set_errfile) (DB *, FILE*)", 616, 8},
{"int (*set_flags) (DB *, u_int32_t)", 640, 8},
......
......@@ -65,6 +65,7 @@ struct fieldinfo db_fields64[] = {
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 648, 8},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 656, 8},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 664, 8},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 672, 8},
{"int (*set_dup_compare) (DB *, int (*)(DB *, const DBT *, const DBT *))", 704, 8},
{"void (*set_errfile) (DB *, FILE*)", 728, 8},
{"int (*set_flags) (DB *, u_int32_t)", 752, 8},
......
......@@ -71,6 +71,7 @@ struct fieldinfo db_fields64[] = {
{"int (*set_flags) (DB *, u_int32_t)", 864, 8},
{"int (*set_pagesize) (DB *, u_int32_t)", 920, 8},
{"int (*stat) (DB *, void *, u_int32_t)", 976, 8},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 1000, 8},
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 1016, 8},
{0, 1080, 1080} /* size of whole struct */
};
......
......@@ -70,6 +70,7 @@ struct fieldinfo db_fields64[] = {
{"int (*set_flags) (DB *, u_int32_t)", 888, 8},
{"int (*set_pagesize) (DB *, u_int32_t)", 944, 8},
{"int (*stat) (DB *, void *, u_int32_t)", 1000, 8},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 1024, 8},
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 1040, 8},
{0, 1104, 1104} /* size of whole struct */
};
......
......@@ -70,6 +70,7 @@ struct fieldinfo db_fields64[] = {
{"int (*set_flags) (DB *, u_int32_t)", 936, 8},
{"int (*set_pagesize) (DB *, u_int32_t)", 1000, 8},
{"int (*stat) (DB *, void *, u_int32_t)", 1064, 8},
{"int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t)", 1088, 8},
{"int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t)", 1104, 8},
{0, 1168, 1168} /* size of whole struct */
};
......
......@@ -224,29 +224,31 @@ struct __toku_db {
int (*set_pagesize) (DB *, u_int32_t); /* 32-bit offset=508 size=4, 64=bit offset=920 size=8 */
void* __toku_dummy13[6];
int (*stat) (DB *, void *, u_int32_t); /* 32-bit offset=536 size=4, 64=bit offset=976 size=8 */
void* __toku_dummy14[4];
void* __toku_dummy14[2];
int (*truncate) (DB *, DB_TXN *, u_int32_t *, u_int32_t); /* 32-bit offset=548 size=4, 64=bit offset=1000 size=8 */
void* __toku_dummy15[1];
int (*verify) (DB *, const char *, const char *, FILE *, u_int32_t); /* 32-bit offset=556 size=4, 64=bit offset=1016 size=8 */
void* __toku_dummy15[5]; /* Padding at the end */
char __toku_dummy16[16]; /* Padding at the end */
void* __toku_dummy16[5]; /* Padding at the end */
char __toku_dummy17[16]; /* Padding at the end */
};
struct __toku_db_txn_active {
u_int32_t txnid; /* 32-bit offset=0 size=4, 64=bit offset=0 size=4 */
void* __toku_dummy0[1];
char __toku_dummy1[12];
DB_LSN lsn; /* 32-bit offset=20 size=8, 64=bit offset=24 size=8 */
void* __toku_dummy0[2];
char __toku_dummy1[4];
DB_LSN lsn; /* 32-bit offset=16 size=8, 64=bit offset=24 size=8 */
char __toku_dummy2[184]; /* Padding at the end */
};
struct __toku_db_txn {
DB_ENV *mgrp /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/; /* 32-bit offset=0 size=4, 64=bit offset=0 size=8 */
struct __toku_db_txn_internal *i;
void* __toku_dummy0[16];
char __toku_dummy1[16];
void *api_internal; /* 32-bit offset=88 size=4, 64=bit offset=160 size=8 */
void* __toku_dummy0[17];
char __toku_dummy1[8];
void *api_internal; /* 32-bit offset=84 size=4, 64=bit offset=160 size=8 */
void* __toku_dummy2[2];
int (*abort) (DB_TXN *); /* 32-bit offset=100 size=4, 64=bit offset=184 size=8 */
int (*commit) (DB_TXN*, u_int32_t); /* 32-bit offset=104 size=4, 64=bit offset=192 size=8 */
int (*abort) (DB_TXN *); /* 32-bit offset=96 size=4, 64=bit offset=184 size=8 */
int (*commit) (DB_TXN*, u_int32_t); /* 32-bit offset=100 size=4, 64=bit offset=192 size=8 */
void* __toku_dummy3[2];
u_int32_t (*id) (DB_TXN *); /* 32-bit offset=116 size=4, 64=bit offset=216 size=8 */
u_int32_t (*id) (DB_TXN *); /* 32-bit offset=112 size=4, 64=bit offset=216 size=8 */
void* __toku_dummy4[5]; /* Padding at the end */
};
struct __toku_db_txn_stat {
......
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