summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-12-09 16:22:20 -0500
committerKeith Bostic <keith@wiredtiger.com>2014-12-09 16:22:20 -0500
commit5088ee53fce569915e8de8c168da50cff7991ec1 (patch)
treee38029c2ad073e7f19cc061b03f4f33adbc27653 /examples
parentbbe9ab35663fba23e070b9a50fb444de83cc5b47 (diff)
downloadmongo-5088ee53fce569915e8de8c168da50cff7991ec1.tar.gz
Separate the btree maximum key/value sizes from the underlying page
size, reference #1282. Deprecate the internal_item_max and leaf_item_max configuration strings, replace with internal_key_max, leaf_key_max and leaf_value_max. Remove examples/c/ex_file.c (there's no real need for a "file" URI example, and it's easy to replace the one place the documentation used it).
Diffstat (limited to 'examples')
-rw-r--r--examples/c/Makefile.am1
-rw-r--r--examples/c/ex_all.c7
-rw-r--r--examples/c/ex_file.c72
3 files changed, 7 insertions, 73 deletions
diff --git a/examples/c/Makefile.am b/examples/c/Makefile.am
index 17beba4a470..382c5912fef 100644
--- a/examples/c/Makefile.am
+++ b/examples/c/Makefile.am
@@ -13,7 +13,6 @@ noinst_PROGRAMS = \
ex_data_source \
ex_extending \
ex_extractor \
- ex_file \
ex_hello \
ex_log \
ex_pack \
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c
index 4fe6a2f265a..731b63b8eb8 100644
--- a/examples/c/ex_all.c
+++ b/examples/c/ex_all.c
@@ -528,6 +528,13 @@ session_ops(WT_SESSION *session)
/*! [Create a table with columns] */
ret = session->drop(session, "table:mytable", NULL);
+ /*! [Create a table and configure the page size] */
+ ret = session->create(session,
+ "table:mytable", "key_format=S,value_format=S"
+ "internal_page_max=16KB,leaf_page_max=1MB,leaf_value_max=64KB");
+ /*! [Create a table and configure the page size] */
+ ret = session->drop(session, "table:mytable", NULL);
+
/*
* This example code gets run, and the compression libraries might not
* be loaded, causing the create to fail. The documentation requires
diff --git a/examples/c/ex_file.c b/examples/c/ex_file.c
deleted file mode 100644
index 4170d1b099d..00000000000
--- a/examples/c/ex_file.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ex_file.c
- * This is an example demonstrating how to configure an individual file.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <wiredtiger.h>
-
-static const char *home;
-
-int
-main(void)
-{
- WT_CONNECTION *conn;
- WT_SESSION *session;
- int ret;
-
- /*
- * Create a clean test directory for this run of the test program if the
- * environment variable isn't already set (as is done by make check).
- */
- if (getenv("WIREDTIGER_HOME") == NULL) {
- home = "WT_HOME";
- ret = system("rm -rf WT_HOME && mkdir WT_HOME");
- } else
- home = NULL;
-
- if ((ret = wiredtiger_open(home, NULL, "create", &conn)) != 0 ||
- (ret = conn->open_session(conn, NULL, NULL, &session)) != 0) {
- fprintf(stderr, "Error connecting to %s: %s\n",
- home, wiredtiger_strerror(ret));
- return (ret);
- }
- /* Note: further error checking omitted for clarity. */
-
- /*! [file create] */
- ret = session->create(session, "file:example",
- "key_format=u,"
- "internal_page_max=32KB,internal_item_max=1KB,"
- "leaf_page_max=1MB,leaf_item_max=32KB");
- /*! [file create] */
-
- return (conn->close(conn, NULL) == 0 ? ret : EXIT_FAILURE);
-}