]>
git.mikk.net Git - mtbl-rs/log
summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Chris Mikkelson [Mon, 12 Aug 2024 19:21:14 +0000 (14:21 -0500)]
Write index block with length, crc
Remove dead code
Chris Mikkelson [Thu, 8 Aug 2024 22:39:10 +0000 (16:39 -0600)]
Add file reader, rudimentary mtbl_dump
Chris Mikkelson [Thu, 8 Aug 2024 22:38:36 +0000 (16:38 -0600)]
tests: use small blocksize in rwtest to exercise index
Chris Mikkelson [Thu, 8 Aug 2024 12:56:25 +0000 (06:56 -0600)]
block: use little-endian fixed representations
Consistent with C mtbl
Chris Mikkelson [Thu, 8 Aug 2024 12:38:07 +0000 (06:38 -0600)]
reader: handle seeking past end of index block
Chris Mikkelson [Thu, 8 Aug 2024 12:37:16 +0000 (06:37 -0600)]
writer: fix logic error in offset tracking
Chris Mikkelson [Thu, 8 Aug 2024 05:39:45 +0000 (23:39 -0600)]
Refactor block code for clean-up, tests, seek() fixes
Chris Mikkelson [Thu, 8 Aug 2024 02:28:58 +0000 (20:28 -0600)]
increase size of rwtest data
Chris Mikkelson [Thu, 8 Aug 2024 00:12:38 +0000 (18:12 -0600)]
Update API layout to use prelude
Add test for range iter, add missing linear search step to
BlockIter seek
Chris Mikkelson [Wed, 7 Aug 2024 22:49:41 +0000 (16:49 -0600)]
reader: remove debug print and unused CRC decoding
Chris Mikkelson [Wed, 7 Aug 2024 22:48:45 +0000 (16:48 -0600)]
cargo-clippy lints
Chris Mikkelson [Wed, 7 Aug 2024 22:13:17 +0000 (16:13 -0600)]
Give ReaderIter a Reader Clone for flexibility
Chris Mikkelson [Wed, 7 Aug 2024 06:53:10 +0000 (00:53 -0600)]
WIP: working reader, with test
Squashed several bugs, will have to squash `.expect()`s next.
Chris Mikkelson [Wed, 7 Aug 2024 04:54:08 +0000 (22:54 -0600)]
iter.rs: cargo fmt
Chris Mikkelson [Wed, 7 Aug 2024 04:53:00 +0000 (22:53 -0600)]
writer: Move index update to data block write
Fixes missing index write on last block.
Chris Mikkelson [Wed, 7 Aug 2024 04:50:22 +0000 (22:50 -0600)]
Refactor reader code around Arc<impl AsRef<[u8]>>
API currently named 'DataSlice' provides convenient views of
ranges / slices of the underlying buffer, avoiding lifetime
entaglements.
Chris Mikkelson [Tue, 6 Aug 2024 01:38:49 +0000 (19:38 -0600)]
experimental first cut at reader -- not working
Chris Mikkelson [Mon, 5 Aug 2024 06:02:28 +0000 (00:02 -0600)]
writer: write in-progress block
Chris Mikkelson [Mon, 5 Aug 2024 06:01:41 +0000 (00:01 -0600)]
metadata: read from file-like object instaed of buf
Chris Mikkelson [Mon, 5 Aug 2024 05:14:49 +0000 (23:14 -0600)]
Flesh out writer, block builder, requirements
Chris Mikkelson [Mon, 5 Aug 2024 05:14:17 +0000 (23:14 -0600)]
move block result, error to main lib
Chris Mikkelson [Mon, 5 Aug 2024 05:12:22 +0000 (23:12 -0600)]
add metadata, compression
Chris Mikkelson [Fri, 2 Aug 2024 23:42:45 +0000 (18:42 -0500)]
Refactor block, block_builder for readability, magic numbers
Fix "off by 4" bug caused by double call to block builder finish.
chris mikkelson [Mon, 29 Jul 2024 19:00:38 +0000 (14:00 -0500)]
Break iter and source into separate modules.
chris mikkelson [Mon, 29 Jul 2024 18:45:20 +0000 (13:45 -0500)]
source.rs: Remove unneeded GenSource trait
Rename GenWrap to BoxWrap for clarity.
Chris Mikkelson [Sun, 28 Jul 2024 18:23:12 +0000 (13:23 -0500)]
Rename GenericSource -> BoxedSource
Chris Mikkelson [Wed, 24 Jul 2024 18:22:46 +0000 (13:22 -0500)]
Flesh out 'generic merger' test
Chris Mikkelson [Tue, 23 Jul 2024 20:15:21 +0000 (15:15 -0500)]
Generic sources working after big refactor.
Root cause was Box<dyn Trait> defaults to Box<dyn Trait + 'static>,
leading to the 'static lifetime "infecting" the generated iterators,
causing the borrow to last beyond the end of the function which dropped
the box or its containing structure.
The quick fix was to inject and add an explicit lifetime to the Box.
While tuning that fix, opted to inject lifetimes by implementing
Source methods on references. This tracks more with the C mtbl API,
where:
m = mtbl_merger_init(mopt);
/* populate m */
mtbl_merger_source(m);
is roughly mirrored by:
let m = mtbl::Merger::from(...);
let source = &m;
Chris Mikkelson [Mon, 22 Jul 2024 13:58:21 +0000 (08:58 -0500)]
generic sources working, sort of, in test
Chris Mikkelson [Mon, 22 Jul 2024 02:12:51 +0000 (21:12 -0500)]
WIP experiment dyn source
Lifetime making it hard to test, possibly implement at all
Chris Mikkelson [Sun, 21 Jul 2024 00:40:23 +0000 (19:40 -0500)]
Refactor Source trait hierarchy
Source implements get/prefix/range, and is a subtrait of
IterSource which implements only iter(). The Default
implementation is now another subtrait of IterSource.
This avoids several of the previouas `Source<'a> + Ranges<'a>`
and 'Source<'a> + DefaultRanges' type constraints, and
simplifies type paths.
Chris Mikkelson [Sat, 20 Jul 2024 02:02:01 +0000 (21:02 -0500)]
General cleanup, cargo-clippy fixes
Chris Mikkelson [Sat, 20 Jul 2024 02:01:43 +0000 (21:01 -0500)]
pull out the non-working generic source bits
Chris Mikkelson [Sat, 20 Jul 2024 01:56:22 +0000 (20:56 -0500)]
WIP of attempt to make a generic source
Chris Mikkelson [Fri, 19 Jul 2024 20:02:20 +0000 (15:02 -0500)]
Add generic source wrapper for mixed mergers
Chris Mikkelson [Fri, 19 Jul 2024 18:41:45 +0000 (13:41 -0500)]
fixed lifetime issue! ?
Chris Mikkelson [Fri, 19 Jul 2024 17:10:19 +0000 (12:10 -0500)]
WIP commit: attempt to make Source object safe
Use associated iterator types instead of `impl Iter`. Move
get, get_prefix, get_range to separate "Ranges" trait, with
a generic default implementation based on iter() enabled by
"DefaultRanges" trait.
WIP due to one pesky lifetime issue.
Chris Mikkelson [Fri, 19 Jul 2024 03:28:00 +0000 (22:28 -0500)]
merger: Remove all internal use of Box<dyn Iter>
Adding Iter implementation for Box<dyn Iter> allows it
to be used as a concrete type in case of a mixed merger.
Chris Mikkelson [Fri, 19 Jul 2024 03:27:11 +0000 (22:27 -0500)]
Add support for Boxed dyn Iter objects
Chris Mikkelson [Fri, 19 Jul 2024 01:02:20 +0000 (20:02 -0500)]
merger: remove Source paramater from Iter template.
Chris Mikkelson [Tue, 16 Jul 2024 06:14:44 +0000 (01:14 -0500)]
Beginnings of reader and writer
Chris Mikkelson [Sun, 14 Jul 2024 20:31:15 +0000 (15:31 -0500)]
Another refactor: back to mtbl C idioms
Iter (includes seek + iterator), static entry type, Source,
merger, etc.
Chris Mikkelson [Mon, 17 Jun 2024 02:08:38 +0000 (21:08 -0500)]
map values only; generic keys too complex
Chris Mikkelson [Fri, 3 May 2024 05:54:15 +0000 (00:54 -0500)]
Seekable: relax Ord requirement on keys
This allows implementations to return Result<> types to propagate
errors. Those errors will need to be handled prior to merging
or coalescing.
Chris Mikkelson [Mon, 29 Apr 2024 01:48:59 +0000 (20:48 -0500)]
SeekableVec: relax Copy requirement to Clone
Chris Mikkelson [Mon, 29 Apr 2024 01:44:00 +0000 (20:44 -0500)]
Modify filter_map to only map values
Mapping keys requires a conversion on seek from the
mapped key to the inner key. Since the keys are passed
to seek by reference to avoid moves, this complicates
consuming the key for a full conversion to the inner
key.
For now, restrict mapping to values only. This required
changing the filter function signature to take a reference
to the key so its caller could retain the key for returning.
Chris Mikkelson [Sun, 28 Apr 2024 20:57:27 +0000 (15:57 -0500)]
cargo-clippy fixes
Remove redudant Some(foo()?).
Make PartialOrd more canonical.
Chris Mikkelson [Sun, 28 Apr 2024 20:54:28 +0000 (15:54 -0500)]
Add coalesce (merge function) support
Chris Mikkelson [Sun, 28 Apr 2024 20:46:14 +0000 (15:46 -0500)]
SeekableVec: add value type.
Chris Mikkelson [Sun, 28 Apr 2024 19:18:23 +0000 (14:18 -0500)]
Refactor imports for visibility.
Chris Mikkelson [Sun, 28 Apr 2024 18:52:14 +0000 (13:52 -0500)]
Move SeekableVec to module for test support
Chris Mikkelson [Sun, 28 Apr 2024 18:43:04 +0000 (13:43 -0500)]
Refactor to generic Seekable IntoIterator
Chris Mikkelson [Sun, 28 Apr 2024 18:18:18 +0000 (13:18 -0500)]
Remove lender dependency
Chris Mikkelson [Thu, 18 Apr 2024 01:16:10 +0000 (20:16 -0500)]
format iter.rs
Chris Mikkelson [Thu, 18 Apr 2024 01:15:48 +0000 (20:15 -0500)]
Convert AsRef template functions to use impl AsRef
Chris Mikkelson [Fri, 12 Apr 2024 19:15:10 +0000 (14:15 -0500)]
iter: Genericize repeated IntoIterator implementations
Introduce 'Seekable<T: Entries>' wrapper to bring common
'return Iter<T>' logic to one place.
Chris Mikkelson [Sun, 7 Apr 2024 20:04:53 +0000 (15:04 -0500)]
Entries::filter_seek -> Entries::filter
No longer need separate name due to Iterator co-implementation
Chris Mikkelson [Sun, 7 Apr 2024 20:01:41 +0000 (15:01 -0500)]
Rename Iter to "entries" to avoid confusion with iterator.
Entries implements IntoIterator.
Chris Mikkelson [Sun, 7 Apr 2024 19:09:25 +0000 (14:09 -0500)]
Iter -> Entries, prep for Iter: IntoIterator
Chris Mikkelson [Sun, 7 Apr 2024 18:37:03 +0000 (13:37 -0500)]
iter: IterBox -> IterCell, private struct
Chris Mikkelson [Sun, 7 Apr 2024 18:08:22 +0000 (13:08 -0500)]
make test output more readable
Chris Mikkelson [Sun, 7 Apr 2024 18:08:03 +0000 (13:08 -0500)]
Iter::filter_seek: consume source iterator
Chris Mikkelson [Sun, 7 Apr 2024 18:05:57 +0000 (13:05 -0500)]
rustfmt
Chris Mikkelson [Sun, 7 Apr 2024 16:56:05 +0000 (11:56 -0500)]
Initial commit