Commit Graph

48 Commits

Author SHA1 Message Date
Keith Bostic
40c0ea67fa Switch uses of wiredtiger_strerror() for WT_SESSION.strerror(). 2015-03-20 17:46:54 -04:00
Keith Bostic
a26d87a53e Replace wiredtiger_strerror_r with WT_SESSION.strerror, reference #1516. 2015-02-02 19:20:33 -05:00
Keith Bostic
1f9098871a Copyright notices: add MongoDB, update to 2015. 2015-01-04 14:07:56 -05:00
Michael Cahill
7264da5c54 Fix custom collators with LSM (and other non-btree sources): don't assume there is a data handle in the session. 2014-11-10 22:19:43 +11:00
Michael Cahill
77fc19801a Don't use const for strings returned in allocated memory. 2014-10-16 18:12:57 +11:00
Michael Cahill
aa5452e0c1 Add WT_COLLATOR::customize, allowing collators to be customized for specific data sources, or with application-managed metadata. 2014-08-15 18:02:25 +10:00
Alex Gorrod
54b39fc72f Update the configuration parsing API. Not finalized, but a step closer. 2014-02-24 15:38:48 +11:00
Keith Bostic
5b509b7220 Update copyright notices for 2014.
Move lang/java and lang/python into the public domain.
2014-01-07 10:30:12 -05:00
Alex Gorrod
c6387bd021 Fix compiler warnings from OS X. 2013-08-16 14:08:47 +10:00
Michael Cahill
60bf48743f Use an interface for WT_TXN_NOTIFY so it doesn't need a magic cookie. 2013-08-09 15:54:52 +10:00
Michael Cahill
112c757e38 Move data source truncate method into WT_DATA_SOURCE. 2013-08-08 20:05:38 +10:00
Michael Cahill
131f70a4c0 examples/c/ex_data_source.c:174:6: error: variable ‘is_snapshot_isolation’ set but not used [-Werror=unused-but-set-variable]
examples/c/ex_data_source.c:168:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
2013-08-08 11:40:35 +10:00
Keith Bostic
20ec86b444 Rename WT_EXTENSION_API.transaction_resolve to
WT_EXTENSION_API.transaction_resolve.
2013-08-07 10:56:01 -04:00
Keith Bostic
45d8cfe04c Replace __wt_ext_transaction_snapshot_isolation() with
__wt_ext_transaction_isolation_level().
2013-08-07 10:46:26 -04:00
Keith Bostic
54332f1f23 Add a WT_DATA_SOURCE method to support session.checkpoint, then drill
the necessary holes to make it work: this change supports checkpoints
of specific target objects (table:foo), but doesn't support generic
database checkpoints (they don't currently fail, but that's because
they don't do anything at all).

Turn off named checkpoints in test/format, when running with the
memrata device.
2013-07-31 13:54:04 -04:00
Keith Bostic
de2ddfef3a Replace the cursor commit/rollback functions with an extension API that
allows the data-source to request notification when the transaction is
committed or rolled back.
2013-07-09 12:53:45 -04:00
Keith Bostic
b65c29e087 Add a separate thread to migrate cache data into the primary (it's a
separate thread because it's possible to copy data out of the cache
without acquiring a lock, so there should be a reasonable amount of
overlap).

Fix a bug in the cache vs. primary comparison code, we were comparing
the value, not the key.

The WT_EXTENSION_API.transaction_oldest method doesn't require a
WT_SESSION handle, simplify it.

Minor re-ordering of the shared library load/unload code to simplify
error handling.
2013-07-08 12:19:49 -04:00
Keith Bostic
cdafd7356c Add the WT_EXTENSION_API.transaction_oldest method to return the oldest
transaction ID not yet visible to a running transaction.
2013-07-05 09:11:33 -04:00
Keith Bostic
279b09c1b8 lint 2013-07-04 12:47:47 -04:00
Keith Bostic
d1602b24ea More transactional code for the Memrata device.
Check if the update can proceed on inserts and updatest, fix the overwrite
stuff (again).  Probably still wrong, but I'll wait until I can run the
test suite to fix it.

Add support for setting the transaction state on commit/rollback; walk
the session handle and for every data-source cursor, call an underlying
commit or rollback function.  I don't see another solution, so I'm doing
this until Michael weighs in: I'm adding private WT_CURSOR methods the
data-source code sets, which is flatly wrong, but the other approaches
seem worse.

Another WT_EXTENSION_API method: the transaction_snapshot_isolation method
returns if snapshot isolation is configured for the current transaction.

Change the WT_EXTENSION_API transaction_id method to return the transaction
ID; it's no more likely to fail than the other transaction methods, and
I don't see them failing in the future either.   It's a little dangerous,
but I'd rather keep error handling simple if we can.
2013-07-04 12:34:40 -04:00
Keith Bostic
f4a42070a3 Write the code to marshall/unmarshall to/from the cache structure
(this version mostly works, supporting the cursor methods other than
search-near).

Add support for two new WT_EXTENSION API methods, collator_config and
collator; the former connects the current sessions collation cookie
to the WT_EXTENSION structure, the second calls it.  This is required
for the underlying data-source if it needs to order key/value pairs.
2013-07-04 09:12:50 -04:00
Alex Gorrod
d679e12ce7 Update extension API names from txn_XX to transaction_XX. 2013-06-18 12:30:05 +10:00
Michael Cahill
09e7840292 examples/c/ex_data_source.c:578:6: error: variable 'is_visible' set but not used 2013-06-11 09:28:16 +10:00
Michael Cahill
c6ff974b7f Transaction ID extension methods need a real session handle. 2013-06-11 09:17:11 +10:00
Keith Bostic
10038d5029 minor lint, cleanup the new docs. 2013-06-10 11:48:45 -04:00
Keith Bostic
dfbce70242 Add two next extension functions, one to return a transaction ID,
one to return if a transaction ID is visible to the current transaction.
2013-06-10 11:31:32 -04:00
Keith Bostic
be6742a425 Add some more structure to the data-source cursor-create example. 2013-06-10 09:33:48 -04:00
Keith Bostic
7f64e46c56 Add examples to the WiredTiger extension methods for accessing the
metadata.
2013-06-04 12:56:26 -04:00
Michael Cahill
bee26bb372 Merge branch 'develop' into terminate-method
Conflicts:
	src/conn/conn_api.c
2013-05-09 12:46:08 +10:00
Michael Cahill
6f12dda7ca Simplify quoting in config string examples, now that quotes are not reqired for string values starting with slashes. 2013-05-08 16:29:19 +10:00
Keith Bostic
3b88aa616e Add handle.terminate methods to WT_COLLATOR, WT_COMPRESSOR and
WT_DATA_SOURCE handles, called when the handle is discarded,
intended to allow general cleanup when the database is closed.

Re-work the BDB KVS and Memrata support to handle multiple open
databases, that is, get rid of all of the globals.
2013-05-07 11:50:12 -04:00
Keith Bostic
37bc5c7036 minor cleanup, remove unnecessary documentation chunk. 2013-04-20 11:27:56 -04:00
Keith Bostic
df7b969c3b Add WT_EXTENSION_API::strerror so extensions don't have to load against
the WiredTiger library in order to get to wiredtiger_strerror().
2013-04-20 11:02:00 -04:00
Michael Cahill
e4bfc6a957 Export more of the config parsing machinery to the extension API: we're going to need it at some point.
--HG--
rename : src/config/config.c => src/config/config_ext.c
2013-04-18 22:46:00 +10:00
Michael Cahill
1123a185e7 Use an opaque type for config arguments passed to callbacks, rather than void *. 2013-04-18 16:51:20 +10:00
Keith Bostic
ce9c3de74b Remove WT_EXTENSION_CONFIG, export WT_CONFIG_ITEM instead. 2013-04-17 13:46:43 -04:00
Keith Bostic
2f693d8e20 Replace WT_EXTENSION_CONFIG.argv[] with WT_EXTENSION_API::get_config_next;
that method returns the next entry from the list of items contained in the
last value retrieved from WT_EXTENSION_API::get_config.
2013-04-17 12:59:53 -04:00
Keith Bostic
2a53eeb6bb Rename WT_EXTENSION_API::config to be WT_EXTENSION_API::get_config. 2013-04-17 11:24:44 -04:00
Keith Bostic
08c982ad15 Replace wiredtiger_extension_api() with WT_CONNECTION.get_extension_api.
Pass the wiredtiger_extension_init function a (WT_CONNECTION *) instead
of a (WT_SESSION *, WT_EXTENSION_API) pair.
2013-04-17 11:02:54 -04:00
Keith Bostic
2a89a594b8 More changes to the extension API (this is only part-way there, but it
builds cleanly so I'm going to commit it).  Change the extension API
handle methods to take the handle as their first argument, get rid of
the WT_EXTENSION_API.default_session method, instead, store a reference
to the enclosing WT_CONNECTION in the extension handle.

This push also includes a few changes that are part of creating a STEC
data source.
2013-04-17 10:00:15 -04:00
Keith Bostic
148b1c8bc3 Add a new WT_EXTENSION_API method that returns the default session for
a WT_CONNECTION, we need a session to use the other WT_EXTENSION_API
methods.

Remove the "exclusive" argument to the WT_DATA_SOURCE.create method:
we handle it internally and it's not documented anywhere (besides it's
not standard for the WT_SESSION.create method, if the WT_SESSION.create
method needs it, it should retrieve it from the configuration information).
2013-04-16 13:02:55 -04:00
Michael Cahill
c24be939fb Data source cleanup: fix some build warnings, exclude new function from the Java API, allow enough space in the wiredtiger_open cfg stack for a WIREDTIGER_CONFIG environment variable. 2013-04-12 11:01:12 +10:00
Keith Bostic
5488e656fa More work on data-source configuration support.
We can't stack a random set of entries into a cfg[] because we don't
want to allocate memory in the API.  Instead, whenever a method's
arguments are reconfigured, re-build the base configuration string by
appending the new configuration, and re-build the checks array, that way
we always have a single base configuration string and a single checks
array.

Re-work how we're handling lists, we can't expect the application to
crack them, they can be seriously messy.  If it's a list, create an
array of NULL-terminated refrences to nul-terminated strings (create
an "argv" array, in other words).  It's ugly, and the user has to free
the memory, but I don't see an alternative.
2013-04-11 15:58:42 -04:00
Keith Bostic
db2ce0c4e6 update for dist scripts. 2013-04-11 09:38:55 -04:00
Keith Bostic
cccb0ea538 Add a small example for list using strsep -- I'm pretty sure this is
wrong, but it's a placeholder.
2013-04-11 09:34:19 -04:00
Keith Bostic
10c5382883 Enhance some wording and the examples. 2013-04-11 08:49:54 -04:00
Keith Bostic
1ad8f5bd5a Add documentation and examples for setting custom configuration strings.
I'm doing it in the WT_DATA_SOURCE pages because that's the only part of
the system that can currently use application-specified config strings.
2013-04-10 15:21:50 -04:00
Keith Bostic
00b0fe3a1d Add a new method WT_EXTENSION_API::config that takes a cfg[] and returns
a configuration string's value.  Push that method through the KVS code
in test/format.
2013-04-10 13:58:34 -04:00