Merge pull request #51 from aeternity/ta-rocksdb-1.8.0

Towards version 7.10.2 of rocksdb via version 1.8.0 or erlang_rocksdb
This commit is contained in:
Thomas Arts 2024-03-19 14:41:50 +01:00 committed by GitHub
commit 296813ef7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 29 additions and 18 deletions

View File

@ -6,10 +6,12 @@ executors:
otp:
type: string
docker:
- image: aeternity/builder:bionic-<< parameters.otp >>
- image: aeternity/builder:focal-<< parameters.otp >>
user: builder
environment:
ERLANG_ROCKSDB_BUILDOPTS: "-j2"
ERLANG_ROCKSDB_OPTS: "-DWITH_SYSTEM_ROCKSDB=ON -DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_BZ2=ON -DWITH_ZSTD=ON"
jobs:
build_and_test:
@ -31,4 +33,4 @@ workflows:
- build_and_test:
matrix:
parameters:
otp: ["otp23", "otp24"]
otp: ["otp24", "otp25", "otp26"]

View File

@ -4,7 +4,7 @@
{deps,
[
{sext, "1.8.0"},
{rocksdb, {git, "https://gitlab.com/seanhinde/erlang-rocksdb.git", {ref,"9ae37839"}}},
{rocksdb, {git, "https://gitlab.com/barrel-db/erlang-rocksdb.git", {tag,"1.8.0"}}},
{hut, "1.4.0"}
]}.
@ -14,6 +14,10 @@
deprecated_function_calls
]}.
{dialyzer, [{plt_apps, all_deps},
{base_plt_apps, [erts, kernel, stdlib, mnesia ]}
]}.
{profiles,
[
{test,

View File

@ -1,8 +1,8 @@
{"1.2.0",
[{<<"hut">>,{pkg,<<"hut">>,<<"1.4.0">>},0},
{<<"rocksdb">>,
{git,"https://gitlab.com/seanhinde/erlang-rocksdb.git",
{ref,"9ae378391ffc94200bde24efcd7a4921eba688d0"}},
{git,"https://gitlab.com/barrel-db/erlang-rocksdb.git",
{ref,"fced5f637de7991c5948e28414ba3790b0476c4b"}},
0},
{<<"sext">>,{pkg,<<"sext">>,<<"1.8.0">>},0}]}.
[

View File

@ -559,6 +559,7 @@ rdb_release_batch(H) ->
rocksdb:release_batch(H).
%% @doc Aborts an ongoing {@link activity/2}
-spec abort(_) -> no_return().
abort(Reason) ->
case mnesia_compatible_aborts() of
true ->
@ -1546,8 +1547,9 @@ rdb_iterator(R) -> rdb_iterator(R, []).
rdb_iterator(R, Opts) ->
rdb_iterator_(R, read_opts(R, Opts)).
rdb_iterator_(#{db_ref := DbRef, cf_handle := CfH, activity := #{type := tx, handle := TxH}}, ROpts) ->
rocksdb:transaction_iterator(DbRef, TxH, CfH, ROpts);
rdb_iterator_(#{cf_handle := CfH, activity := #{type := tx, handle := TxH}}, ROpts) ->
%% Note: versions before 1.8.0 expected DbRef as first argument
rocksdb:transaction_iterator(TxH, CfH, ROpts);
rdb_iterator_(#{db_ref := DbRef, cf_handle := CfH}, ROpts) ->
rocksdb:iterator(DbRef, CfH, ROpts).

View File

@ -11,9 +11,9 @@
, index_ref/2
]).
-record(mrdb_ix_iter, { i :: mrdb:iterator()
-record(mrdb_ix_iter, { i :: mrdb:mrdb_iterator()
, type = set :: set | bag
, sub :: mrdb:ref() | pid()
, sub :: pid() | mrdb:db_ref()
}).
-type ix_iterator() :: #mrdb_ix_iter{}.
@ -22,7 +22,7 @@
-type object() :: tuple().
-record(subst, { i :: mrdb:iterator()
-record(subst, { i :: mrdb:mrdb_iterator()
, vals_f
, cur
, mref }).
@ -121,6 +121,7 @@ iterator_move_bag(#mrdb_ix_iter{i = I, sub = Sub}, Dir) ->
Other
end.
-spec opt_read(mrdb:ref_or_tab(), Key :: any()) -> any().
opt_read(R, Key) ->
case mrdb:read(R, Key, []) of
[Obj] ->

View File

@ -3,7 +3,9 @@
-export([ do/2 ]).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
%% We use a gen_server-based FIFO queue (one queue per alias) to manage the
%% critical section.