Skip to content

Commit

Permalink
Merge branch 'microtransactions' of https://github.com/kaimast/HyperDex
Browse files Browse the repository at this point in the history
… into merge/microtransactions

* 'microtransactions' of https://github.com/kaimast/HyperDex: (28 commits)
  Added min/max for microtransactions
  Fixed all tests
  Use bytestring in java tests
  More tests...
  Committing microtransactions works in java
  Work toward working commit() in the java bindings
  Restore java code generation
  Some more Java microtransaction work
  More testing for Document
  Cleaned up bindings
  Almost working document support in Java
  First steps into proper java bindings and tests
  Actually generate the typ conversion call
  Cleaned up java code-generation script
  Cleaned up java code-generation script
  Fixed memory leaks
  Working cond_commit
  Working group_commit
  Working group_commit
  New naming scheme uxact
  ...
  • Loading branch information
rescrv committed Apr 8, 2015
2 parents 6472961 + 58e36c7 commit e0cb1ce
Show file tree
Hide file tree
Showing 65 changed files with 5,353 additions and 1,459 deletions.
21 changes: 17 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ EXTRA_DIST += bindings/java.py
EXTRA_DIST += bindings/java/org/hyperdex/client/ByteString.java
EXTRA_DIST += bindings/java/org_hyperdex_client_Client.definitions.c
EXTRA_DIST += bindings/java/org/hyperdex/client/Client.java
EXTRA_DIST += bindings/java/org/hyperdex/client/Document.java
EXTRA_DIST += bindings/java/org/hyperdex/client/Deferred.java
EXTRA_DIST += bindings/java/org/hyperdex/client/GreaterEqual.java
EXTRA_DIST += bindings/java/org/hyperdex/client/GreaterThan.java
Expand All @@ -634,6 +635,8 @@ EXTRA_DIST += bindings/java/org/hyperdex/client/LengthGreaterEqual.java
EXTRA_DIST += bindings/java/org/hyperdex/client/LengthLessEqual.java
EXTRA_DIST += bindings/java/org/hyperdex/client/LessEqual.java
EXTRA_DIST += bindings/java/org/hyperdex/client/LessThan.java
EXTRA_DIST += bindings/java/org/hyperdex/client/Microtransaction.java
EXTRA_DIST += bindings/java/org_hyperdex_client_Microtransaction.definitions.c
EXTRA_DIST += bindings/java/org/hyperdex/client/Operation.java
EXTRA_DIST += bindings/java/org/hyperdex/client/Predicate.java
EXTRA_DIST += bindings/java/org/hyperdex/client/Range.java
Expand All @@ -642,6 +645,7 @@ EXTRA_DIST += bindings/java/org/hyperdex/ycsb/HyperDex.java
EXTRA_DIST += test/java/.exists

# Client
noinst_HEADERS += bindings/java/client-util.h
noinst_HEADERS += bindings/java/org_hyperdex_client_Client.h
noinst_HEADERS += bindings/java/org_hyperdex_client_Deferred.h
noinst_HEADERS += bindings/java/org_hyperdex_client_GreaterEqual.h
Expand All @@ -656,6 +660,7 @@ noinst_HEADERS += bindings/java/org_hyperdex_client_Range.h
noinst_HEADERS += bindings/java/org_hyperdex_client_Regex.h

libhyperdex_client_java_la_SOURCES =
libhyperdex_client_java_la_SOURCES += bindings/java/org_hyperdex_client_Microtransaction.c
libhyperdex_client_java_la_SOURCES += bindings/java/org_hyperdex_client_Client.c
libhyperdex_client_java_la_CPPFLAGS = $(JNI_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS)
libhyperdex_client_java_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS) -Wmissing-prototypes
Expand Down Expand Up @@ -870,6 +875,7 @@ python_wrappers += test/sh/bindings.python.DataTypeString.sh
python_wrappers += test/sh/bindings.python.GroupAtomic.sh
python_wrappers += test/sh/bindings.python.HyperMongo.sh
python_wrappers += test/sh/bindings.python.LengthString.sh
python_wrappers += test/sh/bindings.python.Microtransactions.sh
python_wrappers += test/sh/bindings.python.MultiAttribute.sh
python_wrappers += test/sh/bindings.python.RangeSearchInt.sh
python_wrappers += test/sh/bindings.python.RangeSearchString.sh
Expand All @@ -880,6 +886,7 @@ java_wrappers =
java_wrappers += test/sh/bindings.java.BasicSearch.sh
java_wrappers += test/sh/bindings.java.Basic.sh
java_wrappers += test/sh/bindings.java.CondPut.sh
java_wrappers += test/sh/bindings.java.DataTypeDocument.sh
java_wrappers += test/sh/bindings.java.DataTypeFloat.sh
java_wrappers += test/sh/bindings.java.DataTypeInt.sh
java_wrappers += test/sh/bindings.java.DataTypeListFloat.sh
Expand All @@ -899,6 +906,8 @@ java_wrappers += test/sh/bindings.java.DataTypeSetInt.sh
java_wrappers += test/sh/bindings.java.DataTypeSetString.sh
java_wrappers += test/sh/bindings.java.DataTypeString.sh
java_wrappers += test/sh/bindings.java.LengthString.sh
java_wrappers += test/sh/bindings.java.Microtransactions.sh
java_wrappers += test/sh/bindings.java.MultitypeMicrotransactions.sh
java_wrappers += test/sh/bindings.java.MultiAttribute.sh
java_wrappers += test/sh/bindings.java.RangeSearchInt.sh
java_wrappers += test/sh/bindings.java.RangeSearchString.sh
Expand Down Expand Up @@ -968,10 +977,6 @@ if ENABLE_CLIENT
if ENABLE_PYTHON_BINDINGS
TESTS += $(doctest_wrappers)

if ENABLE_TIME_CONSUMING_TESTS
TESTS += $(stress_wrappers)
endif

TESTS += $(python_wrappers)
check_PROGRAMS += bindings/python/hyperdex/admin.so
check_PROGRAMS += bindings/python/hyperdex/client.so
Expand All @@ -984,6 +989,10 @@ if ENABLE_RUBY_BINDINGS
TESTS += $(ruby_wrappers)
endif

if ENABLE_TIME_CONSUMING_TESTS
TESTS += $(stress_wrappers)
endif

endif # ENABLE_PYTHON_BINDINGS
endif # ENABLE_CLIENT
endif # ENABLE_ADMIN
Expand Down Expand Up @@ -1025,13 +1034,15 @@ EXTRA_DIST += test/python/GroupAtomic.py
EXTRA_DIST += test/python/HyperMongo.py
EXTRA_DIST += test/python/LengthString.py
EXTRA_DIST += test/python/MultiAttribute.py
EXTRA_DIST += test/python/Microtransactions.py
EXTRA_DIST += test/python/RangeSearchInt.py
EXTRA_DIST += test/python/RangeSearchString.py
EXTRA_DIST += test/python/RegexSearch.py
EXTRA_DIST += test/python/testlib.py
EXTRA_DIST += test/java/Basic.java
EXTRA_DIST += test/java/BasicSearch.java
EXTRA_DIST += test/java/CondPut.java
EXTRA_DIST += test/java/DataTypeDocument.java
EXTRA_DIST += test/java/DataTypeFloat.java
EXTRA_DIST += test/java/DataTypeInt.java
EXTRA_DIST += test/java/DataTypeListFloat.java
Expand All @@ -1051,6 +1062,8 @@ EXTRA_DIST += test/java/DataTypeSetInt.java
EXTRA_DIST += test/java/DataTypeSetString.java
EXTRA_DIST += test/java/DataTypeString.java
EXTRA_DIST += test/java/LengthString.java
EXTRA_DIST += test/java/Microtransactions.java
EXTRA_DIST += test/java/MultitypeMicrotransactions.java
EXTRA_DIST += test/java/MultiAttribute.java
EXTRA_DIST += test/java/RangeSearchInt.java
EXTRA_DIST += test/java/RangeSearchString.java
Expand Down
18 changes: 18 additions & 0 deletions bindings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

class MicrotransactionCall : pass
class AsyncCall: pass
class SyncCall: pass
class NoFailCall: pass
Expand All @@ -33,6 +34,8 @@ class StructClient(object):
args = (('struct hyperdex_client*', 'client'),)
class StructAdmin(object):
args = (('struct hyperdex_admin*', 'admin'),)
class Microtransaction(object):
args = (('struct hyperdex_client_microtransaction*', 'microtransaction'),)
class SpaceName(object):
args = (('const char*', 'space'),)
class SpaceNameSource(object):
Expand Down Expand Up @@ -108,6 +111,7 @@ def __init__(self, name, form, args_in, args_out):
Method('get', AsyncCall, (SpaceName, Key), (Status, Attributes)),
Method('get_partial', AsyncCall, (SpaceName, Key, AttributeNames), (Status, Attributes)),
Method('put', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_put', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_put', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('cond_put_or_create', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_put', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Expand All @@ -116,24 +120,30 @@ def __init__(self, name, form, args_in, args_out):
Method('cond_del', AsyncCall, (SpaceName, Key, Predicates), (Status,)),
Method('group_del', AsyncCall, (SpaceName, Predicates), (Status, Count)),
Method('atomic_add', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_atomic_add', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_atomic_add', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_atomic_add', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('atomic_sub', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_atomic_sub', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_atomic_sub', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_atomic_sub', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('atomic_mul', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_atomic_mul', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_atomic_mul', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_atomic_mul', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('atomic_div', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_atomic_div', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_atomic_div', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_atomic_div', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('atomic_mod', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('cond_atomic_mod', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_atomic_mod', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('atomic_and', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_atomic_and', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_atomic_and', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_atomic_and', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('atomic_or', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_atomic_or', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_atomic_or', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_atomic_or', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('atomic_xor', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Expand All @@ -146,15 +156,19 @@ def __init__(self, name, form, args_in, args_out):
Method('cond_atomic_max', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_atomic_max', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('string_prepend', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_string_prepend', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_string_prepend', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_string_prepend', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('string_append', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_string_append', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_string_append', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_string_append', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('list_lpush', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_list_lpush', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_list_lpush', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_list_lpush', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('list_rpush', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_list_rpush', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_list_rpush', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_list_rpush', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('set_add', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Expand All @@ -170,9 +184,11 @@ def __init__(self, name, form, args_in, args_out):
Method('cond_set_union', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_set_union', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('document_rename', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_document_rename', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_document_rename', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_document_rename', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('document_unset', AsyncCall, (SpaceName, Key, Attributes), (Status,)),
Method('uxact_document_unset', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('cond_document_unset', AsyncCall, (SpaceName, Key, Predicates, Attributes), (Status,)),
Method('group_document_unset', AsyncCall, (SpaceName, Predicates, Attributes), (Status, Count)),
Method('map_add', AsyncCall, (SpaceName, Key, MapAttributes), (Status,)),
Expand Down Expand Up @@ -214,9 +230,11 @@ def __init__(self, name, form, args_in, args_out):
Method('map_atomic_min', AsyncCall, (SpaceName, Key, MapAttributes), (Status,)),
Method('cond_map_atomic_min', AsyncCall, (SpaceName, Key, Predicates, MapAttributes), (Status,)),
Method('group_map_atomic_min', AsyncCall, (SpaceName, Predicates, MapAttributes), (Status, Count)),
Method('uxact_atomic_min', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('map_atomic_max', AsyncCall, (SpaceName, Key, MapAttributes), (Status,)),
Method('cond_map_atomic_max', AsyncCall, (SpaceName, Key, Predicates, MapAttributes), (Status,)),
Method('group_map_atomic_max', AsyncCall, (SpaceName, Predicates, MapAttributes), (Status, Count)),
Method('uxact_atomic_max', MicrotransactionCall, (Microtransaction, Attributes), ()),
Method('search', Iterator, (SpaceName, Predicates), (Status, Attributes)),
Method('search_describe', AsyncCall, (SpaceName, Predicates), (Status, Description)),
Method('sorted_search', Iterator, (SpaceName, Predicates, SortBy, Limit, MaxMin), (Status, Attributes)),
Expand Down
Loading

0 comments on commit e0cb1ce

Please sign in to comment.