couchdb-erlfdb.git
3 years agoMatch Python catching all exceptions
Paul J. Davis [Mon, 25 Feb 2019 16:52:49 +0000 (10:52 -0600)] 
Match Python catching all exceptions

3 years agoImplement the DirectoryLayer
Paul J. Davis [Fri, 22 Feb 2019 17:19:36 +0000 (11:19 -0600)] 
Implement the DirectoryLayer

This implements a DirectoryLayer intends to behave identically to the
Python version. Soak tests have so far run as long as an hour without
finding issues. However I plan on trying to get that number to upwards
of 24 hours or more.

3 years agoFix wait_for_empty calls in concurrent testing
Paul J. Davis [Fri, 22 Feb 2019 17:13:52 +0000 (11:13 -0600)] 
Fix wait_for_empty calls in concurrent testing

3 years agoUse the new snapshot object for API tests
Paul J. Davis [Fri, 22 Feb 2019 17:12:21 +0000 (11:12 -0600)] 
Use the new snapshot object for API tests

3 years agoFix test runs with concurrency
Paul J. Davis [Fri, 22 Feb 2019 17:10:17 +0000 (11:10 -0600)] 
Fix test runs with concurrency

3 years agoSimplify clearing the stack
Paul J. Davis [Fri, 22 Feb 2019 17:09:01 +0000 (11:09 -0600)] 
Simplify clearing the stack

Killing the process made for some dirty log output since the exit wasn't
handled cleanly. Rather than trying to fix that we just add a message to
reset the stack state inside the same pid.

3 years agoMove py_repr to erlfdb_util:repr
Paul J. Davis [Fri, 22 Feb 2019 17:04:11 +0000 (11:04 -0600)] 
Move py_repr to erlfdb_util:repr

This is a useful function to have when using the FoundationDB binding
tester in comparison to the Python implementation.

3 years agoFix the `contains` check for subspaces
Paul J. Davis [Fri, 22 Feb 2019 17:00:04 +0000 (11:00 -0600)] 
Fix the `contains` check for subspaces

Silly mistake reordering which value was tested for a prefix.

3 years agoAdd compatibility shim
Paul J. Davis [Fri, 22 Feb 2019 16:59:20 +0000 (10:59 -0600)] 
Add compatibility shim

This is just a compatibility shim to make the directory layer tests
slightly easier to implement.

3 years agoFix HCA module
Paul J. Davis [Fri, 22 Feb 2019 16:58:06 +0000 (10:58 -0600)] 
Fix HCA module

A few minor bug fixes found with testing the directory layer.

3 years agoAdd support for snapshots as a transaction object
Paul J. Davis [Fri, 22 Feb 2019 16:49:43 +0000 (10:49 -0600)] 
Add support for snapshots as a transaction object

The way that FoundationDB tests are written in OO languages more or less
requires that we have this concept so that we maintain the same read
semantics without having to add plumbing for options during testing.

3 years agoImprove handling of futures
Paul J. Davis [Fri, 22 Feb 2019 16:47:09 +0000 (10:47 -0600)] 
Improve handling of futures

This covers two cases where a future is either immediately available and
similarly when a future has already been waited on. The first case
appears to be mostly when reading a key that was either previously read
or set in the same transaction. The second case can happen when passing
the future around. Since we've already consumed the ready message we
just add a check for `is_ready`.

3 years agoFix tuple mutation macros
Paul J. Davis [Fri, 22 Feb 2019 16:45:25 +0000 (10:45 -0600)] 
Fix tuple mutation macros

This improves the consistency of the macro argument ordering and general
usage after having worked with it in the directory layer.

3 years agoReplace subspace usage with macros
Paul J. Davis [Fri, 15 Feb 2019 17:15:13 +0000 (11:15 -0600)] 
Replace subspace usage with macros

The subspace layer is really not super helpful in Erlang. In Pyhton the
subspace layer helps significantly by using magic functions and
inheritance. However, Erlang doesn't have similar syntactical niceties
so it ends up being more burdensome than just adding macros for tuple
mutations.

If someone has a better idea I'm all ears on this as the macros do take
a decent level of knowledge on tuple packing to make use of.

3 years agoAdd a utility module for reusable functions
Paul J. Davis [Fri, 15 Feb 2019 17:14:33 +0000 (11:14 -0600)] 
Add a utility module for reusable functions

3 years agoImplement a high contention allocator
Paul J. Davis [Tue, 12 Feb 2019 17:40:19 +0000 (11:40 -0600)] 
Implement a high contention allocator

This allocator is used to assign short binary strings that are
guaranteed to never be duplicated and also remain relatively short
(i.e., 1-4 byte range). This is currently primarily used by the
DirectoryLayer for creating nodes in the directory tree.

3 years agoLock transactions to the process that created them
Paul J. Davis [Tue, 12 Feb 2019 17:38:44 +0000 (11:38 -0600)] 
Lock transactions to the process that created them

Rather than attempt to manage concurrent access to transactions we've
just removed the necessity by locking transaction resources to a given
thread. Perhaps in the future a use case for sharing a transaction
between threads may arrise and we'll have to revisit this approach.
However, given the five second limit on transactions, this seems fairly
unlikely at this point in time.

3 years agoFix typo in function head for future_is_ready
Paul J. Davis [Tue, 12 Feb 2019 17:14:21 +0000 (11:14 -0600)] 
Fix typo in function head for future_is_ready

Fixes #1

Co-Authored-By: Robert Newson <rnewson@apache.org>
3 years agoSupport 64bit integers in atomic operations
Paul J. Davis [Mon, 11 Feb 2019 18:28:11 +0000 (12:28 -0600)] 
Support 64bit integers in atomic operations

3 years agoImplement the subspace layer
Paul J. Davis [Mon, 11 Feb 2019 16:12:31 +0000 (10:12 -0600)] 
Implement the subspace layer

3 years agoRename erlfdb_layer_tuple to erlfdb_tuple
Paul J. Davis [Sun, 10 Feb 2019 17:19:57 +0000 (11:19 -0600)] 
Rename erlfdb_layer_tuple to erlfdb_tuple

Originally I thought I'd have these stacked in some sort of record to
force all operations to go through the various layers but that does not
appear to be how FoundationDB bindings generally work.

3 years agoImplement driver for fdb bindingstester
Paul J. Davis [Thu, 7 Feb 2019 23:14:14 +0000 (17:14 -0600)] 
Implement driver for fdb bindingstester

3 years agoSupport packing versionstamps in the tuple layer
Paul J. Davis [Sat, 9 Feb 2019 22:46:10 +0000 (16:46 -0600)] 
Support packing versionstamps in the tuple layer

3 years agoFix bugs found using FoundationDBs bindings tester
Paul J. Davis [Sat, 9 Feb 2019 22:43:32 +0000 (16:43 -0600)] 
Fix bugs found using FoundationDBs bindings tester

There were a handful of subtle bugs related to how various corner cases
were handled. The bindings tester is fairly impressivly thorough.

3 years agoFix iterating over key/value arrays
Paul J. Davis [Sat, 9 Feb 2019 22:31:47 +0000 (16:31 -0600)] 
Fix iterating over key/value arrays

Classic off by one error starting one element past the end of the array.

3 years agoAdd missing void future type
Paul J. Davis [Thu, 7 Feb 2019 23:48:39 +0000 (17:48 -0600)] 
Add missing void future type

I initially misread the docs and thought some futures just returned
empty values instead of no value whatsoever. This accounts for that
new reality.

3 years agoTidy up API implementation
Paul J. Davis [Thu, 7 Feb 2019 23:13:38 +0000 (17:13 -0600)] 
Tidy up API implementation

3 years agoAdd string and keyvalue future callbacks
Paul J. Davis [Thu, 7 Feb 2019 23:13:12 +0000 (17:13 -0600)] 
Add string and keyvalue future callbacks

3 years agoFix bug when creating futures
Paul J. Davis [Thu, 7 Feb 2019 21:48:46 +0000 (15:48 -0600)] 
Fix bug when creating futures

We accidentally set the wrong future variable for the callback data
which caused a segfault when attempting to invoke the callback.

3 years agoImplement Erlang API
Paul J. Davis [Wed, 6 Feb 2019 14:21:54 +0000 (08:21 -0600)] 
Implement Erlang API

This is the first draft API over the NIF bindings to FoundationDB. Once
this gets some more use we may want to make a couple tweaks for things
that are are discovered to be awkward or repetitive.

3 years agoInitial tuple comparison implementation
Paul J. Davis [Fri, 1 Feb 2019 17:07:11 +0000 (11:07 -0600)] 
Initial tuple comparison implementation

3 years agoImplement tuple layer encoding
Paul J. Davis [Thu, 31 Jan 2019 17:29:50 +0000 (11:29 -0600)] 
Implement tuple layer encoding

3 years agoImplement set_option APIs
Paul J. Davis [Wed, 30 Jan 2019 14:10:41 +0000 (08:10 -0600)] 
Implement set_option APIs

3 years agoImplement network_set_option
Paul J. Davis [Wed, 30 Jan 2019 13:43:32 +0000 (07:43 -0600)] 
Implement network_set_option

3 years agoAdd IS_ATOM helper
Paul J. Davis [Wed, 30 Jan 2019 13:31:55 +0000 (07:31 -0600)] 
Add IS_ATOM helper

3 years agoList option names for specs
Paul J. Davis [Wed, 30 Jan 2019 13:26:17 +0000 (07:26 -0600)] 
List option names for specs

3 years agoImplemented the rest of the API
Paul J. Davis [Wed, 30 Jan 2019 12:57:33 +0000 (06:57 -0600)] 
Implemented the rest of the API

3 years agoImplmeented transaction commit APIs
Paul J. Davis [Tue, 29 Jan 2019 22:48:53 +0000 (16:48 -0600)] 
Implmeented transaction commit APIs

3 years agoImplemented transaction side effect APIs
Paul J. Davis [Tue, 29 Jan 2019 22:28:28 +0000 (16:28 -0600)] 
Implemented transaction side effect APIs

3 years agoMore transaction APIs implemented
Paul J. Davis [Tue, 29 Jan 2019 21:15:45 +0000 (15:15 -0600)] 
More transaction APIs implemented

3 years agoInitial work on transaction APIs
Paul J. Davis [Tue, 29 Jan 2019 18:36:14 +0000 (12:36 -0600)] 
Initial work on transaction APIs

3 years agoImplement cluster and database creation
Paul J. Davis [Tue, 29 Jan 2019 17:55:37 +0000 (11:55 -0600)] 
Implement cluster and database creation

This includes initial work on being able to resolve futures.

3 years agoAdd create_cluster callback
Paul J. Davis [Tue, 29 Jan 2019 16:20:52 +0000 (10:20 -0600)] 
Add create_cluster callback

Completely untested for now. This is the initial outline for how
features will work. Next up I'll add the shape for erlfdb_future_get to
return the various value types from different futures.

3 years agoAdd base future functions
Paul J. Davis [Tue, 29 Jan 2019 15:30:06 +0000 (09:30 -0600)] 
Add base future functions

3 years agoAdd network thread creation and destruction
Paul J. Davis [Tue, 29 Jan 2019 15:07:49 +0000 (09:07 -0600)] 
Add network thread creation and destruction

3 years agoAdd network configuration outline
Paul J. Davis [Tue, 29 Jan 2019 13:46:03 +0000 (07:46 -0600)] 
Add network configuration outline

3 years agoInitial Import
Paul J. Davis [Tue, 29 Jan 2019 12:37:30 +0000 (06:37 -0600)] 
Initial Import