Commit Graph

56 Commits

Author SHA1 Message Date
Susan LoVerso
6f78c3d431 Ignore __wt_lsn in language interfaces. #1106 2014-07-15 15:49:55 -04:00
Susan LoVerso
af428ba90c Revert languages to using lang_private. 2014-05-28 11:02:10 -04:00
Alex Gorrod
c904ad189f Add an app_private field to the WT_ASYNC_OP handle. 2014-05-28 15:14:14 +10:00
Susan LoVerso
82bb27627b Expose the private field with a macro. 2014-05-27 13:07:06 -04:00
Don Anderson
3a3339d29f Added 'throws' clauses to Java method signatures for all wrapped
functions except getters.  refs #1011
2014-05-15 11:25:40 -04:00
Don Anderson
0fafbdd0c8 Fixes for Java async stability and performance.
Cache field ids and method ids for all async operations.  Invalidate
unpackers by setting fields, rather than calling a method to do it.

Use javaClose to invalidate the swigCptr for a AsyncOp at the end of
the callback.  Any use of an AsyncOp after its lifetime has ended will
give a NullPointerException.

Declare that new_async_op throws WiredTigerException, which happens
when there are no more slots available.

Added a test with a million items that typically does no pauses when
creating ops, but catches WiredTigerException and retries with a short
sleep.
2014-05-13 22:20:18 -04:00
Don Anderson
8893d57383 KNF fixes and comment typo.
Name async_new_op async_flush using underscore (not camelcase) convention.
2014-05-13 13:19:52 -04:00
Don Anderson
2bf916541f Support async operations in Java. refs #933.
- Created a real async handler for java allowing callbacks
  into java code.  Code to be registered must implement the
  new AsyncCallback interface.
- Renamed classes/methods to Java-ish names.
- Fixes to support 'this' removal for AsyncOp.
- Java's cursor ops, like 'insert' set up the value unpackers
  after insert completes.  For AsyncOp, we take a different
  approach, and invalidate the unpacker when the op completes,
  letting the value be fetched when needed.
- Added new test AsyncTest that tests doing different numbers of
  async ops with different parameters, and also with different types
  of keys/values.
2014-05-11 15:09:40 -04:00
Don Anderson
10b45b8a73 Python for async:
- Various fixes to allow test_async01.py to work for string key/value.
- Hand rolled AsyncCallback class to mirror C's WT_ASYNC_CALLBACK.
- Keep the async callback in the PY_CALLBACK struct hidden in cursor's
  lang_private.
- Some cleanups in writeToPythonStream(), including fixing
  potential race condition.

Java for async:
- Modified Java SWIG interfaces for async enough to allow it compile.
- Standardized class spelling to 'AsyncOp'.
- Removed a few non-applicable methods from AsyncOp.
2014-05-01 13:13:47 -04:00
Susan LoVerso
10d75f7130 Add asynchronous compact support to async API. 2014-04-28 15:23:36 -04:00
Susan LoVerso
cc7fdde5cc Add Java support for async ops. 2014-04-21 12:23:03 -04:00
Susan LoVerso
569be29173 Use an underlying cursor for async op keys/values. 2014-04-09 14:25:51 -04:00
Michael Cahill
5cba38f382 Merge branch 'develop' into async
Conflicts:
	src/include/extern.h
	src/include/wiredtiger.in
2014-04-07 15:39:23 +10:00
Alex Gorrod
c93b75875b Fix include paths for Java and Python builds.
This means that Java and Python builds work from the root
(or arbitrary) directories again.
2014-03-31 13:03:53 +11:00
Susan LoVerso
970b114fc6 Clean up pass for s_all. 2014-03-26 11:42:29 -04:00
Alex Gorrod
0983863e18 Configuration parser API, update documentation and examples. 2014-02-25 13:14:48 +11:00
Alex Gorrod
54b39fc72f Update the configuration parsing API. Not finalized, but a step closer. 2014-02-24 15:38:48 +11:00
Michael Cahill
8354efc8c9 Remove circular dependency from the Java build.
refs #841
2014-01-14 14:17:12 +11:00
Michael Cahill
0a9925e7e3 Add a rule to the Java Makefile that knows the path to wiredtiger_wrap.c.
refs #841
2014-01-13 14:21:49 +11:00
Michael Cahill
8c10616fb7 Fix the Java build for automake 1.14.
refs #841, #599
2014-01-13 11:18:05 +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
Don Anderson
f9e48c480e Fix errors that crash the Java VM when a cursor is explicitly closed.
The java test suite now passes cleanly.
refs #649
2013-12-28 10:16:01 -05:00
Don Anderson
29aaec0c9f Null out closed handles in Java, and detect nulled handles on use. refs #485.
As reported in #485, when a conn/session is closed, any subordinate
open cursors and sessions have dangling handles that refer to freed
memory.  But also, if a conn/session/cursor handle is closed, that
handle may still be referenced in Java though it references freed
memory.

This commit uses the event handler for close calls to capture the first
case, and makes explicit calls at the close site for the second case.
For each case, a close will set the Java side 'swigCPtr' for each associated
object being closed to 0.

For detection, typemaps effectively check an arg's swigCPtr to see
if the object has been previously closed.  Special cases, like when
a NULL handle is permitted in the API, are accounted for.

Some details:
  - WT_HANDLE_NULLABLE() and WT_HANDLE_CLOSED() mark points in the API
    (wiredtiger.in) where handles may be used as null and where
    handles are closed.  This are not exposed to doxygen.
  - lang_private fields have been added to WT_CONNECTION_IMPL,
    WT_SESSION_IMPL and WT_CURSOR to keep a handle to the
    associated java object, needed at the time of the close().
2013-11-18 13:29:15 -05:00
Alex Gorrod
1625a33985 Add a test case for Java auto close feature. 2013-10-25 15:41:30 +11:00
Susan LoVerso
fe1f3aa693 First pass that compiles. 2013-05-15 13:59:11 -04:00
Michael Cahill
a37f94d337 Move pack/unpack methods into the extension API, because extensions shouldn't link with the WiredTiger library.
While in the area, make doxygen comment formatting consistent: block comments should have a blank first line.
2013-04-22 17:41:34 +10:00
Michael Cahill
9a74a794a7 Change the extension function names to "init" and "terminate" so that API changes are caught at compile time. 2013-04-19 17:11:21 +10:00
Keith Bostic
3f5f248803 Add an extension "unload" entry point, configured with "unload" and with
a default of wiredtiger_extension_unload.

Rename "entry" load extension entry point to be "load", rename the default
from wiredtiger_extension_init to wiredtiger_extension_load, to match.
2013-04-18 08:44:08 -04:00
Michael Cahill
25128373b9 Minor build fixes: don't export WT_CONFIG_ITEM with SWIG, uninitialized 'ret'. 2013-04-18 15:39:19 +10: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
89b23edbdc Support new configuration options added by the applications, using a new
method, WT_CONNECTION::configure_method.

For some reason I can'quite figure out, this set of changes made lint run a
bunch better on some sources, and showed up a few different uninitialized
variables in error paths.  Got me why, but they're real, and I fixed them.
2013-04-09 20:17:58 -04:00
Keith Bostic
9889288775 Make WiredTiger extension functions available to linked-in modules via
a new function wiredtiger_extension_api(WT_EXTENSION_API **pp).

Write some WT_EXTENSION_API documentation.

Remove WT_SESSION::msg_printf, add a new msg_printf extension function
instead, convert test/format to use it.

Quit using __UNUSED in the extension code, use explicit (void) casting,
it's cleaner.
2013-04-09 13:12:36 -04:00
Alex Gorrod
ed3d9ff846 Add a test case for Java cursor issue refs #493 2013-03-26 12:54:39 +11:00
Michael Cahill
9698d23d93 Fix get_key/value in the Java API for complex cursors.
closes #493
2013-03-26 12:42:57 +11:00
Alex Gorrod
40b2fd6dce Add Java documentation for Session::open_cursor 2013-03-25 16:41:47 +11:00
Michael Cahill
dcebe3dca2 Install wiredtiger.jar when running "make install". 2013-03-14 14:57:07 +11:00
Michael Cahill
6234ba40fc Improvements for the Java API documentation: create a Java API module, link to class documentation and wiredtiger_open documentation. 2013-02-25 16:13:39 +11:00
Alex Gorrod
12ea0e5961 Fix copyright notices in Java source code. 2013-02-19 18:40:27 +11:00
Alex Gorrod
7cfaebdc3b Add comments to the Java methods defined in the SWIG interface. 2013-02-19 18:00:50 +11:00
Alex Gorrod
39150c640e Update Java Cursor API naming to reflect ByteArray semantics.
Also update documentation, to use Doxygen and @copydoc where possible.
Not yet tied into s_docs.
2013-02-19 17:06:41 +11:00
Alex Gorrod
d6f5ed6237 Fix library path for Java make check on Linux. 2013-02-14 16:21:18 +11:00
Alex Gorrod
27e2b3ff17 Fix conditional compilation of JUnit tests. 2013-02-14 16:11:43 +11:00
Alex Gorrod
52d37a140b Update Java cursors to use packing code. Also enhance JUnit usage. 2013-02-13 19:14:40 +11:00
Alex Gorrod
19fed99760 Update Java structure packing implementation.
Add a first JUnit test case, and associated autoconf files.
2013-02-12 21:00:49 +11:00
Alex Gorrod
12c649b0f4 Add a Java implementation of packed formats.
Also add a test case and update the layout of the Java build.
2013-02-08 14:15:19 +11:00
Alex Gorrod
697825e73b Add in examples to Java build. 2013-01-25 12:48:02 +11:00
Alex Gorrod
90e7314eb3 Fix Java build to work with recent autoconf. 2013-01-24 14:26:51 +11:00
Alex Gorrod
20cf269c8c Move generated Java files into a subdirectory. 2013-01-24 13:49:35 +11:00
Alex Gorrod
4dc587244a Have compare return an int not a bool. Add Java implementation for Cursor::compare. 2012-11-29 15:54:50 +11:00
Alex Gorrod
fb896878a0 Rename cursor equals to compare in Java API. 2012-11-29 10:38:29 +11:00