summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorsueloverso <sue@mongodb.com>2016-12-15 13:06:31 -0500
committerGitHub <noreply@github.com>2016-12-15 13:06:31 -0500
commite8d8fd81109554f7ae845b92c716ed54364b433d (patch)
tree61e71c809512dc5acab8955e62221ce825fdd48a /examples
parent2142d32fd6b747022da2bab0cf76b30941bab918 (diff)
downloadmongo-e8d8fd81109554f7ae845b92c716ed54364b433d.tar.gz
WT-283 Add WT_SESSION::alter method (#3177)
* WT-283 Add WT_SESSION:alter method * Add new method to ex_all.c * Typo * Add testing and fixes for LSM, column groups and indexes for alter. * Fix WITH_*_LOCK macro usage. * Whitespace * Change table alter to not walk down into column groups and indexes. * Whitespace * Use base file meta config and compare strings. * Add skip stat * Add alter support to wt command. * Add util_alter.c to SConstruct * Fix subsection in doc. * Add alter thread to test/format * Swap the value we send into alter in test/format. * Add data-source alter support * Only alter access pattern hint in test/format. * Make LSM alter not exclusive. * Whitespace * Use access_pattern_hint in example. * Include base lsm metadata configuration. * Fix text/comment. * Minor changes from review comments. * Unused variable warning.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_all.c6
-rw-r--r--examples/c/ex_data_source.c16
2 files changed, 22 insertions, 0 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c
index ea646604a76..8a1533011b2 100644
--- a/examples/c/ex_all.c
+++ b/examples/c/ex_all.c
@@ -557,6 +557,12 @@ session_ops(WT_SESSION *session)
/*! [Create a column-store table] */
ret = session->create(session,
"table:mytable", "key_format=r,value_format=S");
+
+ /*! [Alter a table] */
+ ret = session->alter(session,
+ "table:mytable", "access_pattern_hint=random");
+ /*! [Alter a table] */
+
/*! [Create a column-store table] */
ret = session->drop(session, "table:mytable", NULL);
diff --git a/examples/c/ex_data_source.c b/examples/c/ex_data_source.c
index 6ed80dfcf19..387248f6ae2 100644
--- a/examples/c/ex_data_source.c
+++ b/examples/c/ex_data_source.c
@@ -46,6 +46,21 @@ my_data_source_init(WT_CONNECTION *connection)
}
/*! [WT_EXTENSION_API declaration] */
+/*! [WT_DATA_SOURCE alter] */
+static int
+my_alter(WT_DATA_SOURCE *dsrc, WT_SESSION *session,
+ const char *uri, WT_CONFIG_ARG *config)
+/*! [WT_DATA_SOURCE alter] */
+{
+ /* Unused parameters */
+ (void)dsrc;
+ (void)session;
+ (void)uri;
+ (void)config;
+
+ return (0);
+}
+
/*! [WT_DATA_SOURCE create] */
static int
my_create(WT_DATA_SOURCE *dsrc, WT_SESSION *session,
@@ -604,6 +619,7 @@ main(void)
{
/*! [WT_DATA_SOURCE register] */
static WT_DATA_SOURCE my_dsrc = {
+ my_alter,
my_create,
my_compact,
my_drop,