summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-02-01 09:08:43 -0500
committerKeith Bostic <keith@wiredtiger.com>2014-02-01 09:08:43 -0500
commitba66d442df0699065b7ff4763dcd8dfb4968a0eb (patch)
treec106de1da75c3c9d91e4212464d1daa25f32335b /ext
parentc3d9c9cf34bf132e628161bf85c46a7c3e931a56 (diff)
downloadmongo-ba66d442df0699065b7ff4763dcd8dfb4968a0eb.tar.gz
Add debugging code for column-store (record number keys).
Diffstat (limited to 'ext')
-rw-r--r--ext/datasources/helium/helium.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/ext/datasources/helium/helium.c b/ext/datasources/helium/helium.c
index d9cc55b5302..bfbe6ed7d11 100644
--- a/ext/datasources/helium/helium.c
+++ b/ext/datasources/helium/helium.c
@@ -405,7 +405,7 @@ unlock(WT_EXTENSION_API *wtext, WT_SESSION *session, pthread_rwlock_t *lockp)
#if 0
static void
-helium_dump_print(const char *pfx, uint8_t *p, size_t len, FILE *fp)
+helium_dump_kv(const char *pfx, uint8_t *p, size_t len, FILE *fp)
{
(void)fprintf(stderr, "%s %3zu: ", pfx, len);
for (; len > 0; --len, ++p)
@@ -423,7 +423,7 @@ helium_dump_print(const char *pfx, uint8_t *p, size_t len, FILE *fp)
* Dump the records in a Helium store.
*/
static int
-helium_dump(he_t he, const char *tag)
+helium_dump(WT_EXTENSION_API *wtext, he_t he, const char *tag)
{
HE_ITEM *r, _r;
uint8_t k[4 * 1024], v[4 * 1024];
@@ -436,11 +436,19 @@ helium_dump(he_t he, const char *tag)
(void)fprintf(stderr, "== %s\n", tag);
while ((ret = he_next(he, r, (size_t)0, sizeof(v))) == 0) {
- helium_dump_print("K: ", r->key, r->key_len, stderr);
- helium_dump_print("V: ", r->val, r->val_len, stderr);
+#if 0
+ uint64_t recno;
+ if ((ret = wtext->struct_unpack(wtext,
+ NULL, r->key, r->key_len, "r", &recno)) != 0)
+ return (ret);
+ fprintf(stderr, "K: %" PRIu64, recno);
+#else
+ helium_dump_kv("K: ", r->key, r->key_len, stderr);
+#endif
+ helium_dump_kv("V: ", r->val, r->val_len, stderr);
}
if (ret != HE_ERR_ITEM_NOT_FOUND) {
- fprintf(stderr, "== error: %s\n", he_strerror(ret));
+ fprintf(stderr, "he_next: %s\n", he_strerror(ret));
ret = WT_ERROR;
}
return (ret);