Commit Graph

61 Commits

Author SHA1 Message Date
Griffin Smith c44604e06c Release 2.2.1 2018-01-17 15:24:04 -05:00
Griffin Smith c7c0788bb1 deps(): Update version of erlang_nif-sys
Update Cargo dependency on erlang_nif-sys, to work with OTP 20.2
2018-01-17 15:23:05 -05:00
Griffin Smith ce8988d100 Release 2.2.0 2017-12-06 14:53:10 -05:00
Griffin Smith 81839aa6ae feat(): Allow creating database snapshots
Add a `create_snapshot` function, that creates a RocksDB database
snapshot from the given database handle and returns it.

There's a pretty fantastic amount of horribly unsafe Rust going on here
- primarily caused by the fact that the rust-rocksdb snapshot type is,
unlike Iterator or ColumnFamily or any of the other types that really
*should* be, parametrized by the lifetime of a borrowed reference to its
owner database. The abstraction provided by Rustler doesn't allow
non-static lifetime-parametrized struct types to be returned back to
Erlang as resources, for some technical type-mismatch reasons but also
practically because relying on the Erlang garbage collector to free our
stuff doesn't fit at *all* with rust's lifetime model.

The workaround here is to use `mem::transmute` (I told you it was
crazy...) to turn the snapshot reference from a `Snapshot<'a>` to a
`Snapshot<'static>`, and pass *that*, along with a held ARC reference to
the owning DB, to Erlang, and then when the Erlang GC decides it's time
to free the snapshot, go *back* to a first unbounded, then elided
lifetime to force the snapshot to be dropped.

I've done some cursory checking and regular operation (creating a
snapshot from a process then letting that process die) appears to not
leak the snapshots, but we should keep an eye on this to make sure we
don't have any leaks (or worse) in the future.

As a further note, the bit that parses out the argument for the NIFs
that now accept *either* a DB or a snapshot is a little mucky - that
should be revisited at a later date to see if we can clean it up a
little.
2017-11-30 15:30:06 -05:00
Griffin Smith baad4ab176 Release 2.1.0 2017-10-30 12:06:31 -04:00
Griffin Smith 7590dbb5f3 deps(): Update dependency on rust_rocksdb 2017-10-26 14:08:35 -04:00
Griffin Smith ffa891319c feat(): Add Rox.stream_keys/2
In addition to Rox.stream/2, add a Rox.stream_keys/2 function, which
optimizes over `stream` by avoiding decoding the values of the stream
from binary at each step of the iteration. There's a later optimization
to be had here by avoiding allocating the Erlang term *entirely*.
2017-10-26 14:08:35 -04:00
Griffin Smith 6f4986596d feat(options): add use_direct_io_for_flush_and_compaction
Add support for the `use_direct_io_for_flush_and_compaction` db option
2017-09-11 14:47:02 -04:00
Griffin Smith 414bac25d2 Release 2.0.0 2017-08-29 12:05:29 -04:00
Griffin Smith 133783e14f deps(rocksdb): Update to rocksdb 0.7.0 2017-08-29 12:02:54 -04:00
Griffin Smith 072917eefe fix(): Remove disable_data_sync
This is removed in rocksdb-core
2017-08-23 16:34:41 -04:00
Griffin Smith bb627a4d9d deps(rocksdb): Depend on our fork of rust-rocksdb
Depend on our fork of rust-rocksdb, so we can get urbint/rust-rocksdb#1
2017-08-23 16:34:18 -04:00
William Carroll aa0ad55770
chore(rox:stream): Corrects docs & fn spec
Changes Iterator.mode (incorrect) -> Rox.Cursor.mode (correct).
2017-08-21 11:38:01 -04:00
Ryan Schmukler 36ba797e50 Release 1.3.0 2017-08-15 19:04:37 -04:00
Ryan Schmukler 87544c2e2b feat(): allow non-utf8 binary as keys
RocksDB supports any binary to be a key, not just UTF-8 encoded
strings. In the case of things like UUIDs, this difference can be a big
one (ie. 36 bytes vs 16 bytes).
2017-08-15 18:43:01 -04:00
Justin DeMaris 2887d85c21 Release 1.2.2 2017-07-03 13:06:13 -04:00
Ryan Schmukler 36748e94e7 feat(): OTP 20 and Elixir 1.4.5 support 2017-06-29 14:36:51 -04:00
Ryan Schmukler 3e52266601 Release 1.2.0 2017-06-27 18:40:47 -04:00
William Carroll 4cc078a7ba chore(): Updates Native.batch_write/2 return API 2017-06-27 18:39:21 -04:00
Ryan Schmukler 1d7429e7c0 feat(batch): Implement merge/2 2017-06-22 18:54:29 -04:00
William Carroll fc4ec51166
feat(batch): Impls batch merging 2017-06-22 17:29:50 -04:00
Ryan Schmukler 7cdbea0dae Release 1.1.0 2017-06-15 14:26:03 -04:00
Ryan Schmukler 767483ca72 feat(): add Batch commands (atomic operations) 2017-06-15 14:25:19 -04:00
Ryan Schmukler 8721b63c59 Release 1.0.2 2017-05-26 13:45:06 -05:00
Ryan Schmukler cffdaa7d49 fix(): no longer crash if DB reference is released before an iterator ref 2017-05-26 13:42:50 -05:00
Ryan Schmukler 680e20a55c deps(): update rust dependencies 2017-05-26 13:42:42 -05:00
Ryan Schmukler e5f275cd04 test(stream): better testing 2017-05-25 18:07:59 -05:00
Ryan Schmukler 1d51d4e67a fix(): error when auto creating non existent column families 2017-05-25 18:02:24 -05:00
Ryan Schmukler ec3415b095 Release 1.0.1 2017-04-25 16:39:11 -04:00
Ryan Schmukler 5538203d8b chore(dialyzer): trick dialyzer into passing on NIF 2017-04-25 16:38:32 -04:00
Ryan Schmukler bf6da9d94f build(): benchmarks 2017-04-14 15:20:22 -04:00
Ryan Schmukler 63e9b87456 deps(): switch to hex based rustler dep, publish 2017-03-21 15:47:30 -04:00
Ryan Schmukler 4d56cb9ad7 Release 1.0.0 2017-03-21 15:20:52 -04:00
Ryan Schmukler f8dbe6a0db feat(): add delete, restore basic testing 2017-03-21 14:59:34 -04:00
Ryan Schmukler aab14d167e feat(): add auto opening of column families, streaming, enumerable and collectable 2017-03-21 14:09:51 -04:00
Ryan Schmukler 131b5df024 feat(): begin iterator, simplify API, refactor 2017-03-20 20:38:39 -04:00
Ryan Schmukler b25bbba795 chore(): update deps, tweak impls 2017-03-20 16:50:12 -04:00
Ryan Schmukler 34746d6751 fix(): get and put for erlang types 2017-03-02 20:36:12 -05:00
Ryan Schmukler 95b3bf6e7c feat(): implement basic get 2017-03-01 21:47:02 -05:00
Ryan Schmukler fcc3627ce9 feat(): add opening column families and put (with and without CF) 2017-02-28 23:45:01 -05:00
Ryan Schmukler 00107da301 feat(): implement create_cf/3 2017-02-28 22:32:03 -05:00
Ryan Schmukler 6ba1609e5a wip(rustler): port db options 2017-02-28 15:43:13 -05:00
Ryan Schmukler 41ba01b681 wip(restler): begin db_options serialization 2017-02-27 22:20:12 -05:00
Ryan Schmukler 3f70e06a34 wip(rustler): add count, db_handle struct 2017-02-27 21:51:04 -05:00
Ryan Schmukler 33e0e655f9 wip(rustler): wip port to rustler 2017-02-27 19:36:14 -05:00
Ryan Schmukler 7ee6cd3a53 feat(): add count/1 2017-01-24 16:50:37 -05:00
Ryan Schmukler 07bfefc49a fix(): update specs 2017-01-19 16:10:00 -05:00
Ryan Schmukler bafb36bb49 refactor(): formatting and styling 2016-12-29 20:08:09 -06:00
Ryan Schmukler ed025c569e fix(dialyzer): better type definitions 2016-11-04 11:16:34 -04:00
Ryan Schmukler 8415712ec6 fix(stream): fix partial exhaustion of a stream throwing errors 2016-08-18 19:25:38 -07:00