diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-06-20 20:43:31 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-06-20 20:43:31 +1000 |
commit | 1cde95e2858baf5a3a9b5c4a7ba94865cbdaf557 (patch) | |
tree | 27cb08f3de7153b35f8748ddb3c4e836c3fa1912 /examples/c/ex_all.c | |
parent | bf93b477e45ae533e39e0edaed32bfef1431a293 (diff) | |
download | mongo-1cde95e2858baf5a3a9b5c4a7ba94865cbdaf557.tar.gz |
Call methods to reconfigure a handle "reconfigure".
Use lists of flags in api_data.py so no special handling is needed.
Diffstat (limited to 'examples/c/ex_all.c')
-rw-r--r-- | examples/c/ex_all.c | 89 |
1 files changed, 44 insertions, 45 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c index 8451abbbfec..15c53abd122 100644 --- a/examples/c/ex_all.c +++ b/examples/c/ex_all.c @@ -220,9 +220,9 @@ cursor_ops(WT_SESSION *session) /*! [Display an error] */ } - /*! [Configure the cursor] */ - ret = cursor->config(cursor, "append=true"); - /*! [Configure the cursor] */ + /*! [Reconfigure the cursor] */ + ret = cursor->reconfigure(cursor, "append=true"); + /*! [Reconfigure the cursor] */ /*! [Close the cursor] */ ret = cursor->close(cursor); @@ -292,7 +292,7 @@ checkpoint_ops(WT_SESSION *session) { int ret; - /*! [session checkpoint] */ + /*! [Checkpoint examples] */ /* Checkpoint the database. */ ret = session->checkpoint(session, NULL); @@ -338,7 +338,7 @@ checkpoint_ops(WT_SESSION *session) */ ret = session->checkpoint(session, "target=(\"table:mytable\"),name=July01,drop=(May01,June01)"); - /*! [session checkpoint] */ + /*! [Checkpoint examples] */ return (ret); } @@ -357,34 +357,33 @@ session_ops(WT_SESSION *session) checkpoint_ops(session); - /*! [session drop] */ - /* Discard a table. */ + /*! [Drop a table] */ ret = session->drop(session, "table:mytable", NULL); - /*! [session drop] */ + /*! [Drop a table] */ - /*! [session dumpfile] */ + /*! [Dump a file] */ ret = session->dumpfile(session, "file:myfile", NULL); - /*! [session dumpfile] */ + /*! [Dump a file] */ - /*! [session msg_printf] */ + /*! [Print to the message stream] */ ret = session->msg_printf( session, "process ID %" PRIuMAX, (uintmax_t)getpid()); - /*! [session msg_printf] */ + /*! [Print to the message stream] */ - /*! [session rename] */ + /*! [Rename a table] */ ret = session->rename(session, "table:old", "table:new", NULL); - /*! [session rename] */ + /*! [Rename a table] */ - /*! [session salvage] */ + /*! [Salvage a table] */ ret = session->salvage(session, "table:mytable", NULL); - /*! [session salvage] */ + /*! [Salvage a table] */ - /*! [session truncate] */ + /*! [Truncate a table] */ ret = session->truncate(session, "table:mytable", NULL, NULL, NULL); - /*! [session truncate] */ + /*! [Truncate a table] */ { - /*! [session range truncate] */ + /*! [Truncate a range] */ WT_CURSOR *start, *stop; ret = session->open_cursor( @@ -398,32 +397,32 @@ session_ops(WT_SESSION *session) ret = stop->search(stop); ret = session->truncate(session, NULL, start, stop, NULL); - /*! [session range truncate] */ + /*! [Truncate a range] */ } - /*! [session upgrade] */ + /*! [Upgrade a table] */ ret = session->upgrade(session, "table:mytable", NULL); - /*! [session upgrade] */ + /*! [Upgrade a table] */ - /*! [session verify] */ + /*! [Verify a table] */ ret = session->verify(session, "table:mytable", NULL); - /*! [session verify] */ + /*! [Verify a table] */ - /*! [session begin transaction] */ + /*! [Begin a transaction] */ ret = session->begin_transaction(session, NULL); - /*! [session begin transaction] */ + /*! [Begin a transaction] */ - /*! [session commit transaction] */ + /*! [Commit a transaction] */ ret = session->commit_transaction(session, NULL); - /*! [session commit transaction] */ + /*! [Commit a transaction] */ - /*! [session rollback transaction] */ + /*! [Rollback a transaction] */ ret = session->rollback_transaction(session, NULL); - /*! [session rollback transaction] */ + /*! [Rollback a transaction] */ - /*! [session close] */ + /*! [Close a session] */ ret = session->close(session, NULL); - /*! [session close] */ + /*! [Close a session] */ return (ret); } @@ -696,31 +695,27 @@ connection_ops(WT_CONNECTION *conn) { int ret; - /*! [conn load extension] */ + /*! [Load an extension] */ ret = conn->load_extension(conn, "my_extension.dll", NULL); - /*! [conn load extension] */ + /*! [Load an extension] */ add_collator(conn); add_data_source(conn); add_extractor(conn); - /*! [conn close] */ - ret = conn->close(conn, NULL); - /*! [conn close] */ - - /*! [conn config] */ - ret = conn->config(conn, "eviction_target=75"); - /*! [conn config] */ + /*! [Reconfigure a connection] */ + ret = conn->reconfigure(conn, "eviction_target=75"); + /*! [Reconfigure a connection] */ - /*! [conn get_home] */ + /*! [Get the database home directory] */ printf("The database home is %s\n", conn->get_home(conn)); - /*! [conn get_home] */ + /*! [Get the database home directory] */ - /*! [is_new] */ + /*! [Check if the database is newly created] */ if (conn->is_new(conn)) { /* First time initialization. */ } - /*! [is_new] */ + /*! [Check if the database is newly created] */ { /*! [Open a session] */ @@ -731,6 +726,10 @@ connection_ops(WT_CONNECTION *conn) session_ops(session); } + /*! [Close a connection] */ + ret = conn->close(conn, NULL); + /*! [Close a connection] */ + return (ret); } |